我想显示默认的WiX的ProgressDlg自定义状态消息,以下这个答案自定义状态消息:维克斯,显示ProgressDlg
WiX: dynamically changing the status text during CustomAction
到目前为止,我在我的自定义操作得到这个代码:
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);
}
}
}
然后,在Product.wxs具有下面的XML片段:
<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>
但在UI中没有显示任何内容。在自定义操作运行时,状态消息保持为空。
还有什么应该做acomplish呢?也许订阅<Subscribe Event="ActionData" Attribute="Text" />
我是否必须为此实现自己的自定义ProgressDlg?
您可以通过使用MSI中的ActionText表应用每个自定义操作的一个自定义消息。 – jbudreau
@jbudreau只要我明白,ActionText显示当前操作名称,但我需要显示自定义消息,这就是为什么我认为我需要ActionData – Oscar
如果你看看ActionText表有3列:'行动'(应该'Description'(这是放置自定义/本地化显示字符串的地方)和'Template'(用于将ActionData打印到MSI日志文件)。打开已完成的MSI文件并查看ActionText表以了解每列的填充情况。 – jbudreau