<?xml version="1.0" encoding="utf-8"?>
<!--
 *
 * test.wxs -
 *
 * Copyright (c) 2007-2012 by Joe Mistachkin.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: $
 *
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="32559C62-B1B1-4086-AB15-0059DE1CC6C1"
           Name="Test Product"
           Language="1033"
           Version="1.0.0.0"
           Manufacturer="Eagle Development Team"
           UpgradeCode="BE0B4547-0AD4-4AF5-B355-0F1269B79FC5">
    <Package Description="Test Eagle Preprocessor Extension for WiX"
             InstallerVersion="200"
             Compressed="yes" />

    <Media Id="1" Cabinet="test.cab" EmbedCab="yes" />

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Component Id="Test.ProductComponent"
                 Guid="{487685E9-FE00-414A-B5C3-2F8679900A12}">
        <File Id="Test.ProductFile"
              Name="test.txt"
              Source="Files\test.txt"
              KeyPath="yes" />
      </Component>
    </Directory>

    <Feature Id="Test.ProductFeature" Level="1">
      <ComponentRef Id="Test.ProductComponent" />
    </Feature>

    <!--
        NOTE: This is an example of how to refer to and fetch the value of an
              Eagle variable from the WiX preprocessor.  The only limitation is
              that the value of array elements must be fetched using a somewhat
              non-natural syntax [for Tcl and Eagle] because of how WiX parses
              references to extension variables and functions.  The "[" and "]"
              characters are used to indicate the "(" and ")" characters,
              respectively.
    -->
    <Property Id="BuildOperatingSystem"
              Value="$(eagle.eagle_platform[os])" />

    <!--
        NOTE: This is an example of how to invoke an Eagle command using the WiX
              preprocessor function syntax.  In this case, the final command to
              be invoked will be: [set dir <directory_containing_this_file>].
    -->
    <Property Id="BuildSourceFileDir"
              Value="$(eagle.set(dir,$(sys.SOURCEFILEDIR)))" />

    <!--
        NOTE: Here is another Eagle command example.  This time, we want to put
              the daily build number into a WiX property value.
    -->
    <Property Id="BuildNumber"
              Value="$(eagle.clock(build))" />

    <!--
        NOTE: This is an example of how to evaluate an Eagle script using the
              WiX custom "pragma" XML processing instruction.  This is only
              supported by WiX version 3.5 or higher.
    -->
    <?pragma eagle.EvaluateScript
      #
      # NOTE: This is a fairly trivial example of how to do something useful in
      #       an Eagle script that is being evaluated from inside the WiX
      #       preprocessor.  The final result of this script will be inserted
      #       as raw XML into the XML document at this location.
      #
      source [file normalize [file join $dir Scripts test.eagle]]
      makeProperty BuildUserName $env(USERNAME); # define a WiX property
    ?>
  </Product>
</Wix>
