[英]Wix Installer error during upgrade-The setup must update files or services that cannot be updated while system is running
我在卸载产品或卸载阶段的主要更新期间(当产品服务正在运行时)收到警告消息:
“安装程序必须更新在系统运行时无法更新的文件或服务。如果您选择继续,则需要重新启动才能完成安装程序。”
故事从这里开始
我开发了 Windows service
并使用Wix
创建了installer
[msi],然后分发给用户。 它按预期工作。
现在,是时候交付具有服务增强功能的新版本了。 因此,我创建了一个新的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 安装程序升级具有相同的“升级代码”ID 显示权限错误提示
问题解决了。 罪魁祸首低于代码
<util:ServiceConfig xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
FirstFailureActionType="restart"
SecondFailureActionType="restart"
ThirdFailureActionType="restart" />
我添加了以下延迟,现在一切都像魅力一样工作。
RestartServiceDelayInSeconds="60"
感谢有人认为需要RestartServiceDelayInSeconds
。 ServiceConfig
实用程序开发期间的ServiceConfig
思考
所以我正在安装 MongoDB 并且此消息不断弹出。 我试着点击 OK 认为它会重新启动系统,但什么也没发生。 然后我关闭了互联网并重试。 有效。 这很奇怪,但这就是我的问题得到解决的方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.