1 <?xml version="1.0" encoding="utf-8"?>
   2 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
   3      xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
   4 
   5   <?ifdef JpIsSystemWide ?>
   6     <?define JpInstallScope="perMachine"?>
   7   <?else?>
   8     <?define JpInstallScope="perUser"?>
   9   <?endif?>
  10 
  11   <?define JpProductLanguage=1033 ?>
  12   <?define JpInstallerVersion=200 ?>
  13   <?define JpCompressedMsi=yes ?>
  14 
  15   <?include $(var.JpConfigDir)/overrides.wxi ?>
  16 
  17   <Product
  18     Id="$(var.JpProductCode)"
  19     Name="$(var.JpAppName)"
  20     Language="$(var.JpProductLanguage)"
  21     Version="$(var.JpAppVersion)"
  22     Manufacturer="$(var.JpAppVendor)"
  23     UpgradeCode="$(var.JpProductUpgradeCode)">
  24 
  25     <Package
  26       Description="$(var.JpAppDescription)"
  27       Manufacturer="$(var.JpAppVendor)"
  28       InstallerVersion="$(var.JpInstallerVersion)"
  29       Compressed="$(var.JpCompressedMsi)"
  30       InstallScope="$(var.JpInstallScope)" Platform="x64"
  31     />
  32 
  33     <Media Id="1" Cabinet="Data.cab" EmbedCab="yes" />
  34 
  35     <?ifdef JpAllowDowngrades ?>
  36     <?ifdef JpAllowUpgrades ?>
  37     <MajorUpgrade
  38       AllowDowngrades="yes"
  39       Disallow="no"
  40     />
  41     <?endif?>
  42     <?endif?>
  43 
  44     <?ifdef JpAllowDowngrades ?>
  45     <?ifndef JpAllowUpgrades ?>
  46     <MajorUpgrade
  47       AllowDowngrades="yes"
  48       Disallow="yes"
  49       DisallowUpgradeErrorMessage="!(loc.DisallowUpgradeErrorMessage)"
  50     />
  51     <?endif?>
  52     <?endif?>
  53 
  54     <?ifndef JpAllowDowngrades ?>
  55     <?ifdef JpAllowUpgrades ?>
  56     <MajorUpgrade
  57       AllowDowngrades="no"
  58       Disallow="no"
  59       DowngradeErrorMessage="!(loc.DowngradeErrorMessage)"
  60     />
  61     <?endif?>
  62     <?endif?>
  63 
  64     <?ifndef JpAllowDowngrades ?>
  65     <?ifndef JpAllowUpgrades ?>
  66     <MajorUpgrade
  67       AllowDowngrades="no"
  68       Disallow="yes"
  69       DowngradeErrorMessage="!(loc.DowngradeErrorMessage)"
  70       DisallowUpgradeErrorMessage="!(loc.DisallowUpgradeErrorMessage)"
  71     />
  72     <?endif?>
  73     <?endif?>
  74 
  75     <!-- Standard required root -->
  76     <Directory Id="TARGETDIR" Name="SourceDir"/>
  77 
  78     <Feature Id="DefaultFeature" Title="!(loc.MainFeatureTitle)" Level="1">
  79       <ComponentGroupRef Id="Shortcuts"/>
  80       <ComponentGroupRef Id="Files"/>
  81       <ComponentGroupRef Id="FileAssociations"/>
  82     </Feature>
  83 
  84     <?ifdef JpInstallDirChooser ?>
  85     <Binary Id="JpCaDll" SourceFile="wixhelper.dll"/>
  86     <CustomAction Id="JpCheckInstallDir" BinaryKey="JpCaDll" DllEntry="CheckInstallDir" />
  87     <?endif?>
  88 
  89     <UI>
  90       <?ifdef JpInstallDirChooser ?>
  91       <Dialog Id="JpInvalidInstallDir" Width="300" Height="85" Title="[ProductName] Setup" NoMinimize="yes">
  92         <Control Id="JpInvalidInstallDirYes" Type="PushButton" X="100" Y="55" Width="50" Height="15" Default="no" Cancel="no" Text="Yes">
  93           <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
  94         </Control>
  95         <Control Id="JpInvalidInstallDirNo" Type="PushButton" X="150" Y="55" Width="50" Height="15" Default="yes" Cancel="yes" Text="No">
  96           <Publish Event="NewDialog" Value="InstallDirDlg">1</Publish>
  97         </Control>
  98         <Control Id="Text" Type="Text" X="25" Y="15" Width="250" Height="30" TabSkip="no">
  99           <Text>!(loc.message.install.dir.exist)</Text>
 100         </Control>
 101       </Dialog>
 102 
 103       <!--
 104         Run WixUI_InstallDir dialog in the default install directory.
 105       -->
 106       <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
 107       <UIRef Id="WixUI_InstallDir" />
 108 
 109       <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="JpCheckInstallDir" Order="3">1</Publish>
 110       <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="JpInvalidInstallDir" Order="5">INSTALLDIR_VALID="0"</Publish>
 111       <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="5">INSTALLDIR_VALID="1"</Publish>
 112 
 113       <?ifndef JpLicenseRtf ?>
 114       <!--
 115         No license file provided.
 116         Override the dialog sequence in built-in dialog set "WixUI_InstallDir"
 117         to exclude license dialog.
 118       -->
 119       <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
 120       <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
 121       <?endif?>
 122 
 123       <?else?>
 124 
 125       <?ifdef JpLicenseRtf ?>
 126       <UIRef Id="WixUI_Minimal" />
 127       <?endif?>
 128 
 129       <?endif?>
 130     </UI>
 131 
 132     <?ifdef JpLicenseRtf ?>
 133     <WixVariable Id="WixUILicenseRtf" Value="$(var.JpLicenseRtf)"/>
 134     <?endif?>
 135 
 136   </Product>
 137 </Wix>