Archive: Jump to installer section after computer restart


Jump to installer section after computer restart
Hi, as part of an installer I am creating I need to install Windows Installer 4.5 as a pre-requisite to SQL Express 2008.

Windows Installer 4.5 requires a reboot for system changes to take effect and the SQL 2008 installer will fail to start if there is a reboot pending.

I have been able to get my installer to restart after the computer restart but I need it to resume with the next selected section of the installer. Currently, it displays the Welcome page and I have to click through and select components again.

I have stored the installer path in the RunOnce registry key as follows:

;--------------------------------
;Installer Sections
Section "Windows Installer 4.5"
StrCpy $PRODUCTNAME "Internet Tracker"
SetOutPath $INSTDIR
SetShellVarContext all

; store where the installer should resume from
System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1'

; $R0 will contain the installer filename
WriteRegStr HKLM Software\Microsoft\Windows\CurrentVersion\Run "SetupContinue" '"$R0"'

; install Windows Installer 4.5 and force reboot
File "WindowsXP-KB942288-v3-x86.exe"
ExecWait "WindowsXP-KB942288-v3-x86.exe /passive /forcerestart"
Delete "WindowsXP-KB942288-v3-x86.exe"
SectionEnd

I then have another section for .NET and this is where I need the installer to resume from.

Any help and examples on how to do this would be greatly appreciated.

Thanks

Kevin


You'll need to re-run your installer after the reboot with a command line switch. You can use GetParameters and GetOptions to detect it (see manual). You'll then need to call Abort in all page pre functions (or use RelGotoPage on Wiki) and ensure all sections prior to the one to run are unselected (use the UnselectSection macro in Sections.nsh) or jumped over (using an ${If}/${Unless}...${EndIf} or StrCmp and a label).

Stu


Thanks. :)

I will give it a try later and post back if I have any problems.