MUI_INSTALLOPTIONS_WRITE problems with writing to text field
I have the following code in my validate page function. I read the email address OK, but can't set it to anything when the user's entered values don't match. (Var $EmailData is the value entered in the main email text box, $R0 is the 'verify email' text box value.) I wanted to set the Field 9 text to blank, but nothing I do with MUI_INSTALLOPTIONS_WRITE affects the given controls.
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "..\email.ini" "Field 9" "State"
MessageBox MB_ICONEXCLAMATION|MB_OK "email is $EmailData Confirm email is: $R0"
StrCmp $EmailData $R0 Same NotSame
NotSame:
MessageBox MB_ICONEXCLAMATION|MB_OK "Your e-mail addresses do not match. Please re-enter."
!insertmacro MUI_INSTALLOPTIONS_WRITE "..\email.ini" "Field 1" "State" "Your name here."
!insertmacro MUI_INSTALLOPTIONS_WRITE "..\email.ini" "Field 2" "State" "Your email here."
!insertmacro MUI_INSTALLOPTIONS_WRITE "..\email.ini" "Field 9" "State" "Confirm email here."
I know... Doing something dumb!
(Text in the example MUI_INSTALLOPTIONS_WRITE is for example only, final version will write an empty string to the Field 2 one only)