0
votes

I have created MSI package using Wix.

Wix Script:

<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" />

<CustomAction Id="InstallDRV" Directory="INSTALLDIR" Execute="deferred" ExeCommand="[INSTALLDIR]setup.exe" Impersonate="no" Return="check" />

This 'setup.exe' will be installing 'Printer' drivers and set as default printer.

So, this will be update the default printer in the below key. HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows

But, msiexec.exe is running in 'System Administrator' instead of 'User Administrator'.

How can we execute MSI as 'User Administrator' account.

Thanks in advance.

Regards,

Dileep

1

1 Answers

2
votes

It is normal for per machine "Everyone" installs to run with the system account so that they can run elevated. Also, there is little support in Windows Installer for running elevated custom actions with the installing user's credentials. The way that people solve this problem is primarily to do this kind of "install within an install" in some other way that does not involve custom actions. But try this:

  1. The custom action needs to be impersonate="yes" so that it impersonates the installing user.

  2. Elevate the entire MSI install by starting from an exe that elevates to administrator privilege and then starts the MSI.