Customizing text in the standard Wix dialogs
Asked Answered
F

2

8

I'm making use of the Wix standard dialogs. How do I customise the text of the messages displayed?

For example, in the License Agreement page, I want to change the text "I accept the terms in the License Agreement" to "I acknowledge and accept the terms of the above agreement."


Related:
How can I set at runtime the text to be displayed in VerifyReadyDlg ?

Fidelfidela answered 12/11, 2009 at 17:12 Comment(0)
F
17

Here's how I did it:

  1. Add a new Localisation file to my Votive project (ie my Visual Studio Wix project) - right-click, Add -> New Item... -> Wix Localisation file
  2. Since I was customising the english text, I made sure the Culture attribute in the file said en-US
  3. Added String elements for each element that I wanted to customise. E.g.

    <WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
        <String Id="WelcomeEulaDlgLicenseAcceptedCheckBox">I accept the terms of the above Agreement</String>
    </WixLocalization>
  4. To determine the Ids of the strings I needed to override, I looked in the WixUI_en-us.wxl file from the Wix source code. In some cases it was helpful to refer to the source code of the individual dialogs to find which strings were used where.

  5. Last point to note is that when you add a localisation file to your project, Wix starts outputing the msi files in subfolders named for the culture in the localisation file. E.g. mine were written to \bin\Debug\en-us rather than \bin\Debug\
Fidelfidela answered 12/11, 2009 at 20:6 Comment(3)
You can also use Orca to determine the Ids of the strings.Oratorian
Important note, if you get many errors like The localization variable !(loc.MyVariable) is unknown. Please ensure the variable is defined. This happens, when you add a *.wxl file with a culture, which doesn't exist in the UIExtension. For example en-GB. In the WiX toolkit repository you can check for existing *.wxl files. (here are the files)Electrocautery
Good steps and useful links. See also this WiX tutorial page How To: Make your installer localizable.Electrocautery
E
6

The chapter Advanced WiX Topics -> Wix UI Dialog Library -> Customizing Built-in WixUI Dialog Sets in the WiX documentation (wix.chm) has all the information on customising the UI dialogs, including the text. There's also a topic on customising the UI in the WiX tutorial at http://www.tramontana.co.hu/wix/ .

If you do find you need to override more of WiX's default behaviour, the best way to start is to download the sources ( e.g. from http://wix.sourceforge.net/releases/3.5.1030.0/wix35-sources.zip ): all the UI dialogs are in src\ext\UIExtension\wixlib, and will give you an insight into how it works.

Earp answered 12/11, 2009 at 17:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.