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 agreemen开发者_如何学编程t, 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?
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 :)
You can have a session variable say LOCLICENSEFILEPATH
which will contain the path to License file based upon localization. So in the Control you simply 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>
精彩评论