本文介绍了下一个之后的 WIX 自定义操作调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

当我单击下一步按钮时,如何调用我的自定义操作 dll?目前我正在做的事情如下:

How can I make a call to my Custom Action dll when I click on Next button? Currently what I am doing is given below:

<CustomAction Id="TestingAction" BinaryKey="BIN_CustomAction" DllEntry="TestValue" Execute="deferred" Return="check" />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&amp;Next"></Control>
<Custom Action="TestingAction" After="Next"></Custom>

当我给出 After ="Next" 这是我的 Next 按钮时,我在构建应用程序后出现错误.

When I given After ="Next" which is my Next button i am getting error after building my application.

未解决对符号WixAction:InstallUISequence/Next"的引用部分'产品:*.

如何解决是个问题,任何人都可以帮助我在单击下一步按钮后如何调用 CustomAction.

How to resolve is issue and can anyone help me how to make a call to CustomAction after i click on Next Button.

推荐答案

您要做的是将延迟的自定义操作安排到某个序列并在名为 Next 的自定义操作之后运行它,这显然不存在.您应该采用完全不同的方式在按钮单击时调用自定义操作.

What you are trying to do is to schedule the deferred custom action to a certain sequence and run it after a custom action called Next, which obviously doesn't exist. You should go a totally different way to call custom action on button click.

按照以下步骤操作:

  • 创建自定义操作.它必须是即时的 (execute='immediate'),并且永远不应该改变目标系统的状态
  • 编写一个 Control 元素 - 您想要触发事件的按钮
  • 最后,创作一个 Publish 元素作为 Control 的子元素,它发布 DoAction 事件
  • create a custom action. It must be immediate (execute='immediate') and should never ever change the state of the target system
  • author a Control element - the button you'd like to trigger the event
  • finally, author a Publish element as a child of the Control, which publishes the DoAction event

以下是来自 WiX 来源的完整示例,如何通过单击按钮打印 EULA:

Here's a full sample from the WiX sources how to print EULA on a button click:

<Control Id="Print" Type="PushButton" X="88" Y="243" Width="56" Height="17" Text="!(loc.WixUIPrint)">
  <Publish Event="DoAction" Value="WixUIPrintEula">1</Publish>
</Control>

显然,Control 元素应该是Dialog 元素的子元素.自定义操作定义如下:

Obviously, the Control element should be a child of Dialog element.And the custom action is defined like this:

<CustomAction Id="WixUIPrintEula" BinaryKey="WixUIWixca" DllEntry="PrintEula" Return="ignore" Execute="immediate" />

希望这会有所帮助.

这篇关于下一个之后的 WIX 自定义操作调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 17:55