I have an application that includes a shell that is displayed for all non-admin users. During installation the shell needs to be closed. However if anything goes wrong during installation, I would like the shell to be restarted via a custom action. For legacy reasons, I accomplish both the close and the restart via C# custom actions. Here is the WiX code:
<CustomAction Id="CA_StopShell" ... Execute="deferred" Impersonate="no"/>
<CustomAction Id="CA_StartRollbackShell" ... Execute="rollback" Impersonate="yes"/>
<InstallExecuteSequence>
<Custom Action="CA_StartRollbackShell" Before="CA_StopShell"> </Custom>
<Custom Action="CA_StopShell" After="ProcessComponents" />
</InstallExecuteSequence>
This works fine, but it also brings up the shell for the admin user when there is an install failure, which is bad. The question is how do I make the custom action only occur if the user was not the Admin user?
I tried:
<Custom Action="CA_StartRollbackShell" Before="CA_StopAllAADProcesses"> NOT Privileged </Custom>
But that didn't ever start the shell back up.
FYI, I'm using Wix 3.8.
Thanks for any help you can give.