【发布时间】:2009-05-07 16:11:57
【问题描述】:
我正在使用 Wxs 3.0 创建一个 MSI 文件。我的 MSI 引用了一个 C# 自定义操作,使用新的 C# Custom Action project 编写。
我想向 msiexec 传递一个参数,该参数被路由到我的自定义操作 - 例如:
msiexec /i MyApp.msi ENVIRONMENT=TEST#
在我的 .wxs 文件中,我这样引用我的自定义操作:
<Property Id="ENVIRONMENT"/>
<Binary Id="WixCustomAction.dll" SourceFile="$(var.WixCustomAction.Path)" />
<CustomAction Id="WixCustomAction" BinaryKey="WixCustomAction.dll" DllEntry="ConfigureSettings"/>
<InstallExecuteSequence>
<Custom Action="WixCustomAction" After="InstallFiles"></Custom>
</InstallExecuteSequence>
我的 C# 自定义操作是这样设置的:
[CustomAction]
public static ActionResult ConfigureSettings(Session session)
{
}
我希望能够像这样访问该属性:
string environmentName = session.Property["ENVIRONMENT"];
但这似乎不起作用。
如何访问我在自定义操作中传递给 msiexec 的属性?
【问题讨论】:
标签: wix windows-installer installation custom-action