Search code examples
installshieldmerge-module

How to set the install path of a merge module from a registry key?


I have created an installer (using InstallShield 2012 Spring) that consumes a merge module that I created and I want to install the files from both the main installer and the merge module to a path that is stored in the registry. In a separate installer the user is able to specify the install location and I save this path in the registry to be used by subsequent installers.

In the merge module my components have a desination of 'INSTALLDIR\Folder'. In the main installer I have changed the Destination property in the Redistributables pane from '(User merge module's default destination)' to 'INSTALLDIR'. This allows me to install the merge module's files to the same path that is in the main installer when the installer is built, but if I change the Destination during run time (through custom action or the DestinationFolder dialog) only the main installer's files are installed to the desired path.

I am using an system search to retrieve the path from the registry and store it in a property. Then I have a custom action that sets INSTALLDIR to the path that is read from the registry.

If I go to the direct editor of the merge module and edit the Directory table I can change INSTALLDIR.GUID to INSTALLDIR and I get my desired results however this causes the 'Components' and 'Files and Folders' panes to be unusable.

Is there a better way to do this?

I saw these answers and they got me started but I can't seem to get the Merge Module's destination to change during run time.

Installshield 12: Changing the destination of a merge module at run time

Make installshield merge module installation path configurable for user


Solution

  • I ran into a similar situation. If you remove the GUID from the INSTALLDIR values only in the Directory_Parent column, then the Files and Folders, etc, panels become unusable. You need to be sure that you remove the GUID from the INSTALLDIR cell in the Directory column as well. Then the merge module will 'inherit' the INSTALLDIR of the parent installer and the directories you've created in your merge module will inherit from that.