1
votes

Its my first project with Wix Toolset and Visual Stdio - im not counting simple turtorial with "Hello World" kind of application.

In my current project i do have only one localisation file, named common.wxl:

<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">

  <String Id="Company">TestCompany</String>

  <String Id="ProductNameFolder">TestApp/[Buildversion]</String>

  <String Id="ProductName_x86">TestApp</String>
  <String Id="ProductName_x64">TestApp</String>

  <String Id="Description">Test Description​</String>
  <String Id="Comments">Designed by TestCompany</String>
  <String Id="Keywords">application, installer</String>

  <String Id="DowngradeErrorMessage">A newer version of [ProductName] is already installed.</String>

  <String Id="Language">1033</String>
</WixLocalization>

And that's it, there is nothing more inside the file. Also there's no any other localisation file. Still, when I am trying to build te WIX project I'm getting 9 errors about duplicated identifiers:

The localisation identifier 'xx' has been duplicated in multiple locations. Please resolve the conflict.

One error for each of ID's in my common.wxl. But i dont have any other localisation file, so how these identifiers could be duplicated ?

I'm trying to solve that for hours already... does anyone have any idea ?

I'm using WiX Toolset 3.11.2, and WiX Toolset Visual Studio 2019 Extension.

1
Do you have any extra files with *.wxl file extension in your project? Try to download the sample below and test from there by injecting one string at a time.Stein Åsmul
Hello ! I do have only one xml file. To be clear i just renamed it to English.xml. And i have been still getting errors about duplicated IDs. I discovered also something very weird - check please my comment under Stein Asmul answer.mrsilesia

1 Answers

0
votes

WiX Localization: Please try this WiX localization sample: https://github.com/glytzhkof/WiXLocalizationSample

Pragmatic Advice: If this sample project works for you, consider creating a new WiX project and migrating one construct at a time over whilst continually checking the build as you go. There could be unnecessary files included that cause such duplication errors. Perhaps also try to change the String Id field - for example from Description to MyDescription. Just to test.


You refer to an identifier in the localization file using the "!(loc.StringID)" format. This will expand these placeholder values with the actual string when the MSIs are getting built. Here is a compressed sample:

In your Project.wxs file:

<Product Id="*" Name="WixLocalizationSample" Language="1033" Version="1.0.0.0"
         Manufacturer="!(loc.Company)" UpgradeCode="PUT-GUID-HERE"   >

  <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"
           Comments="!(loc.Comments)" Keywords="!(loc.Keywords)"
           Description="!(loc.Description)" />

In your localization file (English.wxl):

<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
  
  <String Id="Description">This is a long test description.</String>  
  <String Id="Comments">Designed by TestCompany</String>
  <String Id="Keywords">application, installer</String>
  <String Id="Company">TestCompany</String>

</WixLocalization>

Use CDATA if needed to escape XML delimiters.