Windows Installer 如何在卸载过程中关闭应用程序? [英] How does Windows Installer close an application during uninstall?

查看:50
本文介绍了Windows Installer 如何在卸载过程中关闭应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

卸载我的应用程序时,如果它正在运行,它会尝试将其停止:

When uninstalling my application, it attempts to stop it if it's running:

遗憾的是,自动关闭并没有真正起作用,并显示此错误:

Sadly, the automatically closing doesn't really work and it displays this error:

我的应用程序消失了,窗口,托盘栏图标,它们都消失了.但是我仍然可以在进程列表中看到它们.

My applications disappear, the windows, the tray bar icon, they are all gone. But I can still see them in the process list.

我猜 Windows 会向应用程序发送一个信号以正常退出,UI 也会这样做,但是有一些线程阻止进程终止.

I'm guessing Windows sends a signal to the applications to exit gracefully and the UI does so, but there's some lingering thread preventing the processes from terminating.

Windows Installer 如何在卸载过程中关闭应用程序?

How does Windows Installer close an application during uninstall?

一旦我知道这一点,我想在调试我的应用程序时模拟它以查看发生了什么.这是一个合理的计划吗?

Once I know this I want to simulate it while debugging my app to see what's going on. Is this a sound plan?

推荐答案

自 Windows Vista 起,Windows Installer 将利用 重启管理器 以识别、关闭和重启应用程序.微软关于使用重启管理器的文档,特别是将重启管理器与主安装程序一起使用 应该是实现测试线束.您的应用程序和服务应遵循应用程序和服务指南.

Since Windows Vista, Windows Installer will leverage the Restart Manager to identify, close, and restart applications. Microsoft's documentation on Using Restart Manager, and in particular Using Restart Manager with a Primary Installer should be a solid starting point for implementing a test harness. Your applications and services should instead follow the Guidelines for Applications and Services.

应用指南讨论发送给您的邮件由重启管理器申请;服务通过服务控制管理器重新启动.从理论上讲,您可以在该级别模拟重启管理器,但我怀疑通过调用真实的东西,注册精心选择的 资源,如果可能的话,只针对您的应用程序.

The Guidelines for Applications discuss the messages sent to your application by the restart manager; services are restarted through the service control manager. In theory you could simulate the restart manager at that level, but I suspect you'd be better served by invoking the real thing, registering a carefully chosen list of resources to target just your application, if possible.

这篇关于Windows Installer 如何在卸载过程中关闭应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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