4

How can I launch an application with administrator rights after I have completed an installation using a WiX-based MSI?

I can launch the application just fine on Windows XP, but with Windows 7, it's an issue.

The application has a manifest embedded in it that says it should run as administrator and I've changed the impersonate attribute in the Custom Action to "no". I can't change the execute attribute to deferred, as this only works before the InstallFinalize action, and I need it after the user has clicked Finish in the MSI.

This is my custom action:

<CustomAction Id="LaunchApp" FileKey="App" ExeCommand="[Command Line Args]" Execute="immediate" Impersonate="no" Return="asyncNoWait" />
1

1 Answer 1

2

I couldn't use WixShellExec as I needed to pass in command line arguments if certain conditions were true. So I just created a custom action that launched the exe through cmd prompt. Hacky, but a viable workaround and it works without a hitch.

Sign up to request clarification or add additional context in comments.

1 Comment

Huh, I hadn't used it so didn't realize WixShellExec didn't handle arguments. How odd! Well you can always create your own C++ DLL custom action which calls ShellExecute...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.