diff --git a/WebsitePanel.Installer/Sources/VersionInfo.cs b/WebsitePanel.Installer/Sources/VersionInfo.cs index f939546f..9434d902 100644 --- a/WebsitePanel.Installer/Sources/VersionInfo.cs +++ b/WebsitePanel.Installer/Sources/VersionInfo.cs @@ -37,5 +37,5 @@ using System.Reflection; [assembly: AssemblyCompany("Outercurve Foundation")] [assembly: AssemblyCopyright("Copyright © 2012 Outercurve Foundation.")] [assembly: AssemblyVersion("1.2.1.0")] -[assembly: AssemblyFileVersion("1.2.1.0")] +[assembly: AssemblyFileVersion("1.2.1.1")] [assembly: AssemblyInformationalVersion("1.2.1")] \ No newline at end of file diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Installer.Core/Loader.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Installer.Core/Loader.cs index 39fe1861..54ef5d79 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Installer.Core/Loader.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Installer.Core/Loader.cs @@ -80,7 +80,7 @@ namespace WebsitePanel.Installer.Core private WebClient fileLoader; - public BitlyLoader(string remoteFile) + internal BitlyLoader(string remoteFile) : base(remoteFile) { InitFileLoader(); @@ -175,7 +175,7 @@ namespace WebsitePanel.Installer.Core public event EventHandler> ProgressChanged; public event EventHandler OperationCompleted; - public Loader(string remoteFile) + internal Loader(string remoteFile) { this.remoteFile = remoteFile; } diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Installer/Updater.exe b/WebsitePanel.Installer/Sources/WebsitePanel.Installer/Updater.exe index 9105eeef..201af23a 100644 Binary files a/WebsitePanel.Installer/Sources/WebsitePanel.Installer/Updater.exe and b/WebsitePanel.Installer/Sources/WebsitePanel.Installer/Updater.exe differ diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.SilentInstaller/Program.cs b/WebsitePanel.Installer/Sources/WebsitePanel.SilentInstaller/Program.cs index 76fbefd8..621b0c16 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.SilentInstaller/Program.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.SilentInstaller/Program.cs @@ -337,10 +337,13 @@ namespace WebsitePanel.SilentInstaller string installerPath = Utils.GetDbString(row["InstallerPath"]); string installerType = Utils.GetDbString(row["InstallerType"]); + // Get appropriate loader to download the app distributive + var loader = LoaderFactory.CreateFileLoader(fileName); + // Mimic synchronous download process for the console app + AutoResetEvent autoEvent = new AutoResetEvent(false); + try { - // download installer - var loader = new Loader(fileName); // loader.OperationCompleted += new EventHandler((object sender, EventArgs e) => { @@ -374,25 +377,26 @@ namespace WebsitePanel.SilentInstaller Log.WriteEnd("Installer finished"); // Remove temporary directory FileUtils.DeleteTempDirectory(); + // We are done + autoEvent.Set(); }); - + // TODO: Add cleanup for events. loader.OperationFailed += new EventHandler>(loader_OperationFailed); loader.ProgressChanged += new EventHandler>(loader_ProgressChanged); loader.StatusChanged += new EventHandler>(loader_StatusChanged); // loader.LoadAppDistributive(); + // Wait until the download is complete + autoEvent.WaitOne(); } catch (Exception ex) { Log.WriteError("Installer error", ex); - //AppContext.AppForm.ShowError(ex); } finally { - //this.componentSettingsXml = null; - //this.componentCode = null; + autoEvent.Set(); } - } static void loader_StatusChanged(object sender, LoaderEventArgs e)