Archive: Problem reading a textbox


Problem reading a textbox
  I know this is an easy question that I probably shouldn't even be asking...but...I'm having trouble reading the input that a user puts in a textbox. I feel I must not understand really how it works. (Yes I can look at the test.ini and see how that works, I copy it almost directly, but don't see what part i'm missing)

I have a custom Page with a show funtion, and a leave function...which are below..(it's not PHP but I thought it looked nicer)


My Show Function


RegEnter

!insertmacro XPUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro XPUI_INSTALLOPTIONS_DISPLAY "REG.ini"

>FunctionEnd
>
My Leave Function

RegLeave

ReadINIStr${varInput} "REG.ini" "Field 2" "State"
>MessageBox MB_OK ${varInput}
>FunctionEnd
>
Now...it was my understanding that it should work with just about this and only this...but...my message box will give me a blank box everytime. What is all required to read text from a textbox?...Why is ReadINIStr returning an empty string?

Thank You
Kyle

Ok, I got it to work by simply chainging this line


ReadINIStr ${varInput} "REG.ini" "Field 2" "State"

to

ReadINIStr ${varInput} "$PLUGINSDIR\REG.ini" "Field 2" "State"


Does anyone know why that would fix it? I'm guessing $PLUGINSDIR is just a variable that holds the location of the NSIS Plugins Directory?...I don't know why this would be needed when everything is in the same directory...what is the default location that it looks in?

$PLUGINSDIR is a directory created in the user's temp folder at runtime.

Pages are usually extracted to this location.

If you say just read the ini file (without the $PLUGINSDIR), then it will try to read it from whatever the current directory is set to (which is usually $EXEDIR).


You should have used XPUI_INSTALLOPTIONS_READ ${varInput} "REG.ini" ...

Stu