如何使用必备下载的wix包和一个具有先决条件压缩但是等效的包?

时间:2014-04-17 04:08:19

标签: wix

我希望有两个等效的包:一个包含.net框架(包括wix调用它,压缩),以及一个下载它。我目前正在使用我在命令行传递的<?ifdef?>从单个捆绑文件创建两个捆绑包。一切正常,但在安装过程中,如果已安装另一个捆绑包,则捆绑包无法安装。日志显示它检测到相关的捆绑包,但WixBundleInstalled设置为0.有没有办法做到这一点,以便捆绑包不能安装在彼此之上?

这是捆绑文件:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:netfx='http://schemas.microsoft.com/wix/NetFxExtension'
     xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  <?include Settings.wxi ?>
  <Bundle UpgradeCode="GUID" Version='$(var.ProductVersion)'
          Name="MyTune" DisableModify="yes"
          IconSourceFile="../icon_gear.ico" Manufacturer='GearHead Software, LLC' UpdateUrl='$(var.UpdateUrl)'>
    <OptionalUpdateRegistration/>
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLargeLicense">
      <bal:WixStandardBootstrapperApplication LicenseFile="..\EULA.rtf" SuppressOptionsUI="yes" ShowVersion="yes" ThemeFile="RtfLargeTheme.xml"
                                              LaunchTarget="[ProgramFilesFolder]\GearHead Software\MyTune\MyTune.exe"/>
    </BootstrapperApplicationRef>
    <Chain>
      <?ifdef IncludeDotNet ?>
        <PackageGroupRef Id="NetFx40RedistCompressed"/>
      <?else?>
        <PackageGroupRef Id="NetFx40Redist"/>
      <?endif?>
      <MsiPackage Id="MyTune" SourceFile="MyTune.msi" DisplayName="MyTune" />
    </Chain>
  </Bundle>

  <Fragment>
    <util:RegistrySearchRef Id="NETFRAMEWORK40"/>

    <PackageGroup Id="NetFx40RedistCompressed">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot;"
          PerMachine="yes"
          DetectCondition="NETFRAMEWORK40"
          Id="NetFx40RedistCompressed"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          Compressed="yes"
          SourceFile="dotNetFx40_Full_x86_x64.exe">
      </ExePackage>
    </PackageGroup>
  </Fragment>
</Wix>

以下是安装包含.net的软件包的日志文件,而不安装.net的软件包已经安装:

[0EBC:0604][2014-04-16T19:54:19]i001: Burn v3.8.1128.0, Windows v5.1 (Build 2600: Service Pack 3), path: C:\MyTune1440_setup.exe, cmdline: ''
[0EBC:0604][2014-04-16T19:54:19]i000: Initializing string variable 'LaunchTarget' to value '[ProgramFilesFolder]\GearHead Software\MyTune\MyTune.exe'
[0EBC:0604][2014-04-16T19:54:19]i000: Setting string variable 'WixBundleLog' to value 'C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\MyTune_20140416195419.log'
[0EBC:0604][2014-04-16T19:54:19]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\MyTune1440_setup.exe'
[0EBC:0604][2014-04-16T19:54:19]i000: Setting string variable 'WixBundleName' to value 'MyTune'
[0EBC:0604][2014-04-16T19:54:19]i100: Detect begin, 2 packages
[0EBC:0604][2014-04-16T19:54:19]i000: Setting string variable 'NETFRAMEWORK40' to value '1'
[0EBC:0604][2014-04-16T19:54:19]i102: Detected related bundle: {1d4ce8b1-06c6-47dc-a5f7-0dba64aadd69}, type: Upgrade, scope: PerMachine, version: 1.4.4.0, operation: None
[0EBC:0604][2014-04-16T19:54:19]i052: Condition 'NETFRAMEWORK40' evaluates to true.
[0EBC:0604][2014-04-16T19:54:19]i101: Detected package: NetFx40RedistCompressed, state: Present, cached: Complete
[0EBC:0604][2014-04-16T19:54:19]i101: Detected package: MyTune, state: Present, cached: Complete
[0EBC:0604][2014-04-16T19:54:19]i199: Detect complete, result: 0x0
[0EBC:0F04][2014-04-16T19:54:31]i000: Setting numeric variable 'EulaAcceptCheckbox' to value 1
[0EBC:0604][2014-04-16T19:54:31]i200: Plan begin, 2 packages, action: Install
[0EBC:0604][2014-04-16T19:54:31]w321: Skipping dependency registration on package with no dependency providers: NetFx40RedistCompressed
[0EBC:0604][2014-04-16T19:54:31]i201: Planned package: NetFx40RedistCompressed, state: Present, default requested: Present, ba requested: Present, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0EBC:0604][2014-04-16T19:54:31]i201: Planned package: MyTune, state: Present, default requested: Present, ba requested: Present, execute: None, rollback: None, cache: No, uncache: No, dependency: Register
[0EBC:0604][2014-04-16T19:54:31]i207: Planned related bundle: {1d4ce8b1-06c6-47dc-a5f7-0dba64aadd69}, type: Upgrade, default requested: None, ba requested: None, execute: None, rollback: None, dependency: None
[0EBC:0604][2014-04-16T19:54:31]i299: Plan complete, result: 0x0
[0EBC:0604][2014-04-16T19:54:31]i300: Apply begin
[0F00:0C10][2014-04-16T19:54:31]i360: Creating a system restore point.
[0F00:0C10][2014-04-16T19:54:33]i361: Created a system restore point.
[0F00:0C10][2014-04-16T19:54:33]i000: Caching bundle from: 'C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\{8c1caa8f-1ff2-4691-9e98-0af4f5fdffd8}\.be\MyTune1440_setup.exe' to: 'C:\Documents and Settings\All Users\Application Data\Package Cache\{8c1caa8f-1ff2-4691-9e98-0af4f5fdffd8}\MyTune1440_setup.exe'
[0F00:0C10][2014-04-16T19:54:33]i320: Registering bundle dependency provider: {8c1caa8f-1ff2-4691-9e98-0af4f5fdffd8}, version: 1.4.4.0
[0F00:0C10][2014-04-16T19:54:33]i323: Registering package dependency provider: {62105E4D-AAC1-4A87-95FB-BBDD34926285}, version: 1.4.4.0, package: MyTune
[0F00:0C10][2014-04-16T19:54:33]i325: Registering dependency: {8c1caa8f-1ff2-4691-9e98-0af4f5fdffd8} on package provider: {62105E4D-AAC1-4A87-95FB-BBDD34926285}, package: MyTune
[0EBC:0604][2014-04-16T19:54:33]i399: Apply complete, result: 0x0, restart: None, ba requested restart:  No
[0EBC:0604][2014-04-16T19:54:36]i500: Shutting down, exit code: 0x0
[0EBC:0604][2014-04-16T19:54:36]i410: Variable: EulaAcceptCheckbox = 1
[0EBC:0604][2014-04-16T19:54:36]i410: Variable: LaunchTarget = C:\Program Files\\GearHead Software\MyTune\MyTune.exe
[0EBC:0604][2014-04-16T19:54:36]i410: Variable: NETFRAMEWORK40 = 1
[0EBC:0604][2014-04-16T19:54:36]i410: Variable: ProgramFilesFolder = C:\Program Files\
[0EBC:0604][2014-04-16T19:54:36]i410: Variable: WixBundleAction = 4
[0EBC:0604][2014-04-16T19:54:36]i410: Variable: WixBundleElevated = 1
[0EBC:0604][2014-04-16T19:54:36]i410: Variable: WixBundleInstalled = 0
[0EBC:0604][2014-04-16T19:54:36]i410: Variable: WixBundleLog = C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\MyTune_20140416195419.log
[0EBC:0604][2014-04-16T19:54:36]i410: Variable: WixBundleManufacturer = GearHead Software, LLC
[0EBC:0604][2014-04-16T19:54:36]i410: Variable: WixBundleName = MyTune
[0EBC:0604][2014-04-16T19:54:36]i410: Variable: WixBundleOriginalSource = C:\MyTune1440_setup.exe
[0EBC:0604][2014-04-16T19:54:36]i410: Variable: WixBundleProviderKey = {8c1caa8f-1ff2-4691-9e98-0af4f5fdffd8}
[0EBC:0604][2014-04-16T19:54:36]i410: Variable: WixBundleTag = 
[0EBC:0604][2014-04-16T19:54:36]i410: Variable: WixBundleVersion = 1.4.4.0
[0EBC:0604][2014-04-16T19:54:37]i007: Exit code: 0x0, restarting: No

这是安装包含.net的捆绑包时的日志,同时已经安装了相同的捆绑包(这可以正常工作,WixBundleInstalled设置为1):

[0F94:0BE4][2014-04-16T19:56:51]i001: Burn v3.8.1128.0, Windows v5.1 (Build 2600: Service Pack 3), path: C:\MyTune1440_setup.exe, cmdline: ''
[0F94:0BE4][2014-04-16T19:56:51]i000: Initializing string variable 'LaunchTarget' to value '[ProgramFilesFolder]\GearHead Software\MyTune\MyTune.exe'
[0F94:0BE4][2014-04-16T19:56:51]i000: Setting string variable 'WixBundleLog' to value 'C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\MyTune_20140416195651.log'
[0F94:0BE4][2014-04-16T19:56:51]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\MyTune1440_setup.exe'
[0F94:0BE4][2014-04-16T19:56:51]i100: Detect begin, 2 packages
[0F94:0BE4][2014-04-16T19:56:51]i000: Setting string variable 'NETFRAMEWORK40' to value '1'
[0F94:0BE4][2014-04-16T19:56:51]i102: Detected related bundle: {1d4ce8b1-06c6-47dc-a5f7-0dba64aadd69}, type: Upgrade, scope: PerMachine, version: 1.4.4.0, operation: None
[0F94:0BE4][2014-04-16T19:56:51]i052: Condition 'NETFRAMEWORK40' evaluates to true.
[0F94:0BE4][2014-04-16T19:56:51]i101: Detected package: NetFx40RedistCompressed, state: Present, cached: Complete
[0F94:0BE4][2014-04-16T19:56:51]i101: Detected package: MyTune, state: Present, cached: Complete
[0F94:0BE4][2014-04-16T19:56:51]i199: Detect complete, result: 0x0
[0F94:0BE4][2014-04-16T19:56:55]i500: Shutting down, exit code: 0x642
[0F94:0BE4][2014-04-16T19:56:55]i410: Variable: LaunchTarget = C:\Program Files\\GearHead Software\MyTune\MyTune.exe
[0F94:0BE4][2014-04-16T19:56:55]i410: Variable: NETFRAMEWORK40 = 1
[0F94:0BE4][2014-04-16T19:56:55]i410: Variable: ProgramFilesFolder = C:\Program Files\
[0F94:0BE4][2014-04-16T19:56:55]i410: Variable: WixBundleAction = 4
[0F94:0BE4][2014-04-16T19:56:55]i410: Variable: WixBundleElevated = 0
[0F94:0BE4][2014-04-16T19:56:55]i410: Variable: WixBundleInstalled = 1
[0F94:0BE4][2014-04-16T19:56:55]i410: Variable: WixBundleLog = C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\MyTune_20140416195651.log
[0F94:0BE4][2014-04-16T19:56:55]i410: Variable: WixBundleManufacturer = GearHead Software, LLC
[0F94:0BE4][2014-04-16T19:56:55]i410: Variable: WixBundleName = MyTune
[0F94:0BE4][2014-04-16T19:56:55]i410: Variable: WixBundleOriginalSource = C:\MyTune1440_setup.exe
[0F94:0BE4][2014-04-16T19:56:55]i410: Variable: WixBundleProviderKey = {8c1caa8f-1ff2-4691-9e98-0af4f5fdffd8}
[0F94:0BE4][2014-04-16T19:56:55]i410: Variable: WixBundleTag = 
[0F94:0BE4][2014-04-16T19:56:55]i410: Variable: WixBundleVersion = 1.4.4.0
[0F94:0BE4][2014-04-16T19:56:55]i007: Exit code: 0x642, restarting: No

1 个答案:

答案 0 :(得分:0)

找到另一个捆绑包但似乎没有安排任何操作。 尝试添加下一个代码:

<MajorUpgrade DowngradeErrorMessage="[ProductName] is already installed." AllowDowngrades="no" Disallow="no" AllowSameVersionUpgrades="no" Schedule="afterInstallInitialize" />