Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Execute script after reboot automatically (http://forums.winamp.com/showthread.php?t=239340)

Oxyyy 27th February 2006 13:26

Execute script after reboot automatically
 
Hi,

I have to execute a part of the installation after a reboot. That means, some files are installed, the system is rebooted and after the reboot the installation process has to be continued.

So my question is: how can I define a NSIS-script that is executed after rebooting?

Oxyyy

glory_man 27th February 2006 14:50

You can add your installer in RunOnce key of regestry. Execute your installer with parameter which can tell you about computer's restart.

Afrow UK 27th February 2006 15:00

Or even write a registry key to tell your installer that the PC was just rebooted (remember to remove it afterwards!)

-Stu

Oxyyy 27th February 2006 18:38

Quote:

Originally posted by glory_man
You can add your installer in RunOnce key of regestry. Execute your installer with parameter which can tell you about computer's restart.
That sounds good but thereI have the problem that the installer can be located somewhere on a network drive that is no longer available after restarting. So it would be necessary to copy the installer itself to e.g. TMP. But is this possible?

Afrow UK 27th February 2006 18:57

Try CopyFiles on itself. If this doesn't work (I doubt it will) then you need to write another installer to do it. This other installer will contain the following:

code:
OutFile "CopyInstaller.exe"

Function .onInit
Sleep 1000 #Need to wait a bit until installer closes.
Call GetParameters
Pop $R0
CopyFiles $R0 "$TEMP\setupfile.exe"
Abort
FunctionEnd

Section
SectionEnd



So you should include this file as any other file, extract it to $TEMP and execute it from there with "$INSTDIR" as the parameter. Ideally the installer should Exec it and then Quit immediately. Also you need the GetParameters function in the script (which you can grab in the docs under Useful Scripts).

-Stu


All times are GMT. The time now is 04:56.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.