Added file logger and default values for usernames, passwords.

This commit is contained in:
McMak 2015-05-08 20:50:54 +03:00
parent b35dec4356
commit ff7ccc7dab
4 changed files with 93 additions and 5 deletions

View file

@ -54,6 +54,32 @@ namespace WebsitePanel.WIXInstaller
#region CustomActions
[CustomAction]
public static ActionResult PreFillSettings(Session session)
{
PopUpDebugger();
var Ctx = session;
Ctx.AttachToSetupLog();
Log.WriteStart("PreFillSettings");
TryApllyNewPassword(Ctx, "PI_SERVER_PASSWORD");
TryApllyNewPassword(Ctx, "PI_ESERVER_PASSWORD");
TryApllyNewPassword(Ctx, "PI_PORTAL_PASSWORD");
TryApllyNewPassword(Ctx, "SERVER_ACCESS_PASSWORD");
TryApllyNewPassword(Ctx, "SERVERADMIN_PASSWORD");
Log.WriteEnd("PreFillSettings");
return ActionResult.Success;
}
private static void TryApllyNewPassword(Session Ctx, string Id)
{
var Pass = Ctx[Id];
if(string.IsNullOrWhiteSpace(Pass))
{
Pass = Guid.NewGuid().ToString();
Ctx[Id] = Pass;
Ctx[Id + "_CONFIRM"] = Pass;
Log.WriteInfo("New password was applied to " + Id);
}
}
[CustomAction]
public static ActionResult InstallWebFeatures(Session session)
{
var Msg = string.Empty;
@ -406,6 +432,7 @@ namespace WebsitePanel.WIXInstaller
[CustomAction]
public static ActionResult FillIpListUI(Session session)
{
PopUpDebugger();
var Ctrls = new[]{ new ComboBoxCtrl(session, "PI_SERVER_IP"),
new ComboBoxCtrl(session, "PI_ESERVER_IP"),
new ComboBoxCtrl(session, "PI_PORTAL_IP") };
@ -758,6 +785,7 @@ namespace WebsitePanel.WIXInstaller
{
WiXSetup.InstallLogListener(new WiXLogListener(Ctx));
WiXSetup.InstallLogListener(new InMemoryStringLogListener("WIX CA IN MEMORY"));
WiXSetup.InstallLogListener(new WiXLogFileListener());
}
}