cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
pilar_pl
Level 2

Detect if the system has been rebooted

I am developing an InstallScript MSI project. To complete the installation, the system should be rebooted, but the user can choose to reboot it at this moment or later. But before the application can be reinstalling or uninstalling, the system should be rebooted if it wasn't rebooted since the last time. How can I detect if the system has been rebooted after the installation?

Thank you for your ideas.
Labels (1)
0 Kudos
(1) Reply
TheResearch
Level 6

I m not sure how do we find whether the system has rebooted. May be the experts can guide you, if there is a direct solution.

But as a work around, u can add a dummy entry in the 'Run Once' registry during installation of your application.

Once the system is rebooted, the run once registry entry will be executed and then deleted.

So, during Repair or uninstall, u can check whether this entry is available and then u can decide to continue or abort the repair or uninstall based on this condition.

Hope this helps.
0 Kudos