Problems reading InstallOptions field
On a custom MUI page, I am using a page leave function to validate the user input. My problem is that after doing the ReadINIStr function it always returns the default field value of "Text" rather than the newly entered data. I am using NSIS 2.08 and the INI file is not opened by any other application.
Here are the contents of my INI file (CompName.ini)
---------
[Settings]
FieldNum=2
[Field 1]
Type=Label
Text=New Computer Name
<Position info follows and has been omitted>
[Field 2]
Type=Text
State=Text
<Position info follows and has been omitted>
---------
Here is the custom page defnition:
page custom ComputerName VerifyInput
Here is the VerifyInput function:
----------
;This is the problematic validation function
Function VerifyInput
Push $R0
Push $R1
;******This is where my problem lies. Read newly entered
; Computer Name from custom page
ReadINIStr $R1 "CompName.ini" "Field 2" "State"
; Display debug MB with entered Computer Name
MessageBox MB_OK "Name Entered = $R1"
;MessageBox always displays "Name Entered = Text"
;Now vaildate user entry, always fails since $R1="Text"
;See attachment for details on CheckName.exe
ExecWait '"$INSTDIR\CheckName.exe" $R1' $R0
IntCmp $R0 1 goodname badname badname
goodname:
StrCpy $RENAME 1
Goto done1
badname:
MessageBox MB_ICONEXCLATMATION|MB_OK|MB_TOPMOST "Computer Name must adhere to corporate naming standards...."
Abort
done1:
Pop $R1
Pop $R0
FunctionEnd
---------------
The attachment contains additional relevant excerpts from the NSI file.
Can anyone provide any insight as to why "Field 2" always contains "Text"? This is my first custom MUI page, am I going about this the wrong way? Just for grins, I have tried the following items:
Replace the ReadINIStr statement with the following:
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "CompName.ini" "Field 2" "State"
Additionally, I added the NOTIFY flag to the field in the INI file (I know it is not suppose to work with TEXT fields, but I'm grasping at straws), again with no joy.
Any thoughts would be greatly appreciated. Thanks.