I would like to stay on the InstFiles page if errors occurs,
but I am unable to make this working...
Can somebody help me please?
; Sample code (NSIS3)
;--------------------------------
!include "MUI2.nsh"
;--------------------------------
Name "Test"
OutFile "Test.exe"
RequestExecutionLevel user
ShowInstDetails show
Var ErrorCount
Function .onInit
IntOp $ErrorCount 0 + 0
FunctionEnd
;--------------------------------
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
;===============================================================================
;// same result with MUI_PAGE_CUSTOMFUNCTION_SHOW
!define MUI_PAGE_CUSTOMFUNCTION_PRE FinishPagePre
!insertmacro MUI_PAGE_FINISH
Function FinishPagePre
${If} $ErrorCount > 0
DetailPrint ""
DetailPrint "$ErrorCount error(s)!"
ShowWindow $mui.FinishPage.Run ${SW_HIDE}
ShowWindow $mui.InstFilesPage.Run ${SW_SHOW}
MessageBox MB_OK "Ok?"
;// FinishPage displayed...
${EndIf}
FunctionEnd
;===============================================================================
;--------------------------------
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
Section "Test"
DetailPrint "Hello!"
IntOp $ErrorCount $ErrorCount + 1
;// $ErrorCount == 1
SectionEnd
;--------------------------------
; EOF