Skip to content
⌘ NSIS Forum Archive

im stumped any help would be appreciated

4 posts

00zero#

im stumped any help would be appreciated

I have been trying to get this to work all day and i keep getting this error

!insertmacro: MUI_INSTALLOPTIONS_READ
Usage: ReadINIStr $(user_var: output) ini_file section entry_name
Error in macro MUI_INSTALLOPTIONS_READ on macroline 5
on the last line of code

;**********************************************************
;Mathematica Directory Page
!define MathDir
ReserveFile "MathLocal.ini"
LangString MATHLOCAL_TITLE ${LANG_ENGLISH} "Please enter the loaction of Mathematica"
LangString MATHLOCAL_SUBTITLE ${LANG_ENGLISH} " "
Page custom mathpage
;********************************************************

;**********************************************************
;runs the function needed for the custom page
Function .onint
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "mathlocal.ini" "MathLocal"
FunctionEnd

;gets values of the custom page
Function mathpage

!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 $MathDir "MathLocal" "Field 1" "State"

FuncitonEnd
;**********************************************************

i can figure it out i have read all the help and example files and been at it all day. any help would be much appreciated

thanks
jonathan
galil#
For starters, change "!define MathDir" to "Var MathDir",
because it appears that's what you want it for. You try to use it as variable, but ealier in your code just defined an empty string with it (which you'd have to use as ${MathDir}).
Filus#
Re: im stumped any help would be appreciated

It's better if you read from page after displaying it in seperate "leave" function:


;**********************************************************
;Mathematica Directory Page
Var MathDir

...

Page custom mathpage_show mathpage_leave
;********************************************************

;**********************************************************
;runs the function needed for the custom page

...

;shows custom page
Function mathpage_show

!insertmacro MUI_HEADER_TEXT "$(MATHLOCAL_TITLE)" "$(MATHLOCAL_SUBTITLE)"
;displays the custom page
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "MathLocal"

FuncitonEnd

;gets the user entered values
Function mathpage_leave

!insertmacro MUI_INSTALLOPTIONS_READ $MathDir "MathLocal" "Field 1" "State"
FunctionEnd
;**********************************************************