How to run custom action inside MSI created in WiX with elevated privileges?

I have an installer that needs to access the registry, copy and delete files using custom actions. In Windows XP, the installer works fine, but in Vista and 7, the installer detects an error because it cannot access the folder, but if I run the installer as an administrator, everything works.

So, I need the installer to be able to run the user action as an administrator, even if the MSI did not start this way (it requires the installer to be started by regular users). I tried using EXE at the beginning of my installation to modify the registry and let MSI work fine, but I don't think this is a very good solution.

PS. Bootstrapper is not an option due to client requirements: S All my user actions are delayed and issued: "no"

Any ideas? Thanks you

+4
installer windows-installer wix custom-action
source share
2 answers

Make sure that:

  • it is scheduled after InstallInitialize
  • Run attribute set to deferred
  • Impersonate attribute set to none

Please note that pending user actions cannot access the installation session, so you cannot directly access the properties of the installer.

+5
source share

Your custom actions should be ordered between InstallInitialize and InstallFinalize .

Do you get a UAC prompt when you run the installer? If you complete the installation for each machine, you will receive a UAC prompt when you click the Install button in the wizard. If you have not received a UAC prompt, verify that the ALLUSERS property is set to 2. See Also MSI Privilege Labeling

+2
source share

All Articles