How to include wxi file into wxs?
Asked Answered
S

2

18

Following the excellent suggestion I have moved some variables to WXI file. How do I include it in WXS file?

Spiegleman answered 21/8, 2009 at 8:59 Comment(0)
R
4

for reference:

http://wix.sourceforge.net/manual-wix2/preprocessor.htm

Although this is about wix 2.0 and uses a file with extension .wxs - the game stays the same, as only the "include" element is required to exist in the file.

A good article how to use this can be found here: http://weblogs.sqlteam.com/mladenp/archive/2010/02/17/WiX-3-Tutorial-Understanding-main-WXS-and-WXI-file.aspx

Renatarenate answered 27/3, 2012 at 12:28 Comment(1)
Also, note that you have to include in each .wxs file where you want to use the variables. The only way to avoid this is to define vars at the project level: right-click the project > Properties > Build tab.Stomatitis
S
37

use <?include ?> preprocessor tag, for example:

 <?include include.wxi ?>
Spiegleman answered 21/8, 2009 at 10:29 Comment(2)
It works only for 32bit installer. For 64bit this inclusion does not work. I get error: Schema validation failed with the following error at line 1, column 245: The element 'Wix' in namespace 'schemas.microsoft.com/wix/2006/wi' cannot contain text. List of possible elements expected: 'Bundle Product Module Patch Fragment PatchCreation'.Vitalis
@Vitalis It is because you added <?include ... ?> at the top of the wsx file. wsi files containing <Fragment> elements must be added after the <Product> elementEdelstein
R
4

for reference:

http://wix.sourceforge.net/manual-wix2/preprocessor.htm

Although this is about wix 2.0 and uses a file with extension .wxs - the game stays the same, as only the "include" element is required to exist in the file.

A good article how to use this can be found here: http://weblogs.sqlteam.com/mladenp/archive/2010/02/17/WiX-3-Tutorial-Understanding-main-WXS-and-WXI-file.aspx

Renatarenate answered 27/3, 2012 at 12:28 Comment(1)
Also, note that you have to include in each .wxs file where you want to use the variables. The only way to avoid this is to define vars at the project level: right-click the project > Properties > Build tab.Stomatitis

© 2022 - 2024 — McMap. All rights reserved.