简体   繁体   English

Installshield-合并模块-基于用户对话框输入的动态目标目录

[英]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]。 BIN is public property. BIN是公共财产。 At compile time the value of [BIN] is C:\\Program Files (x86)\\CompanyName\\ProductName. 在编译时,[BIN]的值为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. 根据自定义对话框中的用户输入,此属性更新为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. 来自合并模块的所有DLL文件都复制到[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 我正在使用Install Shield Version 2010 Professional Edition,项目类型是Basic MSI Project

Merge Modules add a GUID to every primary key to prevent merge collisions. 合并模块将GUID添加到每个主键,以防止合并冲突。 So the BIN identifier actually turns into BIN.G_U_I_D when used in a Merge Module. 因此,在合并模块中使用时, BIN标识符实际上变成BIN.G_U_I_D

To resolve this issue, Merge Modules are designed to be "retargetable" . 为了解决此问题,合并模块被设计为“可重定向的”

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. 我已经在InstallShield论坛上发布了相同的问题,结论是InstallShield不支持在运行时更改MSM文件的目标目录。

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]. 在“可再分发”视图中,右键单击MSM文件->属性->目标->设置为[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] 创建类型为“设置目录”的自定义操作,其目录名称-MSM_DEST_STATIC_DIR,目录值-[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. 从对话框中获取用户输入后,首先,更新MSD_DEST_DIR_DYNAMIC_VALUE,然后执行在步骤2中创建的自定义操作。

While doing this I also realized that it is not possible to update the IISROOTFOLDER based on the dynamic user input. 在执行此操作时,我还意识到无法基于动态用户输入来更新IISROOTFOLDER。 I followed the same procedure with the custom action to update the IISROOTFOLDER. 我按照相同的步骤进行了自定义操作,以更新IISROOTFOLDER。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM