You are currently viewing [Stop] Hard Reboot MSI Exit Code 1641 (ERROR_SUCCESS_REBOOT_INITIATED) like a Pro
Log File of MSI Application where we get hard reboot Exit Code 1641 (ERROR_SUCCESS_REBOOT_INITIATED)

[Stop] Hard Reboot MSI Exit Code 1641 (ERROR_SUCCESS_REBOOT_INITIATED) like a Pro

You must have faced this following exit code 1641 (ERROR_SUCCESS_REBOOT_INITIATED) after install, repair or uninstall some MSI based applications. 

I would say this is not error code, actually it’s success exit code which get generated by Windows installer based on the MSI file behaviour. Now understand how it could create problem for you and your users with following scenario: 

Let’s assume you’re a SCCM/System administrator and responsible to deploy an application (e.g., 7-Zip 21.07) with below order: 

Understand the Scenario:

  • Pre-Install Steps 
    • Uninstall previous version 7-Zip 19.00, 
    • Remove leftover some folders (e.g., C:\Program Files (x86)\7-Zip), 
  • Install Steps 
    • Install new version 7-Zip 21.07 

You prepare an install script and deploy application 7-Zip 21.07 through Configuration manager (formerly known as SCCM). 

Later, you get multiple calls referring that user’s system are getting rebooted forcefully without any notification while installing 7-Zip 21.07 application.  

Cause for Hard Reboot Exit Code 1641 (ERROR_SUCCESS_REBOOT_INITIATED)

Now here troubleshooting comes in the action. After rebooting some affected systems, you found that only previous version of 7-Zip 19.00 task has been executed successfully (Exit error code 1641, ERROR_SUCCESS_REBOOT_INITIATED) and then system rebooted immediately without execute next steps. 

Log File of MSI Application where we get hard reboot Exit Code 1641 (ERROR_SUCCESS_REBOOT_INITIATED)
Log File of MSI Application where we get hard reboot Exit Code 1641 (ERROR_SUCCESS_REBOOT_INITIATED)
  • Pre-Install Steps
    • Uninstall previous version 7-Zip 19.00, (Executed with exit error code 1641)
    • Remove leftover some folders (C:\Program Files (x86)\7-Zip), (Didn’t executed) 
  • Install Steps 
    • Install new version 7-Zip 21.07 (Didn’t executed) 

Now there are two issues for you: 

  • First, whole script was not able to execute cause of that new version hasn’t installed, 
  • Second, user’s systems are getting reboot forcefully.

 It could create a big problem for users when users are busy in an important works or giving presentation in a meeting and don’t want their system to get forcefully reboot without giving any notification or way to stop it.

If you’ve worked with MSI file, then can suppress this hard reboot by using following parameters for most of the applications:

  • REBOOT=ReallySuppress 
  • /norestart 

But, for some applications this parameter doesn’t work and still system get hard reboot. 

Like you, I also tried multiple ways to prevent this and after multiple attempts I prepare a working solution to overcome this issue.

Solution for Hard Reboot Exit Code 1641 (ERROR_SUCCESS_REBOOT_INITIATED) 

Based on above scenario, we need to add a schedule reboot step in starting of script:

#Set Restart time to prevent force hard reboot
cmd /c shutdown -r -t 43200

In above command I’ve used 43200 seconds (~ 10 hours), you may change but that’s not require because end of script we’ll cancel the scheduled reboot (cmd /c shutdown /a). 

#Cancel the scheduled reboot at the end of script after finish all steps
cmd /c shutdown /a

Let me show you how it’s look like when you execute this commands: 

So now your script steps will look like this: 

  • Pre-Install Steps 
    • Schedule a reboot (cmd /c shutdown -r -t 43200) 
    • Uninstall previous version 7-Zip 19.00, 
    • Remove leftover some folders (C:\Program Files (x86)\7-Zip), 
  • Install Steps 
    • Install new version 7-Zip 21.07 
    • Cancel the scheduled reboot (cmd /c shutdown /a

This trick will work with any MSI, or EXE based installation where you want to prevent hard reboot Exit code 1641 of client systems.

Understand the Concept of Prevent Hard Reboot (ERROR_SUCCESS_REBOOT_INITIATED)

You’ll get following notification when you already schedule a shutdown task on system:

how to stop hard reboot Exit Code 1641 (ERROR_SUCCESS_REBOOT_INITIATED)
How to Pre-schedule Shutdown on system to prevent hard reboot Exit Code 1641 (ERROR_SUCCESS_REBOOT_INITIATED)

You will receive following notification while cancel the scheduled shutdown task:

How to cancel pre-schedule Shutdown on system to prevent hard reboot Exit Code 1641 (ERROR_SUCCESS_REBOOT_INITIATED)
How to Cancel Pre-schedule Shutdown on system after prevent hard reboot Exit Code 1641 (ERROR_SUCCESS_REBOOT_INITIATED)

Now here you’ll understand why MSI exit code 1641 hard reboot unable to reboot system if you’ve already scheduled a Shutdown on system.

You can see in following screenshot. If you try to schedule shutdown task second time without cancel previous shutdown, you’ll get message that “A system shutdown has already been scheduled.(1190)”.

That means when you’ve already set shutdown manually with some delay, then Windows installer unable to schedule second shutdown on the event of MSI exit code 1641 hard reboot. Then this Hard Reboot exit code 1641 (ERROR_SUCCESS_REBOOT_INITIATED) get change to Soft Reboot exit code 3010 (ERROR_SUCCESS_REBOOT_REQUIRED). Which is OK. 🙂

What will happen when try to re-schedule Shutdown on system where already a shutdown already schedule

Summary:

In this article we talked about how we can prevent system from forcefully reboot on then event of MSI Exit code 1641 hard reboot (ERROR_SUCCESS_REBOOT_INITIATED) while installing, repairing or uninstalling applications on client systems.

I hope this workaround help you in this scenario and we also love to hear your feedback if you know any other trick to overcome this issue.

Please check this page for more learning resources.

Please also take the following course for more learning….

Advance IT Troubleshooting for Desktop Support Professional
Advance IT Troubleshooting for Desktop Support Professional

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.