Archive: NSIS InstallOption initialisation


NSIS InstallOption initialisation
Hi,

I'm fairly new in nsis. I wanted to be able to do the following with nsis:
- Find the location of a .exe file (say, mysql.exe)
- display a dialog box that has directory combo box, displaying the location found above. It also allows the user
to specify different location, if he/she wishes to.

I have been able to find the location of the .exe file, and also displaying the dialog box with the directory combo box (and extract value from it).

My current problem is, how can I initialise the value of the directory combo box, before displaying it?

I've tried the following (using MUI_INSTALLOPTIONS_WRITE) without any luck..:
----------------------------------
!insertmacro MUI_INSTALLOPTIONS_WRITE "db_config.ini" "Field 7" $R0

;----- initialise the value --------------
!insertmacro MUI_INSTALLOPTIONS_WRITE "db_config.ini" "Field13" "Text" $R0
!insertmacro MUI_INSTALLOPTIONS_WRITE "db_config.ini" "Field13" "State" $R0

!insertmacro MUI_INSTALLOPTIONS_DISPLAY "db_config.ini"

;---------------------------
; Get details from database dialog box
;---------------------------
!insertmacro MUI_INSTALLOPTIONS_READ $PORT "db_config.ini" "Field 7" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $USER "db_config.ini" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $PASS "db_config.ini" "Field 5" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $DBNAME "db_config.ini" "Field 8" "State"



-----------------------------------


THanks a lot for the help!


Best regards,

Alex.


Don't worry about it..
my mistake.. :p

SHould be like this:

!insertmacro MUI_INSTALLOPTIONS_WRITE "db_config.ini" "Field 13" "State" "$R0"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "db_config.ini"

;---------------------------
; Get details from database dialog box
;---------------------------
!insertmacro MUI_INSTALLOPTIONS_READ $PORT "db_config.ini" "Field 7" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $USER "db_config.ini" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $PASS "db_config.ini" "Field 5" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $DBNAME "db_config.ini" "Field 8" "State"

(missing space between "Field" and "13".

Thanks a lot!