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

  <?define ProductName="Double Commander" ?>
  <?define UpgradeCode="D220A081-E26D-4ECD-B399-EFEB4D6678EA" ?>

   <Product
     Id="*"
     UpgradeCode="$(var.UpgradeCode)"
     Name="$(var.ProductName)"
     Version="$(var.ProductVersion)"
     Manufacturer="Alexander Koblov"
     Language="1033">

      <Package InstallerVersion="200" Compressed="yes" />

      <Media Id="1" Cabinet="product.cab" EmbedCab="yes"/>
      <Icon Id="ProductIcon" SourceFile="doublecmd.ico"/>
      <Property Id="ARPPRODUCTICON" Value="ProductIcon"/>
      <Property Id="ARPURLINFOABOUT" Value="http://doublecmd.sourceforge.net"/>
      <Property Id="ARPNOREPAIR" Value="1"/>

      <Upgrade Id="$(var.UpgradeCode)">
         <UpgradeVersion Minimum="$(var.ProductVersion)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/>
         <UpgradeVersion Minimum="0.0.0" Maximum="$(var.ProductVersion)" IncludeMinimum="yes" IncludeMaximum="no"
                         Property="OLDERVERSIONBEINGUPGRADED"/>
      </Upgrade>
      <Condition Message="A newer version of this software is already installed.">NOT NEWERVERSIONDETECTED</Condition>

      <Directory Id="TARGETDIR" Name="SourceDir">
         <Directory Id="$(var.ProgramFiles)">
            <Directory Id="INSTALLDIR" Name="$(var.ProductName)">
            </Directory>
         </Directory>
         <Directory Id="ProgramMenuFolder">
            <Directory Id="ApplicationProgramsFolder" Name="$(var.ProductName)">
               <Component Id="ApplicationShortcut" Guid="BA37DDBD-5F67-4BA5-B5B8-01B3998E5BDE">
                  <Shortcut
                    Id="Shortcut"
                    Name="$(var.ProductName)"
                    Description="$(var.ProductName)"
                    Target="[INSTALLDIR]doublecmd.exe"
                    WorkingDirectory="INSTALLDIR"/>
                  <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
                  <RegistryValue Root="HKCU" Key="Software\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
               </Component>
            </Directory>
         </Directory>
      </Directory>

      <InstallExecuteSequence>
         <RemoveExistingProducts After="InstallValidate"/>
      </InstallExecuteSequence>

      <Feature Id="DefaultFeature" Level="1">
         <ComponentGroupRef Id="HeatGroup"/>
         <ComponentRef Id="ApplicationShortcut" />
      </Feature>

      <WixVariable Id="WixUILicenseRtf" Value="license.rtf" />

      <UIRef Id="WixUI_Minimal" />

   </Product>
</Wix>