WiX卸载前关闭应用程序-关闭打开的应用程序消息 [英] WiX close application before uninstall - close open applications message

查看:323
本文介绍了WiX卸载前关闭应用程序-关闭打开的应用程序消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有点痛苦.我有一个安装程序,用于安装和启动任务栏图标应用程序(常见的.exe)

I'm in a kind of misery. I got an installer installing and starting a tray icon app (common .exe)

这正常工作,但是现在我想在此UI告诉用户手动关闭该应用程序之前停止该应用程序,因为在卸载例程中,我的任务栏图标已删除,但该过程仍在运行.

This is working properly, but now i want to stop that app before this UI telling the user to close the app manually comes up, because during the deinstall routine, my tray icon is removed but the process is still running.

我应用了此自定义操作以在卸载之前(甚至在卸载过程中)关闭应用程序

I applied this custom action to close the app before uninstall (or even during)

<CustomAction Id="CloseTrayApp" ExeCommand="-exit" FileKey="TrayApp" Execute="immediate" Return="asyncNoWait" />

<InstallExecuteSequence>
    <Custom Action="CloseTrayApp" Before="InstallValidate" />
</InstallExecuteSequence>

但是仍然会弹出关闭所有正在运行的应用程序"对话框,但是我认为这将解决我的问题.

But the "close all running apps" dialog still pops up, but i thought that this will solve my issue.

我已经尝试使用CloseAction,但是由于编译时出现错误,我急于使用它.它说WixUtils命名空间可能会丢失,但是我再次检查它是否存在:

I already tried to use the CloseAction but i got into a hurry using it because of error while compiling the stuff. It says that the WixUtils namespace may be missing but i double checked that it is there:

xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"

如何避免弹出对话框窗口并触发要执行的自定义操作?

How can I avoid the dialog window poping up and trigger this custom action to be executed?

推荐答案

您还必须添加对WixUtilExtension.dll的引用.如果您使用的是Visual Studio/Votive,则只需右键单击添加引用,然后从[ProgramFilesFolder] Windows Installer XML v3.5 \ bin中选择DLL.否则,您必须使扩展程序可用于编译器和链接器:

You also have to add a reference to WixUtilExtension.dll. If you are using Visual Studio / Votive you just right click add reference and select the DLL from [ProgramFilesFolder]Windows Installer XML v3.5\bin. Otherwise you have to make the extension available to the compiler and linker:

candle.exe yourfile.wxs -ext %full path to WixUtilExtension.dll%'
light.exe yourfile.wixobj -ext %full path to WixUtilExtension.dll% –out yourfile.msi yourfile.wixout'

更多信息,请访问:

使用标准自定义操作

请注意,CloseApp自定义操作有一个限制,即它不会终止"您的应用程序.只会礼貌地向您的应用发送WM_CLOSE消息,并且由您的trayapp负责关闭并接收和处理该消息.

Please note that the CloseApp custom action has a limitation that it won't "terminate" your application. It will only politely send your app a WM_CLOSE message and it's up to your trayapp to receive and process that message with a shutdown.

这篇关于WiX卸载前关闭应用程序-关闭打开的应用程序消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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