Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WiX and start program - is it possible to pass parameters?

Tags:

parameters

wix

I have an WiX package, application starts after installation:

<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" />

I want to pass language of WiX package to my program. Is it possible?

like image 561
Oleg Sh Avatar asked Jan 12 '23 22:01

Oleg Sh


1 Answers

It works:

<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>
like image 134
Oleg Sh Avatar answered Jan 31 '23 13:01

Oleg Sh