Installshield 12:在运行时更改合并模块的目标 [英] Installshield 12: Changing the destination of a merge module at run time

查看:160
本文介绍了Installshield 12:在运行时更改合并模块的目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在运行时更改合并模块的目标...

I’m trying to change the destination of a merge module at run time...

让我解释一下: 我有一个合并模块,其目标设置为[SystemFolder]文件夹.

Let me explain: I have a merge module, which its destination is set to the [SystemFolder] folder.

我有很多MSI项目都指向这个合并模块,所有项目都将合并模块(组件)的目标指向(使用合并模块的默认目标)".

And I have a lot of MSI projects point to this one merge module, all pointing the merge module (Component) destination to ‘(Use merge module's default destination)’.

问题: MSI项目之一需要将合并模块安装到公用文件"位置(而不是systyem32文件夹).

The Issue: One of the MSI Projects needs to install the merge module to the ‘Common File’ location (not the systyem32 folder).

因此,如果我将MSI项目中的合并模块(组件)目标更改为[CommonFileFolder],则不会发生任何事情(因为合并模块目标仍设置为[SystemFolder])

So if I change the merge module (Component) destination in the MSI project to [CommonFileFolder] nothing happens (because merge module destination is still set to [SystemFolder])

或者,如果我将合并模块的目标更改为[TARGETDIR],然后将MSI项目中的合并模块(组件)的目标更改为[CommonFileFolder],则可以正常工作.但是随后我所有其他MSI项目都将合并模块安装到根驱动器,因为其他MSI项目仍将合并模块(组件)的目标指向(使用合并模块的默认目标)".

Or, if I change the merge module destination to be [TARGETDIR] and then change my merge module (Component) destination in the MSI project to [CommonFileFolder], then that works fine. But then all my other MSI projects will then install the merge module to the root drive because the other MSI projects are still pointing the merge module (Component) destination to ‘(Use merge module's default destination)’.

我不能做这两件事: 我不想将每个MSI项目都更改为[SystemFolder]或[CommonFileFolder].)

I can’t do these two things: I don’t want to change every single MSI project to either [SystemFolder] or [CommonFileFolder]).

我也不想创建两个相同的合并模块(一个指向[SystemFolder],另一个指向[CommonFileFolder]),所以我只需要更改一个MSI项目

And I also don’t want to create two identical merge modules (one pointing to [SystemFolder] and the other point to [CommonFileFolder]), so I only have to change the one MSI project

如果MSI项目将合并模块指向(使用合并模块的默认目标)",这是我可以更改合并模块目的地的一种方法吗?

Is they a way I could change the merge module destination if the MSI project is point the merge module to ‘(Use merge module's default destination)’?

例如: 如果TARGETDIR =(使用合并模块的默认目标)",则将TARGETDIR设置为[SystemFolder],否则使用[TARGETDIR]

For example: If TARGETDIR = ‘(Use merge module's default destination)’ then set the TARGETDIR = [SystemFolder] Else use the [TARGETDIR]

还是我可以解决此问题的另一种方法?

Or is there another way I could fix this?

谢谢 比利·鲍勃·李

推荐答案

在合并模块中创建组件时,将目标"留给INSTALLDIR.

When you create the component in the merge module, leave the Destination to INSTALLDIR.

在基本的msi项目(可重新分发的视图)中使用合并模块时,右键单击合并模块并选择属性.然后使用目标"下拉列表配置关系.现在,合并模块中的文件将转到您告诉的位置.

When you consume the merge module in your basic msi project ( redistributables view ) right click the merge module and select properties. Then use the Destination drop down to configure the relationship. The file in the merge module will now go where you tell it to.

旁注,一旦合并,合并模块就不再存在.看看Orca中内置的MSI,您会看到目录表条目看起来像这样(假设您为SystemFolder配置了模块)

Side note, once merged, merge modules no longer exist. Take a look at the built MSI in Orca and you'll see that there are directory table entries that look like this ( Let's assume you configured the module for SystemFolder )

TARGETDIR SourceDir ProgramFilesFolder TARGETDIR.:PROGRA〜1 |程序文件 ISMyCompanyDir ProgramFilesFolder MYCOMP〜1 |我的公司名称 ISMyProductDir ISMyCompanyDir MYPROD〜1 |我的产品名称 INSTALLDIR IsMyProductDir. INSTALLDIR.SOMEGUID SystemFolder.

TARGETDIR SourceDir ProgramFilesFolder TARGETDIR .:PROGRA~1|program files ISMyCompanyDir ProgramFilesFolder MYCOMP~1|My Company Name ISMyProductDir ISMyCompanyDir MYPROD~1|My Product Name INSTALLDIR IsMyProductDir . INSTALLDIR.SOMEGUID SystemFolder .

."代表当前目录"或与父目录相同".

The "." represent 'current directory' or 'same as parent'.

因此,在这种情况下,您需要建立INSTALLDIR = C:\ Program Files \ My Company Name \ My ProductName \以及INSTALLDIR.SOMEGUID = C:\ Windows \ System32

So in this case you build up that INSTALLDIR = C:\Program Files\My Company Name\My ProductName\ and that INSTALLDIR.SOMEGUID = C:\Windows\System32

有道理吗?这样,您可以在部署到不同位置的不同产品中使用该模块.

Make sense? In this way you can consume the module in different products deploying to different locations.

这篇关于Installshield 12:在运行时更改合并模块的目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆