Archive: Changing values of fields in custom dialogs


Changing values of fields in custom dialogs
  I'm attempting to implement a custom dialog using an INI file and want to change the value of one of the fields, a label, dynamically when the page is loaded, but WriteINIStr doesn't seem to do the trick:

Function customReadyPage

!insertmacro MUI_HEADER_TEXT $(INSTALL_READY_TITLE) $(INSTALL_READY_SUBTITLE)
WriteINIStr ready.ini "Field 2" "Text" "new value"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ready.ini"
>FunctionEnd
>
But the value of Field 2 is what's specified in ready.ini when the page loads.

Any suggestions?

Use the MUI_INSTALLOPTIONS_WRITE macro (check the Modern UI Readme for more info).


What was wrong with the original script is that you used:

WriteINIStr ready.ini "Field 2" "Text" "new value"

Instead of:

WriteINIStr $PLUGINSDIR\ready.ini "Field 2" "Text" "new value"

NSIS can't know where the file is located if you don't tell it.


Ok, good to know.

What about this problem?


LangString INSTALL_READY_DEST_DIR ${LANG_ENGLISH}                     "dir:"

>...
>WriteINIStr $PLUGINSDIRready.ini "Field 2" "Text" "$(INSTALL_READY_DEST_DIR) test"
Only shows up "dir:", even though there's plenty of room in the label. Any ideas?

You can only use a LangString on its own. You can't put it in other strings. I have updated the docs.