Wix 在主要升级期间不会删除以前版本的刻录 exe



我已经使用burn-bootstrapper创建了一个wix-exe。当我尝试对它进行重大升级时,就会安装新版本。新升级中缺少的功能也将从现有文件夹结构中删除。但在"添加或删除程序"中,我仍然可以找到这两个安装。我已经在Bootstrapper项目的Bundle.wxs文件中将版本从1.0.0.0增加到1.0.1.0。我还将Setup项目的Product元素中的版本从1.0.0.0增加到了1.0.1.0。我没有更改这两个文件中的升级代码。我还在安装项目的Product.wxs中为产品ID创建了新的GUID。我在这里做错了什么?为什么"添加或删除程序"中仍然存在以前的版本?请提供建议。

下面是引导程序项目的Bundle.wxs.

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
  <Bundle Name="Kube Installer" Version="1.0.0.0" Manufacturer="Zone24x7" UpgradeCode="DA4CFB28-4441-43BE-9E8E-0E3C92206324">
    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost" >
      <Payload SourceFile="..CustomBABootstrapperCore.config"/>
      <Payload SourceFile="..CustomBAbinReleaseCustomBA.dll"/>
      <Payload SourceFile="..CustomBAbinReleaseGalaSoft.MvvmLight.WPF4.dll"/>
      <Payload SourceFile="C:Program Files (x86)WiX Toolset v3.8SDKMicrosoft.Deployment.WindowsInstaller.dll"/>
    </BootstrapperApplicationRef>
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value=""/>
    <WixVariable Id="WixMbaPrereqPackageId" Value=""/>
    <Chain>
      <MsiPackage SourceFile="..KubeInstallerbinReleaseKubeInstaller.msi" Id="KubeInstallationPackageId" Cache="yes" Visible="no"/>
    </Chain>
  </Bundle>
</Wix>

下面是安装项目的Product.wxs.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="70F65E5D-F307-4155-8847-9E5A66024DE7" Name="Installer" Language="1033" Version="1.0.0.0" Manufacturer="Zone24x7" UpgradeCode="E90569B5-372E-45BB-B101-58E0B75AB5C7">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64"/>
    <Property Id="JAVA_CURRENT_VERSION64">
      <RegistrySearch Id="JRE_CURRENT_VERSION_REGSEARCH64" Root="HKLM" Key="SOFTWAREJavaSoftJava Runtime Environment" Name="CurrentVersion" Type="raw" Win64="yes" />
    </Property>
    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate />
    <Feature Id="ProductFeature" Title="Installer" Level="1" >
      <ComponentGroupRef Id="NewFilesGroup2"/>
    </Feature>
  </Product>
  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="InstallDir" Name="Installer">
            <Directory Id="MyProgramDir2" Name="KKSDKService" />
        </Directory>
      </Directory>
    </Directory>
  </Fragment>

    <Fragment>
        <DirectoryRef Id="MyProgramDir2" />
    </Fragment>
    <Fragment>
        <ComponentGroup Id="NewFilesGroup2">
            <Component Id="cmpB40D9BC07A10F4C7CA1D590EA22BC096" Directory="MyProgramDir2" Guid="6CEF1581-D3B4-43EC-A561-8E35CFD9AB67">
                <File Id="filCD18463F625BD1E6DABFF218E37514D9" KeyPath="yes" Source="$(var.MyDir2)BarcodeScannerPlugin.jar" />
            </Component>
            <Component Id="cmpCEA7123B4B5BD564DC3955797750BDBD" Directory="MyProgramDir2" Guid="0828F282-7F66-4550-9D8B-B9DD914F50BA">
                <File Id="fil1C3696A75F0BD878925FCA64111719CE" KeyPath="yes" Source="$(var.MyDir2)KKSDK.jar" />
            </Component>
            <Component Id="cmp754951538EA86C396458E93F7C5EE8D8" Directory="MyProgramDir2" Guid="83532EF6-0AE6-4B9C-824E-7309E4E97BFA">
                <File Id="fil9EEABE714F6AF741BE3D5AA5B5209994" KeyPath="yes" Source="$(var.MyDir2)SDKTestPlugin.jar" />
            </Component>
            <Component Id="cmp89BABCFC5524994A65C4664EA4FACE6C" Directory="MyProgramDir2" Guid="3C7A05CE-F786-4E23-80B4-2FCB9ABB314C">
                <File Id="fil65C3299403B5E2113A60782D09D56C54" KeyPath="yes" Source="$(var.MyDir2)ProfileManagerPlugin.jar" />
            </Component>
            <Component Id="cmpCB38C422B08F1CA1B1E85B1EA87CC1E6" Directory="MyProgramDir2" Guid="66766CBB-A4CD-46C9-94F5-79410A8981C2">
                <File Id="filC9B025CB143BD34F87C0041C5D550955" KeyPath="yes" Source="$(var.MyDir2)RFIDScannerPlugin.jar" />
            </Component>
            <Component Id="cmp0F9E9EA430641A0340428B2A9E45E672" Directory="MyProgramDir2" Guid="203631E3-581B-49C4-8D38-2B2D1CB9DDCD">
                <File Id="filCA701380AEB33971329784A6C3186684" KeyPath="yes" Source="$(var.MyDir2)WebSocketServerPlugin.jar" />
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

下面是处理与安装程序相关操作的类。

 public class MainViewModel : ViewModelBase
    {
        //constructor
        public MainViewModel(BootstrapperApplication bootstrapper)
        {
            this.IsThinking = false;
            this.Bootstrapper = bootstrapper;
            this.Bootstrapper.ApplyComplete += this.OnApplyComplete;
            this.Bootstrapper.DetectPackageComplete += this.OnDetectPackageComplete;
            this.Bootstrapper.PlanComplete += this.OnPlanComplete;
            this.Bootstrapper.CacheAcquireProgress += (sender, args) =>
            {
                this.cacheProgress = args.OverallPercentage;
                this.Progress = (this.cacheProgress + this.executeProgress) / 2;
            };
            this.Bootstrapper.ExecuteProgress += (sender, args) =>
            {
                this.executeProgress = args.OverallPercentage;
                this.Progress = (this.cacheProgress + this.executeProgress) / 2;
            };
        }
        #region Properties
        private bool installEnabled;
        public bool InstallEnabled
        {
            get { return installEnabled; }
            set
            {
                installEnabled = value;
                RaisePropertyChanged("InstallEnabled");
            }
        }
        private bool uninstallEnabled;
        public bool UninstallEnabled
        {
            get { return uninstallEnabled; }
            set
            {
                uninstallEnabled = value;
                RaisePropertyChanged("UninstallEnabled");
            }
        }
        private bool isThinking;
        public bool IsThinking
        {
            get { return isThinking; }
            set
            {
                isThinking = value;
                RaisePropertyChanged("IsThinking");
            }
        }
        private int progress;
        public int Progress
        {
            get { return progress; }
            set
            {
                this.progress = value;
                RaisePropertyChanged("Progress");
            }
        }
        private int cacheProgress;
        private int executeProgress;
        public BootstrapperApplication Bootstrapper { get; private set; }
        #endregion //Properties
        #region Methods
        public void InstallExecute()
        {
            IsThinking = true;
            Bootstrapper.Engine.Plan(LaunchAction.Install);
        }
        public void UninstallExecute()
        {
            IsThinking = true;
            Bootstrapper.Engine.Plan(LaunchAction.Uninstall);
        }
        public void ExitExecute()
        {
            CustomBA.BootstrapperDispatcher.InvokeShutdown();
        }
        /// <summary>
        /// Method that gets invoked when the Bootstrapper ApplyComplete event is fired.
        /// This is called after a bundle installation has completed. Make sure we updated the view.
        /// </summary>
        private void OnApplyComplete(object sender, ApplyCompleteEventArgs e)
        {
            IsThinking = false;
            InstallEnabled = false;
            UninstallEnabled = false;
            this.Progress = 100;
            ExitExecute();
        }
        /// <summary>
        /// Method that gets invoked when the Bootstrapper DetectPackageComplete event is fired.
        /// Checks the PackageId and sets the installation scenario. The PackageId is the ID
        /// specified in one of the package elements (msipackage, exepackage, msppackage,
        /// msupackage) in the WiX bundle.
        /// </summary>
        private void OnDetectPackageComplete(object sender, DetectPackageCompleteEventArgs e)
        {
            if (e.PackageId == "KubeInstallationPackageId")
            {
                if (e.State == PackageState.Absent)
                    InstallEnabled = true;
                else if (e.State == PackageState.Present)
                    UninstallEnabled = true;
            }
        }
        /// <summary>
        /// Method that gets invoked when the Bootstrapper PlanComplete event is fired.
        /// If the planning was successful, it instructs the Bootstrapper Engine to 
        /// install the packages.
        /// </summary>
        private void OnPlanComplete(object sender, PlanCompleteEventArgs e)
        {
            if (e.Status >= 0)
                Bootstrapper.Engine.Apply(System.IntPtr.Zero);
        }
        #endregion //Methods
        #region RelayCommands
        private RelayCommand installCommand;
        public RelayCommand InstallCommand
        {
            get
            {
                if (installCommand == null)
                    installCommand = new RelayCommand(() => InstallExecute(), () => InstallEnabled == true);
                return installCommand;
            }
        }
        private RelayCommand uninstallCommand;
        public RelayCommand UninstallCommand
        {
            get
            {
                if (uninstallCommand == null)
                    uninstallCommand = new RelayCommand(() => UninstallExecute(), () => UninstallEnabled == true);
                return uninstallCommand;
            }
        }
        private RelayCommand exitCommand;
        public RelayCommand ExitCommand
        {
            get
            {
                if (exitCommand == null)
                    exitCommand = new RelayCommand(() => ExitExecute());
                return exitCommand;
            }
        }
        #endregion //RelayCommands
    }

日志文件1:

[0980:3888][2016-04-22T16:49:18]i001: Burn v3.10.2.2516, Windows v6.3 (Build 9600: Service Pack 0), path: C:ProgramDataPackage Cache{71ae2d4e-5c00-442b-9ea1-00cec549800d}KubePlatformSetup.exe
[0980:3888][2016-04-22T16:49:18]i003: This bundle is being run by a related bundle as type 'Upgrade'.
[0980:3888][2016-04-22T16:49:18]i009: Command Line: '-uninstall -quiet -burn.related.upgrade -burn.ancestors={f57e276b-2b99-4f55-9566-88f47c0a065c} -burn.embedded BurnPipe.{22EB703C-0051-46E7-8B68-BA209900F6F7} {B0B02376-A988-437A-92A4-6116CFBC5526} 13952'
[0980:3888][2016-04-22T16:49:18]i000: Setting string variable 'WixBundleLog' to value 'C:UsersMACILA~1AppDataLocalTempKubePlatformSetup_20160422164918.log'
[0980:3888][2016-04-22T16:49:18]i000: Setting string variable 'WixBundleManufacturer' to value 'Zone24x7'
[0980:3888][2016-04-22T16:49:18]i000: Loading managed bootstrapper application.
[0980:3888][2016-04-22T16:49:18]i000: Creating BA thread to run asynchronously.
[0980:37B4][2016-04-22T16:49:18]i000: Launching custom TestBA UX
[0980:3888][2016-04-22T16:49:19]i100: Detect begin, 2 packages
[0980:3888][2016-04-22T16:49:19]i102: Detected related bundle: {f57e276b-2b99-4f55-9566-88f47c0a065c}, type: Upgrade, scope: PerMachine, version: 1.0.1.0, operation: None
[0980:3888][2016-04-22T16:49:19]i103: Detected related package: {8C442A83-F559-488C-8CC4-21B1626F4B8E}, scope: PerMachine, version: 1.0.1.0, language: 0 operation: Downgrade
[0980:3888][2016-04-22T16:49:19]i103: Detected related package: {8201DD23-40A5-418B-B016-4D29BE6F010B}, scope: PerMachine, version: 1.0.1.0, language: 0 operation: Downgrade
[0980:3888][2016-04-22T16:49:19]i101: Detected package: KubeUpdaterServiceInstallerId, state: Obsolete, cached: Complete
[0980:3888][2016-04-22T16:49:19]i101: Detected package: MosquittoInstallerId, state: Obsolete, cached: Complete
[0980:3888][2016-04-22T16:49:19]i199: Detect complete, result: 0x0
[0980:3888][2016-04-22T16:51:43]i500: Shutting down, exit code: 0x0
[0980:3888][2016-04-22T16:51:43]i410: Variable: WixBundleAction = 3
[0980:3888][2016-04-22T16:51:43]i410: Variable: WixBundleElevated = 1
[0980:3888][2016-04-22T16:51:43]i410: Variable: WixBundleInstalled = 1
[0980:3888][2016-04-22T16:51:43]i410: Variable: WixBundleLastUsedSource = G:ProjectsKube2kube-installerKubePlatformSetupKubePlatformSetupbinRelease
[0980:3888][2016-04-22T16:51:43]i410: Variable: WixBundleLog = C:UsersMACILA~1AppDataLocalTempKubePlatformSetup_20160422164918.log
[0980:3888][2016-04-22T16:51:43]i410: Variable: WixBundleManufacturer = Zone24x7
[0980:3888][2016-04-22T16:51:43]i410: Variable: WixBundleName = KubePlatformSetup
[0980:3888][2016-04-22T16:51:43]i410: Variable: WixBundleOriginalSource = G:ProjectsKube2kube-installerKubePlatformSetupKubePlatformSetupbinReleaseKubePlatformSetup.exe
[0980:3888][2016-04-22T16:51:43]i410: Variable: WixBundleOriginalSourceFolder = G:ProjectsKube2kube-installerKubePlatformSetupKubePlatformSetupbinRelease
[0980:3888][2016-04-22T16:51:43]i410: Variable: WixBundleProviderKey = {71ae2d4e-5c00-442b-9ea1-00cec549800d}
[0980:3888][2016-04-22T16:51:43]i410: Variable: WixBundleTag = 
[0980:3888][2016-04-22T16:51:43]i410: Variable: WixBundleVersion = 1.0.0.0
[0980:3888][2016-04-22T16:51:43]i007: Exit code: 0x0, restarting: No

日志文件2:

[3204:32B0][2016-04-22T16:48:38]i001: Burn v3.10.2.2516, Windows v6.3 (Build 9600: Service Pack 0), path: C:UsersMACILA~1AppDataLocalTemp{E6470133-8EFE-49DE-8561-A335091D3464}.crKubePlatformSetup.exe
[3204:32B0][2016-04-22T16:48:38]i009: Command Line: '-burn.clean.room=G:ProjectsKube2kube-installerKubePlatformSetupKubePlatformSetupbinReleaseKubePlatformSetup.exe'
[3204:32B0][2016-04-22T16:48:38]i000: Setting string variable 'WixBundleOriginalSource' to value 'G:ProjectsKube2kube-installerKubePlatformSetupKubePlatformSetupbinReleaseKubePlatformSetup.exe'
[3204:32B0][2016-04-22T16:48:38]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'G:ProjectsKube2kube-installerKubePlatformSetupKubePlatformSetupbinRelease'
[3204:32B0][2016-04-22T16:48:38]i000: Setting string variable 'WixBundleLog' to value 'C:UsersMACILA~1AppDataLocalTempKubePlatformSetup_20160422164838.log'
[3204:32B0][2016-04-22T16:48:38]i000: Setting string variable 'WixBundleName' to value 'KubePlatformSetup'
[3204:32B0][2016-04-22T16:48:38]i000: Setting string variable 'WixBundleManufacturer' to value 'Zone24x7'
[3204:32B0][2016-04-22T16:48:38]i000: Loading managed bootstrapper application.
[3204:32B0][2016-04-22T16:48:38]i000: Creating BA thread to run asynchronously.
[3204:3A5C][2016-04-22T16:48:38]i000: Launching custom TestBA UX
[3204:32B0][2016-04-22T16:48:39]i100: Detect begin, 2 packages
[3204:32B0][2016-04-22T16:48:39]i102: Detected related bundle: {71ae2d4e-5c00-442b-9ea1-00cec549800d}, type: Upgrade, scope: PerMachine, version: 1.0.0.0, operation: MajorUpgrade
[3204:32B0][2016-04-22T16:48:39]i103: Detected related package: {398C5992-4E70-4844-8063-48639892BACF}, scope: PerMachine, version: 1.0.0.0, language: 0 operation: MajorUpgrade
[3204:32B0][2016-04-22T16:48:39]i103: Detected related package: {392D3E7F-6FCB-4EFD-A40F-B2F7C2CB6D44}, scope: PerMachine, version: 1.0.0.0, language: 0 operation: MajorUpgrade
[3204:32B0][2016-04-22T16:48:39]i101: Detected package: KubeUpdaterServiceInstallerId, state: Absent, cached: None
[3204:32B0][2016-04-22T16:48:39]i101: Detected package: MosquittoInstallerId, state: Absent, cached: None
[3204:32B0][2016-04-22T16:48:39]i199: Detect complete, result: 0x0
[3204:32B0][2016-04-22T16:48:40]i200: Plan begin, 2 packages, action: Install
[3204:32B0][2016-04-22T16:48:40]i000: Setting string variable 'WixBundleRollbackLog_KubeUpdaterServiceInstallerId' to value 'C:UsersMACILA~1AppDataLocalTempKubePlatformSetup_20160422164838_000_KubeUpdaterServiceInstallerId_rollback.log'
[3204:32B0][2016-04-22T16:48:40]i000: Setting string variable 'WixBundleLog_KubeUpdaterServiceInstallerId' to value 'C:UsersMACILA~1AppDataLocalTempKubePlatformSetup_20160422164838_000_KubeUpdaterServiceInstallerId.log'
[3204:32B0][2016-04-22T16:48:40]i000: Setting string variable 'WixBundleRollbackLog_MosquittoInstallerId' to value 'C:UsersMACILA~1AppDataLocalTempKubePlatformSetup_20160422164838_001_MosquittoInstallerId_rollback.log'
[3204:32B0][2016-04-22T16:48:40]i000: Setting string variable 'WixBundleLog_MosquittoInstallerId' to value 'C:UsersMACILA~1AppDataLocalTempKubePlatformSetup_20160422164838_001_MosquittoInstallerId.log'
[3204:32B0][2016-04-22T16:48:40]i201: Planned package: KubeUpdaterServiceInstallerId, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register
[3204:32B0][2016-04-22T16:48:40]i201: Planned package: MosquittoInstallerId, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register
[3204:32B0][2016-04-22T16:48:40]i207: Planned related bundle: {71ae2d4e-5c00-442b-9ea1-00cec549800d}, type: Upgrade, default requested: Absent, ba requested: Absent, execute: Uninstall, rollback: Install, dependency: None
[3204:32B0][2016-04-22T16:48:40]i299: Plan complete, result: 0x0
[3204:32B0][2016-04-22T16:48:40]i300: Apply begin
[3204:32B0][2016-04-22T16:48:40]i010: Launching elevated engine process.
[3204:32B0][2016-04-22T16:48:40]i011: Launched elevated engine process.
[3204:32B0][2016-04-22T16:48:40]i012: Connected to elevated engine.
[3680:38D0][2016-04-22T16:48:40]i358: Pausing automatic updates.
[3680:38D0][2016-04-22T16:48:40]i359: Paused automatic updates.
[3680:38D0][2016-04-22T16:48:40]i360: Creating a system restore point.
[3680:38D0][2016-04-22T16:48:40]i361: Created a system restore point.
[3680:38D0][2016-04-22T16:48:40]i370: Session begin, registration key: SOFTWAREMicrosoftWindowsCurrentVersionUninstall{f57e276b-2b99-4f55-9566-88f47c0a065c}, options: 0x7, disable resume: No
[3680:38D0][2016-04-22T16:48:40]i000: Caching bundle from: 'C:UsersMACILA~1AppDataLocalTemp{89CCD5C8-EB48-4FB3-8FB5-32FC9EEAB83F}.beKubePlatformSetup.exe' to: 'C:ProgramDataPackage Cache{f57e276b-2b99-4f55-9566-88f47c0a065c}KubePlatformSetup.exe'
[3680:38D0][2016-04-22T16:48:40]i320: Registering bundle dependency provider: {f57e276b-2b99-4f55-9566-88f47c0a065c}, version: 1.0.1.0
[3680:38D0][2016-04-22T16:48:40]i371: Updating session, registration key: SOFTWAREMicrosoftWindowsCurrentVersionUninstall{f57e276b-2b99-4f55-9566-88f47c0a065c}, resume: Active, restart initiated: No, disable resume: No
[3204:2B40][2016-04-22T16:48:40]i336: Acquiring container: WixAttachedContainer, copy from: G:ProjectsKube2kube-installerKubePlatformSetupKubePlatformSetupbinReleaseKubePlatformSetup.exe
[3204:2B40][2016-04-22T16:48:40]i000: Setting string variable 'WixBundleLastUsedSource' to value 'G:ProjectsKube2kube-installerKubePlatformSetupKubePlatformSetupbinRelease'
[3680:350C][2016-04-22T16:48:40]i305: Verified acquired payload: KubeUpdaterServiceInstallerId at path: C:ProgramDataPackage Cache.unverifiedKubeUpdaterServiceInstallerId, moving to: C:ProgramDataPackage Cache{8C442A83-F559-488C-8CC4-21B1626F4B8E}v1.0.1.0KubeUpdaterServiceInstaller.msi.
[3680:350C][2016-04-22T16:48:40]i305: Verified acquired payload: cabDF68CF429512A78026D040F0FB13A50B at path: C:ProgramDataPackage Cache.unverifiedcabDF68CF429512A78026D040F0FB13A50B, moving to: C:ProgramDataPackage Cache{8C442A83-F559-488C-8CC4-21B1626F4B8E}v1.0.1.0cab1.cab.
[3680:350C][2016-04-22T16:48:40]i305: Verified acquired payload: MosquittoInstallerId at path: C:ProgramDataPackage Cache.unverifiedMosquittoInstallerId, moving to: C:ProgramDataPackage Cache{8201DD23-40A5-418B-B016-4D29BE6F010B}v1.0.1.0MosquittoInstaller.msi.
[3680:350C][2016-04-22T16:48:40]i305: Verified acquired payload: cab657E45B8C9A7EF24C9A74563C2FA6EB3 at path: C:ProgramDataPackage Cache.unverifiedcab657E45B8C9A7EF24C9A74563C2FA6EB3, moving to: C:ProgramDataPackage Cache{8201DD23-40A5-418B-B016-4D29BE6F010B}v1.0.1.0cab1.cab.
[3680:38D0][2016-04-22T16:48:40]i323: Registering package dependency provider: {8C442A83-F559-488C-8CC4-21B1626F4B8E}, version: 1.0.1.0, package: KubeUpdaterServiceInstallerId
[3680:38D0][2016-04-22T16:48:40]i301: Applying execute package: KubeUpdaterServiceInstallerId, action: Install, path: C:ProgramDataPackage Cache{8C442A83-F559-488C-8CC4-21B1626F4B8E}v1.0.1.0KubeUpdaterServiceInstaller.msi, arguments: ' ARPSYSTEMCOMPONENT="1" MSIFASTINSTALL="7" INSTALLLOCATION="G:"'
[3204:32B0][2016-04-22T16:49:17]i319: Applied execute package: KubeUpdaterServiceInstallerId, result: 0x0, restart: None
[3680:38D0][2016-04-22T16:49:17]i325: Registering dependency: {f57e276b-2b99-4f55-9566-88f47c0a065c} on package provider: {8C442A83-F559-488C-8CC4-21B1626F4B8E}, package: KubeUpdaterServiceInstallerId
[3680:38D0][2016-04-22T16:49:17]i323: Registering package dependency provider: {8201DD23-40A5-418B-B016-4D29BE6F010B}, version: 1.0.1.0, package: MosquittoInstallerId
[3680:38D0][2016-04-22T16:49:17]i301: Applying execute package: MosquittoInstallerId, action: Install, path: C:ProgramDataPackage Cache{8201DD23-40A5-418B-B016-4D29BE6F010B}v1.0.1.0MosquittoInstaller.msi, arguments: ' ARPSYSTEMCOMPONENT="1" MSIFASTINSTALL="7" INSTALLLOCATION="G:"'
[3204:32B0][2016-04-22T16:49:18]i319: Applied execute package: MosquittoInstallerId, result: 0x0, restart: None
[3680:38D0][2016-04-22T16:49:18]i325: Registering dependency: {f57e276b-2b99-4f55-9566-88f47c0a065c} on package provider: {8201DD23-40A5-418B-B016-4D29BE6F010B}, package: MosquittoInstallerId
[3680:38D0][2016-04-22T16:49:18]i301: Applying execute package: {71ae2d4e-5c00-442b-9ea1-00cec549800d}, action: Uninstall, path: C:ProgramDataPackage Cache{71ae2d4e-5c00-442b-9ea1-00cec549800d}KubePlatformSetup.exe, arguments: '"C:ProgramDataPackage Cache{71ae2d4e-5c00-442b-9ea1-00cec549800d}KubePlatformSetup.exe" -uninstall -quiet -burn.related.upgrade -burn.ancestors={f57e276b-2b99-4f55-9566-88f47c0a065c}'
[3204:32B0][2016-04-22T16:51:43]i319: Applied execute package: {71ae2d4e-5c00-442b-9ea1-00cec549800d}, result: 0x0, restart: None
[3680:38D0][2016-04-22T16:51:43]i372: Session end, registration key: SOFTWAREMicrosoftWindowsCurrentVersionUninstall{f57e276b-2b99-4f55-9566-88f47c0a065c}, resume: ARP, restart: None, disable resume: No
[3680:38D0][2016-04-22T16:51:43]i371: Updating session, registration key: SOFTWAREMicrosoftWindowsCurrentVersionUninstall{f57e276b-2b99-4f55-9566-88f47c0a065c}, resume: ARP, restart initiated: No, disable resume: No
[3204:32B0][2016-04-22T16:51:43]i399: Apply complete, result: 0x0, restart: None, ba requested restart:  No
[3204:32B0][2016-04-22T16:51:43]i500: Shutting down, exit code: 0x0
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleAction = 5
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleElevated = 1
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleLastUsedSource = G:ProjectsKube2kube-installerKubePlatformSetupKubePlatformSetupbinRelease
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleLog = C:UsersMACILA~1AppDataLocalTempKubePlatformSetup_20160422164838.log
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleLog_KubeUpdaterServiceInstallerId = C:UsersMACILA~1AppDataLocalTempKubePlatformSetup_20160422164838_000_KubeUpdaterServiceInstallerId.log
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleLog_MosquittoInstallerId = C:UsersMACILA~1AppDataLocalTempKubePlatformSetup_20160422164838_001_MosquittoInstallerId.log
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleManufacturer = Zone24x7
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleName = KubePlatformSetup
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleOriginalSource = G:ProjectsKube2kube-installerKubePlatformSetupKubePlatformSetupbinReleaseKubePlatformSetup.exe
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleOriginalSourceFolder = G:ProjectsKube2kube-installerKubePlatformSetupKubePlatformSetupbinRelease
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleProviderKey = {f57e276b-2b99-4f55-9566-88f47c0a065c}
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleRollbackLog_KubeUpdaterServiceInstallerId = C:UsersMACILA~1AppDataLocalTempKubePlatformSetup_20160422164838_000_KubeUpdaterServiceInstallerId_rollback.log
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleRollbackLog_MosquittoInstallerId = C:UsersMACILA~1AppDataLocalTempKubePlatformSetup_20160422164838_001_MosquittoInstallerId_rollback.log
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleSourceProcessFolder = G:ProjectsKube2kube-installerKubePlatformSetupKubePlatformSetupbinRelease
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleSourceProcessPath = G:ProjectsKube2kube-installerKubePlatformSetupKubePlatformSetupbinReleaseKubePlatformSetup.exe
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleTag = 
[3204:32B0][2016-04-22T16:51:43]i410: Variable: WixBundleVersion = 1.0.1.0
[3204:32B0][2016-04-22T16:51:43]i007: Exit code: 0x0, restarting: No

我至少找到了解决方案。我不得不挂接DetectComplete方法,并在Engine上调用plan方法。以下是我的做法。

void DetectComplete(object sender, DetectCompleteEventArgs e)
    {
        Bootstrapper.Engine.Log(LogLevel.Verbose,"fired! but does that give you any clue?! idiot!");
        if (LaunchAction.Uninstall == Bootstrapper.Command.Action)
        {
            Bootstrapper.Engine.Log(LogLevel.Verbose, "Invoking automatic plan for uninstall");
            Bootstrapper.Engine.Plan(LaunchAction.Uninstall);
        } 
    }

从日志中我看到了一些事情。

关于升级,它似乎正确地检测到了所有的包并对其进行了正确的规划。

这两个安装程序包是作为主要升级安装的,相关的捆绑包(正在升级的捆绑包)也被检测到并运行以卸载它。

所有的问题似乎都来自于您对上一个捆绑包的卸载。

您标记为"日志文件1"的日志实际上是当您的升级重新运行当前安装的引导程序以将其删除时的日志。我看到的问题就在这里:

[0980:3888][2016-04-22T16:49:19]i100: Detect begin, 2 packages
[0980:3888][2016-04-22T16:49:19]i102: Detected related bundle: {f57e276b-2b99-4f55-9566-88f47c0a065c}, type: Upgrade, scope: PerMachine, version: 1.0.1.0, operation: None
[0980:3888][2016-04-22T16:49:19]i103: Detected related package: {8C442A83-F559-488C-8CC4-21B1626F4B8E}, scope: PerMachine, version: 1.0.1.0, language: 0 operation: Downgrade
[0980:3888][2016-04-22T16:49:19]i103: Detected related package: {8201DD23-40A5-418B-B016-4D29BE6F010B}, scope: PerMachine, version: 1.0.1.0, language: 0 operation: Downgrade
[0980:3888][2016-04-22T16:49:19]i101: Detected package: KubeUpdaterServiceInstallerId, state: Obsolete, cached: Complete
[0980:3888][2016-04-22T16:49:19]i101: Detected package: MosquittoInstallerId, state: Obsolete, cached: Complete
[0980:3888][2016-04-22T16:49:19]i199: Detect complete, result: 0x0
[0980:3888][2016-04-22T16:51:43]i500: Shutting down, exit code: 0x0

所有刻录引导程序所需的过程是执行检测阶段、计划阶段和应用阶段。

由于某种原因,当由相关捆绑包运行时,您的卸载在检测阶段后刚刚停止。

我还怀疑你的机器现在可能处于一种奇怪的状态。我想你已经安装了几个,但隐藏在添加-删除程序列表中,安装了KubeUpdaterServiceInstaller和MosquittInstaller。

我要做的第一件事是停止在构建/开发机器上安装任何东西。在编写安装程序时,会犯错误,并导致机器处于奇怪的状态,无法知道上面安装了什么和没有安装什么。我建议使用虚拟环境进行所有安装程序测试。当你把事情搞砸了,你可以很容易地恢复到干净的状态,然后重新开始测试。如果你使用的是虚拟环境,那么忽略这一段——你做得对——但要确保在测试更改和升级之前清理干净所有内容。

在你的MSI wix中,我建议你使用"*"作为产品Id,这样你就不必每次构建都更改它。

<Product Id="*" Name="Installer" Language="1033" Version="1.0.0.0" Manufacturer="Zone24x7" UpgradeCode="E90569B5-372E-45BB-B101-58E0B75AB5C7">

在您的主要升级元素中添加AllowSameVersionUpgrades="yes"

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="yes" />

因此,您不必每次测试升级时都更新版本,只需重新生成msi安装程序即可。

作为参考,以下是我的引导程序应用程序的引导程序升级日志,以及它删除旧安装时的日志。注意的一些差异

升级安装

当它重新运行旧安装以删除时

升级日志看起来与您的日志基本相同,这很好,但重新运行以卸载日志有一些不同。如果没有基本上看到你的整个代码库(我没有时间或意愿这样做),我不完全确定如何解决这些问题,但希望这个答案中的一些东西能帮助你。

相关内容

  • 没有找到相关文章

最新更新