Old 24th April 2007, 00:43   #1
kraza
Junior Member
 
Join Date: Apr 2007
Posts: 5
Question Custom page is not displayed in installer

Hello,

I am trying to display a custom page in my installer. It is reading the ini file using a path in the script. Everything works fine when I run the installer from the same folder as the script (meaning all the referenced paths are correct from that folder).

As soon as I move my installer to a different location, say desktop and run it, I can view all the pages, display my license (that was a relative path too) but my custom page is not displayed. The installer hangs and doesn't read my ini file.

Interesting enough, if I copy all my folders from my orig location to desktop (matching the relative path to ini from desktop now) it starts working.

Shouldn't my compiler comprress the ini file into the output .exe at the time of compiling?
Seems like the exe is not able to find the ini here.

Any help would be greatly appreciated.
Thanks,
Kaz
kraza is offline   Reply With Quote
Old 24th April 2007, 03:20   #2
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
It's hard to tell w/o seeing your code, but if I had to guess, you are not extracting the page file in the correct place (or maybe not at all.)

If you are using the classic interface, use this in your .onInit function
code:

Init PluginsDir
File "/oname=$PLUGINSDIR\yourpagefile.ini" "yourpagefile.ini"
...


and this in your page's show function:
code:

InstallOptions::dialog "$PLUGINSDIR\yourpagefile.ini"
...

Comperio is offline   Reply With Quote
Old 24th April 2007, 18:22   #3
kraza
Junior Member
 
Join Date: Apr 2007
Posts: 5
Thanks a lot for your response!!

Here is my relevant code. I'm kinda using both MUI and Old style (had difficulty with MUI only..)

ReserveFile "..\V1_final_code\hostinput.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
...
...

;custom input page
LangString HOSTPORT_TITLE ${LANG_ENGLISH} "Enter your Host name and Port #."
LangString HOSTPORT_SUBTITLE ${LANG_ENGLISH} " "
Page custom HostPortPage

Function .onInit
;my input ini file
;!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "hostinput.ini" "HostPort"

InitPluginsDir
File /oname=$PLUGINSDIR\hostinput.ini "..\V1_final_code\hostinput.ini"

FunctionEnd

Function HostPortPage

!insertmacro MUI_HEADER_TEXT "$(HostPort_TITLE)" "$(HostPort_SUBTITLE)"


Push ${TEMP1}

again:
InstallOptions::dialog "..\V1_final_code\hostinput.ini"
Pop ${TEMP1}



ReadINIStr ${Hostname} "..\V1_final_code\hostinput.ini" "Field 2" "State"

ReadINIStr ${Port} "..\V1_final_code\hostinput.ini" "Field 4" "State"
...
...

ty!!
Kaz
kraza is offline   Reply With Quote
Old 24th April 2007, 18:57   #4
kraza
Junior Member
 
Join Date: Apr 2007
Posts: 5
ah.. nevermind... I got it.

Had to do:

InstallOptions::dialog "$PLUGINSDIR\hostinput.ini" instead of
my relative path.

Thanks for the help!!
Kaz
kraza is offline   Reply With Quote
Old 24th April 2007, 19:50   #5
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
This works, but a better way would be to use the included MUI macros.

According to the MUI docs:

To include a custom page, use MUI_INSTALLOPTIONS_EXTRACT.

To display a custom page use MUI_INSTALLOPTIONS_DISPLAY.

And if you want a return value from the page, you can use MUI_INSTALLOPTIONS_DISPLAY_RETURN or MUI_INSTALLOPTIONS_SHOW_RETURN (The return value is set to the stack and you can then pop from there.)
Comperio is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump