在进行任何验证之前,Windows Installer自定义操作 [英] Windows Installer custom action BEFORE any validation

查看:100
本文介绍了在进行任何验证之前,Windows Installer自定义操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我根据此处找到的教程编写了Windows Installer自定义操作:
http://www.codeproject.com/kb/install/msicustomaction.aspx



我的自定义操作是杀死给定名称的后台进程,该进程仍然可以由用户打开。原因是我不希望用户看到给定EXE正在运行的警告,必须将其关闭才能继续安装。当像在本教程中一样在 InstallUISequence表中创建操作时,MSI通过UI序列时,此方法很好用。

但是,当静默使用MSI时(右键单击并选择修复或卸载) ),那么我的自定义操作当然就不会执行。



我必须在哪里放置我的自定义操作,以便它在静默运行时也能立即执行? p>

我尝试将其添加到 InstallExecuteSequence中,但仍显示应用正在运行警告。然后,我尝试将自定义操作的序列号降低到5,但这也无济于事。



注意:

我正在使用Orca修改从Visual Studio安装项目生成的MSI。然后,我使用转换文件来应用它。

解决方案

您需要将操作安排为两次 >,一次在UI序列中,一次在Execute序列中,然后进行调度,因此它将仅在尝试执行它的第一个序列中运行。 (例如WiX中的 CustomAction / @ execute ='firstSequence'



更新:如果您使用的是Orca,请参阅自定义操作上的文档执行调度选项,您只需确保已设置 msidbCustomActionTypeFirstSequence 位。


I wrote a Windows Installer custom action based on the tutorial found here: http://www.codeproject.com/kb/install/msicustomaction.aspx

My custom action is killing a background process of a given name which could still be opened by the user. The reason is that I don't want users to see the warning that a given EXE is running and must be closed so that setup can continue. This works fine when the MSI passes through the UI sequence as the action is created in "InstallUISequence" table like in the tutorial.
However, when the MSI is used silently (right-click and select repair or uninstall), then my custom action isn't executed of course.

Where do I have to put my custom action so that it is executed immediately also when run silently?

I tried adding it to "InstallExecuteSequence", but the 'app running' warning is still shown. I then tried lowering the sequence number of my custom action to 5, but this also didn't help.

Note:
I'm using Orca to modify an MSI generated from a Visual Studio setup project. I'm then using the transform file to apply it.

解决方案

You need to schedule the action twice, once in the UI sequence and once in the Execute sequence, then schedule so it will only run in the first sequence that tries to execute it. (e.g. CustomAction/@execute='firstSequence' in WiX)

Update: If you're using Orca, then see the documentation on Custom Action Execution Scheduling Options, you'll just need to ensure that the msidbCustomActionTypeFirstSequence bit is set.

这篇关于在进行任何验证之前,Windows Installer自定义操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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