如果在运行时卸载了应用程序,则显示警告消息 [英] Display warning message if application is uninstalled while running

查看:86
本文介绍了如果在运行时卸载了应用程序,则显示警告消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我创建了一个wix文件来为我的VC ++应用程序创建安装程序.
在卸载期间,如果应用程序在其实例运行时被卸载,我想显示警告消息.
我是Wix的新手.

谁能帮我解决这个问题....


在此先感谢您.



I have created a wix file to create the installer for my VC++ application.
During uninstallation I want to display warning message if the application is uninstalled while the instance of it is running.
I am new to Wix.

Can anyone help me out how to resolve this problem....


Thanks in advance.

推荐答案

在运行时无法实际卸载应用程序.我的意思是,可以删除某些文件和注册表项,但是不能删除当前正在运行的进程直接或间接加载的可执行文件-操作系统可以防止它们在加载时被删除或修改.打开的数据文件也是一样.

也就是说,最好从主要可执行文件开始卸载过程,这样该过程将在对未使用的文件造成任何损害之前会失败.

另一方面,卸载过程可能会杀死所有阻止对象删除的过程.您要使用这种方式吗?在这种情况下,您可以真正与要卸载的应用程序进行通信,但是应用程序(通过其用户)应确定是否应允许卸载过程.对于通信,您可以使用的全部称为IPC(进程间通信).我不知道WIX是否提供了这样的功能,因此此步骤可以自定义.可以使用哪种IPC取决于您的决定以及所使用的语言,平台和库.它可以命名为管道,首先是在同一台计算机上卸载的话,或者是套接字.

—SA
An application cannot physically be uninstalled while running. I mean, some files and Registry entries can be removed, but the executable file directly or indirectly loaded by a currently running process cannot be removed — OS protects them from removing or modifications while they are loaded. Same thing with opened data files.

That said, it''s better to start uninstall process with main executable files so the process will fail before doing any harm to unused files.

From the other hand, uninstall process can kill all the processes which prevents removing of objects. Do you want to use this way? In this case you can really communicate with the application being uninstalled, but the application (via its user) should decide if uninstall process should be allowed or not. For communication, all you can use is called IPC (Inter-Process Communication). I don''t know if WIX provides such feature, so this step could be custom. Which IPC you can use depends on your decision and language, platform and libraries you use; it can be named pipes, first of all if you uninstall on the same machine, or sockets.

—SA


这篇关于如果在运行时卸载了应用程序,则显示警告消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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