I'm trying to show a custom status message in default wix's ProgressDlg, following this answer:
WiX: dynamically changing the status text during CustomAction
So far, I got this code in my custom action:
public class CustomActions
{
[CustomAction]
public static ActionResult CustomAction1(Session session)
{
Debugger.Launch();
session.Log("Begin CustomAction1");
MessageTest(session);
return ActionResult.Success;
}
private static void MessageTest(Session session)
{
for (int i = 0; i < 10; i++)
{
using (Record r = new Record(0))
{
r.SetString(0, $"Hello worls {i}");
session.Message(InstallMessage.ActionData, r);
}
Thread.Sleep(1000);
}
}
}
Then, in Product.wxs have the following xml fragment:
<Binary Id="CuCustomInstallActionsBinary" SourceFile="$(var.ConsoleApplication1_TargetDir)CustomAction1.CA.dll" />
<CustomAction Id="CuCustomActionOnAfterInstall" BinaryKey="CuCustomInstallActionsBinary" DllEntry="CustomAction1" Execute="deferred" HideTarget="no" Return="check" Impersonate="no" />
<InstallExecuteSequence>
<Custom Action="CuCustomActionOnAfterInstall" Before="InstallFinalize"><![CDATA[(NOT Installed) AND (NOT REMOVE)]]></Custom>
</InstallExecuteSequence>
But nothing is been shown in UI. The status message remains empty while the custom action runs.
Is there anything else that should be done to acomplish this? Maybe suscribing to <Subscribe Event="ActionData" Attribute="Text" />
Do I have to implement my own custom ProgressDlg for this?