PreInstall WebRole and AspNet, small WiX UI fix for Server 2008.

This commit is contained in:
McMak 2015-05-05 11:05:42 +03:00
parent ef97dcfd38
commit 0d12cb94e8
5 changed files with 227 additions and 35 deletions

View file

@ -53,6 +53,45 @@ namespace WebsitePanel.WIXInstaller
public const string CustomDataDelimiter = "-=del=-";
#region CustomActions
[CustomAction]
public static ActionResult InstallWebFeatures(Session session)
{
var Msg = string.Empty;
var Ctx = session;
Ctx.AttachToSetupLog();
var Result = ActionResult.Success;
try
{
Log.WriteStart("InstallWebFeatures");
if(Tool.GetIsWebRoleInstalled())
{
if (!Tool.GetIsWebFeaturesInstalled())
{
Log.WriteInfo("InstallWebFeatures: ASP.NET.");
Tool.InstallWebFeatures(out Msg);
}
}
else
{
var Tmp = string.Empty;
Log.WriteInfo("InstallWebFeatures: IIS and ASP.NET.");
Tool.InstallWebRole(out Tmp);
Msg += Tmp;
Tool.InstallWebFeatures(out Tmp);
Msg += Tmp;
}
Log.WriteInfo("InstallWebFeatures: done.");
}
catch(Exception ex)
{
Log.WriteError(string.Format("InstallWebFeatures: fail - {0}.", ex.ToString()));
Result = ActionResult.Failure;
}
if(!string.IsNullOrWhiteSpace(Msg))
Log.WriteInfo(string.Format("InstallWebFeatures Tool Log: {0}.", Msg));
Log.WriteEnd("InstallWebFeatures");
return Result;
}
// Install.
[CustomAction]
public static ActionResult OnServerInstall(Session session)