pdprog
Posts: 5
Joined: Fri Aug 19, 2005 2:59 pm
Location: Lafayette, CO
Contact: Website

Set AppDir to registry value

I'm attempting to set the default path (that the user is prompted for) to the path where the application was last installed.

I've read every post related to the subject that I can find, to no avail.

Currently, I havea search called "GETREGTARGETDIR". It specifies a registry entry that I've manually set.

I also have defined a custom action that sets APPDIR to [GETREGTARGETDIR] I've tried placing this custom action in every location that accepts Directory Set With Formatted. I settled on MigrateFeatureStates. I was able to set a hard-coded path here ('c:\test\test') and that worked - it appeared in the dialog where the user chooses the install path. But when I changed it to a variable created in the search [GETREGTARGETDIR], it fails.

I presume that the search hasn't happened yet.

So, what steps can I take to read the prior install dir from the registry and use that as the default install location that the user sees and can modify?

Thanks
-pete
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

There is no need for a custom action and the intermediate GETREGTARGETDIR property. You can simply name your search APPDIR and choose the appropriate registry location in the Search page of Advanced Installer.

Regards,
Denis
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
pdprog
Posts: 5
Joined: Fri Aug 19, 2005 2:59 pm
Location: Lafayette, CO
Contact: Website

That doesn't seem to work. I've posted a screen image for you to see my first installer screen, the AI search page and the registry entry. It doesn't seem to be picking it up.

http://research.pdmagic.com/ai/ai_appdir.jpg

Thanks,

-pete
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

You have to select "Retrieve the raw value" in the Type combobox. If you select the first option ("The value contains a path to a directory") the property will not be set correctly if that folder does not exist.

Regards,
Denis
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
pdprog
Posts: 5
Joined: Fri Aug 19, 2005 2:59 pm
Location: Lafayette, CO
Contact: Website

Thanks for the very fast response.

Did I already say: You've got an awesome product, thanks!

Return to “Common Problems”