I have been using Wix Toolset to create custom Actions. I can easily pass information through properties in Actions (modify property values, read property values). The following is an example of Action.
Code: Select all
[CustomAction]
public static ActionResult ValidateUserAccountAction(Session session)
{
session.Log("Begin ValidateUserAccountAction");
const string sessionResultName = "USERACCOUNT_VALIDATION_RESULT";
try
{
if (!ValidateUsername(session))
{
session[sessionResultName] = "False";
return ActionResult.Success;
}
if (!ValidatePassword(session))
{
session[sessionResultName] = "False";
return ActionResult.Success;
}
session["CREDENTIAL_STRING"] = CredentialFileUtils.BuildUserCredential();
session[sessionResultName] = "True";
}
catch (Exception e)
{
session["ACTION_MESSAGE"] = Properties.Resources.StringUnknownError;
session[sessionResultName] = "False";
session.Log("ValidateUserAccountAction: " + e.Message);
}
finally
{
session.Log("End ValidateUserAccountAction");
}
return ActionResult.Success;
}
So I want to create an exe file based on .NET 7, and contain all the Custom Actions in this exe file. My question is how to read and modify the property values in the Custom Action of this exe?