Archive: How can I reset instfiles page?


How can I reset instfiles page?
Good time of day. Sorry if my English so bad.
I wrote NSIS script for installing some MSI (MicroSoft Installer) files. I can't decompile it, because files have signature.
All files required serial numbers for installing.
script:


!include "nsDialogs.nsh"
....
!include "MUI2.nsh"
....
Page Custom GetSN
!insertmacro MUI_PAGE_INSTFILES
...
Var HWNDGetSN
Function GetSN
nsDialogs::Create 1018
Pop $HWNDGetSN
... ; fields for SerialNumbers
nsDialogs::Show
FunctionEnd
...
Section ... ; install section
ExecWait 'MsiExec /i "1.msi" PIDKEY=$SN1' $0
StrCmp $0 "1603" is1603 ; check return code.
is1603: ... ; How i can return to GetSN page? And after correct SN retry Install files.
ExecWait 'MsiExec /i "2.msi" PIDKEY=$SN2' $0
... ; check return code. How i can return to GetSN page?
ExecWait 'MsiExec /i "3.msi" PIDKEY=$SN3' $0
... ; check return code. How i can return to GetSN page?
SectionEnd


I can return, using that method http://nsis.sourceforge.net/Go_to_a_NSIS_page
but if I push Install button again... NSIS script don't clear status for installfiles page.

I think if you jump to the end of the last section to allow the installer to leave the InstFiles page before going back to your custom page; that should sort it.

Stu


oh.. Big thanks.
Really, when i return to SN page after Instfiles page it's work correctly. I do it using another custom page.
script:


!include LogicLib.nsh
!include "nsDialogs.nsh"
....
!include "MUI2.nsh"
....
Page Custom GetSN
!insertmacro MUI_PAGE_INSTFILES
Page Custom verifyInstall
!insertmacro MUI_PAGE_FINISH
...
Var HWNDGetSN
Function GetSN
nsDialogs::Create 1018
Pop $HWNDGetSN
... ; fields for SerialNumbers
nsDialogs::Show
FunctionEnd
...
Section ... ; install section
${If} $InstallStatus == "true"
ExecWait 'MsiExec /i "1.msi" PIDKEY=$SN1' $0
StrCmp $0 "1603" is1603 ; check return code.
is1603:
StrCpy $InstallStatus "false"
${EndIf}
${If} $InstallStatus == "true"
ExecWait 'MsiExec /i "2.msi" PIDKEY=$SN2' $0
... ; check return code.
${EndIf}
... ; other files
SectionEnd
Section -FinishSection
${If} $InstallStatus == "true"
; wrilte links and unstaller
${EndIf}
SectionEnd
Function verifyInstall ; функция для создания страницы проверки.
${If} $InstallStatus == "false"
StrCpy $R9 -3
Call RelGotoPage
${EndIf}
FunctionEnd

After that I have only one question: Can I disable "Back" button on finish page?

GetDlgItem $R0 $HWNDPARENT 3
EnableWindow $R0 0

Use in a defined MUI_PAGE_CUSTOMFUNCTION_SHOW function for your finish page.

Stu


Thanks a lot. script working correctly now