Perform custom actions that require upgrades after installation

I have the following WiX snippet:

<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" /> <CustomAction Id="StartAppOnExit" FileKey="Configurator.exe" ExeCommand="" Execute="immediate" Impersonate="yes" Return="asyncNoWait" /> <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Configure initial settings" /> <UI> <Publish Dialog="ExitDialog" Control="Finish" Order="1" Event="DoAction" Value="StartAppOnExit" >WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish> </UI> 

Basically, the exit dialog box displays a field that says: start the application. Note. This app requires a boost. All this works great, except for misses. If UAC is turned on, it seems that MSI is galloping with the user's token and splitting its groups, so when it tries to run an application that requires a boost, it is no longer an option.

How to tie it together to work?

I tried throwing Impersonate = "no", but it's too late for this to work.

+6
windows-installer wix
source share
2 answers

The user interface sequence acts as a limited user and launches applications with a call to CreateProcess. If instead you use something like WixShellExec with [WixShellExecTarget], it will act as Explorer and display a UAC prompt if the target needs to be raised. Or you can modify your Configurator.exe to allow it to run without elevated privileges, detect this case, and restart itself with elevated privileges.

For example, this should work:

 <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" /> <CustomAction Id="StartAppOnExit" BinaryKey="WixCA" DllEntry="WixShellExec" Execute="immediate" Return="check" Impersonate="yes"/> <Property Id="WixShellExecTarget" Value="[#Configurator.exe]"/> <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Configure initial settings" /> <UI> <Publish Dialog="ExitDialog" Control="Finish" Order="1" Event="DoAction" Value="StartAppOnExit">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish> </UI> 
+12
source share

FYI, immediate user actions are ALWAYS issued (i.e. they are always started as the user running the MSI).

I like Michael Urman's idea of ​​how your Configurator.exe handles the raise problem.

I wonder if it is possible to simply include the manifest in the EXE so that the OS knows that height is always required.

0
source share

All Articles