[wix-users] Custom Bootstrapper Elevated

Rob Mensching rob at firegiant.com
Wed Sep 29 11:48:29 PDT 2021


It's up to you how design the .exe. I agree prompting multiple times would be a very poor user experience. I wouldn't design the solution to prompt multiple times.

Note: The UI running unelevated isn't just a recommendation from Microsoft we're following. The Burn's current design addresses problems accessing payloads as the correct user. I don't think we've changed this design in WiX v4 (Sean would know better, maybe the new Burn extensions can help, not sure) but I have some ideas for larger Burn changes WiX v5 to maybe make this sort of scenario work better.

-----Original Message-----
From: Vanniekerk, Tyrel (GE Healthcare) <tyrel.vanniekerk at ge.com> 
Sent: Wednesday, September 29, 2021 11:12 AM
To: Rob Mensching <rob at firegiant.com>; 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

Hmm.  So for every check I would need to do that Windows forces me to be in elevated mode I would have to start an exe, the user needs to click to elevate it, then return the result somehow and rinse repeat.  For some installers we have several checks on different pages that would require this.  Our solution we have works well for a normal install, it's just that you cannot choose to elevate permissions when you click on modify in programs and features.

Also, I just had to install SQL Server and SQL Management Studio and both asked to elevate once the installer started running.  So Microsoft don't follow their own recommendations.  :D

-----Original Message-----
From: Rob Mensching <rob at firegiant.com> 
Sent: Wednesday, September 29, 2021 12:03 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Vanniekerk, Tyrel (GE Healthcare) <tyrel.vanniekerk at ge.com>; Nir Bar <nir.bar at panel-sw.com>
Subject: EXT: RE: [wix-users] Custom Bootstrapper Elevated

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