Wix Burn Bootstrapper在重大升级时卸载Crystal Report

时间:2015-01-08 10:10:18

标签: crystal-reports wix windows-installer bootstrapper burn

我正在为我的bootstrapper使用wix burn,每次升级到我的应用程序时都会卸载Crystal Reports运行时。有人可以帮我解决这个问题吗?

Bundle.wxs

 <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" 
     xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

  <?include Variables.wxi ?>

  <Bundle Name="!(loc.BundleName)"
          Version="$(var.Version)"
                Manufacturer="!(loc.Manufacturer)"
                HelpTelephone="!(loc.HelpPhone)"
                Copyright="!(loc.Copyright)"
          UpgradeCode="$(var.UpgradeCode)"
          IconSourceFile="$(var.MainApplicationImagesFolder)\Car_Count_Report_Flat.ico" >
    <!--SplashScreenSourceFile="$(var.MainApplicationImagesFolder)\BurnSplashScreen.bmp" >-->

    <bal:Condition Message="This install requires Windows 7 Service Pack 1 or Higher">
      ((VersionNT >= v6.1) AND (ServicePackLevel >= 1) OR (VersionNT >= v6.3))
    </bal:Condition>

    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
    <WixVariable Id="WixStdbaLicenseRtf" Value="$(var.EULAFolder)\EULA_en-US.rtf" />
    <WixVariable Id="WixStdbaLogo" Value="$(var.MainApplicationImagesFolder)\car_counter_report_icon_64.png" />

    <!-- Checks the Crystal Reports Registry Values -->
    <!--<util:RegistrySearch Root="HKLM" Key="SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports"
                      Value="CRRuntime64Version" Format="raw" Variable="CRRuntime64Version" Result="value" Win64="yes"/>-->

    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports"
                         Value="CRRuntime32Version" Format="raw" Variable="CRRuntime32Version" Result="value"/>

    <!-- Checks the Main Application Registry Values -->
    <!--<util:RegistrySearch Root="HKLM" Key="Software\Saunders Creative Strategies\Kaady\Car Count Report"
                        Value="Version" Format="raw" Variable="x64Version" Result="value" Win64="yes"/>-->

    <util:RegistrySearch Root="HKLM" Key="Software\Saunders Creative Strategies\Kaady\Car Count Report"
                         Value="Version" Format="raw" Variable="x86Version" Result="value"/>

    <!-- Adds Local Variables -->
    <Variable Name="CRRUNTIMEUPGRADE" bal:Overridable="yes" Type="numeric" Value="1" />

    <Chain>
      <!-- TODO: Define the list of chained packages. -->
      <!-- <MsiPackage SourceFile="path\to\your.msi" /> -->
      <PackageGroupRef Id="NetFx45Redist"/>
      <PackageGroupRef Id ="CrystalReportsRuntime"/>
      <PackageGroupRef Id="MainApplicationFile"/>
    </Chain>
  </Bundle>
</Wix>

InstallationFiles.wxs

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

  <?include Variables.wxi ?>
  <Fragment>
    <!-- Crystal Reports Runtime -->
    <PackageGroup Id="CrystalReportsRuntime">

      <!--<?if $(var.Platform) = x64 ?>--><!--
      --><!--<MsiPackage Id ="CRRuntime64"
                   DownloadUrl="$(var.CRHttp)/$(var.CRx64Msi)"
                   SourceFile="$(var.3rdPartyApplicationFiles)\$(var.CRx64Msi)"
                   Name="$(var.CRx64Msi)"
                   Vital ="yes"
                   Compressed="no"
                   ForcePerMachine="yes"
                   InstallCondition="NOT CRRuntime64Version OR (CRRuntime64Version &lt; &quot;$(var.CRVersion)&quot;)" >
        <MsiProperty Name="UPGRADE" Value="[CRRUNTIMEUPGRADE]" />
      </MsiPackage>--><!--
      --><!--<?else ?>-->
      <MsiPackage Id ="CRRuntime32"
                DownloadUrl="$(var.CRHttp)/$(var.CRx86Msi)"
                SourceFile="$(var.3rdPartyApplicationFiles)\$(var.CRx86Msi)"
                Name="$(var.CRx86Msi)"
                Vital ="yes"
                Compressed="no"
                ForcePerMachine="yes"
                Visible="yes" 
                Permanent="yes"
                InstallCondition="NOT CRRuntime32Version AND (NOT (CRRuntime32Version = &quot;$(var.CRVersion)&quot;))" >
        <MsiProperty Name="UPGRADE" Value="[CRRUNTIMEUPGRADE]" />
      </MsiPackage>
      <!--<?endif ?>-->
    </PackageGroup>

    <PackageGroup Id="MainApplicationFile">
      <!--<MsiPackage Id="MainApplicationx64Msi" Vital="yes" Compressed="yes" ForcePerMachine="yes" Cache="yes"
                 Name="$(var.Mainx64Msi)"
                 InstallCondition="NOT x64Version OR (x64Version &lt; &quot;$(var.Version)&quot;)"
                 SourceFile="$(var.MainApplicationx64MsiFile)\$(var.Mainx64Msi)"/>-->

      <MsiPackage Id="MainApplicationx86Msi" Vital="yes" Compressed="yes" ForcePerMachine="yes" Cache="yes"
                  Name="$(var.Mainx86Msi)" 
                  Visible="no"
                  InstallCondition="NOT x86Version OR (x86Version &lt; &quot;$(var.Version)&quot;)"
                  SourceFile="$(var.MainApplicationx86MsiFile)\$(var.Mainx86Msi)"/>
    </PackageGroup>
  </Fragment>
</Wix>

谢谢 沙恩

2 个答案:

答案 0 :(得分:3)

如果查看用户临时目录中的安装日志,您会看到升级捆绑包认为它不应该安装CRRuntime32,因为InstallCondition为false。 Burn使用MSI的升级表来执行您尝试执行的相同逻辑。如果正确创作了Crystal Reports MSI,您应该可以放弃安装条件,让Burn决定是否需要安装它。

答案 1 :(得分:0)

您应该使用DetectCondition而不是InstallCondition。第一个答案:是否已安装?第二种:对于捆绑安装,是否需要?

你拥有它的方式,刻录会在安装过程中删除CR,因为逻辑表明它不是想要的。