Freigeben über


WiX project structure

 A project needs some structure to its files. After looking at some example projects, I decided for now to use a "main" project file that in turn includes a file for each table being generated, like this:

 

<?xml version="1.0" encoding="utf-8"?>

<Wix xmlns="https://schemas.microsoft.com/wix/2003/01/wi">

<Product

         …(attributes)...

>

<Package

…(attributes)...

/>

<?include Media.wxs>

<?include Property.wxs?>

<?include Directory.wxs?>

</Product>

</Wix>

 

Directory.wxs is going to be too big if I put everything in a single file so in turn I will use one file that nests the others, with a structure like this:

 

<?xml version="1.0" encoding="utf-8"?>

<Include xmlns="https://schemas.microsoft.com/wix/2003/01/wi">

<!--Root of Directory/Component/File Table-->

<!--This file only contains the entries for the root folders-->

<!--The actual contents of each folder are ?include?d -->

<Directory

…(attributes)...

>

<Directory

…(attributes)...

>

<?include Dir1.wxs?>

</Directory>

<Directory

…(attributes)...

>

<?include Dir2.wxs?>

</Directory>

...

</Directory>

</Include>

 

Each ?include?d Directory would corresponds to a root folder in the "old" Installscript-based project.

 

If I were writing C/C++ I would certainly not create a file that #includes every file in the project. I'm probably overusing ?include? and I should look into producing separate object files instead, but I'll leave that for another day.

 

On other news, our product was part of today's Ready for a New Day announcement. Yeah!

Comments

  • Anonymous
    December 04, 2006
    I would highly suggest not using include files like this.  Fragments are a much more powerful and comparable to C/C++ functions.  Take a look at the first few topics in the WiX.chm to see how Fragments can improve your setup authoring.

  • Anonymous
    December 05, 2006
    Thank you Rob, I will change to fragments as soon as I get to writing the corresponding sources and makefile.inc