installshieldwindows-installermerge-moduleinstallshield-2010

Installshield - Merge Module - Dynamic destination directory based on user dialog input


I am trying to set the override the destination directory of the merge module as described here. I set the destination directory to [BIN]. BIN is public property. At compile time the value of [BIN] is C:\Program Files (x86)\CompanyName\ProductName.

Based on the user input in a custom dialog, this property is updated to C:\Program Files (x86)\CompanyName\UserInputName\ProductName.

All the DLL files from the merge module are copied into the compile-time value of [BIN] - C:\Program Files (x86)\CompanyName\ProductName. For some reason, the dynamic value is ignored in this case.

Can someone tell me what could be going wrong?

I am using Install Shield Version 2010 Professional Edition, Project Type is Basic MSI Project


Solution

  • I have posted the same question on InstallShield forum, the conclusion there was it is not supported by InstallShield to change destination directory of an MSM file during run time.

    A workaround suggested is to have a custom action 'Set Directory'.

    Here are the steps:

    1. In the Redistributable view, right click on the MSM file -> Properties -> Destination -> set to [MSM_DEST_STATIC_DIR].
    2. Create a custom action of type'Set Directory', with Directory Name - MSM_DEST_STATIC_DIR, Directory Value - [MSD_DEST_DIR_DYNAMIC_VALUE]
    3. After getting the user input from the dialog, first, update the MSD_DEST_DIR_DYNAMIC_VALUE, then execute the custom action created in step 2.

    While doing this I also realized that it is not possible to update the IISROOTFOLDER based on the dynamic user input. I followed the same procedure with the custom action to update the IISROOTFOLDER.