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

<Product
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  ProductCode="SAP.CrystalReports14.NET.2.0"
>
  <!-- Defines list of files to be copied on build -->
  <PackageFiles>
    <PackageFile Name="CRRuntime_32bit_13_0_8.msi" 
      HomeSite="http://downloads.businessobjects.com/akdlm/crnetruntime/clickonce/CRRuntime_32bit_13_0_8.msi" 
      PublicKey=" "/>
    <PackageFile Name="CRRuntime_64bit_13_0_8.msi" 
      HomeSite="http://downloads.businessobjects.com/akdlm/crnetruntime/clickonce/CRRuntime_64bit_13_0_8.msi" 
      PublicKey=" "/>
  </PackageFiles>

  <RelatedProducts>
    <DependsOnProduct Code="Microsoft.Net.Framework.2.0" />
    <DependsOnProduct Code="Microsoft.Data.Access.Components.2.8" />
  </RelatedProducts>

  <InstallChecks>
    <RegistryCheck Property="CRRuntime32Version" Key="HKLM\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports" Value="CRRuntime32Version" /> 
    <RegistryCheck Property="CRRuntime64Version" Key="HKLM\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports" Value="CRRuntime64Version" /> 
  </InstallChecks>

  <Commands Reboot="Defer">
    <Command PackageFile="CRRuntime_32bit_13_0_8.msi"
	     Arguments='' 
	     EstimatedInstalledBytes="50000000" 
	     EstimatedInstallSeconds="220">

      <!-- These checks determine whether the package is to be installed -->

      <InstallConditions>
        <!-- Comment out the below BypassIf entry if you want install the 32bit version CRRuntime redist in the target machine -->      
        <!-- ByPass if the Processor is not x86 -->
        <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel"/>

        <!-- ByPass if the installed version is same or higher --> 
        <BypassIf Property="CRRuntime32Version" Compare="VersionGreaterThanOrEqualTo"  Value="13.0.8"/>
        
        <!-- Block install if user does not have admin privileges -->
        <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>

        <!-- Block install on Win95 -->
        <FailIf Property="Version9x" Compare="VersionLessThan" Value="4.10" String="InvalidPlatformWin9x"/>

        <!-- Block install on NT 4 or less -->
        <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.00" String="InvalidPlatformWinNT"/>

      </InstallConditions>

      <ExitCodes>
        <ExitCode Value="0" Result="Success"/>
        <ExitCode Value="1641" Result="SuccessReboot"/>
        <ExitCode Value="3010" Result="SuccessReboot"/>
        <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
      </ExitCodes>

    </Command>
    
    <Command PackageFile="CRRuntime_64bit_13_0_8.msi"
	     Arguments=''
	     EstimatedInstalledBytes="21000000"
	     EstimatedInstallSeconds="300">

      <!-- These checks determine whether the package is to be installed -->

      <InstallConditions>
        <!-- ByPass if the Processor is not x64 -->
        <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="AMD64"/>
        
        <!-- Uncomment the below BypassIf entry if you do not want to install the 64bit version CRRuntime redist in the target machine -->      
        <!--
        <BypassIf Property="ProcessorArchitecture" Compare="ValueEqualTo" Value="AMD64"/>
        -->
         
        <!-- ByPass if the installed version is same or higher --> 
        <BypassIf Property="CRRuntime64Version" Compare="VersionGreaterThanOrEqualTo"  Value="13.0.8"/>

        <!-- Block install if user does not have admin privileges -->
        <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>

        <!-- Block install on Win95 -->
        <FailIf Property="Version9x" Compare="VersionLessThan" Value="4.10" String="InvalidPlatformWin9x"/>

        <!-- Block install on NT 4 or less -->
        <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.00" String="InvalidPlatformWinNT"/>

      </InstallConditions>

      <ExitCodes>
        <ExitCode Value="0" Result="Success"/>
        <ExitCode Value="1641" Result="SuccessReboot"/>
        <ExitCode Value="3010" Result="SuccessReboot"/>
        <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
      </ExitCodes>
    </Command>
  </Commands>
</Product>
