wix - 升级期间出现 Wix 安装程序错误 - 安装程序必须更新系统运行时无法更新的文件或服务
问题描述
我在卸载产品或卸载阶段的主要更新期间收到警告消息(当产品服务正在运行时):
“安装程序必须更新系统运行时无法更新的文件或服务。如果选择继续,则需要重新启动才能完成安装程序。”
故事从这里开始
我已经开发了 windowsservice
并使用创建了installer
[msi] Wix
,然后分发给了用户。它按预期工作。
现在,是时候交付具有服务增强功能的新版本了。因此,我创建了一个新的msi
. 我希望新的执行msi
应该upgrade
是现有的应用程序。
但我得到以下错误
安装程序必须更新系统运行时无法更新的文件或服务
为了支持 MSI 升级,我做了以下更改
产品部分的现有代码
<?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)">
代码改了,这里Product ID
改成*
<?define UpgradeCode = "{3D197FE4-86DF-31FD-A0CD-21B5D3B97ABC}" ?>
<Product Id="*"
Name="!(loc.ProductName_$(var.Platform)) $(var.ProductVersion)"
Language="!(loc.Language)"
Version="$(var.ProductVersion)"
Manufacturer="!(loc.Company)"
UpgradeCode="$(var.UpgradeCode)">
注意upgrade code
从旧版本到新版本没有变化。
用于升级的现有代码
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeErrorMessage)" />
更新了升级代码
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeErrorMessage)"
AllowDowngrades="no"
AllowSameVersionUpgrades="yes"
RemoveFeatures="ALL"
Schedule="afterInstallInitialize"/>
跟服务有关系吗?
<ServiceControl Id="myservice"
Name="GatewayService"
Start="install"
Stop="both"
Remove="uninstall" Wait="yes" />
安装顺序
如何摆脱这个提示?如果服务停止,为什么它会来。
部分日志
MSI (s) (78:5C) [19:54:21:691]: WIN64DUALFOLDERS: Substitution in 'C:\Program Files (x86)\Service\Service.dll' folder had been blocked by the 1 mask argument (the folder pair's iSwapAttrib member = 0).
The setup must update files or services that cannot be updated while
the system is running. If you choose to continue, a reboot will be
required to complete the setup.
MSI (s) (78:5C) [19:54:53:705]: Note: 1: 2727 2:
MSI (s) (78:5C) [19:54:53:706]: Doing action: RemoveExistingProducts
MSI (s) (78:5C) [19:54:53:706]: Note: 1: 2205 2: 3: ActionText
Action ended 19:54:53: InstallValidate. Return value 1.
MSI (s) (78:5C) [19:54:53:706]: Skipping RemoveExistingProducts action:
current configuration is maintenance mode or an uninstall
Action start 19:54:53: RemoveExistingProducts.
MSI (s) (78:5C) [19:54:53:706]: Doing action: InstallInitialize
MSI (s) (78:5C) [19:54:53:706]: Note: 1: 2205 2: 3: ActionText
Action ended 19:54:53: RemoveExistingProducts. Return value 0.
MSI (s) (78:5C) [19:54:53:708]: Machine policy value 'AlwaysInstallElevated' is 0
MSI (s) (78:5C) [19:54:53:708]: User policy value 'AlwaysInstallElevated' is 0
我有以下代码可以在失败时重新启动服务。你认为这会导致问题吗?
<util:ServiceConfig xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
FirstFailureActionType="restart"
SecondFailureActionType="restart"
ThirdFailureActionType="restart" />
问题根源
我看到旧版本在升级过程中没有被删除。因此在这里创建了一个新问题Wix installer upgrade with same "upgrade code" ID shows privilege error prompt
解决方案
所以我正在安装 MongoDB 并且此消息不断弹出。我尝试单击“确定”,以为它会重新启动系统,但什么也没发生。然后我关闭了互联网并重试。有效。这很奇怪,但这就是我的问题得到解决的方式。
推荐阅读
- ipad - OOTB 调查未在 iPad Salesforce 应用程序中以模式打开
- javascript - window.alert() 不显示输入
- excel - 基于表格的自动填充任务矩阵
- laravel - 如何在 cPanel 共享主机中运行 composer 命令
- php - PHP:如何仅获取最后一行(输入行)之前的行?
- r - 数据框:将由星号分隔的数据块从长格式改成狂野格式
- python - db_create_all() 不工作并在终端上给出错误
- android-11 - 在 Android 11 上调用 getNetworkCapabilities 时出现 SecurityException
- terraform - 属性中的局部变量和变量中的 Terraform 报告错误
- animation - SwiftUI:如何保持动画隐藏和显示按钮(视图)?