Archive: A custom Page inside of instfiles Page


A custom Page inside of instfiles Page
Hi,

I'm very new to NSIS. I need to pop up a custom page asking for IP address only if I find a file, otherwise I shall skip the custom page.

Section ;install section

ifFileExists $MYFILE custom
Goto end

custom:
Call Setcustom
Goto end
end:
WriteUninstaller "$INSTDIR\uninstall.exe"

SectionEnd

Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "server-ip.ini" "SERVERIP"
FunctionEnd

Function Setcustom
Push $9
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "SERVERIP"
!insertmacro MUI_INSTALLOPTIONS_SHOW
Pop $9
FunctionEnd


I do see the custom page, but after I give user input, the installer start all over again, it did not go to the unistall section. What's wrong? and how can I put a custom page inside the install page and continue till finish page?

Please help.

Thanks.[B]


No one has an idea? Why after I call Setcustom, the installer crashes?


You can't create a custom page from within a function. You'll need to wait until after the InstFiles page completes and then insert the custom page:

!insertmacro MUI_PAGE_INSTFILES
Page custom "SetCustom" "" " - IP Address"
Section ;install section
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd

Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "server-ip.ini" "SERVERIP"
FunctionEnd

Function Setcustom
IfFileExists $MYFILE 0 +2
Abort
Push $9
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "SERVERIP"
!insertmacro MUI_INSTALLOPTIONS_SHOW
Pop $9
FunctionEnd


-dandaman32

Thanks for the reply. I fixed it. As what you said, I need do that after install section.