[wix-users] Custom Bootstrapper Elevated
Rob Mensching
rob at firegiant.com
Wed Sep 29 10:03:23 PDT 2021
We've tackled this problem in the past by creating an executable launched in the UI (by pressing a button with the elevation shield on it) to report back the necessary data.
Not launching the bundle UI elevated ensures there aren't any over-the-shoulder elevation issues accessing network resources.
-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Nir Bar via wix-users
Sent: Wednesday, September 29, 2021 9:50 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Nir Bar <nir.bar at panel-sw.com>
Subject: Re: [wix-users] Custom Bootstrapper Elevated
I maintain a custom build of WiX which supports elevation on bootstrapper launch
The build is distributed as a nuget package https://www.nuget.org/packages/PanelSW.Custom.WiX/
Set Bundle/@RunAsAdmin="yes" to get it working
--
Nir Bar
WiX Expert
---- On Wed, 29 Sep 2021 19:35:34 +0300 Vanniekerk, Tyrel (GE Healthcare) via wix-users <wix-users at lists.wixtoolset.org> wrote ----
Hi,
Currently we have a check in all of our installers that gives an error if the installer is not run as administrator. We never change the system state during the UI phase and I have tried several times to get everything to work without running with elevated permissions, but alas, some checks with LDAP and IIS just don't work unless you are running with elevated permissions.
Our approach works for a regular install, but when you click modify on the installed application, the install fails when it checks some things in IIS. For instance, we check if the default site is running, if certain ports are in use etc. We are not modifying the system state and this action is a verification step to ensure the user entered correct information before continuing the install, so it's not like we can run the at a different point in the install (before the UI, during the elevated MSI etc.)
I saw a post where Rob said to run IBootstrapperApplicationEngine->Elevate() right away. I tried this at various points, but no luck yet. I needed to wait for the Engine property to not be null and if I run it early on I get the prompt to elevate, but the setup starts running without a UI (I had to kill it from task manager). If I run it when I start my WPF window, passing the window handle into the Elevate function, I get the prompt, but the UI is still not running in elevated mode.
What's the trick to doing this? I can't help that the UI requires elevated rights, I am not violating Windows best practices by making changes etc., I just need this to work.
Thanks,
Tyrel
"Anyway, if you want the "elevate right away" behavior, your BA can call "IBootstrapperApplicationEngine->Elevate()" right away. If you have a splash screen then you'll still have a better chance showing up on without being stuck blinking in the task bar.", Rob Mensching, ten years ago... :D
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
More information about the wix-users
mailing list