Archive: Resume installation after reboot


Resume installation after reboot
Resume installation after reboot
Hi all,

I need the installer to resume the installation process after a system reboot. Is it possible to acheive this using NSIS?

Help appreciated! Thanks!


Hey, calm down... You never should create new topics based on the same question more than one time.

You can't do it with NSIS naturally, but you can create 2 installers in which one of them will be executed when the computer restarts. You can use the code below to make Windows to execute the second installer when the computer restarts next time:

WriteRegStr "HKLM" "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "Program Name" "C:\Path\To\File.exe"
(Where "Program Name" is the name of the program, and "C:\Path\To\File.exe" is where the second installer is located)

You can't do it with NSIS naturally, but you can create 2 installers in which one of them will be executed when the computer restarts
... or use only one, and just use some data on the hard disk that tells the installer in which state it is (ie. first pass run, or second pass run after rebooting), and add itself in the Run section of the Registry so that it is run the next time the computer reboots. Just remember to remove this entry after the second pass is over.

Please don't create multiple threads for the same question. The other threads have been moved.


Hi!

The mechanism to start the installer after reboot in the middle of the installation using RunOnce section in the registry works fine, but I need to continue the installer from the position that it was restarted. I know that I can use a plug-in to jump on the needed state. But before the reboot I have to store some data, needed for the second reboot (for example the page that the installer have to jump, the selected components and so on...). The question is where to store the data? I can write it on the HDD, but where (temp folder???) or in the registry,... What is the typical storage for such information in such case? I don't have experience with this and I need advice what is the best way to do it.


You can add a commandline switch in the RunOnce entry, and check it with GetParameters and GetOptions on startup of your installer