Archive: Custom page is not displayed in installer


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


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


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

and this in your page's show function:

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

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


ah.. nevermind... I got it.

Had to do:

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

Thanks for the help!!
Kaz


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.)