1

我试图在更新我的应用程序期间关闭“托盘应用程序”。从“Windows 服务”关闭托盘的功能如下所示:

<util:CloseApplication 
  Id="CloseTrayAgent"
  Target="$(var.TrayAgentBinName).exe"
  RebootPrompt="no"
  CloseMessage="yes"
  Description="Tray application is still running"/>

<InstallExecuteSequence>
  <Custom Action="WixCloseApplications" Before="RemoveFiles" />
</InstallExecuteSequence>

如果从“用户”(仅从用户控制台)调用更新,则该方案有效,但如果从“Windows 服务”调用,则该方案不起作用。我检查了 msi 日志,但在我看来没有错误。

我的错误在哪里?谢谢。

4

1 回答 1

3

服务在会话零中运行,该会话与交互式桌面会话隔离。本文明确指出了使用诸如 SendMessage 之类的 API 向交互式会话中运行的应用程序发送消息的服务的问题:

https://blogs.technet.microsoft.com/askperf/2007/04/27/application-compatibility-session-0-isolation/

搜索 -services session isolation- 或 -session 0- 将提供更多信息。

于 2018-06-08T19:31:42.830 回答