R. Beiboer
R. Beiboer

Reputation: 724

WIX How to execute custom action that runs installed file with admin priveleges

In a Windows Installer msi package, created with WIX, I want to execute a custom action (written in c#) that executes a powershell script file that is installed by the installer.

The script needs admin privileges to run correctly.

When I execute the custom action before InstallFinalize, then the execution fails because the script is not yet installed. When I execute the custom action after InstallFinalize, then the custom action does not have admin privileges.

How can I execute a custom action that executes an installed file with admin privileges?

Upvotes: 0

Views: 66

Answers (1)

Rob Mensching
Rob Mensching

Reputation: 35901

You need to Execute the CustomAction deferred to execute as part of the elevated installation transaction... and not impersonate. Read the CustomAction documentation.

Upvotes: 1

Related Questions