cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dinesh_ravin
Level 3

Merge Module - Dynamic destination directory based on user dialog input

Jump to solution

Hi,

  1. I am trying to set the override the destination directory of the merge module as described here. I set the destination directory to [BIN].
  2. At compile time the value of [BIN] is C:\Program Files (x86)\CompanyName\ProductName.
  3. Based on the user input in a custom dialog, this property is updated to C:\Program Files (x86)\CompanyName\UserInputName\ProductName. 
  4. All the DLL files from the merge module are copied into 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

Labels (1)
0 Kudos
(1) Solution

Hi,

I could think of one more solution for the resolving this on run-time. What you can do is:

  • Make sure you create one directory entry say ISMyOwnDirectory as discussed in previous thread which is derived from ISMyProductDir
  • Make sure merge module's destination property points to ISMyOwnDirectory
  • On selecting directory that you choose on runtime,set the value to specific property say [BIN]
  • Just after this, execute custom action of type SetDirectory which sets the directory value of ISMyOwnDirectory to property value [BIN]
  • Make sure to set sequence properly,in your case it should happen before filetransfer
  • Check the attached snapshot for SetDirectory customaction though it might not exactly fit into your requirement(In terms of sequence i meant)
  • After installing ,files of mergemodule will go to the directory that you picked up runtime.

i could see this working by having compile-time property value of [BIN]-C:\Users\<username>\Desktop\<FolderName>

 

Hope it helps,

Thanks,

Jenifer 

View solution in original post

(9) Replies
banna_k
Revenera
Revenera

 

See the below link, it is almost similar to your issue.  

https://stackoverflow.com/questions/2272216/installshield-12-changing-the-destination-of-a-merge-module-at-run-time

Apart from that if you want to control destination path at runtime using a dialog, you have to configure a public property that need to be selected in the mergemodule destination, as well same property need to be initialized at runtime.  

 

0 Kudos

Hi,

[BIN] is a public property which I update it during run time. For some reason, the new value is ignored.

any clue why might be wrong here?

0 Kudos

Depends on where you are calling for it.

If it’s a Deferred Custom Action the Property [BIN] won’t make it over.

Search for CustomActionData on how to handle Properties between immediate and deferred actions.

0 Kudos

Hi,

There is specific note from InstallShield side:

Note: This procedure redirects only the TARGETDIR directory in the merge module, or directories that derive directly from TARGETDIR. If the merge module is configured to send files to a predefined folder (for example, SystemFolder), you cannot override the module’s destination.

from this link:https://helpnet.flexerasoftware.com/installshield22helplib/helplibrary/IHelpMMOverrideDestination.htm#organizingfiles_1481236491_1130342

So it deals with Directory table entries.I had tried below:

  • Create a new directory entry say MyOwnDirectory which has ISMyProductDir as parent directory
  • Selected that [MyOwnDirectory] from destination property of mergemodule
  • After installing i could see mergemodule files going to MyOwnDirectory
  • If you could make directory entry which has TARGETDIR as derived will work at Runtime
  • Note:ISMyProductDir->ISMyCompanyDir->ProgramFilesFolder->TARGETDIR which is TARGETDIR derived

Hope it helps,

Thanks,

Jenifer

0 Kudos

@Jeinifer

Thanks

Exactly, the procedure which you have mentioned also works for me. In the Installshield, I seleted the destination of the merge module to be [BIN] directory. The files go into this directory, everything same like you explained.

However, if I change the value of the [BIN] during run time based on user input, the files still go into the same directory i.e value of [BIN] during compile time. It doesn't respect the new value of [BIN]. ( I verifed the update of [BIN] variable using a message box)

0 Kudos

Hi,

I could think of one more solution for the resolving this on run-time. What you can do is:

  • Make sure you create one directory entry say ISMyOwnDirectory as discussed in previous thread which is derived from ISMyProductDir
  • Make sure merge module's destination property points to ISMyOwnDirectory
  • On selecting directory that you choose on runtime,set the value to specific property say [BIN]
  • Just after this, execute custom action of type SetDirectory which sets the directory value of ISMyOwnDirectory to property value [BIN]
  • Make sure to set sequence properly,in your case it should happen before filetransfer
  • Check the attached snapshot for SetDirectory customaction though it might not exactly fit into your requirement(In terms of sequence i meant)
  • After installing ,files of mergemodule will go to the directory that you picked up runtime.

i could see this working by having compile-time property value of [BIN]-C:\Users\<username>\Desktop\<FolderName>

 

Hope it helps,

Thanks,

Jenifer 

Please open the built .msi file in Direct Edit mode and look at the Directory table. I guess you will see that the destination property for the files from the merge module is not BIN but BIN with the merge module's GUID attached.

Stefan Krueger
InstallSite.org
0 Kudos
@Jenifer Thanks, that was a Genius from you :-). It is really sad that you have to a detour to do this. is this something Installshield can improve on?
0 Kudos

Hi,

I think that is the feature that InstallShield has today with compile time directory entries for mergemodule destination directory.The same directory set(compile-time) applies to many other features by implementation itself.If you feel like it can make value to the product,you can raise enhancement request which can be validated by the team.

 

Glad you could get the solution.

 

Thanks,

Jenifer

0 Kudos