更新安装的应用程序后如何停止机器重启? Wix安装程序

时间:2016-04-07 13:14:54

标签: .net wix windows-installer restart wixsharp

我有一个带有自定义操作的wixsharp安装程序(我在任务计划程序中启动和停止任务并删除我的自定义证书)。

如果我安装,卸载或修复当前版本,那么一切正常。 但是,如果我只是更改(增加)安装程序的版本以进行更新,安装程序将在安装过程完成后重新启动计算机(如果已完成)并按下完成(更新)按钮。

如何停止此“强制重启”?

几个星期前出现了这个问题,原因可能是Windows的某些更新。因为安装程序已经过时,并且自2015年12月以来没有任何更改。 我不知道如何阻止它。

      <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
 <Product Id="0474c71c-4d9c-4610-94a8-e7662f4179a3" Name="Solid Commerce Label Printing Client" Language="1033" Codepage="Windows-1252" Version="11.22.15" UpgradeCode="51b65f41-9ea9-4a11-b32b-fcb9fda5599e" Manufacturer="Solid Commerce">
 <Package InstallerVersion="200" Compressed="yes" SummaryCodepage="Windows-1252" Languages="1033" />
 <Media Id="1" Cabinet="My_Commerce_Label_Printing_Client.cab" EmbedCab="yes" />

 <Condition Message="Please install the appropriate .NET version first."><![CDATA[NETFRAMEWORK45 >= "#378389"]]></Condition>

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder" Name="ProgramFilesFolder">
    <Directory Id="ProgramFilesFolder.My_Commerce" Name="Solid Commerce">
      <Directory Id="INSTALLDIR" Name="Solid Commerce Label Printing Client">

        <Component Id="Component.MC.Shipping.PrintingAgent.exe" Guid="0474c71c-4d9c-4610-94a8-e766aca086d5">
          <File Id="MC.Shipping.PrintingAgent.exe" Source="bin\Debug\MC.Shipping.PrintingAgent.exe">
            <Shortcut Id="Shortcut.MC.Shipping.PrintingAgent.exe.My_Commerce_Label_Printing_Client" WorkingDirectory="ProgramMenuFolder.My_Commerce.My_Commerce_Label_Printing_Client" Directory="ProgramMenuFolder.My_Commerce.My_Commerce" Name="Solid Commerce Label Printing Client.lnk" Icon="IconFile1_LD.ICO" IconIndex="0" />
          </File>

          <RegistryKey Root="HKCU" Key="Software\WixSharp\Used">
            <RegistryValue Value="0" Type="string" KeyPath="yes" />
          </RegistryKey>
        </Component>

        <Component Id="Component.App.config" Guid="0474c71c-4d9c-4610-94a8-e766cb4267c3">
          <File Id="App.config" Source="bin\Debug\App.config" />
        </Component>

        <Component Id="Component.BootstrapperCore.dll" Guid="0474c71c-4d9c-4610-94a8-e7666542b4ca">
          <File Id="BootstrapperCore.dll" Source="bin\Debug\BootstrapperCore.dll" />
        </Component>

        <Component Id="Component.CsvHelper.dll" Guid="0474c71c-4d9c-4610-94a8-e7668a73f622">
          <File Id="CsvHelper.dll" Source="bin\Debug\CsvHelper.dll" />
        </Component>

        <Component Id="Component.DYMO.Common.dll" Guid="0474c71c-4d9c-4610-94a8-e766ec78d613">
          <File Id="DYMO.Common.dll" Source="bin\Debug\DYMO.Common.dll" />
        </Component>

        <Component Id="Component.DYMO.DLS.Runtime.dll" Guid="0474c71c-4d9c-4610-94a8-e766be9b746f">
          <File Id="DYMO.DLS.Runtime.dll" Source="bin\Debug\DYMO.DLS.Runtime.dll" />
        </Component>

        <Component Id="Component.DYMO.Label.Framework.dll" Guid="0474c71c-4d9c-4610-94a8-e7660e7e50c6">
          <File Id="DYMO.Label.Framework.dll" Source="bin\Debug\DYMO.Label.Framework.dll" />
        </Component>

        <Component Id="Component.InvertedSoftware.DataBlock.dll" Guid="0474c71c-4d9c-4610-94a8-e76618c67a66">
          <File Id="InvertedSoftware.DataBlock.dll" Source="bin\Debug\InvertedSoftware.DataBlock.dll" />
        </Component>

        <Component Id="Component.Ionic.Zip.dll" Guid="0474c71c-4d9c-4610-94a8-e766c4b64554">
          <File Id="Ionic.Zip.dll" Source="bin\Debug\Ionic.Zip.dll" />
        </Component>

        <Component Id="Component.KafkaNET.Library.dll" Guid="0474c71c-4d9c-4610-94a8-e7664d8e8cc7">
          <File Id="KafkaNET.Library.dll" Source="bin\Debug\KafkaNET.Library.dll" />
        </Component>

        <Component Id="Component.localhost.pfx" Guid="0474c71c-4d9c-4610-94a8-e76623eb272d">
          <File Id="localhost.pfx" Source="bin\Debug\localhost.pfx" />
        </Component>

        <Component Id="Component.log4net.dll" Guid="0474c71c-4d9c-4610-94a8-e7665d038b68">
          <File Id="log4net.dll" Source="bin\Debug\log4net.dll" />
        </Component>

        <Component Id="Component.ManagedActionsFactory.cs" Guid="0474c71c-4d9c-4610-94a8-e766d7c98a1f">
          <File Id="ManagedActionsFactory.cs" Source="bin\Debug\ManagedActionsFactory.cs" />
        </Component>

        <Component Id="Component.Microsoft.AspNet.Identity.Core.dll" Guid="0474c71c-4d9c-4610-94a8-e7661c25b613">
          <File Id="Microsoft.AspNet.Identity.Core.dll" Source="bin\Debug\Microsoft.AspNet.Identity.Core.dll" />
        </Component>

        <Component Id="Component.Microsoft.AspNet.SignalR.Client.dll" Guid="0474c71c-4d9c-4610-94a8-e7661f83f5d7">
          <File Id="Microsoft.AspNet.SignalR.Client.dll" Source="bin\Debug\Microsoft.AspNet.SignalR.Client.dll" />
        </Component>

        <Component Id="Component.Microsoft.AspNet.SignalR.Core.dll" Guid="0474c71c-4d9c-4610-94a8-e76602609497">
          <File Id="Microsoft.AspNet.SignalR.Core.dll" Source="bin\Debug\Microsoft.AspNet.SignalR.Core.dll" />
        </Component>

        <Component Id="Component.Microsoft.Deployment.WindowsInstaller.dll" Guid="0474c71c-4d9c-4610-94a8-e766d14bdace">
          <File Id="Microsoft.Deployment.WindowsInstaller.dll" Source="bin\Debug\Microsoft.Deployment.WindowsInstaller.dll" />
        </Component>

        <Component Id="Component.Microsoft.Owin.Cors.dll" Guid="0474c71c-4d9c-4610-94a8-e76623b3c53a">
          <File Id="Microsoft.Owin.Cors.dll" Source="bin\Debug\Microsoft.Owin.Cors.dll" />
        </Component>

        <Component Id="Component.Microsoft.Owin.Diagnostics.dll" Guid="0474c71c-4d9c-4610-94a8-e766696412b9">
          <File Id="Microsoft.Owin.Diagnostics.dll" Source="bin\Debug\Microsoft.Owin.Diagnostics.dll" />
        </Component>

        <Component Id="Component.Microsoft.Owin.dll" Guid="0474c71c-4d9c-4610-94a8-e7669f938256">
          <File Id="Microsoft.Owin.dll" Source="bin\Debug\Microsoft.Owin.dll" />
        </Component>

        <Component Id="Component.Microsoft.Owin.Host.HttpListener.dll" Guid="0474c71c-4d9c-4610-94a8-e76651f84ae1">
          <File Id="Microsoft.Owin.Host.HttpListener.dll" Source="bin\Debug\Microsoft.Owin.Host.HttpListener.dll" />
        </Component>

        <Component Id="Component.Microsoft.Owin.Hosting.dll" Guid="0474c71c-4d9c-4610-94a8-e766a88f29cf">
          <File Id="Microsoft.Owin.Hosting.dll" Source="bin\Debug\Microsoft.Owin.Hosting.dll" />
        </Component>

        <Component Id="Component.Microsoft.Owin.Security.dll" Guid="0474c71c-4d9c-4610-94a8-e7669f751290">
          <File Id="Microsoft.Owin.Security.dll" Source="bin\Debug\Microsoft.Owin.Security.dll" />
        </Component>

        <Component Id="Component.Microsoft.Win32.TaskScheduler.dll" Guid="0474c71c-4d9c-4610-94a8-e766b439958c">
          <File Id="Microsoft.Win32.TaskScheduler.dll" Source="bin\Debug\Microsoft.Win32.TaskScheduler.dll" />
        </Component>

        <Component Id="Component.Newtonsoft.Json.dll" Guid="0474c71c-4d9c-4610-94a8-e7660c3af47e">
          <File Id="Newtonsoft.Json.dll" Source="bin\Debug\Newtonsoft.Json.dll" />
        </Component>

        <Component Id="Component.NLog.dll" Guid="0474c71c-4d9c-4610-94a8-e766900cfbb3">
          <File Id="NLog.dll" Source="bin\Debug\NLog.dll" />
        </Component>

        <Component Id="Component.Owin.dll" Guid="0474c71c-4d9c-4610-94a8-e766feffdd4c">
          <File Id="Owin.dll" Source="bin\Debug\Owin.dll" />
        </Component>

        <Component Id="Component.packages.config" Guid="0474c71c-4d9c-4610-94a8-e766a1415114">
          <File Id="packages.config" Source="bin\Debug\packages.config" />
        </Component>

        <Component Id="Component.ProductInfo.cs" Guid="0474c71c-4d9c-4610-94a8-e7669a169da7">
          <File Id="ProductInfo.cs" Source="bin\Debug\ProductInfo.cs" />
        </Component>

        <Component Id="Component.protobuf_net.dll" Guid="0474c71c-4d9c-4610-94a8-e76686082588">
          <File Id="protobuf_net.dll" Source="bin\Debug\protobuf-net.dll" />
        </Component>

        <Component Id="Component.PWDTK.dll" Guid="0474c71c-4d9c-4610-94a8-e7661a049745">
          <File Id="PWDTK.dll" Source="bin\Debug\PWDTK.dll" />
        </Component>

        <Component Id="Component.RestSharp.dll" Guid="0474c71c-4d9c-4610-94a8-e766478d856e">
          <File Id="RestSharp.dll" Source="bin\Debug\RestSharp.dll" />
        </Component>

        <Component Id="Component.RootCASolidShipPrinting.cer" Guid="0474c71c-4d9c-4610-94a8-e76634f37701">
          <File Id="RootCASolidShipPrinting.cer" Source="bin\Debug\RootCASolidShipPrinting.cer" />
        </Component>

        <Component Id="Component.MC.Common.dll" Guid="0474c71c-4d9c-4610-94a8-e766d42ec867">
          <File Id="MC.Common.dll" Source="bin\Debug\MC.Common.dll" />
        </Component>

        <Component Id="Component.MC.Common.Logging.dll" Guid="0474c71c-4d9c-4610-94a8-e76632294532">
          <File Id="MC.Common.Logging.dll" Source="bin\Debug\MC.Common.Logging.dll" />
        </Component>

        <Component Id="Component.MC.DataObjects.dll" Guid="0474c71c-4d9c-4610-94a8-e76632395c24">
          <File Id="MC.DataObjects.dll" Source="bin\Debug\MC.DataObjects.dll" />
        </Component>

        <Component Id="Component.MC.Services.ConfigurationService.dll" Guid="0474c71c-4d9c-4610-94a8-e7661a73d488">
          <File Id="MC.Services.ConfigurationService.dll" Source="bin\Debug\MC.Services.ConfigurationService.dll" />
        </Component>

        <Component Id="Component.MC.Services.Logging.dll" Guid="0474c71c-4d9c-4610-94a8-e7662d7bc9de">
          <File Id="MC.Services.Logging.dll" Source="bin\Debug\MC.Services.Logging.dll" />
        </Component>

        <Component Id="Component.MC.Shipping.Models.dll" Guid="0474c71c-4d9c-4610-94a8-e766607f0940">
          <File Id="MC.Shipping.Models.dll" Source="bin\Debug\MC.Shipping.Models.dll" />
        </Component>

        <Component Id="Component.MC.Shipping.PrintingAgent.exe.config" Guid="0474c71c-4d9c-4610-94a8-e766206d203d">
          <File Id="MC.Shipping.PrintingAgent.exe.config" Source="bin\Debug\MC.Shipping.PrintingAgent.exe.config" />
        </Component>

        <Component Id="Component.MC.Utilities.dll" Guid="0474c71c-4d9c-4610-94a8-e7667201aa97">
          <File Id="MC.Utilities.dll" Source="bin\Debug\MC.Utilities.dll" />
        </Component>

        <Component Id="Component.ServiceStack.Text.dll" Guid="0474c71c-4d9c-4610-94a8-e766e92c2ac8">
          <File Id="ServiceStack.Text.dll" Source="bin\Debug\ServiceStack.Text.dll" />
        </Component>

        <Component Id="Component.Setup.cs" Guid="0474c71c-4d9c-4610-94a8-e766e70476e8">
          <File Id="Setup.cs" Source="bin\Debug\Setup.cs" />
        </Component>

        <Component Id="Component.SignMsiInfo.cs" Guid="0474c71c-4d9c-4610-94a8-e766d8da6b84">
          <File Id="SignMsiInfo.cs" Source="bin\Debug\SignMsiInfo.cs" />
        </Component>

        <Component Id="Component.My_Commerce_Label_Printing_Client.dialog_banner.png" Guid="0474c71c-4d9c-4610-94a8-e766a0d67bd6">
          <File Id="My_Commerce_Label_Printing_Client.dialog_banner.png" Source="bin\Debug\Solid Commerce Label Printing Client.dialog_banner.png" />
        </Component>

        <Component Id="Component.My_Commerce_Label_Printing_Client.dialog_bmp.png" Guid="0474c71c-4d9c-4610-94a8-e7669fb3610c">
          <File Id="My_Commerce_Label_Printing_Client.dialog_bmp.png" Source="bin\Debug\Solid Commerce Label Printing Client.dialog_bmp.png" />
        </Component>

        <Component Id="Component.My_Commerce_Label_Printing_Client.licence.rtf" Guid="0474c71c-4d9c-4610-94a8-e766d85114cc">
          <File Id="My_Commerce_Label_Printing_Client.licence.rtf" Source="bin\Debug\Solid Commerce Label Printing Client.licence.rtf" />
        </Component>

        <Component Id="Component.My_Commerce_Label_Printing_Client.wxl" Guid="0474c71c-4d9c-4610-94a8-e766f6dabd75">
          <File Id="My_Commerce_Label_Printing_Client.wxl" Source="bin\Debug\Solid Commerce Label Printing Client.wxl" />
        </Component>

        <Component Id="Component.MyCommerceCodeSigningCert.pfx" Guid="0474c71c-4d9c-4610-94a8-e7669821ee6c">
          <File Id="MyCommerceCodeSigningCert.pfx" Source="bin\Debug\MyCommerceCodeSigningCert.pfx" />
        </Component>

        <Component Id="Component.StackExchange.Redis.dll" Guid="0474c71c-4d9c-4610-94a8-e76687fb70b0">
          <File Id="StackExchange.Redis.dll" Source="bin\Debug\StackExchange.Redis.dll" />
        </Component>

        <Component Id="Component.System.Web.Cors.dll" Guid="0474c71c-4d9c-4610-94a8-e766becff917">
          <File Id="System.Web.Cors.dll" Source="bin\Debug\System.Web.Cors.dll" />
        </Component>

        <Component Id="Component.Topshelf.dll" Guid="0474c71c-4d9c-4610-94a8-e76659aae5c2">
          <File Id="Topshelf.dll" Source="bin\Debug\Topshelf.dll" />
        </Component>

        <Component Id="Component.Topshelf.NLog.dll" Guid="0474c71c-4d9c-4610-94a8-e76604432317">
          <File Id="Topshelf.NLog.dll" Source="bin\Debug\Topshelf.NLog.dll" />
        </Component>

        <Component Id="Component.WixSharp.dll" Guid="0474c71c-4d9c-4610-94a8-e7662373a22e">
          <File Id="WixSharp.dll" Source="bin\Debug\WixSharp.dll" />
        </Component>

        <Component Id="Component.WixSharp.UI.dll" Guid="0474c71c-4d9c-4610-94a8-e76697b62e76">
          <File Id="WixSharp.UI.dll" Source="bin\Debug\WixSharp.UI.dll" />
        </Component>

        <Component Id="Component.WixSharpSetup.exe" Guid="0474c71c-4d9c-4610-94a8-e76668583d9d">
          <File Id="WixSharpSetup.exe" Source="bin\Debug\WixSharpSetup.exe" />
        </Component>

        <Component Id="Component.WixSharpSetup.exe.config" Guid="0474c71c-4d9c-4610-94a8-e7665a76b646">
          <File Id="WixSharpSetup.exe.config" Source="bin\Debug\WixSharpSetup.exe.config" />
        </Component>

        <Component Id="Component.ZooKeeperNet.dll" Guid="0474c71c-4d9c-4610-94a8-e766dd894126">
          <File Id="ZooKeeperNet.dll" Source="bin\Debug\ZooKeeperNet.dll" />
        </Component>

        <Component Id="Uninstall_My_Commerce_Label_Printing_Client" Guid="0474c71c-4d9c-4610-94a8-e766ad69068e">
          <Shortcut Id="INSTALLDIR.Uninstall_My_Commerce_Label_Printing_Client" WorkingDirectory="System64Folder" Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]" Name="Uninstall Solid Commerce Label Printing Client.lnk" />

          <RegistryKey Root="HKCU" Key="Software\WixSharp\Used">
            <RegistryValue Value="0" Type="string" KeyPath="yes" />
          </RegistryKey>
        </Component>

        <Directory Id="INSTALLDIR.CustomInstallationLogic" Name="CustomInstallationLogic">

          <Component Id="Component.CustomActions.cs" Guid="0474c71c-4d9c-4610-94a8-e7664573f55c">
            <File Id="CustomActions.cs" Source="bin\Debug\CustomInstallationLogic\CustomActions.cs" />
          </Component>

          <Component Id="Component.ErrorMessage.cs" Guid="0474c71c-4d9c-4610-94a8-e766ac48fa20">
            <File Id="ErrorMessage.cs" Source="bin\Debug\CustomInstallationLogic\ErrorMessage.cs" />
          </Component>

          <Component Id="Component.HttpsConfigurator.cs" Guid="0474c71c-4d9c-4610-94a8-e76645a7c4bb">
            <File Id="HttpsConfigurator.cs" Source="bin\Debug\CustomInstallationLogic\HttpsConfigurator.cs" />
          </Component>

          <Component Id="Component.InstallationStatusService.cs" Guid="0474c71c-4d9c-4610-94a8-e766433131b7">
            <File Id="InstallationStatusService.cs" Source="bin\Debug\CustomInstallationLogic\InstallationStatusService.cs" />
          </Component>

          <Component Id="Component.SolidShipPrintingStarterService.cs" Guid="0474c71c-4d9c-4610-94a8-e7662049c8e0">
            <File Id="SolidShipPrintingStarterService.cs" Source="bin\Debug\CustomInstallationLogic\SolidShipPrintingStarterService.cs" />
          </Component>

        </Directory>

        <Directory Id="INSTALLDIR.de" Name="de">

          <Component Id="Component.Microsoft.Win32.TaskScheduler.resources.dll" Guid="0474c71c-4d9c-4610-94a8-e766138f4026">
            <File Id="Microsoft.Win32.TaskScheduler.resources.dll" Source="bin\Debug\de\Microsoft.Win32.TaskScheduler.resources.dll" />
          </Component>

        </Directory>

        <Directory Id="INSTALLDIR.DymoLabels" Name="DymoLabels">

          <Component Id="Component.Horizontal.label" Guid="0474c71c-4d9c-4610-94a8-e7662b9ab10d">
            <File Id="Horizontal.label" Source="bin\Debug\DymoLabels\Horizontal.label" />
          </Component>

          <Component Id="Component.Vertical.label" Guid="0474c71c-4d9c-4610-94a8-e766a7a6cfcd">
            <File Id="Vertical.label" Source="bin\Debug\DymoLabels\Vertical.label" />
          </Component>

        </Directory>

        <Directory Id="INSTALLDIR.es" Name="es">

          <Component Id="Component.Microsoft.Win32.TaskScheduler.resources.dll.1" Guid="0474c71c-4d9c-4610-94a8-e76664aa5eca">
            <File Id="Microsoft.Win32.TaskScheduler.resources.dll.1" Source="bin\Debug\es\Microsoft.Win32.TaskScheduler.resources.dll" />
          </Component>

        </Directory>

        <Directory Id="INSTALLDIR.fr" Name="fr">

          <Component Id="Component.Microsoft.Win32.TaskScheduler.resources.dll.2" Guid="0474c71c-4d9c-4610-94a8-e7667cb400f9">
            <File Id="Microsoft.Win32.TaskScheduler.resources.dll.2" Source="bin\Debug\fr\Microsoft.Win32.TaskScheduler.resources.dll" />
          </Component>

        </Directory>

        <Directory Id="INSTALLDIR.it" Name="it">

          <Component Id="Component.Microsoft.Win32.TaskScheduler.resources.dll.3" Guid="0474c71c-4d9c-4610-94a8-e7661f5b7494">
            <File Id="Microsoft.Win32.TaskScheduler.resources.dll.3" Source="bin\Debug\it\Microsoft.Win32.TaskScheduler.resources.dll" />
          </Component>

        </Directory>

        <Directory Id="INSTALLDIR.Resources" Name="Resources">

          <Component Id="Component.LD.ICO" Guid="0474c71c-4d9c-4610-94a8-e766d9129baf">
            <File Id="LD.ICO" Source="bin\Debug\Resources\LD.ICO" />
          </Component>

        </Directory>

        <Directory Id="INSTALLDIR.zh_CN" Name="zh-CN">

          <Component Id="Component.Microsoft.Win32.TaskScheduler.resources.dll.4" Guid="0474c71c-4d9c-4610-94a8-e7664ca1bb9b">
            <File Id="Microsoft.Win32.TaskScheduler.resources.dll.4" Source="bin\Debug\zh-CN\Microsoft.Win32.TaskScheduler.resources.dll" />
          </Component>

        </Directory>
      </Directory>
    </Directory>
  </Directory>

  <Directory Id="ProgramMenuFolder" Name="ProgramMenuFolder">
    <Directory Id="ProgramMenuFolder.My_Commerce" Name="Solid Commerce">
      <Directory Id="ProgramMenuFolder.My_Commerce.My_Commerce" Name="Solid Commerce">

        <Component Id="My_Commerce.EmptyDirectory" Guid="0474c71c-4d9c-4610-94a8-e7666d5d374a">
          <RemoveFolder Id="ProgramMenuFolder.My_Commerce.My_Commerce" On="both" />

          <RegistryKey Root="HKCU" Key="Software\WixSharp\Used">
            <RegistryValue Value="0" Type="string" KeyPath="yes" />
          </RegistryKey>
        </Component>

      </Directory>

      <Component Id="ProgramMenuFolder.My_Commerce" Guid="0474c71c-4d9c-4610-94a8-e766b5416496">
        <RemoveFolder Id="ProgramMenuFolder.My_Commerce" On="uninstall" />

        <RegistryKey Root="HKCU" Key="Software\WixSharp\Used">
          <RegistryValue Value="0" Type="string" KeyPath="yes" />
        </RegistryKey>
      </Component>

    </Directory>
  </Directory>
</Directory>

<Property Id="ARPPRODUCTICON" Value="IconFile1_LD.ICO" />
<Property Id="ARPNOMODIFY" Value="yes" />

  <PropertyRef Id="NETFRAMEWORK45" />

  <Property Id="WixSharp_UI_INSTALLDIR" Value="INSTALLDIR" />
  <Property Id="WixSharp_InstallDialogs" Value="WixSharp.UI, Version=1.0.27.3, Culture=neutral, PublicKeyToken=3775edd25acc43c2|WixSharp.UI.Forms.WelcomeDialog&#xA;WixSharp.UI, Version=1.0.27.3, Culture=neutral, PublicKeyToken=3775edd25acc43c2|WixSharp.UI.Forms.ProgressDialog&#xA;WixSharp.UI, Version=1.0.27.3, Culture=neutral, PublicKeyToken=3775edd25acc43c2|WixSharp.UI.Forms.ExitDialog" />
<Property Id="WixSharp_ModifyDialogs" Value="WixSharp.UI, Version=1.0.27.3, Culture=neutral, PublicKeyToken=3775edd25acc43c2|WixSharp.UI.Forms.MaintenanceTypeDialog&#xA;WixSharp.UI, Version=1.0.27.3, Culture=neutral, PublicKeyToken=3775edd25acc43c2|WixSharp.UI.Forms.FeaturesDialog&#xA;WixSharp.UI, Version=1.0.27.3, Culture=neutral, PublicKeyToken=3775edd25acc43c2|WixSharp.UI.Forms.ProgressDialog&#xA;WixSharp.UI, Version=1.0.27.3, Culture=neutral, PublicKeyToken=3775edd25acc43c2|WixSharp.UI.Forms.ExitDialog" />
   <Property Id="ARPCONTACT" Value="Solid Commerce" />
   <Property Id="ARPURLINFOABOUT" Value="http://www.MyCommerce.com" />

<UI>
  <EmbeddedUI Id="WixSharp.UI.dll" SourceFile="bin\Debug\WixSharp.UI.CA.dll" />
</UI>

<Upgrade Id="51b65f41-9ea9-4a11-b32b-fcb9fda5599e">
  <UpgradeVersion Minimum="0.0.0.0" IncludeMinimum="yes" Maximum="11.22.15" IncludeMaximum="yes" Property="UPGRADEFOUND" />
  <UpgradeVersion Minimum="11.22.15" IncludeMinimum="no" OnlyDetect="yes" Property="NEWPRODUCTFOUND" />
</Upgrade>

  <CustomAction Id="Set_Action1_InstallRunTaskAction_Props" Property="Action1_InstallRunTaskAction" Value="Installed=[Installed];REMOVE=[REMOVE];REINSTALL=[REINSTALL];INSTALLDIR=[INSTALLDIR];UILevel=[UILevel]" />
  <CustomAction Id="Action1_InstallRunTaskAction" BinaryKey="Action1_InstallRunTaskAction_File" DllEntry="InstallRunTaskAction" Impersonate="no" Execute="deferred" Return="check" />
  <CustomAction Id="Set_Action2_UnInstallCertificatesAndStopTaskAction_Props" Property="Action2_UnInstallCertificatesAndStopTaskAction" Value="Installed=[Installed];REMOVE=[REMOVE];REINSTALL=[REINSTALL];INSTALLDIR=[INSTALLDIR];UILevel=[UILevel]" />
  <CustomAction Id="Action2_UnInstallCertificatesAndStopTaskAction" BinaryKey="Action1_InstallRunTaskAction_File" DllEntry="UnInstallCertificatesAndStopTaskAction" Impersonate="no" Execute="deferred" Return="check" />
  <CustomAction Id="Set_Action3_RepairRunTaskAction_Props" Property="Action3_RepairRunTaskAction" Value="Installed=[Installed];REMOVE=[REMOVE];REINSTALL=[REINSTALL];INSTALLDIR=[INSTALLDIR];UILevel=[UILevel]" />
  <CustomAction Id="Action3_RepairRunTaskAction" BinaryKey="Action1_InstallRunTaskAction_File" DllEntry="RepairRunTaskAction" Impersonate="no" Execute="deferred" Return="check" />
<CustomAction Id="WixSharp_InitRuntime_Action" BinaryKey="Action4_WixSharp_InitRuntime_Action_File" DllEntry="WixSharp_InitRuntime_Action" Impersonate="yes" Execute="immediate" Return="check" />
<CustomAction Id="PreventDowngrading" Error="Newer version was already installed" />

<Binary Id="Action1_InstallRunTaskAction_File" SourceFile="bin\Debug\%this%.CA.dll" />
<Binary Id="Action4_WixSharp_InitRuntime_Action_File" SourceFile="bin\Debug\WixSharp.CA.dll" />
<Binary Id="WixSharp_UIText" SourceFile="bin\Debug\Solid Commerce Label Printing Client.wxl" />
<Binary Id="WixSharp_LicenceFile" SourceFile="bin\Debug\Solid Commerce Label Printing Client.licence.rtf" />
<Binary Id="WixUI_Bmp_Dialog" SourceFile="bin\Debug\Solid Commerce Label Printing Client.dialog_bmp.png" />
<Binary Id="WixUI_Bmp_Banner" SourceFile="bin\Debug\Solid Commerce Label Printing Client.dialog_banner.png" />

<Feature Id="Complete" Title="Complete" Absent="allow" Level="1">
  <ComponentRef Id="Component.MC.Shipping.PrintingAgent.exe" />
  <ComponentRef Id="Component.App.config" />
  <ComponentRef Id="Component.BootstrapperCore.dll" />
  <ComponentRef Id="Component.CsvHelper.dll" />
......
  <ComponentRef Id="My_Commerce.EmptyDirectory" />
  <ComponentRef Id="ProgramMenuFolder.My_Commerce" />
</Feature>

<InstallExecuteSequence>
  <Custom Action="Set_Action1_InstallRunTaskAction_Props" After="InstallInitialize" />
  <Custom Action="Action1_InstallRunTaskAction" Before="InstallFinalize"> (NOT Installed) </Custom>
  <Custom Action="Set_Action2_UnInstallCertificatesAndStopTaskAction_Props" After="InstallInitialize" />
  <Custom Action="Action2_UnInstallCertificatesAndStopTaskAction" Before="RemoveFiles"> (Installed) </Custom>
  <Custom Action="Set_Action3_RepairRunTaskAction_Props" After="InstallInitialize" />
  <Custom Action="Action3_RepairRunTaskAction" Before="InstallFinalize"> (NOT (REMOVE="ALL")) </Custom>
  <Custom Action="WixSharp_InitRuntime_Action" Before="AppSearch"> (1) </Custom>
  <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>

  <RemoveExistingProducts After="InstallFinalize" />
</InstallExecuteSequence>

<InstallUISequence>
  <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
</InstallUISequence>

<Icon Id="IconFile1_LD.ICO" SourceFile="..\Resources\LD.ICO" />

</Product>

2 个答案:

答案 0 :(得分:1)

阻止MSI自动重启的两种快捷方法:

  1. 在命令行上传递REBOOT = ReallySuppress - https://msdn.microsoft.com/en-us/library/windows/desktop/aa371101(v=vs.85).aspx

  2. 更改ScheduleReboot标准操作的InstallExecuteSequence条件,以便它只在您需要时触发 - https://msdn.microsoft.com/en-us/library/windows/desktop/aa371527(v=vs.85).aspx

答案 1 :(得分:1)

重新启动是非确定性的。如果需要,Windows将执行一个。 Windows请求重新启动的最常见原因(特别是在以前的产品升级中)是因为正在使用的文件需要更换,如果没有重新启动就无法更换。最简单的方法是进行安装并创建详细日志,然后查找正在使用的文件消息。如果这确实是原因,那么抑制重启是危险的,因为这意味着你有来自旧产品的文件和来自新产品的文件的混合。我见过许多旧版应用程序在升级后继续运行并崩溃的情况,因为它从不兼容的新产品中加载了一个Dll。因此,无论如何都要将重新启动推迟到一个方便的时间,但(如消息所示)安装在重新启动之前是不完整的。

否则正如我所说,请查看详细日志中的原因。我假设你没有在你的设置中放置任何显式的ScheduleReboot或ForceReboot操作。