Wix 启动时自定义操作

发布于 2024-09-26 03:18:38 字数 51 浏览 1 评论 0原文

如何在任何 UI 发生之前启动 Wix 自定义操作(从 C# .NET CA Lib)?

How can I launch Wix Custom action (from C# .NET CA Lib) before any UI happens ?

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

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

发布评论

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

评论(3

逆光下的微笑 2024-10-03 03:18:38

我认为最好使用 Custom 元素的“Sequence”属性来控制它。

如果您使用 Orca 打开输出 MSI,切换到 InstallUISequenceInstallExecuteSequence 表并按“序列”列对记录进行排序,您将看到正在执行的操作的顺序。因此,在安排自定义操作时,您可以显式放置 Sequence:

<Custom Action="YourAction" ... Sequence="49" />

更方便的方法是使用与 Sequence 互斥的 Before/After 属性。只需找出您希望自定义操作之前或之后执行的操作,并适当地安排它:

<Custom Action="YourAction" ... Before="AnotherAction" />

您应该考虑到 InstallUISequence 可能不会运行(基本 UI)这一事实,因此如果您希望您的操作运行在任何情况下,且仅一次,请将属性 Execute='firstSequence' 添加到自定义操作定义中:

<CustomAction Id="YourAction" ... Execute="firstSequence" />

请务必浏览 wix.chm 和 MSDN,以获取有关自定义操作的更多信息。
希望这有帮助。

I think it is better to control this using 'Sequence' attribute of the Custom element.

If you open your output MSI with Orca, switch to InstallUISequence or InstallExecuteSequence table and sort the records by 'Sequence' column, you'll see the sequence of the actions being executed. So, when scheduling your custom action, you can put the Sequence explicitly:

<Custom Action="YourAction" ... Sequence="49" />

More convenient approach it to use Before/After attributes which are mutually exclusive with Sequence. Just find out the action you'd like your custom action to go before or after, and schedule it appropriately:

<Custom Action="YourAction" ... Before="AnotherAction" />

You should take into account the fact that InstallUISequence might not run (basic UI), so if you'd like your action to run in any case and only once, put the attribute Execute='firstSequence' to the custom action definition:

<CustomAction Id="YourAction" ... Execute="firstSequence" />

Be sure to explore wix.chm and MSDN for more information about custom actions.
Hope this helps.

述情 2024-10-03 03:18:38

您可以使用 InstallUISequence,而不是使用 InstallExecuteSequence

<InstallUISequence>
      <Custom Action="MyCustomAction" Before="LaunchConditions">NOT Installed</Custom>
</InstallUISequence>

Instead of using InstallExecuteSequence, you can use InstallUISequence:

<InstallUISequence>
      <Custom Action="MyCustomAction" Before="LaunchConditions">NOT Installed</Custom>
</InstallUISequence>
往日 2024-10-03 03:18:38

我找到了解决方案。您可以将该代码添加到 UI.wxs

<Publish Dialog="YOUR_DIALOG" Control="SOME_TEXT" Event="DoAction" Value="CA_NAME" Order="you_order">CONDITION</Publish>

I found a solution. You can add that code to UI.wxs

<Publish Dialog="YOUR_DIALOG" Control="SOME_TEXT" Event="DoAction" Value="CA_NAME" Order="you_order">CONDITION</Publish>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文