- NSIS Discussion
- Resuming an install after 3rd party install requires reboot
Archive: Resuming an install after 3rd party install requires reboot
jeffTN
9th June 2004 23:23 UTC
Resuming an install after 3rd party install requires reboot
My installer runs a number of 3rd party installers. On older systems these installers prompt the user to reboot after they have finished.
How can I either:
1) Resume my installer after reboot at the point where it left off.
or
2) Disable the prompt so the user cannot reboot until the end of my installer.
iceman_k
10th June 2004 02:54 UTC
If you know your 3rd party installer is going to require a reboot, then one possible solution would be to:
1) Create a registry entry indicating where your installer left off.
2) Make an entry in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce with your installer name and location.
3) Your installer will be run after the PC reboots.
4) Read the registry entry and continue your installation.
This is a fairly simplistic method, but it may do the trick for you.
I don't think you can disable the reboot prompt from the 3rd party installer.
xpulse
20th December 2004 14:37 UTC
?
i have the same problem.
i know what you mean,
but how can I resume on the point of the reboot?
that the user has not to click through the welcome page, license page, etc?
iceman_k
4th January 2005 05:18 UTC
If the registry entry is set call the abort function in the Pre functions for the pages you want to skip.
johnny44
27th April 2005 14:23 UTC
This thread has been inactive for quite a while but I hope someone will answer me. I'm really new to NSIS and I'm not really a programmation wiz so I'd like for someone to explain to me in greater details how to implement Iceman_k's method.
My installer installs many 3rd party softwares. It has only a WELCOME page then a COMPONENTS page where the user selects which softwares he wants to install. Some require a reboot, some don't. Finally there is the INSTFILES page and the FINISH page. I need to resume with the next software setup after a program that needs to reboot the computer is installed.
I was thinking about adding my installer in RunOnce after a program that needs to reboot is installed, rebooting and then checking strings in the registry in the .onInit section to skip straight to the installation of the next program. Does this make sense? How do I do this? What page do I resume to? How do I know what programs were selected? Regstry key, .ini file?
Any help would be greatly appreciated.
nusenucontesto
6th May 2005 12:23 UTC
hi everyone
im using nsis 1 week ago, and i have make something similar.
im installing some micro$oft packages that "require reboot".
first of all, i have make a ghost image of my computer, to be able to "reset" program installation without problems.
then i have something similar to:
ExecWait "my.exe"
and if you press "yes" on the my.exe reboot question my program DOES NOT RESTART. I think is better to control restarting...
anyway, before restarting i use this line to put my program on windows startup
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "My program" "pathtomyprogram.exe"
with this, i can restart my program after a reboot.
here u can find a problem...how u know "my.exe" is not already installed?
ok...i advice u to use regedit and to export registry(all) before and after installation, u could compare both .reg files with Compareit
i hope that helps u
(sorry for my engl, im spanish :P)
fishweasel
7th November 2006 13:55 UTC
Hi, I am having the same issue. My installer requires a third party application to be launched twice (once for .net or MSDE depending on section chosen) with a reboot in between, and a services for unix install - which when run unattended automatically reboots the machine.
All in , my target machine requires 2 reboots before completion of final install steps.
I understand about putting the runonce entry into the registry. What i dont understand is where or how to put set or get attributes flags into the installer - so it can continue from where it left off after the last reboot.
At present i am looking at creating seperate installers which are put into windows startup - and would like to have it all under one installer.
Is there any code examples about or any working installers that i can get a look at the .nsi file to see how its done ?
If ya could help in lay terms as i am not a programmer and have a small knowledge of scripting.
Thx
Fish
iceman_k
7th November 2006 16:44 UTC
OK, this is a simplistic scenario.
Say you have 3 sections in your installer. The first one runs when the installer is first started, and the second and third are run after the first and second reboots.
When the first section is run, write relevant installer information (installation directory, options, etc.) to the registry along with a flag indicating that the first section was run.
After the first reboot, read the registry settings in the .onInit function. If the flag is set, then you can call abort in the pre-page callbacks to skip the pages. The first section can goto its end if the flag is set.
The second section then sets a flag indicating that it was run.
Rinse and repeat for as many reboots as you need.
fishweasel
14th November 2006 23:27 UTC
Hi,
Thanks for your response iceman_k.
I have managed to figure out how to write flags and read them in .OnInit and using a test script, launch relevant messageboxes to let me know the syntax and details are correct. I am unsure, however as to how i would call the abort in the pre-page call backs. the list of pages in my script are just '!insertmacro LicensePage' etc.
Do i have to StrCmp the registry sring i have read within the macro somewhere ? or is there a simple 'goto postion x within instfiles' flag or attribute i can use. As it stands i can jump to parts of the function depending on the status of the registry sring by using
StrCmp $0 "first_reboot" 0 +3
etc - its just bypassing the license, sections InstDir etc that i cant seem to get my head around .
Thx again in advance.
Fish
papandopala
7th November 2008 14:29 UTC
Hello. I have same same problem and I do understand iceman_k's solution. But my installer has many sections, its difficult to skip each section by checking a flag, and I need more than 1 reboot. 2 years have gone since last post. Maybe there is a better way now to skip sections or something. It would be nice if there was a way to skip whole section groups but I think its not possible. Does anybody know anything else?
Thank you.