1

I want to trigger some custom action by clicking some button.

I get return value 1 but the custom action did not run.

This is my log:

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.

My custom action is:

    [CustomAction]
    public static ActionResult CustomAction1(Session session)
    {
        session.Log("Begin CustomAction1");

        return ActionResult.Success;
    }

As you can see no "Begin CustomAction1" entry in the logs.

My custom action Config:

<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" />
    <supportedRuntime version="v2.0.50727"/>
  </startup>
</configuration>

From wix code declaring 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 binding:

    <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>

1 Answer 1

3

The custom action is running, it's just not logging anything. That's a limitation in MSI -- you can't write to the log from a custom action invoked by DoAction in the UI.

Sign up to request clarification or add additional context in comments.

1 Comment

I guess manually writing a string array to a file it is then!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.