WiX和启动程序 - 是否可以传递参数?

时间:2013-07-13 20:04:28

标签: parameters wix

我有一个WiX软件包,安装后应用程序启动:

<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch MyProgram" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<Property Id="WixShellExecTarget" Value="[#MainExe]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />

我想将WiX包的语言传递给我的程序。有可能吗?

1 个答案:

答案 0 :(得分:8)

有效:

<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<Property Id="LANGUAGE" Admin="yes" />

<CustomAction Id="LaunchApplication"
   FileKey="MainExe"
   ExeCommand="[LANGUAGE]"
   Execute="immediate"
   Impersonate="yes"
   Return="asyncNoWait" />

<!-- icon for add/remove programs -->
<Property Id="ARPPRODUCTICON" Value="ProgramIcon.exe" />

<!-- Интерфейс пользователя (подключается отдельной сборкой) -->
<UI Id="MyWixUI_Mondo">
  <UIRef Id="WixUI_Minimal" />
  <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
  <UIRef Id="WixUI_ErrorProgressText"/>
</UI>