Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   A custom Page inside of instfiles Page (http://forums.winamp.com/showthread.php?t=254999)

nsislover 6th September 2006 22:45

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]

nsislover 7th September 2006 04:15

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

dandaman32 7th September 2006 06:15

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:

code:
!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

nsislover 7th September 2006 06:16

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


All times are GMT. The time now is 05:06.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.