Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WIX: how to change license agreement during installation

I have a requirement where by I need to show the license agreement according to the OS language. The localized license agreements (.rtf) are kept on a server.

I have created a custom action to detect OS language and download the respective license agreement, but how can I show the localized license agreement in the license agreement dialog?

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

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 shows up in the license agreement text.

How can I set this text?

like image 900
ajay_whiz Avatar asked Sep 08 '11 16:09

ajay_whiz


1 Answers

Unfortunately the license agreement is only a file at build time - once the MSI is built the RTF is embedded in text format as a value in the Control table. (You can view this using Orca)

What this means is that in order to update this control dynamically, your custom action(s) will need to do the following:

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

An easier solution would be to include all languages in the same RTF file :)

like image 54
saschabeaumont Avatar answered Nov 05 '22 19:11

saschabeaumont