我想通过单击某个按钮来触发一些自定义操作。
我得到返回值1,但是自定义操作没有运行。
这是我的日志:
Action start 17:09:39: CA1.
MSI (c) (08:00) [17:09:39:220]: Invoking remote custom action. DLL: C:\Users\ARKADY~1\AppData\Local\Temp\MSI87D6.tmp, Entrypoint: CustomAction1
MSI (c) (08:EC) [17:09:39:222]: Cloaking enabled.
MSI (c) (08:EC) [17:09:39:223]: Attempting to enable all disabled privileges before calling Install on Server
MSI (c) (08:EC) [17:09:39:224]: Connected to service for CA interface.
Action ended 17:09:39: CA1. Return value 1.我的习惯是:
[CustomAction]
public static ActionResult CustomAction1(Session session)
{
session.Log("Begin CustomAction1");
return ActionResult.Success;
}如您所见,日志中没有"Begin CustomAction1“条目。
我的自定义动作Config:
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>从wix代码中声明CA:
<Binary Id="CA" SourceFile="$(var.CustomAction1.TargetDir)$(var.CustomAction1.TargetName).CA.dll" />
<CustomAction Id="CA1" BinaryKey="CA" DllEntry="CustomAction1" Execute="immediate" Return="check"/>UI绑定:
<Control Id="ManualUpdateButton" Type="PushButton" X="14" Y="188" Width="95" Height="17" Text="Manual Update">
<Publish Event="DoAction" Value="CA1" Order="1">1</Publish>
</Control>发布于 2017-09-25 16:46:47
自定义操作正在运行,只是没有记录任何内容。这是MSI中的一个限制--您不能从UI中DoAction调用的自定义操作写入日志。
https://stackoverflow.com/questions/46407621
复制相似问题