and it looks like that:
Code: Select all
public static ActionResult VerifyLicense(Session session)
{
session.Log("Begin CustomAction1");
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += (sender, args) => {
return Assembly.ReflectionOnlyLoad(args.Name);
};
string licKey = session["LICKEY"];
session.Log(licKey);
string msg = CheckLicense(licKey).Result;
session["SHOW_LIC_MSG"] = "1";
session["LIC_VALIDATION_MSG"] = msg;
session.Log(msg);
MessageBox.Show(String.Format($"{msg}"), "Open Workspace", MessageBoxButtons.OK);
if (msg.IndexOf("Success:", 0, StringComparison.OrdinalIgnoreCase) != -1)
{
session["ENABLE_NEXT"] = "1"; // A new property to control enabling the Next button
session.Log("Next button is enabled");
string ret = session["ENABLE_NEXT"];
MessageBox.Show(String.Format($"ENABLE_NEXT: {ret}"));
}
else
{
session["ENABLE_NEXT"] = "0"; // A new property to control enabling the Next button
}
return ActionResult.Success;
}session["ENABLE_NEXT"] = "1"; This code does nothing to the button which is initially disabled. If custom action fails, the button should remain disabled and if it succeeds it should get enabled.
Also to mention that Next button has Control Conditions:
ENABLE_NEXT = "1" Action: Enable
The custom action is not sequenced action "Call function from attached native DLL". I assume that all the actions are immediate since there are no controls that allow me to enable/disable "immediate" thing.
What am I doing wrong and why is it not working?