Can I programmatically adjust the text on dialogs?

Answered

Comments

3 comments

  • Avatar
    wojciechka

    It is not possible to change messages at runtime, however, your messages may contain references to other variables that can be set at runtime. For example:

    Installer.Installation.Question.Abort=${QuestionAbortMessage}
    

    You can then set the value for the variable based on some criteria. Such as:

    <if>
      <actionList>
        <setInstallerVariable>
          <name>QuestionAbortMessage</name>
          <value>${msg(Installer.Installation.Question.Abort.Upgrade)}</value>
        </setInstallerVariable>
      </actionList>
      <conditionRuleList>
        <isTrue>
          <value>${isupgrade}</value>
        </isTrue>
      </conditionRuleList>
      <elseActionList>
        <setInstallerVariable>
          <name>QuestionAbortMessage</name>
          <value>${msg(Installer.Installation.Question.Abort.Install)}</value>
        </setInstallerVariable>
      </elseActionList>
    </if>
    

    The example above uses ${msg(...)} variables so the error message can still be made language-specific. For example you can add the following messages to your English custom language file:

    Installer.Installation.Question.Abort.Install=Do you want to abort the installation process?
    Installer.Installation.Question.Abort.Upgrade=Do you want to abort the upgrade process?
    

    This will allow showing a different message depending on whether the installation is a fresh install or an upgrade.

  • Avatar
    jshawver

    We are trying to use this technique to modify text on a License page but it isn't working. We are using two licenseParameter pages, one for a regular EULA, and another to display information we want the user to read before installing. On the Information page, we want to change the question at the bottom to something like "Do you understand this information?", with the radio buttons changed to "Yes" and "No".

    I created a custom-en.lng file:

    Installer.License.IAccept=${AcceptYes}
    Installer.License.IDoNotAccept=${AcceptNo}
    Installer.License.DoYouAccept=${AcceptQuestion}
    Installer.License.InfoIAccept=&Yes
    Installer.License.InfoIDoNotAccept=&No
    Installer.License.InfoDoYouAccept=Do you understand this information?
    Installer.License.LicenseIAccept=I &accept the agreement
    Installer.License.LicenseIDoNotAccept=I &do not accept the agreement
    Installer.License.LicenseDoYouAccept=Do you accept this license?

    The XML for the Information page:

        <licenseParameter>
            <name>infoPage</name>
            <title>Important Information</title>
            <description>Please read this before installing ${product_fullname}.</description>
            <insertAfter>welcome</insertAfter>
            <file>../files/doc/readme.txt</file>
            <wrapText>1</wrapText>
            <preShowPageActionList>
                <setInstallerVariable>
                    <name>AcceptQuestion</name>
                    <value>${msg(Installer.License.InfoDoYouAccept)}</value>
                </setInstallerVariable>
                <setInstallerVariable>
                    <name>AcceptYes</name>
                    <value>${msg(Installer.License.InfoIAccept)}</value>
                </setInstallerVariable>
                <setInstallerVariable>
                    <name>AcceptNo</name>
                    <value>${msg(Installer.License.InfoIDoNotAccept)}</value>
                </setInstallerVariable>
            </preShowPageActionList>
        </licenseParameter>
    

    When it runs, the page contains the literal "${AcceptQuestion}", "${AcceptYes}", "${AcceptNo}" strings, not the replaced variable values. We put the customLanguageFileList at the project level, should it be somewhere else?

    Jim Shawver
    BCC Software

  • Avatar
    jshawver

    Here is a screenshot, the text at the bottom is not getting replaced with the variable values.

    alt text

Please sign in to leave a comment.