Page 1 of 1

Check for system reboot required?

Posted: Wed May 31, 2023 2:07 am
by pushpraj
Required a function that will return a flag if the system is pending for restart. (After window update or any patch download)

Below registries are holding values of the system pending restart.
- "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending"
- "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations "
- "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired "

We are facing issues in silent installation, when we uninstall the old setup, the user received the Reboot required flag after uninstallation. As it is a silent installation user will not receive the pop-up for restarting the system and resuming the setup. Now the user application is removed from the system and a new one is not installed.

Now we wish to make sure before uninstalling the old version of the application we will have a check for the system that is pending restart. or have rollback-like things that we can make sure the User will have at least the Old version if a new version is not installed.

Thanks in advance.
Regards,
Pushpraj

Re: Check for system reboot required?

Posted: Mon Feb 19, 2024 9:46 am
by FrancescoT
Dear Pushpraj,

it's not available a built-in method for that.
At any rate you can easily accomplish this by reading such system registry from your setup script using the "Read Registry" command (https://www.installaware.com/mh52/desktop/readregistry.htm).