WIX: How to Change the License Agreement during Installation

I have a requirement when I need to show the license agreement in accordance with the OS language. Localized license agreements (.rtf) are stored on the server.

I created a custom action to determine the OS language and load the corresponding license agreement, but how can I show the localized license agreement in the license agreement dialog box?

I have all the dialog set files (.wxs). I am using the Wix_Minimal dialog box.

I tried changing the following lines in WelcomeEulaDlg.wxs

 <Control Id="LicenseText" Type="ScrollableText" X="130" Y="36" Width="226" Height="162" Sunken="yes" TabSkip="no"> <Text SourceFile="!(wix.WixUILicenseRtf=$(var.licenseRtf))" /> </Control> 

to

 <Control Id="LicenseText" Type="ScrollableText" X="130" Y="36" Width="226" Height="162" Sunken="yes" TabSkip="no" Text="[MyPropertyConatingRTFData]"> </Control> 

but nothing appears in the text of the license agreement.

How can I set this text?

+7
source share
2 answers

Unfortunately, the license agreement is only a file at build time. Once created, MSI RTF is embedded in text format as a value in the Control table. (You can view this with Orca)

This means that in order to dynamically update this control, your own actions (actions) will have to perform the following actions:

  • Download the RTF file
  • Read RTF in a String Variable
  • Replace the value in the corresponding MSI table with something like this:
    • 'UPDATE Control SET Text='" & sRTFText & "' WHERE Dialog_='LicenseAgreementDlg' AND Control='LicenseText'

A simpler solution would be to include all languages ​​in one RTF file :)

+3
source

You can have a say session variable LOCLICENSEFILEPATH that will contain the path to the license file based on localization. Therefore, in Control, you just need to pass this variable.

 <Control Id="AgreementText" Type="ScrollableText" X="20" Y="60" Width="330" Height="140" Sunken="yes" TabSkip="no"> <Text SourceFile="[LOCLICENSEFILEPATH]" /> </Control> 
-2
source

All Articles