Problems getting Folder from Registry Key for installation - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Skot
Posts: 1
Joined: Thu May 29, 2008 11:36 pm

Problems getting Folder from Registry Key for installation

Hi,

I'm trying to get an installer working for a custom VST (audio plugin) file we have created. There is a registry key for the VST folder path that I have been trying to use as the install path, but I have been having problems. I have created a search for the registry key, and it seems to work and install fine if the key exists on the computer. The problem I have encountered is what to do if the key doesn't exist on the computer. I've tried to create the key using the registry portion of the Project Definitions, and set it to the "create (if absent)" setting, but it doesn't work because I suspect the key is created close to last in the installation process.

I need the install file to work on both computers that have the key and ones that don't. The desired behavior if it doesn't have the key on the computer would be for the a default path to be suggested, and if the computer did have the key the suggested path would be the path the key pointed to.

Thanks in advance,
Scott
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Re: Problems getting Folder from Registry Key for installation

Hi Scott,
I need the install file to work on both computers that have the key and ones that don't. The desired behavior if it doesn't have the key on the computer would be for the a default path to be suggested, and if the computer did have the key the suggested path would be the path the key pointed to.
This can be done easily by using a "Property Set with Formatted" Custom Action, as follows:

1. In the Install Parameters page set an appropriate default value for the "Application Folder".

2. In the Files and Folders page add the files for the audio plugin under the "Application Folder" node.

3. In the Search page create the Search for your registry value and name it, for instance PATH_PROP.

4. In the Custom Actions page, make sure that the AppSearch Standard Action is visible under both InstallUISequence and InstallExecuteSequence nodes. If it is not, select from the toolbar Show Standard Action -> Before Initialization -> AppSearch.

5. Under InstallUISequence -> AppSearch create a new "Property Set with Formatted" Custom Action with the following settings:

Code: Select all

Property Name : APPDIR
Formatted Text: [PATH_PROP]
6. Now drag-and-drop this CA (keeping the SHIFT key pressed) in the tree control under InstallExecuteSequence -> AppSearch.

7. Set the following "Execution Condition" for both CA instances:

Code: Select all

PATH_PROP <> ""
This way, the Application Folder will be set to the path read from the registry only if it is not empty.

8. For one of the CA instances, select the Scheduling Option "Execute only once if present in both sequence tables".

You will find an example project attached below. Hope this helps.

Regards,
Ionut
Attachments
example.zip
(1.86 KiB) Downloaded 339 times
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”