set install folder if value exist in registry - Advanced Installer Community
am_al_59
Posts: 1
Joined: Fri Aug 16, 2013 10:58 am

set install folder if value exist in registry

hi
i need registry check and if value 'path' exists then change install app into that value else install app in [ProgramFilesFolder][ProductName]
Teodor
Posts: 73
Joined: Thu Jul 25, 2013 9:56 am

Re: set install folder if value exist in registry

Hi
am_al_59 wrote:i need registry check and if value 'path' exists then change install app into that value else install app in [ProgramFilesFolder][ProductName]
This can be easily achieved using a Custom Action. Also, please read the Any way to set APPDIR to my own default directory path? post for a similar task.

Shortly, these are all the steps you should make.

1) Set the default Application Folder on the Install Parameters page (ie. [ProgramFilesFolder][ProductName])

2) Add a registry search with The value contains a path to a directory type.

3) Add a custom action to adjust the APPDIR property as explained in the other post. Please note that you need to condition this change only on Install and if your search associated property is not null (meaning that the directory path exists).
This custom action should be placed between Searches and Paths Resolution action groups.

4) Copy this SetProperty custom action from the Wizard Dialogs Stage section to the Install execution Stage section. This must be done to make sure that the custom action is executed with or without UI.

You can copy a custom action by selecting it and while keeping SHIFT key pressed just drag it to you desired destination.

Best regards
Teodor Micu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”