MSI 创建:升级前终止应用程序
我正在使用 Microsoft Visual Studio 2010 为我的简单 .EXE 应用程序创建一个简单的 .MSI 安装程序。
问题是,如果您在 .EXE 仍在运行时安装升级,则会出现问题(直到重新启动)。
我希望 .MSI 安装程序在安装/升级之前终止我的进程。
请有人告诉我如何在 Orca 中执行此操作?
编辑:我已经看到这种情况是由于我的 .EXE 正在使用而发生的,但我也看到了它,因为 .CHM 帮助文件在升级时也是打开的,因此任何进程单独终止都不足以解决此问题问题。
I'm using Microsoft Visual Studio 2010 to create a simple .MSI installer for my simple .EXE application.
Trouble is, things go wrong (until a reboot) if you install an upgrade while the .EXE is still running.
I'd like for the .MSI installer to terminate my process before installing/upgrading.
Please could someone tell me how to do this in Orca?
EDIT: I've seen this occur due to my .EXE being in use, but I've also seen it because the .CHM help file was open at time of upgrade as well, so any process termination alone is not enough to solve this problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该将MsiRMFilesInUse 对话框添加到您的安装程序中。
You should ad the MsiRMFilesInUse Dialog to your installer.
您可以尝试创建一个自定义操作来停止您的应用程序(您编写的自定义 EXE 或 DLL)。例如,您可以将 WM_CLOSE 发送到主应用程序窗口(您的应用程序应该处理此消息)。
应在 InstallExecuteSequence 表中的 InstallValidate 操作之前安排此自定义操作。
You can try creating a custom action which stops your application (a custom EXE or DLL written by you). For example you can send WM_CLOSE to the main application window (your application should handle this message).
This custom action should be scheduled before InstallValidate action in InstallExecuteSequence table.
您可以编写一个自定义操作来关闭您的应用程序以及帮助文件。
您应该能够使用 FindWindow 找到这两个窗口的窗口句柄:
http://msdn.microsoft.com/en- us/library/ms633499(v=vs.85).aspx
对于可执行文件,您应该能够使用 FindWindow 的适当窗口类或标题。
对于帮助文件,您应该能够使用 FindWindow 的适当帮助窗口标题。
我希望这有帮助!
You could write a custom action that closes your application as well as your help file.
You should be able to find the window handles for both of these by using FindWindow:
http://msdn.microsoft.com/en-us/library/ms633499(v=vs.85).aspx
For the executable, you should be able to use the appropriate Window Class or Title for FindWindow.
For the help file, you should be able to use the appropriate Help Window Title for FindWindow.
I hope this helps!