Archive: help with custom page error


help with custom page error
im new to scripting and i made and install srcipt with HMSoft. now i need to add a custom page to ask the loaction of mathematica so it auto loads a directory. i found the custom page tutorial and i have followed it but i get an error when i compile at the MUI_INSTALLOPTIONS_READ command that ther is a problem when reading the ini string.

custom page ini


; Ini file generated by the HM NIS Edit IO designer.
[Settings]
NumFields=2

[Field 1]
Type=FileRequest
State=
Left=64
Right=186
Top=60
Bottom=73

[Field 2]
Type=Label
Text=Please select the directory where Mathematica \r\nis installed.
Left=64
Right=246
Top=40
Bottom=57


the code calling the custom page

; Script generated by the HM NIS Edit Script Wizard.

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME ""
!define PRODUCT_VERSION ""
!define PRODUCT_PUBLISHER ""
!define PRODUCT_WEB_SITE ""
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"



; MUI 1.67 compatible ------
!include "MUI.nsh"

Function .onint
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "...\mathlocal.ini" "MathLocal"
FunctionEnd

; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"

; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "COPYING.txt"
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
;Mathematica Directory Page
LangString MATHLOCAL_TITLE ${LANG_ENGLISH} "Please enter the loaction of Mathematica"
LangString MATHLOCAL_SUBTITLE ${LANG_ENGLISH} " "
Page custom mathematicaloactionpage
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\"
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Readme.txt"
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES

; Language files
!insertmacro MUI_LANGUAGE "English"

; MUI end ------

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Setup.exe"
InstallDir "$PROGRAMFILES\3DNS"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show

#custom page
#gets directory of mathmetica
Function mathematicaloactionpage
;title
!insertmacro MUI_HEADER_TEXT "$(MATHLOCAL_TITLE)" "$(MATHLOCAL_SUBTITLE)"
;displays the custom page
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "MathLocal"
;gets the user entered values
!insertmacro MUI_INSTALLOPTIONS_READ $MathematicaDir "MathLocal" "Field 1" "State"
FunctionEnd


like i said im new and realy kind of fumbeling my way through at this point adn any help would be appreciated.

thanks
Jonathan

ps
i know there are no program names or versions that is for copyright reasons for a part of the code that still need to be run by the author

I'd suggest examine the included InstallOptions examples :-)


i got it to work.