This commit is contained in:
Sergey 2012-08-14 15:11:50 +03:00
commit 27059e69df

View file

@ -29,6 +29,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using Microsoft.Web.PlatformInstaller; using Microsoft.Web.PlatformInstaller;
@ -188,9 +189,11 @@ namespace WebsitePanel.Server.WPIService
{ {
_installationStatus = EWPIServiceStatus.InstallationComplete; _installationStatus = EWPIServiceStatus.InstallationComplete;
} }
CheckIISAlive();
} }
private void InstallStatusUpdatedHandler(object sender, InstallStatusEventArgs e) private void InstallStatusUpdatedHandler(object sender, InstallStatusEventArgs e)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -242,6 +245,27 @@ namespace WebsitePanel.Server.WPIService
_statusMessage = sb.ToString(); _statusMessage = sb.ToString();
} }
} }
private void CheckIISAlive()
{
// run iisreset /start
ProcessStartInfo processStartInfo = new ProcessStartInfo(@"C:\Windows\System32\iisreset.exe", "/start");
processStartInfo.UseShellExecute = false;
try
{
using (Process exeProcess = Process.Start(processStartInfo))
{
exeProcess.WaitForExit();
Debug.Write("WPIService: iisreset /start returns "+exeProcess.ExitCode);
}
}
catch (Exception ex)
{
Debug.Write("WPIService: iisreset /start exception: "+ex.ToString());
}
}
#endregion #endregion
} }
} }