Wix - 引导MSI与Burn安装正常,卸载失败。 MSI就可以自己安装/卸载好了

时间:2013-04-11 07:52:34

标签: twitter-bootstrap installation wix burn

我一直在尝试用网络上的.Net 4.0生成MSI安装程序的自举EXE几天,我需要一些帮助。

我们有一个简单的MSI,需要将它与.Net4捆绑在一起。我们有2个MSI变种 - x64 / x86,并且以通常的方式在Bundle中处理。

如果.Net4在那里,MSI安装和卸载都很好。真棒。 一旦引导,EXE安装好(如果需要,确实补丁.Net4),我们的应用程序启动(按预期)。 问题是卸载。它失败并显示以下日志。

我很难过。有什么线索吗?

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">

  <?ifdef env.BuildNumber ?>
    <?define VersionNumber= $(env.BuildNumber) ?>
  <?else ?>
    <?define VersionNumber="1.0.0.0" ?>
  <?endif ?>
  <?define UpgradeCode="{5C7CB098-A9BB-4ABC-9496-68B96C357270}"?>

  <!-- leaving name off Bundle would stop it appearring in Control Panel-->
  <Bundle Name="App.Net Desktop Bootstrapper" 
          Version="$(var.VersionNumber)" 
          Manufacturer="App.Net" 
          UpgradeCode="$(var.UpgradeCode)"
          Condition="((VersionNT >= v5.1) AND (ServicePackLevel >= 3)) OR ((VersionNT >= v5.2) AND (ServicePackLevel >= 2)) OR (VersionNT >= v6.0)"
          IconSourceFile="..\..\assets\App.NetDesktopIcon.ico">

    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense"> <!-- hyperlink license form -->
      <!-- leave hyperlink url blank to prevent display -->
      <bal:WixStandardBootstrapperApplication 
        LicenseUrl=""
        SuppressOptionsUI="yes" 
        ThemeFile="..\..\assets\wixTheme\PipeInstaller.xml" 
        LocalizationFile="..\..\assets\wixTheme\MyTheme.wxl" />  <!-- setup custom theme -->
      <PayloadGroupRef Id="installPayload"/>   <!-- payload for images used in theme -->
    </BootstrapperApplicationRef>

  <PayloadGroup Id ="installPayload">
     <!-- Images referred to by name in theme -->
      <Payload Id="image1" Name ="header.png" SourceFile="..\..\assets\wixTheme\header.png" />
      <Payload Id="image2" Name ="install-smaller.png" SourceFile="..\..\assets\wixTheme\install-smaller.png" />
    </PayloadGroup>
    <Chain>
      <PackageGroupRef Id="NetFx40Web" />   <!-- bootstrap the /Net install from the web. This is build into Wix -->

      <!-- Set NOT Visible so it's viewable in Control Panel-->
      <MsiPackage
         Id="x86"
          SourceFile="..\..\bin\Win\x86\msi\App.Net.msi"
         InstallCondition="NOT VersionNT64"
         Visible="no">
        <!-- Override property values in the MSI -->
        <MsiProperty Name="AUTOUPDATEENABLED" Value="1" />
        <MsiProperty Name="AUTOSTART" Value="1" />
        <MsiProperty Name="CALLEDFROMEXE" Value="1" />
      </MsiPackage>

      <MsiPackage
          Id="x64"
          SourceFile="..\..\bin\Win\x64\msi\App.Net.msi"
          InstallCondition="VersionNT64"
          Visible="no">
        <!-- Override property values in the MSI -->
        <MsiProperty Name="AUTOUPDATEENABLED" Value="1" />
        <MsiProperty Name="AUTOSTART" Value="1" />
        <MsiProperty Name="CALLEDFROMEXE" Value="1" />
      </MsiPackage>
    </Chain>
    </Bundle>
</Wix>  

安装错误日志

[0FAC:0348][2013-04-11T00:29:11]: Burn v3.6.3303.0, Windows v6.1 (Build 7601: Service Pack 1), path: C:\ProgramData\Package Cache\{c7e4c719-a2f5-46ab-8875-3bc46f059503}\App.Net.Setup.exe, cmdline: '/uninstall -burn.unelevated BurnPipe.{0ED581A2-B6CE-473D-AADF-46CF51E7DF81} {20A283F6-897C-4CFC-9718-89B0E4BD138E} 3888'
[0FAC:0348][2013-04-11T00:29:11]: Setting string variable 'WixBundleLog' to value 'C:\Users\IEUser\AppData\Local\Temp\App.Net_Desktop_Bootstrapper_20130411002911.log'
[0FAC:0348][2013-04-11T00:29:11]: Condition '((VersionNT >= v5.1) AND (ServicePackLevel >= 3)) OR ((VersionNT >= v5.2) AND (ServicePackLevel >= 2)) OR (VersionNT >= v6.0)' evaluates to true.
[0FAC:0348][2013-04-11T00:29:11]: Detect 3 packages
[0FAC:0348][2013-04-11T00:29:11]: Setting string variable 'NETFRAMEWORK40' to value '1'
[0FAC:0348][2013-04-11T00:29:11]: Condition 'NETFRAMEWORK40' evaluates to true.
[0FAC:0348][2013-04-11T00:29:11]: Detected package: NetFx40Web, state: Present, cached: Complete
[0FAC:0348][2013-04-11T00:29:11]: Detected package: x86, state: Present, cached: Complete
[0FAC:0348][2013-04-11T00:29:11]: Detected package: x64, state: Absent, cached: None
[0FAC:0348][2013-04-11T00:29:11]: Detect complete, result: 0x0
[0FAC:0348][2013-04-11T00:29:59]: Plan 3 packages, action: Uninstall
[0FAC:0348][2013-04-11T00:29:59]: Setting string variable 'WixBundleRollbackLog_x86' to value 'C:\Users\IEUser\AppData\Local\Temp\App.Net_Desktop_Bootstrapper_20130411002911_0_x86_rollback.log'
[0FAC:0348][2013-04-11T00:29:59]: Setting string variable 'WixBundleLog_x86' to value 'C:\Users\IEUser\AppData\Local\Temp\App.Net_Desktop_Bootstrapper_20130411002911_0_x86.log'
[0FAC:0348][2013-04-11T00:29:59]: Skipping dependency registration on package with no dependency providers: NetFx40Web
[0FAC:0348][2013-04-11T00:29:59]: Planned package: x64, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: Unregister
[0FAC:0348][2013-04-11T00:29:59]: Planned package: x86, state: Present, default requested: Absent, ba requested: Absent, execute: Uninstall, rollback: Install, cache: No, uncache: Yes, dependency: Unregister
[0FAC:0348][2013-04-11T00:29:59]: Planned package: NetFx40Web, state: Present, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0FAC:0348][2013-04-11T00:29:59]: Plan complete, result: 0x0
[0FAC:0348][2013-04-11T00:29:59]: Apply begin
[0F30:0F50][2013-04-11T00:29:59]: Creating a system restore point.
[0F30:0F50][2013-04-11T00:29:59]: Could not create system restore point, error: 0x80070422. Continuing...
[0F30:0F50][2013-04-11T00:29:59]: Removed dependency: {c7e4c719-a2f5-46ab-8875-3bc46f059503} on package provider: {129A003A-2370-4378-B0FA-10509C76FE2E}, package x86
[0F30:0F50][2013-04-11T00:29:59]: Applying execute package: x86, action: Uninstall, path: C:\ProgramData\Package Cache\{129A003A-2370-4378-B0FA-10509C76FE2E}v1.0.0.0\App.Net.msi, arguments: ' ARPSYSTEMCOMPONENT="1" MSIFASTINSTALL="7" AUTOUPDATEENABLED="1" AUTOSTART="1" CALLEDFROMEXE="1"'
[0F30:0F50][2013-04-11T00:30:00]: Error 0x80070643: Failed to uninstall MSI package.
[0F30:0F50][2013-04-11T00:30:00]: Error 0x80070643: Failed to execute MSI package.
[0FAC:0348][2013-04-11T00:30:00]: Error 0x80070643: Failed to configure per-machine MSI package.
[0FAC:0348][2013-04-11T00:30:00]: Applied execute package: x86, result: 0x80070643, restart: None
[0FAC:0348][2013-04-11T00:30:00]: Error 0x80070643: Failed to execute MSI package.
[0F30:0F50][2013-04-11T00:30:00]: Applying rollback package: x86, action: Install, path: C:\ProgramData\Package Cache\{129A003A-2370-4378-B0FA-10509C76FE2E}v1.0.0.0\App.Net.msi, arguments: ' ARPSYSTEMCOMPONENT="1" MSIFASTINSTALL="7" AUTOUPDATEENABLED="1" AUTOSTART="1" CALLEDFROMEXE="1"'
[0F30:0F50][2013-04-11T00:30:01]: Registering package dependency provider: {129A003A-2370-4378-B0FA-10509C76FE2E}, version: 1.0.0.0, package: x86
[0FAC:0348][2013-04-11T00:30:01]: Applied rollback package: x86, result: 0x0, restart: None
[0F30:0F50][2013-04-11T00:30:01]: Registering dependency: {c7e4c719-a2f5-46ab-8875-3bc46f059503} on package provider: {129A003A-2370-4378-B0FA-10509C76FE2E}, package: x86
[0FAC:0348][2013-04-11T00:30:02]: Apply complete, result: 0x80070643, restart: None, ba requested restart:  No

更新

回应Rob的回答(非常感谢)

Rob非常感谢 - 奇怪的是MSI安装/卸载就好了。我检查了日志,但我没有看到“错误”,但我确实看到了:

MSI (s) (F0:E4) [05:36:30:999]: No System Restore sequence number for this installation.
MSI (s) (F0:E4) [05:36:30:999]: Unlocking Server
MSI (s) (F0:E4) [05:36:30:999]: PROPERTY CHANGE: Deleting UpdateStarted property. Its current value is '1'.
MSI (s) (F0:E4) [05:36:30:999]: Doing action: LaunchApplication
MSI (s) (F0:E4) [05:36:30:999]: Note: 1: 2205 2:  3: ActionText
Action ended 5:36:30: InstallFinalize. Return value 1.
MSI (s) (F0:F0) [05:36:30:999]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI1A6F.tmp, Entrypoint: WixShellExec
Action start 5:36:30: LaunchApplication.
WixShellExec:  Error 0x80070002: ShellExec failed with return code 2
WixShellExec:  Error 0x80070002: failed to launch target
CustomAction LaunchApplication returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 5:36:31: LaunchApplication. Return value 3.
Action ended 5:36:31: INSTALL. Return value 3.
MSI (s) (F0:E4) [05:36:31:015]: Note: 1: 1725
MSI (s) (F0:E4) [05:36:31:015]: Product: TheApp -- Removal failed. 

这几乎就像它试图在卸载时启动应用程序...谢谢我认为Bundle是对的,但我正在咀嚼几天。任何建议都得到了很好的收获

2 个答案:

答案 0 :(得分:3)

为您的MsiPackage添加permanent =“no”属性。

P.S:默认情况下它表示永久属性值为no,但我遇到了同样的问题,并且在添加属性后能够修复它。

答案 1 :(得分:2)

x86 MSI无法卸载。 0x80070643是“此安装包由于某种原因失败了”的一般错误。

查看.MSI日志文件:'C:\Users\IEUser\AppData\Local\Temp\App.Net_Desktop_Bootstrapper_20130411002911_0_x86.log'您可以在“WixBundleLog_x86”变量中看到该日志文件被引用为日志文件。日志文件显示您的LaunchApplication自定义操作失败(请参阅old blog post我是如何发现错误的。)

您需要查看LaunchApplication自定义操作的条件,因为这似乎是在卸载时启动您的应用程序(这看起来很奇怪)。可能是AUTOSTART属性总是从Bundle传递值"1"到导致问题的MSI吗?

PS:您无需明确设置MsiPackage/@Visible='no'。这是默认值。 :)