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.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Threading;
using Microsoft.Web.PlatformInstaller;
@ -188,6 +189,8 @@ namespace WebsitePanel.Server.WPIService
{
_installationStatus = EWPIServiceStatus.InstallationComplete;
}
CheckIISAlive();
}
@ -242,6 +245,27 @@ namespace WebsitePanel.Server.WPIService
_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
}
}