Exception Wix Include file (.wxi) excludes

I am new to Wix and we are trying to upgrade from Installshield to Wix. However, I am stuck with an error that I cannot solve. I did my share of research on the Internet before posting this post, and I hope to get help from you if anyone has a similar problem and is kind enough to point out the stupid mistake I'm making here.

Here is my Wix include file: properties.wxi

<Include> <?define Language="1033"?> <?define Manufacturer="ABC Inc"?> <?define Name="TRIAL-MSI"?> <?define UpgradeCode="....GUID...."?> <?define Version="09.00.0021"?> <?define Comments="Contact: team@abc.com "?> <?define Description="TRIAL Application"?> </Include> 

And I call it in my code as follows:

  <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <?include properties.wxi ?> <Product Id="*" Name="${var.Name}" Language="${var.Language}" Manufacturer="${var.Manufacturer}" UpgradeCode="${var.UpgradeCode}" Version="${var.Version}" > <Package Comments="${var.Contact}" Description="${var.Description}" InstallerVersion="200" Keywords="Installer,MSI,Database" Languages="${var.Language}" Manufacturer="${var.Manufacturer}" Compressed="yes" Platform="x86" /> 

I compile my script on the command line:

  candle -arch x86 -I properties.wxi trial.wxs 

I keep getting errors as follows:

error CNDL0048: The name of the include document element is invalid. The source Windows Installer XML file must use "Wix" as the name of the document element. Source Trace:

And I think because Candle did not accept the include file, it throws an exception for:

CNDL0008 error: The value of the Product / @ Language attribute, '$ {var.Language}', is not a legal integer value.

Can someone please help me with this? Any help is appreciated.

+4
source share
2 answers

The -I flag for a candle is used to specify the directory to search for included files:

Usage: candle.exe [-?] [-Nologo] [-out outputFile] sourceFile [sourceFile ...] [@responseFile]

-I add enable search path

The Wix preprocessor will automatically search the directory of the current source file for the included files, so there is no reason to specify the include file on the command line. Your command line should include only Wix source files:

 candle -arch x86 trial.wxs 

UPDATE:

Wix variables are inserted using $(var.VARIABLENAME) . You have all your variables surrounded by curly braces instead of parentheses.

+1
source

I had this error when transferring wxs files to wxi

Setting properties of Build Action files in Visual Studio from Compile to Content fixed.

+6
source

Source: https://habr.com/ru/post/1402286/


All Articles