PDA

View Full Version : Create Folder for data files



pchoate
03-01-2008, 05:44 PM
Hi,

Do you have an example of a dialog asking the user where to install the data files? I would then like to update an ini file with the location that the user enter for the data file path.

Thanks in advance!

Paul

linder
03-02-2008, 09:28 AM
Paul,

I have attached a quick and dirty demo for you (see attached project).

A second "Select Install Folder" asks where to install the data files. The %DATAFOLDER% variable holds that value (see Image 1).

The %DATAFOLDER% variable has beed defined in the Script Editor (see Image 2).

The %DATAFOLDER% variable has beed added as folder variable to the target folder list (see Image 3).

Hope this helps.

Friedrich

MorningFlight
03-09-2008, 03:27 PM
Hello Friedrich,

You and Jane and I tossed around the VISTA data folder dilemma on the SoftVelocity Forum some time back. Seems that Microsoft still hasn't offered a definitive answer. Maybe Paul is on to something here. Take a look at the following Where Data should go in VISTA article:

http://doughennig.blogspot.com/2007/12/where-should-data-go-in-vista.html

In this post, Doug Hennig suggests creating a sub folder under Program Files in which he stores a writable INI file pointing to the folder that holds a program's data files. He makes the following reference:

In Inno Setup, simply create your directory like this:

[Dirs]Name: "{app}\Data"; Permissions: everyone-modify

This gives all users the ability to write to the folder.

Building on your sample dialog, can you suggest a script comparable to the above? Thank you.

Helmut (Hal) Heindel
www.printfire.com

linder
03-10-2008, 05:45 AM
Hi Helmut,

Well, we already posted a similar UAC "workaround" nine month ago (we have used HKEY_LOCAL_MACHINE as an example). The same can be done for other "protected" areas.

http://www.lindersoft.com/forums/showthread.php?t=2379

But my advice is, never ever do this kind of modification if not strictly necessary.

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.7
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

MorningFlight
03-10-2008, 08:04 AM
Hi Friedrich,

Thank you for the instant reply. You have an incredible product, and your support is absolutely outstanding. I've been using Installshield since before there was a Lindersoft, but once I get my VISTA approach nailed down, I'll be moving to SetupBuilder.

Downloaded the trial last week and converted one of my installs from Installshield in less than an hour without hiccups. Well, except for the fact that when the code-signing dialog box requesting my Comodo password pops up, it closes a few seconds later without the password having been entered and still code-signs. If I do enter a password, the install fails. Minor stuff that I should be able to sort out once I open and read the manual.

Getting back to VISTA, we're running three machines with XP and two with VISTA. All are on automatic updates. Aside from being slower, VISTA is still so full of surprises, none good, that developing our software on it is out of the question. I see where Microsoft is lowering the price of some versions by $100, and where Dell has gone back to offering new machines with XP. Wonder why! For us, the switch to VISTA is inevitable, but not this year, and maybe not the next.

Your point about workarounds is well taken, but I just can't conceive of following the official strategy, if MS even has one. I checked your archives (20 e-mails in as many months and no response) and Jane's post (MS wouldn't commit face-to-face about where to put a program's data files). Unless that has changed since then, we're pretty much on our own.

In any event, what I'm after is a simple, bullet-proof way to place our data files in a non-roaming, non-virtualized, non-junctioned (did I miss anything?) per-machine location. We have more than 4,000 installations, most of them in small to medium sized print shops. My current recommended install path for VISTA is C:\Printfire\Morningflight - definitely on the don't do this list by Microsoft. But it works, avoids virtualization, and poses no greater security risk than C:\Program Files\Printfire\Morningflight under XP.

Virtualization is one of the really great dumb ideas for business applications. First, it can be turned off by the user, which will promptly break the program. Second, Microsoft is telling us "don't look for Virtualization in future versions." From what I understand, VISTA 64 is already one of those versions. Third, two or more people using the same program on the same machine will generate two or more customer files, for instance, in two or more separate "virtualized" locations.

Paul's question and your answer piqued my interest and made me give SetupBuilder a second look. I needed a way to install a manifest in my apps if I wanted to go back to installing the app in C:\Program Files and turn off virtualization, which SetupBuilder does with the simple click of a button.

What would be your objection to

1. Installing a manifest asInvoker (ignored by XP but makes the program VISTA-aware and turns off Virtualization)

2. Setting the recommended program path to C:\Program Files\Printfire\Morningflight for both XP and VISTA

3. Setting the recommended data file path to C:\Printfire\Morningflight, let the user change that path or confirm, then store the data file path in an INI file in either the INSTALLDIR, or as Doug Hennig suggests, in a writeable sub directory. The question I think Paul and I are both asking is, how does the %DATAFOLDER% variable get written by SetupBuilder to the INI file?

(Paul, if you know the answer, I'm all ears)


Helmut (Hal) Heindel
www.printfire.com

linder
03-10-2008, 10:14 AM
Hi Helmut,

First of all, thank you so much for your kind words :)

With regard to the code-signing "password" dialog box problem. The original Microsoft tool to code-sign applications does not support a way to automatically "fill-in" the certificate password. Our PKEY.EXE tool does this for you. The provided PKEY.EXE works for most (~99%) users, but on a few machines "something" (protection tools, etc.) "blocks" this method.

http://www.lindersoft.com/forums/showthread.php?t=7439

What you can do is:

1. Use the "old" PKEY.EXE

http://www.lindersoft.com/forums/showthread.php?p=8879#post8879

2. Switch to SignTool.exe

http://www.lindersoft.com/forums/showthread.php?p=16130&highlight=signtool.exe#post16130

With regard to the data folder question. What you are planning to do is absolutely correct! In Windows Vista, the correct way to make your applications "UAC-aware" is to embed an application "asInvoker" manifest within your program that tells the Vista operating system what the application needs. This manifest disables "virtualization".

Setting the recommended program path to C:\Program Files\Printfire\Morningflight for both XP and VISTA is perfect.

Setting the recommended data file path to C:\Printfire\Morningflight is okay, but you can also use (IMO) CSIDL_COMMON_DO***ENTS\Printfire\Morningflight

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1213890&SiteID=1

I have attached a new DataFolder.sb6 to demonstrate how to write the data folder to an INI file (see Line 82).

Does this help?

Thanks,
Friedrich

Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.7
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

MorningFlight
03-10-2008, 10:48 AM
Hello Friedrich,

That more than helps, thank you. Looks like with your expertise and the resources available in SetupBuilder, I'll finally be able to put the VISTA install to rest.

As for the code-signing, I'm sure that can be sorted out. If not, I'll post it in a new thread. My glitch is similar to what's posted in the archives: "It flashes with a request for a password that closes before I am able to write it. The compile ends with an error -1 for GEN 1053, Code signing process."

Here is the twist: My compile ends error-free and completes the code-signing. It only fails if I do try to enter a password. FYI, the key expires in May and came directly from Comodo. Can I renew with Lindersoft?

My order for SetupBuilder is on its way.


Helmut (Hal) Heindel
www.printfire.com

linder
03-10-2008, 11:17 AM
Hello Helmut,

Thank you :)

The attached "old" PKEY.EXE should fix this for you. Just unzip into your \Lib key under the main SetupBuilder 6 folder and you are done.

BTW, the next web update will replace this "old" PKEY.EXE again with the new one so you have to do this for all future SB6 updates. I would suggest to switch to SignTool.exe on the long run.

You can get the original Comodo 3-Year Certificate for $200 (instead of $500). Just make sure that you do not login with your previous Comodo login/username. This would increase the price to $500. Comodo does not have a "renew" process. You always request a new certificate.

If there is any problem or question, just let me know.

Friedrich

MorningFlight
03-24-2008, 06:52 AM
You can get the original Comodo 3-Year Certificate for $200 (instead of $500). Just make sure that you do not login with your previous Comodo login/username. This would increase the price to $500. Comodo does not have a "renew" process. You always request a new certificate. If there is any problem or question, just let me know.

Hi Friedrich,

There was a memorable episode in M.A.S.H., the television series, where Hawkeye and B.J. were instructed by radio how to defuse a bomb. Step four, I think, is when they were told to cut the red wire. After a tense 30 seconds, step five began with "but first ..." Luckily, the bomb turned out to be harmless, filled only with propaganda flyers.

The three-year Comodo Certificate from Lindersoft is a huge bargain, but after having spent the better part of Easter Sunday banging my head against the wall trying to convert the .pfx file into a .pvk and .spc file, I now realize I should have changed the default on the order form and ordered the certificate as a separate set of files to begin with.

OpenSSL works just fine, both for exporting the private key to a .pem file and for converting the code signing certificate into an .spc file. The problem is with PVK.exe. It refuses to convert the .pem file generated with OpenSSL to a .pvk file. Tried it on both a VISTA and XP machine without success. I've opened a ticket with Comodo to find out what I may be doing wrong. At this point, they're not willing to resend the certificate as two files. The sad part is, none of this would have been necessary had I ticked the right box when placing the order.

That's really the main reason for this post. I know Jane suggested to order the Comodo certificate as a set of .pvk and .spc files, and you probably have too. I remembered it too late, which is where the "but first ..." part comes in. If I can make a suggestion: Can you put that in big red letters on the order page? Code signing is not something we developers do day in and day out, so relearning the old lessons, well, let me just say that yesterday, taking off all my clothes and jumping into a bed of cactus might easily have been time better spent.

I'll let you know what Comodo comes back with. By the way, I did use Signtool.exe from MS for my original certicate, but I obviously haven't gotten that far yet with the new certicate.

Helmut (Hal) Heindel
www.printshopmakeover.com

linder
03-24-2008, 10:58 AM
Hal,

Yes, we always recommend to order a code-signing certificate as a set of .pvk and .spc files. But it is only a recommendation, the "standard" private key option is "In the CSP", and not "In the File". And quite a few developers prefer the "In the CSP" option.

Please keep us posted.

Friedrich

linder
03-24-2008, 11:04 AM
And perhaps this helps:

http://www.lindersoft.com/forums/showthread.php?t=3623&highlight=export

Especially:
http://www.lindersoft.com/forums/showthread.php?p=12219&highlight=export#post12219
http://www.lindersoft.com/forums/showthread.php?p=12237&highlight=export#post12237

Friedrich

MorningFlight
03-24-2008, 11:21 AM
Friedrich,

I suspect the default option is often selected just by "default," not necessarily because that's what developers prefer. We don't always remember what bit us in the rear the last time, especially if it's something we do infrequently. After some further research, I discovered that the culprit is most likely IE7/VISTA, as also suggested by the latest reply from Comodo:

I suspect your collection process on browser. You can also collect your certificate file as spc and pvk. It is generated instantly. You should reorder again through account login and claim refund for current cert. (We have 30 day refund policy). During order process, Please ensure options as follows..

Stored as a file

Please use IE 5.5 or above to apply and collect the certificate, and use the same system to apply and collect the certificate. Kindly select the following options, while ordering the certificate.

Stored cert as file (select)
CSP: Microsoft Enhanced Cryptographic Provider v1.0
Key Size: 2048
Exportable:? tick
User protected:? not tick

Looks like my wasted Easter Sunday isn't a total loss after all.:)

Hal Heindel
www.printshopmakeover.com

linder
03-24-2008, 02:03 PM
Hi Hal,

Thank you for the good news :) Sorry, I missed that you are using Vista.

http://www.lindersoft.com/forums/showthread.php?t=4546

http://www.lindersoft.com/forums/showthread.php?p=13723#post13723

http://www.lindersoft.com/forums/showthread.php?p=13725#post13725

Friedrich

MorningFlight
03-24-2008, 06:33 PM
Friedrich,

Finally, all is well. See http://www.lindersoft.com/forums/showthread.php?t=8279

Thank you once more for pointing me in the right direction.

Hal Heindel
www.printshopmakeover.com