public async Task Install() { this.installButton.IsEnabled = false; this.browseButton.IsEnabled = false; this.dependencies = new DependencyCheck(); this.downloader = new WebClient(); progressBar.IsIndeterminate = true; if(!this.dependencies.IsOriginInstalled) await InstallOrigin(); await InstallDependency("vcredist", "Microsoft VC Redistributable 2012"); try { if (!Directory.Exists(installPath)) Directory.CreateDirectory(installPath); try { System.IO.File.Copy(Assembly.GetEntryAssembly().Location, Path.Combine(installPath, "Battlelogium.Installer.exe"), true); } catch { }; } catch { MessageBox.Show("Failure occured regarding install directory, please try again"); Environment.Exit(1); } this.Hide(); string url = await InstallerCommon.GetDownload("battlelogium"); var updater = new BattlelogiumInstaller(url, installPath); updater.DownloadComplete += (s, e) => { this.Close(); }; updater.BeginUpdate(); }
private async void Application_Startup(object sender, StartupEventArgs e) { AppDomain.CurrentDomain.UnhandledException += (s, unhandledevent) => { this.Shutdown(1); }; string[] args = Environment.GetCommandLineArgs(); if (args.Length == 1) { new UIInstaller().Show(); return; } if (args[1] == "update") { if (args.Length == 2) { MessageBox.Show("No update path provided"); this.Shutdown(); } InstallerCommon.KillBattlelogium(); string path = args[2]; string url = await InstallerCommon.GetDownload("battlelogium"); var updater = new BattlelogiumInstaller(url, path); updater.BeginUpdate(); return; } if (args[1] == "uninstall") { if (File.Exists("filelist")) { InstallerCommon.KillBattlelogium(); new UIUninstaller().Show(); return; } MessageBox.Show("filelist not found, Uninstall is unable to continue"); this.Shutdown(); return; } return; }
public async Task Install() { this.installButton.IsEnabled = false; this.browseButton.IsEnabled = false; this.dependencies = new DependencyCheck(); this.downloader = new WebClient(); progressBar.IsIndeterminate = true; if (!this.dependencies.IsOriginInstalled) { await InstallOrigin(); } await InstallDependency("vcredist", "Microsoft VC Redistributable 2012"); try { if (!Directory.Exists(installPath)) { Directory.CreateDirectory(installPath); } try { System.IO.File.Copy(Assembly.GetEntryAssembly().Location, Path.Combine(installPath, "Battlelogium.Installer.exe"), true); } catch { }; } catch { MessageBox.Show("Failure occured regarding install directory, please try again"); Environment.Exit(1); } this.Hide(); string url = await InstallerCommon.GetDownload("battlelogium"); var updater = new BattlelogiumInstaller(url, installPath); updater.DownloadComplete += (s, e) => { this.Close(); }; updater.BeginUpdate(); }