Code: Select all
using Microsoft.Deployment.WindowsInstaller;
using System.Threading;
namespace SampleAip
{
public class CustomActions
{
[CustomAction]
public static ActionResult TextTemplateTest(Session session)
{
var strings = new[] {
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
};
session.Log("~~~~~ Loop should be starting...");
session.Message(InstallMessage.ActionStart, new Record(3, new object[] { "TextTemplateTest", "Testing stuff...", "Letter: [1]" }));
foreach (string s in strings) {
session.Message(InstallMessage.ActionData, new Record(2, new object[] { "Letter: [1]", s }));
session.Log("Trying to set Action Text to " + s);
Thread.Sleep(3000);
}
session.Log("Should be done!");
return ActionResult.Failure;
}
}
}
I've tried setting the Action Start values in the Edit Action Properties Box displayed when clicking Action Text... and I've tried using an InstallMessage.ActionStart (shown above) instead, but the closest I can get is the Action Text displaying "System.Object".
I've tried a size 1 Record with s as the lone field.
The logging works as intended.
I'm not sure how to proceed, but would really like to get this working as we have a very long-running custom action which installis NGen assemblies and progress updates on that would be a big plus.
The attached .aip has no information in the Action Text... but has in the past had "Testing" as the description and "Letter: [1]" as the template.
FOLLOW US
Get the latest news in Application Packaging