diff --git a/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs b/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs index 11efc0b7..a6b84657 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs @@ -520,7 +520,7 @@ namespace WebsitePanel.Server.Code { Product app = GetProduct(appId); - Installer appInstaller = app.GetInstaller(GetLanguage(languageId)); + Installer appInstaller = GetInstaller(languageId, app); WpiAppInstallLogger logger = new WpiAppInstallLogger(); /* @@ -586,6 +586,25 @@ namespace WebsitePanel.Server.Code return !logger.IsFailed; } + private Installer GetInstaller(string languageId, Product product) + { + Installer installer = product.GetInstaller(GetLanguage(languageId)); + if (null == installer) + { + installer = product.GetInstaller(GetLanguage(DeafultLanguage)); + if (null == installer) + { + throw new Exception( + string.Format( + "Could not get installer for product '{0}', language: {1}, default language: {2}", + product.Title, languageId, DeafultLanguage) + ); + } + } + + return installer; + } + #endregion #endregion Public interface @@ -701,10 +720,11 @@ namespace WebsitePanel.Server.Code private List GetInstallers(List productsToInstall, Language lang) { + Language defaultLang = GetLanguage(DeafultLanguage); List installersToUse = new List(); foreach (Product product in productsToInstall) { - Installer installer = product.GetInstaller(lang); + Installer installer = product.GetInstaller(lang) ?? product.GetInstaller(defaultLang); if (null != installer) { installersToUse.Add(installer);