[wix-users] Custom Bootstrapper Elevated

Vanniekerk, Tyrel (GE Healthcare) tyrel.vanniekerk at ge.com
Wed Sep 29 09:35:34 PDT 2021


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


More information about the wix-users mailing list