使用相同的“升级代码”升级Wix安装程序。 ID显示特权错误提示 [英] Wix installer upgrade with same "upgrade code" ID shows privilege error prompt

查看:183
本文介绍了使用相同的“升级代码”升级Wix安装程序。 ID显示特权错误提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了Windows服务,并使用 Wix工具集创建了 MSI 安装程序,然后分发给用户。它按预期工作。让我们将这个msi命名为版本1.0.0.0

I have developed the windows service and created the MSI installer using Wix toolset, then distributed to users. it is working as expected. Let's name this msi as version 1.0.0.0

现在,该提供具有服务增强功能的新版本了。因此,我创建了一个新的msi。我们将其命名为版本2.0.0.0 。我希望执行新的 msi 可以升级现有的应用程序。

Now, it's time to deliver a new build with service enhancements. Hence, I have created a new msi. Let's name it version 2.0.0.0 . I was hoping that the execution of new msi shall upgrade the existing application.

但是我基本上得到了以下错误,则无法启动该服务

But I get below error, basically, it's unable to start the service

以下是1.0.0.0版中的代码

  <?define UpgradeCode = "{3D197FE4-86DF-31FD-A0CD-21B5D3B97ABC}" ?>
  <Product Id="$(var.ProductCode)" 
       Name="!(loc.ProductName_$(var.Platform)) $(var.ProductVersion)"
       Language="!(loc.Language)" 
       Version="$(var.BuildVersion)"
       Manufacturer="!(loc.Company)" 
       UpgradeCode="$(var.UpgradeCode)">

这是2.0.0.0中的代码

  <?define UpgradeCode = "{3D197FE4-86DF-31FD-A0CD-21B5D3B97ABC}" ?>
  <Product Id="$(var.ProductCode)" 
       Name="!(loc.ProductName_$(var.Platform)) $(var.ProductVersion)"
       Language="!(loc.Language)" 
       Version="$(var.BuildVersion)"
       Manufacturer="!(loc.Company)" 
       UpgradeCode="$(var.UpgradeCode)">

        <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeErrorMessage)" 
Schedule="afterInstallInitialize"/>

如果您观察到的话,我会保留 upgradecode 1.0.0.0 相同。根据 https://wixtoolset.org/documentation/manual/v3/ howtos / updates / major_upgrade.html

If you observe, I kept the upgradecode same as 1.0.0.0. As per https://wixtoolset.org/documentation/manual/v3/howtos/updates/major_upgrade.html

如果我更改了 upgradecode GUID,那么我看不到任何问题。安装正常。 但是,更改升级代码指南不会在升级过程中删除旧版本。我的意思是,我在控制面板中同时看到 1.0.0.0 2.0.0.0 这将同时安装一个版本。边:(

If I change the upgradecode GUID then I do not see any issues. Installation works fine. But changing the upgradecode guid will not remove the old build during upgrade. I mean, i see both 1.0.0.0 and 2.0.0.0 in control panel.It's installing one more version side by side :(

我怎么能摆脱这个问题?

How can I come out from this issue?

推荐答案

配置问题 :好的,现在,我认为我已正确阅读了这篇文章,我认为您有一个基本的服务配置问题,它阻止了该服务的启动。

Configuration Issue: OK, now that I think I have read this properly I think you have a basic service configuration issue that prevents start of the service. The upgrade process probably removes something it shouldn't or it leaves the configuration files in an inconsistent state.


换句话说,:升级方案之后,服务配置文件中可能有问题-或文件或注册表项的选择中缺少某些内容。

In other words: Something is likely wrong in the service configuration files after upgrade scenarios - or something is missing - in the selection of files or registry entries.

最有可能 :我认为您的服务二进制文件不是
升级后的正确版本。请检查升级后的版本号。我敢打赌,您会发现
是版本1的服务二进制文件y。

Most Likely: I think your service binary just isn't the right version after upgrade. Check the version number after upgrade. I bet you will find the version 1 service binary.

测试 :我会尝试一些测试:

Tests: There are a few tests I would try:


  • 记录 :首先,我将遵循以下建议: https://www.coretechnologies.com/WindowsServices/FAQ.html#DiagnoseProblems

  • 文件夹差异 :如果以上内容没有显示,请尝试使用干净的虚拟机安装第一个版本,然后运行升级。将安装文件夹复制到某个位置-现在还原虚拟文件夹并直接安装第二个版本(首先不安装第一个版本)。如果在安装版本2后立即启动该服务,请使用比较工具诸如Beyond Compare 之类的机芯。

  • 早期报告 :如果您还没有-可以尝试移动 RemoveExistingProducts InstallExecuteSequence 早期。这只是为了测试它是否有效-并非永久性修复。这个想法是,在安装新版本之前完全删除旧版本可能会消除您否则会在配置文件中看到的不一致之处。

  • Logging: First I would follow the suggestions here: https://www.coretechnologies.com/WindowsServices/FAQ.html#DiagnoseProblems
  • Folder Diff: If the above revealed nothing, try using a clean virtual to install the first version and then run the upgrade. Copy the installation folder somewhere - now revert virtual and install version two directly (without version 1 first). If the service starts now after version 2 is installed, diff the resulting folders using a diff tool of caliber such as Beyond Compare.
  • Early REP: If you haven't already - you can try to move RemoveExistingProducts early in the InstallExecuteSequence. This is just to test whether that works or not - it is not intended as a permanent fix. The idea is that the complete removal of the old version before installing the new one could remove the inconsistency you otherwise see in the configuration files.

此处的清单可能会激发一些想法:

The check-lists here could spark some ideas:

  • Desktop applicaton not opening after installation in client system
  • Windows Application Startup Error Exception code: 0xe0434352
  • WPF application crashes when I launch
  • https://www.coretechnologies.com/WindowsServices/FAQ.html

这篇关于使用相同的“升级代码”升级Wix安装程序。 ID显示特权错误提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆