我有一个使用Wxs 3.0创建的MSI文件.我的MSI引用了一个C#自定义操作,使用新的C#Custom Action项目编写.
我想将一个参数传递给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>
Run Code Online (Sandbox Code Playgroud)
我的C#自定义操作设置如下:
[CustomAction]
public static ActionResult ConfigureSettings(Session session)
{
}
Run Code Online (Sandbox Code Playgroud)
我原以为能够像这样访问该物业:
string environmentName = session.Property ["ENVIRONMENT"];
但这似乎不起作用.
如何访问我在自定义操作中传递给msiexec的属性?