tderouin
8th January 2003 00:09 UTC
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?
Joost Verburg
8th January 2003 14:17 UTC
Use the MUI_INSTALLOPTIONS_WRITE macro (check the Modern UI Readme for more info).
kichik
8th January 2003 14:26 UTC
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.
tderouin
8th January 2003 22:31 UTC
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?
kichik
9th January 2003 12:49 UTC
You can only use a LangString on its own. You can't put it in other strings. I have updated the docs.