More descriptive names with InstallOptions?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • l_d_allan
    Member
    • Jun 2005
    • 94

    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:

    code:
    [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

    Last edited by l_d_allan; 28 January 2006, 18:31.
  • Afrow UK
    Moderator
    • Nov 2002
    • 8434

    #2
    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

    Comment

    • l_d_allan
      Member
      • Jun 2005
      • 94

      #3
      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"

      Comment

      • Afrow UK
        Moderator
        • Nov 2002
        • 8434

        #4
        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

        Comment

        • Comm@nder21
          Major Dude
          • Jul 2003
          • 734

          #5
          you can do that with defines in the script

          !define SUPPORT_X "Field 1"

          and then use ${SUPPORT_X} anywhere in the script.
          hand by comm@nder21
          ----------
          WiKi pages:CreateInternetShortcut|Enhanced FindWindow|Parse CSV-Data|Open/Close CD-Drive|Installer without Icon|Vista application compatibility

          Comment

          • bholliger
            Senior Member
            • Jul 2004
            • 223

            #6
            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.

            Comment

            • Comm@nder21
              Major Dude
              • Jul 2003
              • 734

              #7
              lol, posted same idea at the same time

              german and switzerland, dreamteam
              hand by comm@nder21
              ----------
              WiKi pages:CreateInternetShortcut|Enhanced FindWindow|Parse CSV-Data|Open/Close CD-Drive|Installer without Icon|Vista application compatibility

              Comment

              • bholliger
                Senior Member
                • Jul 2004
                • 223

                #8
                rofl! Great coincidence!

                Comment

                • l_d_allan
                  Member
                  • Jun 2005
                  • 94

                  #9
                  !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

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

                  Comment

                  Working...
                  X