Archive: More descriptive names with InstallOptions?


More descriptive names with InstallOptions?
Is there a way to use more descriptive names with the InstallOptions .ini file?

Rather than "Field 1", "Field 2", etc., is it possible to use "Support_X", "Support_Y", etc.?

<edit>:
The purpose is to be able to use the meaningful field name in the .nsi file .... something such as

ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field Support_X" "State"
or
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Support_X" "State"
rather than the cryptic
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 2" "State"
</edit>

From the test.ini example:

[Settings]
NumFields=2

[Field 1]
Type=radiobutton
Text=Install support for X
Left=10
Right=-10
Top=17
Bottom=25
State=0
Flags=GROUP

[Field 2]
Type=radiobutton
Text=Install support for Y
Left=10
Right=-10
Top=30
Bottom=38
State=1
Flags=NOTABSTOP

No need just put a comment in there.
Anything after a ; on a new line is a comment and will be ignored by the parser.

-Stu


I'm not sure I understand your answer (but my question wasn't that clear ... mea culpa)

What I want to be able to do is use the more descriptive names in the .nsi file, rather than the rather meaningless "Field 2" reference.

ReadINIStr $0 "$PLUGINSDIR\test.ini" "Support_X" "State"
or
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field Support_X" "State"
rather than the crypic
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 2" "State"


Again, that is what comments are for really.
The fields are named that way ("Field #") so that the plugin can iterate through the Sections easily.

-Stu


you can do that with defines in the script :)

!define SUPPORT_X "Field 1"

and then use ${SUPPORT_X} anywhere in the script.


Hi!

Use !define to map descriptive names to "Field X" names. If you change your UI in the future, you only have to change the constants.

-Bruno.


lol, posted same idea at the same time :)

german and switzerland, dreamteam ;)


rofl! Great coincidence!


!define SUPPORT_X "Field 1"
and then use ${SUPPORT_X} anywhere in the script.
Thanks for the info .... I had tried different combinations, but not that one .... but I found there was one more thing to do ... enclose in quotations

!define SUPPORT_X "Field 1"
WriteINIStr "$PLUGINSDIR\test.ini" "${SUPPORT_X}" "State" 1