Well, as the title suggests, it's all about checking last system reboot time and depending on that, executing some tasks.
My situation is, I will be asking user to restart the system on certain condition during the installation. Now clicking on 'OK' installer will be closed and user will have to manually restart the system.
Now say, user run the installer without restarting the system again. Now installer should report an error and ask for the restart.
Possible workaround thought so far.
- Checking and storing system time and compare both of them. This method will get failed if the user runs the installer after a long time of system reboot.
- Set some invalid values(need the value name only) in registry RunOnce and check for that value on installer startup. As values from RunOnce gets deleted automatically by Windows, if installer found the entry to be there, its obvious that user didn't restarted the system.
Any better ideas?