1

I am using WiX to build a MSI that will be used to silently install and replace templates for a customer's client environment.

This works rather good by now, but when linking the final package with light.exe, I get errors for files using äöüß. The customer doesn't want to change these names, so I have to change the code.

Is this possible? I currently use the encoding 'windows-1252' which is usable with German. Also I don't think this is an issue in .wix, but rather later on, since there are no errors when compiling with candle.exe

Here are some of the errors. They are all rather similar and all go away if I change the name, heat.exe them and repeat the process after that.

\Folder\Installer.wxs(125) : error LGHT0103 : The system cannot find the file 'SourceDir\install\word\Vorlagenverzeichnisse öffnen.bat'.
\Folder\Installer.wxs(545) : error LGHT0103 : The system cannot find the file 'SourceDir\office12\vorlagen\intern\Protokoll-MA-Gespräch.docx'.
\Folder\Installer.wxs(569) : error LGHT0103 : The system cannot find the file 'SourceDir\office12\vorlagen\Marketing\Waben für Firmendarstellung Englisch.pptx'.
\Folder\Installer.wxs(572) : error LGHT0103 : The system cannot find the file 'SourceDir\office12\vorlagen\Marketing\Waben für Firmendarstellung.pptx'.
\Folder\Installer.wxs(767) : error LGHT0103 : The system cannot find the file 'SourceDir\office12\vorlagen\sonstiges\Hähnchenbestellung.xlt'.
\Folder\Installer.wxs(1007) : error LGHT0103 : The system cannot find the file 'SourceDir\office16\Bilder\Grafiken\nikolausmuÌ^tze.png'.
\Folder\Installer.wxs(1064) : error LGHT0103 : The system cannot find the file 'SourceDir\office16\Bilder\Grafiken\Rechner mit Zahnrädern.png'.
\Folder\Installer.wxs(1130) : error LGHT0103 : The system cannot find the file 'SourceDir\office16\Bilder\Grafiken\unabhaâ Ãªngigkeit.png'.

This is my .wix. I changed it a bit and left out some unneeded parts:

<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
  <Product Name='BLABLABLA' Id='*' UpgradeCode='ValidGUID'
    Language='1031' Codepage='1252' Version='1.1.1' Manufacturer='BLABLABLA'>

  <Package Id='*' Keywords='Installer' Description="Something 1.0 Installer"
    Comments='Nothing' Manufacturer='Selfmade Inc.'
    InstallerVersion='100' Languages='1031' Compressed='yes' SummaryCodepage='1252' />

  <MajorUpgrade AllowSameVersionUpgrades="yes" 
    DowngradeErrorMessage="More Nothing" />
  <Media Id='1' Cabinet='A.cab' EmbedCab='yes' DiskPrompt="Files" />
  <Property Id='DiskPrompt' Value="" />
  <Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable"/>
  <Directory Id='TARGETDIR' Name='SourceDir'>
    <Directory Id='noone' Name='noone'/>    
  </Directory>

  <Feature Id='Complete' Level='1'>
    <ComponentGroupRef Id='A' />
  </Feature>

  </Product>
  <Fragment>
    <DirectoryRef Id="noone">
      <Directory Id="..." Name="install" />
      <Directory Id="..." Name="office12" />
      <Directory Id="..." Name="office16" />
      <Directory Id="..." Name="windows" />
    </DirectoryRef>
  </Fragment>
  <Fragment>
    <ComponentGroup Id="A">
      <Component Id="..." Directory="..." Guid="AnotherValidGUID">
        <File Id="..." KeyPath="yes" Source="SourceDir\install\word\Vorlagenverzeichnisse öffnen.bat" />
      </Component>
      <!--Many More Components-->
    </ComponentGroup>
  </Fragment>
  <!--Also Directories also as Fragments-->
</Wix>

Edit: @BrianSutherland gave me the final push to the solution.

I changed the Codepages for both Product and Package, which turned out to one step too much.

All it needed is to change the product's codepage.

So my final WiX-Script starts like this:

<?xml version='1.0' encoding='utf-8'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
  <Product Name='BLABLABLA' Id='*' UpgradeCode='ValidGUID'
    Language='1031' Codepage='utf-8' Version='1.1.1' Manufacturer='BLABLABLA'>

  <Package Id='*' Keywords='Installer' Description="Something 1.0 Installer"
    Comments='Nothing' Manufacturer='Selfmade Inc.'
    InstallerVersion='100' Languages='1031' Compressed='yes' SummaryCodepage='1252' />
Erik Range
  • 11
  • 2
  • Which editor are you using? Are you sure it is saving using the declared character encoding? (Suggestion, UTF-8 wherever you can.) – Tom Blodget Feb 12 '18 at 17:56
  • Do you actually have "\Folder\SourceDir\install\word\Vorlagenverzeichnisse öffnen.bat" where \Folder\ is the folder Installer.wxs is located in? Because that's where the compiler is looking for that bat file. – Brian Sutherland Feb 12 '18 at 20:38
  • @TomBlodget I am using Notepad++ and yes, I just doublechecked, according to notepad++ it is safed as UTF-8 BOM. Just to make sure it doesn't change anything, I manually saved it as UTF-8 (so without Byte Order Mark since this seems to not be recommended https://stackoverflow.com/a/2223926/9349711) But that got me thinking and I just checked the .wixobj ... They are in there already. I can now change the filenames in there but that's no feasable solution for our issue. – Erik Range Feb 13 '18 at 10:19
  • @BrianSutherland As past of my first troubleshooting, I was rather sceptic as well, but yes, those files are there. If i remove further files, I get more errors, if I rename it and do the same stuff again, it works. Don't get me wrong, but I hopefully do this job long enough by now to not fall for such an easy mistake ;) – Erik Range Feb 13 '18 at 10:21
  • If you are saving as UTF-8, change the declared encoding in your XML file to match. – Tom Blodget Feb 13 '18 at 10:52
  • @TomBlodget very good point I didn't yet catch, but once I do that I get further errors asking me to change the Codepage (which was also 1252). I checked shortly if uft-8 is working for that, but WiX specifically want ANSI-Codepages. Since I am in a bit of a rush, I wasn't able to find a fitting ANSI-Page yet ... Do you know a fitting one? – Erik Range Feb 13 '18 at 11:59
  • I'm just talking about the XML itself in your Installer.wix file. The encoding declaration (``) should match the encoding the file is saved with. (The CodePage elements are something else entirely.) It may not be your problem but it has to right. – Tom Blodget Feb 13 '18 at 14:54
  • you can use "utf-8" as a codepage and encoding in wix. You might get a warning but it is ok. – Brian Sutherland Feb 13 '18 at 18:22
  • @TomBlodget Yes, I changed that, so it matches up :) But nevertheless, if I try to build with the changed XML-encoding and the changed codepage, I get errors and it won't built :( – Erik Range Feb 15 '18 at 06:49
  • 1
    @BrianSutherland FML, I think I just did it ... I changed the codepage for product and package before. Now I only changed the products codepage to UTF-8 and the package's SummaryCodepage was left as 1252. It built and on my test, all files were correctly installed! – Erik Range Feb 15 '18 at 06:56

0 Answers0