[wix-users] Running BA elevated
Vanniekerk, Tyrel (GE Healthcare)
tyrel.vanniekerk at ge.com
Mon Oct 28 06:52:30 PDT 2019
I have seen many many many posts and articles where people try to run the Bootstrapper part of their installer in elevated mode. The purists will all chime in that it's not supported, should never be done etc., but I have had several cases where our installers (bootstrapper part) need elevated permissions because of silly Windows restrictions. We 'solved' it, and I say solved, but it's not a real solution in my mind, by having a C# launcher application that has it's manifest set to launces elevated and that has buttons to run the various installers, which are then also running elevated, so no problems. The installers themselves will give and error if the process is not running elevated, requiring the user to click "Run as Administrator'. All fine and well, but there has to be a better solution this this, or as I have seen suggested, modifying the WiX Toolset source code to update the manifest files.
Now before you get angry and try to explain why this should never be needed, let me explain. An option in the bootstrapper XML to enable elevated would be nice, then it's up to the user to decide if they want to do that.
I have two situations I can think of at the moment that I have not been able to get around yet.
1. One of our installers allowed the user to enter an username/password that the elevated MSI installer would use to create a local user for batch processing. Problem is, Windows requires an elevated process to check the username and password policies. So the installer was not changing anything, but it could not ensure the username and password were valid for Windows, so the MSI portion could fail. Not acceptable.
2. I have not found a way yet (other than forcing our internal MSI to run in repair mode during a change, not desirable) to get the MSI installer to update our registry settings during modify mode. The component is already installed and I don't see a way to get it to update. So I a left to either create a custom action to update the registries manually, having to duplicate the code that was in the registry component, or I have the bootstrapper update the registry at the start or end of the install, which requires elevated permissions.
3. I think there was another case where I needed to check if all the required IIS components were installed that also required an elevated process.
So, other than possibly religious reasons, why is the option to run BA elevated so strongly blocked?
More information about the wix-users