WPI: Check if the WebDeploy is installed

WPI: Check if download is completed successfully
WPI: LoadUserProfile on Windows 2003
This commit is contained in:
Sergey 2012-10-25 13:10:11 +03:00
parent 47ba8449ad
commit b19350e64d
6 changed files with 103 additions and 76 deletions

View file

@ -3396,7 +3396,8 @@ namespace WebsitePanel.Providers.Web
virtual public bool CheckLoadUserProfile()
{
throw new NotImplementedException("LoadUserProfile option valid only on IIS7 or higer");
//throw new NotImplementedException("LoadUserProfile option valid only on IIS7 or higer");
return false;
}
virtual public void EnableLoadUserProfile()
@ -3421,20 +3422,28 @@ namespace WebsitePanel.Providers.Web
public bool IsMsDeployInstalled()
{
// project has reference to Microsoft.Web.Deployment, so
return true;
/*
// TO-DO: Implement Web Deploy detection (x64/x86)
var isInstalled = false;
//
try
{
Assembly.Load(MS_DEPLOY_ASSEMBLY_NAME);
return true;
var msdeployRegKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3");
//
var keyValue = msdeployRegKey.GetValue("Install");
// We have found the required key in the registry hive
if (keyValue != null && keyValue.Equals(1))
{
isInstalled = true;
}
}
catch
catch (Exception ex)
{
// type could not be instantiated
return false;
Log.WriteError("Could not retrieve Web Deploy key from the registry", ex);
}
*/
//
return isInstalled;
}
public GalleryLanguagesResult GetGalleryLanguages(int UserId)
@ -3551,6 +3560,11 @@ namespace WebsitePanel.Providers.Web
return module.DownloadAppAndGetStatus(UserId, id);
}
catch (UnauthorizedAccessException ex)
{
Log.WriteError(ex);
return GalleryWebAppStatus.UnauthorizedAccessException;
}
catch (Exception ex)
{
Log.WriteError(ex);