在检查文件是否正在使用之前,如何使用 Wix 3.0 以系统用户身份执行自定义操作?

发布于 2024-08-19 05:29:00 字数 456 浏览 0 评论 0原文

所以我有一个安装 IIS7 本机代码模块的 Wix 3.0 项目。卸载时,我希望能够在删除文件之前关闭 IIS7 应用程序池,这样就不需要重新启动。

我正在使用 appcmd 实用程序关闭 CustomAction 元素中的应用程序池,但是当我尝试卸载时,在调用 customaction 之前收到此错误:

安装程序必须更新文件或 无法更新的服务 系统正在运行。如果你选择 要继续,需要重新启动 完成设置。

我在 CustomAction 上设置了“After='InstallInitialize'”属性,因为文档表明任何延迟/非模拟的自定义操作都必须位于 InstallInitialize 和 InstallFinalize 之间。

那么,在检查正在使用的文件之前,是否有某种方法可以执行自定义操作?或者对给定文件禁用此检查,或者使检查在序列中稍后进行?

So I have a Wix 3.0 project that installs an IIS7 Native Code Module. When uninstalling I would like to be able to shut down the IIS7 application pools before deleting the file so that a reboot is not necessary.

I am using the appcmd utility to shut down the app pools in a CustomAction element, but when I attempt to do an uninstall I get this error before the customaction is ever invoked:

The setup must update files or
services that cannot be updated while
the system is running. If you choose
to continue, a reboot will be required
to complete the setup.

I have the "After='InstallInitialize'" property set on the CustomAction, because the documentation says that any deferred/not-impersonated custom action must come between InstallInitialize and InstallFinalize.

So is there some way to have a custom action execute before this check for files in use is made? Or disable this check for a given file, or make the check happen later in the sequence?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

请持续率性 2024-08-26 05:29:00

是的,您可以通过修改 MSI 文件中的 InstallExecuteSequence 表

获取 ORCA 工具来检查 MSI 文件看看我的意思,使用 Javascript 脚本适当修改 MSI< /a>.

替代文本

Yes, you can specify the order for actions to occur by modifying the Sequence column in the InstallExecuteSequence table within the MSI file.

Get the ORCA tool to examine the MSI file to see what I mean, and use a Javascript script to modify the MSI as appropriate.

alt text

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文