Archive: writing to an INI after a NOTIFY flag


writing to an INI after a NOTIFY flag
im new to nsis and have found this forum more then informative. i have hit a snag in my program though. i am reading multiple registries and writing them to a list box on a INI file. when the user selects an item from the list box it throws a NOTIFY flag and should change the active state of a DirRequest to the selected path. it is returning the proper values but doesnt change the state of the Field. Here is the code used to change the state of the DirRequest field.

Function DirectoryPageLeave
;change state of directory request to current selection in list box
!insertmacro MUI_INSTALLOPTIONS_READ $R0 ${DIR_PG} "Settings" "State"
${If} $R0 == 1
!insertmacro MUI_INSTALLOPTIONS_READ $R1 ${DIR_PG} "Field 1" "State"
!insertmacro MUI_INSTALLOPTIONS_WRITE ${DIR_PG} "Field 4" "State" $R1
MessageBox MB_OK $R1
Abort
${EndIf}
FunctionEnd

any bit of info would be appreciated


You need to use the HWND and send a message, installoptions does not read from the .ini after the page is displayed IIRC


thanks a lot. never used the HWND so im not to sure how to do that. ill do some more reading


Look at the .ini in %temp% while the installer is running, you will find the HWND there.
SendMessage $0 ${WM_SETTEXT} 0 "STR:New text" if the HWND was read into $0


You may also want to look into using nsDialogs (with MUI2) instead of InstallOptions.

Stu


Got it working with install options. read the hwnd from the ini field and set it to a veriable. was able to use the send message function. thnx for the tips