I am running the .exe file through a CustomAction in Wix. The executable is running but not with admin rights. Seems like i am doing everything correct but not sure what's going wrong. Here is the sample of my Custom Action
<CustomAction Id="RunExe" FileKey="Setup" ExeCommand="-switch" Execute="deferred" Return="check" Impersonate="no"/>
<InstallExecuteSequence>
<Custom Action="RunExe" Before="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>
The actual problem is that this .exe that is executed through ExeCommand is not able to access a registry key(HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders).
Running the msi as administrator solve the problem but i need a solution in which WIX should itself able to run the command as admin or atleast give a prompt to user.