How to default the Application Folder - Advanced Installer Community
tscheuerman
Posts: 43
Joined: Thu Feb 11, 2016 11:39 pm

How to default the Application Folder

Hello,

I would like to know how I can default the "Installation" Application Folder (i.e. where files will be installed) based on a condition. The condition is:

- Look in the Registry for the existence of "X" and if found set the "Application Folder" to the path to where "X" has been installed (as defined by the Registry).

- If "X" is not found in the Registry then use what is defined in "Application Folder" to install to.

Thanks,

Todd
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: How to default the Application Folder

Hi Todd and welcome to Advanced Installer forums,
- Look in the Registry for the existence of "X" and if found set the "Application Folder" to the path to where "X" has been installed (as defined by the Registry).
For this you can create a registry search operation in the Search page of Advanced Installer. Use the [ New Search Wizard ] toolbar button, to set up a new search, following step-by-step directions.

Please note that if the registry key is found on the machine, then the property attached to the search operation (by default it is RESULT_PROPERTY) will be set with the related value, otherwise the property will be empty.
- If "X" is not found in the Registry then use what is defined in "Application Folder" to install to.
For this you need to change the value of APPDIR property. The installation path is stored in the APPDIR property and it is represented by the Application Folder directory in the Files and Folders Page.

To change the value of the APPDIR you can use the predefined Set installer property custom action.

in the Custom Actions view you can add this custom action as a custom action with sequence, scheduled after the Searches stage from the Wizard Dialogs Stage. You can edit the custom action properties as following:
  • Property: APPDIR
  • Value: [RESULT_PROPERTY]
  • Condition field: RESULT_PROPERTY
Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”