[wix-users] Forced reboot behavior during bundle install with custom bootstrapper application

Bryan Dam bryand at recastsoftware.com
Thu Apr 14 11:39:57 PDT 2022


Another hole in one Sean.  That's exactly it: when I run the bundle as admin it reboots automatically as expected.
I really need to get better at searching the issues list.

Ok, so now to see if I can detect if the user has reboot permissions and handle that scenario as well.

  Thanks so much.
      Bryan

-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Sean Hall via wix-users
Sent: Thursday, April 14, 2022 2:02 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Sean Hall <r.sean.hall at gmail.com>
Subject: Re: [wix-users] Forced reboot behavior during bundle install with custom bootstrapper application

Are you running into https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fwixtoolset%2Fissues%2Fissues%2F5499&data=04%7C01%7Cbryand%40recastsoftware.com%7Cf447eb0656234b2d047f08da1e40f622%7C9315bb44634846c6bd378880b87e774e%7C0%7C0%7C637855561603410334%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=sXWi%2FHzrR6NezkuioV6sfFfGE%2FsdoT%2FwIq9Kgc3sSjI%3D&reserved=0 or https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fwixtoolset%2Fissues%2Fissues%2F6145&data=04%7C01%7Cbryand%40recastsoftware.com%7Cf447eb0656234b2d047f08da1e40f622%7C9315bb44634846c6bd378880b87e774e%7C0%7C0%7C637855561603410334%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=8cASq7y9UqbXJiABg60Spr3ai3qWLRIIer00vmg0bKY%3D&reserved=0?

On Thu, Apr 14, 2022 at 11:35 AM Bryan Dam via wix-users < wix-users at lists.wixtoolset.org> wrote:

> TL;DR: In my custom BootStrapperApplication's Shutdown event I am (for 
> testing only) hard coding e.Result = Result.Restart but the OS doesn't 
> reboot when my bootstrapper application closes.  What's the expected 
> behavior here? I though it would forcibly restart the OS.
>
>
> I've got a bundle that needs to install IIS before it installs the 
> .Net Core Hosting Bundle before it installs our app.  If IIS isn't 
> there before the .Net Core install then it won't install the IIS 
> features and thus our app will install but fail to run.  I have an EXE 
> project called InstallIIS that uses DISM to install IIS and the 
> necessary modules.  It uses the /noreboot flag which means that 
> sometimes DISM returns 3010 which my EXE returns as its own exit code.  
> When a reboot is needed I need to make sure the OS reboots before the bundle install continues on to .Net Core.
>
> So in the InstallIIS ExePackage element I've added: <ExitCode Value="3010"
> Behavior="forceReboot" />
>
> My custom boostrapper application handles ApplyComplete that checks 
> the e.Restart value and if it's RestartRequired or RestartInitialized 
> will prompt the user to reboot now or reboot later themselves.
>
> My custom boostrapper application also handles  Shutdown and if the 
> user has chosen to reboot now sets e.Result accordingly:
> private void BootstrapperUI_Shutdown(object sender, ShutdownEventArgs 
> e) { //if (_vm.RebootAccepted)- Commented out for testing e.Result = 
> Result.Restart; }
>
> This all appears to work.  InstallIIS runs, returns 3010, I get the 
> reboot prompt from my custom bootstrapper application, and e.Result is 
> set to Result.Restart.  However, my custom bootstrapper application 
> closes and the OS does not reboot.  If I manually reboot and manually 
> rerun the installer then I can see that 
> BootStrapperApplication.Command.Resume equals ResumeType.Reboot but 
> the actual reboot doesn't appear to be triggered as I expected to.  Am 
> I doing something wrong or just have incorrect expectations?
>
>   Thank,
>     Bryan
>
> Here's a truncated bundle log:
> =======================================
> Applied execute package: InstallIIS, result: 0x0, restart: Initiated 
> Session end, registration key:
> SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{a86bc6fc-e90b-4a8
> 9-964c-8c52893ad3e5},
> resume: Reboot Pending, restart: Initiated, disable resume: No 
> Updating session, registration key:
> SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{a86bc6fc-e90b-4a8
> 9-964c-8c52893ad3e5},
> resume: Reboot Pending, restart initiated: Yes, disable resume: No 
> Apply complete, result: 0x0, restart: Initiated, ba requested restart:  
> No Shutting down, exit code: 0x0 Bootstrapper application requested 
> restart at shutdown. Planned to restart
> already: No.
> ...
> Variable: RebootPending = 0
> ...
> Variable: WixBundleForcedRestartPackage = InstallIIS ...
> Exit code: 0x0, restarting: Yes
> Restarting computer...
> =======================================
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.f
> iregiant.com%2F&data=04%7C01%7Cbryand%40recastsoftware.com%7Cf447e
> b0656234b2d047f08da1e40f622%7C9315bb44634846c6bd378880b87e774e%7C0%7C0
> %7C637855561603410334%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=zhO1UYuI2o
> NqInah2ZGtrqK3b2K7O9O6luQd%2B%2FyPr5c%3D&reserved=0
>

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.firegiant.com%2F&data=04%7C01%7Cbryand%40recastsoftware.com%7Cf447eb0656234b2d047f08da1e40f622%7C9315bb44634846c6bd378880b87e774e%7C0%7C0%7C637855561603410334%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=zhO1UYuI2oNqInah2ZGtrqK3b2K7O9O6luQd%2B%2FyPr5c%3D&reserved=0



More information about the wix-users mailing list