diff --git a/WebsitePanel/Sources/WebsitePanel.Server.WPIService/WPIService.cs b/WebsitePanel/Sources/WebsitePanel.Server.WPIService/WPIService.cs index 00c514a9..b1f731c9 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.WPIService/WPIService.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.WPIService/WPIService.cs @@ -172,6 +172,7 @@ namespace WebsitePanel.Server.WPIService { _wpiHelper.InstallProducts( _productsToInstall, + true, //search and install dependencies WpiHelper.DeafultLanguage, InstallStatusUpdatedHandler, InstallCompleteHandler diff --git a/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs b/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs index c067889a..8d948c78 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs @@ -185,6 +185,35 @@ namespace WebsitePanel.Server.Code return installersToUse; } + public List GetProducts(IEnumerable productIdsToInstall) + { + List productsToInstall = new List(); + + foreach (string productId in productIdsToInstall) + { + Log(string.Format("Product {0} to be installed", productId)); + + Product product = _productManager.GetProduct(productId); + if (null == product) + { + Log(string.Format("Product {0} not found", productId)); + continue; + } + if (product.IsInstalled(true)) + { + Log(string.Format("Product {0} is installed", product.Title)); + } + else + { + Log(string.Format("Adding product {0}", product.Title)); + + productsToInstall.Add(product); + } + } + + return productsToInstall; + } + public List GetProductsWithDependencies(IEnumerable productIdsToInstall ) { @@ -309,6 +338,7 @@ namespace WebsitePanel.Server.Code public Product GetProduct(string productId) { + return _productManager.GetProduct(productId); } @@ -321,13 +351,24 @@ namespace WebsitePanel.Server.Code public void InstallProducts( IEnumerable productIdsToInstall, + bool installDependencies, string languageId, EventHandler installStatusUpdatedHandler, EventHandler installCompleteHandler) { - - // Get products & dependencies list to install - List productsToInstall = GetProductsWithDependencies(productIdsToInstall); + + List productsToInstall = null; + if (installDependencies) + { + // Get products & dependencies list to install + productsToInstall = GetProductsWithDependencies(productIdsToInstall); + } + else + { + productsToInstall = GetProducts(productIdsToInstall); + } + + // Get installers Language lang = GetLanguage(languageId); @@ -406,6 +447,8 @@ namespace WebsitePanel.Server.Code Installer appInstaller = app.GetInstaller(GetLanguage(languageId)); WpiAppInstallLogger logger = new WpiAppInstallLogger(); + + if (null != installStatusUpdatedHandler) { _installManager.InstallerStatusUpdated += installStatusUpdatedHandler; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx index 0958ece2..cdc10a06 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx @@ -10,9 +10,12 @@
+ - +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx.cs index e50c141e..fdb04326 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx.cs @@ -64,6 +64,7 @@ namespace WebsitePanel.Portal { // app does not meet requirements messageBox.ShowMessage(appResult, "WAG_CANNOT_INSTALL_APPLICATION", "WebAppGallery"); + chIgnoreDependencies.Visible = true; btnInstall.Enabled = false; } } @@ -118,5 +119,10 @@ namespace WebsitePanel.Portal RedirectSpaceHomePage(); } + protected void chIgnoreDependencies_CheckedChanged(object sender, EventArgs e) + { + btnInstall.Enabled = chIgnoreDependencies.Checked; + } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx.designer.cs index c1fb304b..5a252fb2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx.designer.cs @@ -30,6 +30,15 @@ namespace WebsitePanel.Portal { /// protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + /// + /// chIgnoreDependencies control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chIgnoreDependencies; + /// /// appHeader control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryParams.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryParams.ascx.cs index b45f78b4..9c8fa07b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryParams.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryParams.ascx.cs @@ -74,13 +74,13 @@ namespace WebsitePanel.Portal // bind app details appHeader.BindApplicationDetails(appResult.Value); - // check for warnings - if (appResult.ErrorCodes.Count > 0) - { - // app does not meet requirements - messageBox.ShowMessage(appResult, "WAG_CANNOT_INSTALL_APPLICATION", "WebAppGallery"); - btnInstall.Enabled = false; - } + //// check for warnings + //if (appResult.ErrorCodes.Count > 0) + //{ + // // app does not meet requirements + // messageBox.ShowMessage(appResult, "WAG_CANNOT_INSTALL_APPLICATION", "WebAppGallery"); + // //btnInstall.Enabled = false; + //} // bind app parameters List parameters = GetApplicationParameters();