Archive: WriteIniStr vs. MUI_INSTALLOPTIONS_WRITE


WriteIniStr vs. MUI_INSTALLOPTIONS_WRITE
I'm writing a modern UI script. When I tried using WriteIniString it didn't work, but MUI_INSTALLOPTIONS_WRITE does work. I'm wondering if writeIniString is suppose to work.

I'm playing with the examples that came with the 2.0 download. The script specifically is InstallOptions.nsi

I change Function SetCustomA to:

Function SetCustomA
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
;WriteIniStr "ioA.ini" "Field 1" Text "hello world"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioA.ini" "Field 1" "Text" "crackhead"
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ioA.ini"
!insertmacro MUI_INSTALLOPTIONS_SHOW
FunctionEnd

This works, but if I uncomment WriteIniStr and comment out MUI_INSTALLOPTIONS_WRITE, it doesn't work. Shouldn't this work?


thanks in advance,
mlm (aka, digitalda)


The differences:

1)Way to do same thing:

!insertmacro MUI_INSTALLOPTIONS_WRITE "ioA.ini" "Field 1" Text "hello world"

Is equal than:

WriteINIStr "$PLUGINSDIR\ioA.ini" "Field 1" Text "hello world"

2)!insertmacro MUI_INSTALLOPTIONS_WRITE can only be used with Modern UI. WriteINIStr can be used with all UIs.

3)!insertmacro MUI_INSTALLOPTIONS_WRITE is a macro that contains the command WriteINIStr.

4)!insertmacro MUI_INSTALLOPTIONS_WRITE is only useful if you write in INI files on $PLUGINSDIR folder. WriteINIStr can be used for write in INI files on any folder.


The MUI_INSTALLOPTIONS_WRITE macro is just an easy way to write to an INI file in the plug-ins directory.


mlm, you propably just have made a little typo.


No virtlink, deguix and Joost are right. There is no typo.


Try...
InitPluginsDir
...before trying to write to the ini file using WriteINIStr.

Could there be a bug with the PluginsDir and WriteINIStr?


-Stu


Again, there is no bug. The plug-ins folder has already been initialised (the files have been extracted).

The only difference is that MUI_INSTALLOPTIONS_WRITE writes to the plug-ins folder by default.