Wix toolset license agreement multi-languages issue
Asked Answered
K

1

1

I have created license.rtf file which has multiple languages and when I try to build my wix project it shows me this error :

A string was provided with characters that are not available in the specified database code page '1252'. Either change these characters to ones that exist in the database's code page, or update the database's code page by modifying one of the following attributes: Product/@Codepage, Module/@Codepage, Patch/@Codepage, PatchCreation/@Codepage, or WixLocalization/@Codepage.

I have tried to add this attribute Codepage="1256" on Product tag it still showing the same error.

Could you please help me solving this issue?

Kola answered 1/4, 2018 at 7:20 Comment(8)
Updated the answer a bit to make it clearer what the snippets do.Butylene
You can't have characters that require multiple code pages. MSI only supports one. You can try utf-8 but it has known bugs in MSI UI.Octarchy
You actually have multiple languages in the same license-rtf file? In most cases I compile a separate setup per language. If you need multiple license agreement languages, I suppose you could put it online on a web-page and link to it? Not sure of the legalese of that - but with a default license agreement in English in the setup (or another language as default) it should be OK?Butylene
@Simple Code - Come to think of it: why not show the license agreement during first launch of your application instead (or as well) as in the setup? Not sure of the legalese - has to be verified. But technically it is great: you can show it in any number of languages with ease (full Unicode support) and you have full flexibility with proper dialogs with all events (rather than the limited features of MSI). Applications are always easier to debug than setups (no sequencing, conditioning and impersonation issues to ruin your day - and you can handle errors better than in a one-shot setup run).Butylene
@SteinÅsmul I have applied a dirty solution for that I have created new document using microsoft word and then I saved it as .rtf file , after that I have added it using <WixVariable Id="WixUILicenseRtf" Value="Binary\License.rtf" /> and it worked without changing codepage or any localization configuration!!Kola
Then the text in the rtf must be using the same code page, or it is set to UTF-8? Well, glad that it is working. Good luck with testing - should be done on localized machines. And one more thing on license agreements shown on first launch of applications: I have seen this messed up with application dialogs that end up accidentally hidden (dialog is not set to be always on top) so that people can't use the application and they can't figure out why. Big support issue. Not that you need this solution, just thought I'd mention the problem to not lead people astray.Butylene
@SteinÅsmul I don't think so. We can modify the dialogues and even there are conditions to manage when and where those dialogues should be displayedKola
For license agreements maybe - but if you try doing anything complex in MSI dialogs you will quickly run tired of them. There are issues with dialog update and refreshing. You have been warned :-). Best of luck.Butylene
F
2

This sounded quite mysterious. A quick search found this existing question: Wix string with characters not available in database 's codepage although codepage is set.

It seems there is a separate code page setting for the MSI's summary stream - Codepage Summary property - which is different from the package's main code page setting.

I noticed a code page setting referred to as "SI Codepage" when testing with InstEd (see down the page). I don't really see this codepage summary property in Orca. Perhaps it is there and I just don't see it.

  1. Maybe you are not setting this summary information stream code page properly, although you set the main package code page?

    • It looks like the summary information stream code page is set in the Package element and is not automatically overridden in the wxl localization file. This is probably a WiX bug.
    • I have done a manual override in the snippets below (SummaryCodepage="!(loc.SummaryCodepage)" - grabbing the value from the localization file via a localized string. Essentially you are doing the job yourself and that should work without a bug fix from the WiX guys for what you need. I hope - a new WiX release is heavy stuff).
  2. I also took out the CodePage attribute for the Product element in the main wxs source file to try to let the setting from the wxl localization file take effect. See the last link in the list of WiX bug database entries at the bottom.

  3. My gut feel is that "here be more dragons". Localization is very strange to deal with. How will this behave on a proper Japanese machine? I would like to know, please do test.


I threw together a quick mock-up, but have no time to test properly. Maybe have a quick test:

<Product Id="*" Name="!(loc.ApplicationName)" Language="!(loc.LanguageLcid)" Version="1.0.0" 
                Manufacturer="!(loc.ManufacturerName)" UpgradeCode="PUT-GUID-HERE">

  <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" 
           Languages="!(loc.LanguageLcid)" SummaryCodepage="!(loc.SummaryCodepage)" />

And here is the Japanese localization file (I have no idea what those Japanese characters state, I just copied and pasted something to get my testing done - UPDATE: OK, Google Translate to the rescue! No offensive language found!):

<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="ja-JP" Codepage="932" Language="1041" 
                 xmlns="http://schemas.microsoft.com/wix/2006/localization">
  <String Id="SummaryCodepage">932</String>
  <String Id="LanguageLcid">1041</String>
  <String Id="ApplicationName">各務原市農地支援・畑地管理システムインストーラー</String>
  <String Id="ManufacturerName">(株)テイコク</String>
</WixLocalization>

I put some Japanese characters into a single license agreement RTF I threw in there as well (I didn't set up proper localized include of different RTF files). The setup GUI looks OK - it shows up in Japanese, and the Japanese characters show up in the license agreement.

Please give it a go and see if your problem disappears. If not, maybe spend some time querying the WiX bug database.


WiX bug-tracker near hits:

Friedcake answered 2/4, 2018 at 4:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.