Service 防止服务在WiX中的主要升级时丢失设置

Service 防止服务在WiX中的主要升级时丢失设置,service,wix,upgrade,wix3.7,Service,Wix,Upgrade,Wix3.7,我正在努力防止我的服务在我的WiX安装程序的主要升级中丢失它们的设置(凭据和其他选项)。 我听从了建议,我正在尝试使用 <InstallExecuteSequence> <DeleteServices>NOT UPGRADINGPRODUCTCODE</DeleteServices> </InstallExecuteSequence> 然后几百行之后,我明白了 MSI (s) (6C:A4) [16:52:54:873]: Doing ac

我正在努力防止我的服务在我的WiX安装程序的主要升级中丢失它们的设置(凭据和其他选项)。 我听从了建议,我正在尝试使用

<InstallExecuteSequence>
   <DeleteServices>NOT UPGRADINGPRODUCTCODE</DeleteServices>
</InstallExecuteSequence>
然后几百行之后,我明白了

MSI (s) (6C:A4) [16:52:54:873]: Doing action: DeleteServices
所以在我看来,第二个DeleteServices是我的问题。有谁能告诉我,我怎样才能抑制第二个,或者我是怎么做的

我正在使用WiX工具集3.7。 这是我的代码,显然已经删除了guid

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id='*' Name='My Product' Language='1033'
            Version='1.0.6' Manufacturer='Me' UpgradeCode='PUT-GUID-HERE' >
    <Package Description='My Product' Platform='x86' Id='*'
             Manufacturer='Me' InstallerVersion='200' Compressed='yes' />

    <MajorUpgrade DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."/>
    <InstallExecuteSequence>
      <DeleteServices>NOT UPGRADINGPRODUCTCODE</DeleteServices>
    </InstallExecuteSequence>

    <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />

    <Directory Id='TARGETDIR' Name='SourceDir'>
      <Directory Id='ProgramFilesFolder' Name='PFiles'>
        <Directory Id='AgentDir' Name='Agent'>
          <Component Id='Binaries' Guid='PUT-GUID-HERE' Win64='no'>
            <File Id='AgentExe' Source='../MyProduct/MyExe.exe' KeyPath='yes' ProcessorArchitecture='x86' />
            <ServiceInstall Id="TheServiceInstall" Description="[ProductName]" EraseDescription="no" DisplayName="[ProductName]" ErrorControl="normal" Interactive="no" Name="[ProductName]" Start="auto" Type="ownProcess" Vital="yes">
            </ServiceInstall>
          </Component>
        </Directory>
      </Directory>
    </Directory>

    <Feature Id='CompleteInstall' Title='My Product' Level='1'>
      <ComponentRef Id='Binaries' />
    </Feature>
  </Product>
</Wix>

不升级产品代码

谢谢

在主要升级中,请记住,您将运行两个执行序列,一个用于卸载旧产品,另一个用于安装新产品。我怀疑您的问题来自于卸载旧产品。卸载旧产品时,旧产品是否具有“…且不升级ProductCode”条件以抑制DeleteServices操作?在尝试升级之前,您必须找到一种方法修补旧产品以插入该条件。

我的问题似乎不是服务被删除,而是新产品的安装导致我丢失了服务设置

我将它添加到我的InstallExecuteSequence块中,它似乎完成了这个任务

<InstallServices>NOT WIX_UPGRADE_DETECTED</InstallServices>
未检测到WIX\u升级

谢谢你的帮助,斯蒂芬

谢谢,我不认为这是两个独立的过程。旧产品在DeleteServices上没有“NOT UPGRADINGPRODUCTCODE”条件。我还没有把它部署到任何地方,我还在测试它。因此,我的旧产品与我的新产品相同,只是我增加了产品版本的构建。此外,日志中的“跳过操作:删除服务”排在第一位,“执行操作:删除服务”排在第二位。所以我假设卸载旧产品实际上是在做我想做的事情,是安装新产品在删除服务。
<InstallServices>NOT WIX_UPGRADE_DETECTED</InstallServices>