首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将自定义操作链接到用户界面按钮控件时出错

将自定义操作链接到用户界面按钮控件时出错
EN

Stack Overflow用户
提问于 2017-09-25 14:25:16
回答 1查看 46关注 0票数 1

我想通过单击某个按钮来触发一些自定义操作。

我得到返回值1,但是自定义操作没有运行。

这是我的日志:

代码语言:javascript
复制
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.

我的习惯是:

代码语言:javascript
复制
    [CustomAction]
    public static ActionResult CustomAction1(Session session)
    {
        session.Log("Begin CustomAction1");

        return ActionResult.Success;
    }

如您所见,日志中没有"Begin CustomAction1“条目。

我的自定义动作Config:

代码语言:javascript
复制
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" />
    <supportedRuntime version="v2.0.50727"/>
  </startup>
</configuration>

从wix代码中声明CA:

代码语言:javascript
复制
<Binary Id="CA"  SourceFile="$(var.CustomAction1.TargetDir)$(var.CustomAction1.TargetName).CA.dll" />
<CustomAction Id="CA1" BinaryKey="CA" DllEntry="CustomAction1" Execute="immediate" Return="check"/>

UI绑定:

代码语言:javascript
复制
    <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>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-09-25 16:46:47

自定义操作正在运行,只是没有记录任何内容。这是MSI中的一个限制--您不能从UI中DoAction调用的自定义操作写入日志。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46407621

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档