卸载不适用于 MSI 应用程序 - 错误 1722 [英] Uninstall is not working for MSI application - Error 1722

查看:54
本文介绍了卸载不适用于 MSI 应用程序 - 错误 1722的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 WIX 3.11 创建了 MSI.我对安装程序进行了一些自定义,以便在自定义文件夹中安装应用程序.我还在 HKLM\Software 下写入注册表值的安装路径.

I have created MSI using WIX 3.11. I have made some customization to the Installer to install the application in a custom folder. I am also writing Install path to registry value under HKLM\Software.

我正在为我的一个用例读取批处理文件中的注册表值.

I am reading registry value in batch file for one of my use-case.

安装成功,应用运行正常.

Installation is successful and the application is running fine.

但是在卸载时,我面临以下问题 -

But while uninstalling, I am facing below issue -

卸载窗口弹出消息 - 在继续安装之前应关闭以下应用程序:[MyApplication]

Uninstall window pops up with the message - The following applications should be closed before continuing the Install: [MyApplication]

在删除服务时的卸载日志中,我看到以下错误 - 错误 1722.此 Windows 安装程序包存在问题.作为安装程序的一部分运行的程序未按预期完成.请联系您的支持人员或软件包供应商.

In uninstall log while removing the service, I see below error - Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.

如果我手动删除该服务,则看不到任何错误并且该服务将被删除.不知道为什么卸载失败.

If I remove the service manually, no errors can be seen and the service is getting deleted. Not sure why Uninstall is failing.

请对此有所了解.

推荐答案

Stop Service Before Uninstall:在已编译的 MSI 中,ServiceControl table?您需要在删除其可执行文件之前停止该服务.请参阅下面链接的 WiX 服务安装示例.

Stop Service Before Uninstall: In the compiled MSI, what entries do you have in the ServiceControl table? You need to stop the service before its executable is deleted. See WiX service installation sample linked to below.

自定义操作失败:也有可能您有一个自定义操作试图运行在您尝试运行时已被卸载的批处理文件.这可能是一个不应在卸载时运行的自定义操作(条件错误),或者您对其进行了错误排序,因此批处理文件从磁盘中消失了 - 由卸载提供 - 在自定义操作可以运行之前成功.您需要在安装/卸载序列中更早地移动自定义操作或更好地调整它,使其永远不会在卸载时运行.这两个问题都很常见.请注意,无法对自定义操作进行条件化以使其意外运行是很常见的.它们经常在不受欢迎的主要升级卸载期间运行.

Failing Custom Action: It is also possible that you have a custom action which tries to run a batch file that has already been uninstalled when you try to run it. This can be a custom action that should not run on uninstall (conditioning is wrong), or you have sequenced it incorrectly so the batch file is gone from disk - courtesy of the uninstall - before the custom action can run successfully. You need to move the custom action earlier in the installation / un-installation sequence or condition it better so it never runs on uninstall. Both issues are very common. Be aware that it is common to fail to condition custom actions so they run unexpectedly. Very often they run during major upgrade uninstalls undesirably.

批处理文件 CA:就其价值而言 - 没有冒犯之处:在我看来,在自定义操作中使用批处理文件是 MSI 反模式.基本上零错误处理,因此没有管理和从错误条件中恢复.并且一般不支持 MSI 回滚.在我看来,C++ 自定义操作是最好的(最小的依赖性、良好的可调试性、全功能语言、大型的底层 API).就是这么提的.这完全取决于您的分布有多大.对于内部应用程序,您可以获得比真正的全球包分发更多的东西.这与部署的复杂性有关strong>(请参阅页面下方的部分).错误来源太多了.

Batch Files CAs: For what it is worth - and no offense: using batch files in custom action is an MSI anti-pattern in my opinion. There is basically zero error handling and hence no management and recovery from error conditions. And generally no MSI rollback support. C++ custom actions are best in my view (minimal dependencies, good debugability, full featured language, large down-to-the-metal API). Just so it is mentioned. It all depends how large your distribution is. For in-house appliations one can get away with more than for truly global package distribution. This has to do with the complexity of deployment (see section a bit down the page). There are so many error sources.

WiX 服务安装:也许可以看到来自 Rainer Stropek 的 WiX 标记示例:WiXSamples - github.com/rstropek.请检查ServiceControl 元素.

<小时>

MSI 常见问题:我讨厌推销"此内容.它本质上是你在书中不容易找到的东西 - 并且有充分的理由.一些经验法则和意见以混乱的形式出现,但如果您想查看它,请看这里:我如何避免 WiX/MSI 部署解决方案中的常见设计缺陷? 只是诚实的意见和实用的建议 - 没有声称是正确的",但它应该有助于设置可靠性.希望.


Common MSI Problems: I hate to "pitch" this content. It is essentially the things you can't easily find in books - and for good reason. Some rules of thumb and opinions in a chaotic form, but here it is if you want to check it out: How do I avoid common design flaws in my WiX / MSI deployment solution? Just honest opinions and practical advice - no claim to be "right", but it should help setup reliability. Hopefully.

这篇关于卸载不适用于 MSI 应用程序 - 错误 1722的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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