<?xml version="1.0" ?>
<Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>

    <?define BinsOnly?>

    <!-- See config.wxi for the symbols that it defines/asserts -->
    <?include config.wxi?>

    <!-- See language_config for localization options. -->
    <?include language_config.wxi?>

    <!--
      We autogenerate a new product code for each build.  According to MSDN we have
      to change the product code whenever we change the name of the MSI file.  Each
      version of OpenAFS has a different MSI name.  Thus, each version needs a
      unique product code.
      -->
    <Product 
        Id="????????-????-????-????-????????????"
        Codepage="$(var.Codepage)"
        Language="$(var.LanguageCode)"
        Manufacturer="$(var.Manufacturer)"
        Name="$(var.ProductName)"
        UpgradeCode="A94D03E9-EF11-4B87-9B42-409016BD4B7C"
        Version="$(var.NumericVersion)">

		<!--
		Note that we are not specifying an explicit Package Code below.  That way WiX will
		generate a new one for each build.  If an explicit one needs to be specified, use :
		         Id="$(var.PackageCode)"
		-->
        <Package
         Id="????????-????-????-????-????????????"
         AdminImage="no"
         Comments="$(var.PackageComments)"
         Compressed="yes"
         Description="$(var.ProductName)"
         InstallerVersion="$(var.InstallerVersion)"
         Keywords="Installer,OpenAFS,$(var.Manufacturer)"
         Languages="$(var.Languages)"
         Manufacturer="$(var.Manufacturer)"
         Platforms="$(var.Platform)"
         ShortNames="no"
         SummaryCodepage="1252"
         />
        
        <!-- Launch conditions -->
        <Condition Message="$(loc.StrLaunchCond)">
         <![CDATA[VersionNT >= 500]]>
        </Condition>

        <!-- Global Properties -->
        <?include property.wxi?>

        <!-- File system and registry settings -->
        <Directory Id="TARGETDIR" Name="SourceDir">
            <?include platform.wxi?>
            <?include registry.wxi?>
            <?include files.wxi?>
        </Directory>

        <!-- Features -->
        <?include feature.wxi?>
        
        <!-- User interface -->
        <?include lang\$(var.Language)\ui.wxi?>

        <CustomAction
           Id="SetInstallLocation"
           Property="ARPINSTALLLOCATION"
           Value="[AFSDIR]" />

        <!-- Installation Sequences -->
        <AdvertiseExecuteSequence />
        <AdminExecuteSequence />
        <InstallExecuteSequence>
            <RemoveExistingProducts After="InstallValidate">(Not Installed) And (OPENAFSBIN_UPGRADE)</RemoveExistingProducts>
            <Custom Action="SetInstallLocation" Before="RegisterProduct" />
        </InstallExecuteSequence>

        <!-- Related producs -->
        <!-- OpenAFS MSI installer -->
        <Upgrade Id="A94D03E9-EF11-4B87-9B42-409016BD4B7C">
            <UpgradeVersion IgnoreRemoveFailure="no" IncludeMaximum="yes" Maximum="$(var.NumericVersion)" MigrateFeatures="yes" Property="OPENAFSBIN_UPGRADE" />
        </Upgrade>
        
        <!-- Media -->
        <Media Id="1" Cabinet="disk1.cab" CompressionLevel="high" EmbedCab="yes" />
    </Product>
</Wix>
