Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running CustomAction in wix as elevated user

Tags:

wix

wix3.5

As I see it - WiX supports two kinds of CustomActions:

  • Deferred - The user running this action is (by default) elevated, but it is not the user who ran the install (for example, LocalSystem, or some user like that).

  • Immediate - The user running this action is (by default) not elevated - it's the user who ran the installer in the first place.

I need something quite in the middle - I want the elevated form (UAC) of the user who ran the installer.

The reason I need this is to access databases that can only be accessed by the user installing the package in its elevated form (LocalSystem is not accessible).

like image 805
Roy Reznik Avatar asked Feb 02 '26 15:02

Roy Reznik


1 Answers

This does not exist. There are only two possible contexts for custom actions to run in. One is the launching user (often via impersonation). The other is the elevated context of the Windows Installer service. On some machines (such as Windows XP, or machines with UAC disabled), or with elevating bootstraps, the launching user is an adminstrative user; you can check for this case with a combination of the MSIUSEREALADMINDETECTION and AdminUser properties. But in no case is there a third context.

like image 194
Michael Urman Avatar answered Feb 04 '26 07:02

Michael Urman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!