PDA

View Full Version : Adding the install path to a registry key



devinr
07-07-2008, 10:07 PM
I'm currently trying to create a key in the registry that will hold the install path selected by the user during installation. This will be used to discover whether the program has been installed before, and more importantly where it has been installed.

The only problem is, that I'm not entirely sure how to go about implementing this using InstallShield 2008 Express. Any advice on whether this is possible and how I'd go about setting it up in the program would be greatly appreciated.

DebbieL
07-08-2008, 09:36 AM
To store the install path in the registry, you'd want to add the required registry keys in the Registry view of your project. You could enter [INSTALLDIR] for a registry value. At run time, Windows Installer would replace [INSTALLDIR] with the path of your installation.

I don't think that you'd need to do this in order to simply determine whether your product has already been installed. When the end user launches your installation, Windows Installer will automatically search the target system to see if the product is already installed, as described in the following thread:
http://community.acresso.com/showthread.php?t=181956

Does that help?

andyguest13
07-09-2008, 03:52 AM
I ran into the same issue; I needed to try and prevent IS installing over an existing installation since the user is free to type in whatever path they want in the Destination Folder dialog. Like me you don't so much want to know if it is already installed, rather, where. What i ended up doing was calling out to a Custom Action .exe that I wrote , After Destination Folder Dialog. THis exe just scans the folder chosen for some well known files and if it finds any then i assume the user has picked an old installation folder. Then i throw up a mesagebox to warn them (which you must force on-top BTW). I set IS to ignore the return code and wait for the action to complete. All you can do is warn the user and tell them to press 'Back' in the wizard that follows. If you tell IS to take note of the return code you will see an annoying error message. And that means I had to then introduce a superfluous "Ready to Install" dialog into the wizard to allow a BAck action. This is a really fundamental thing - IS Express has obviously been cut back severely to get you to buy Premier or Professional. It's really just for shareware installations i reckon, no good for serious business apps.

Hope that helps, Andy