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();
        } 
Beispiel #2
0
        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 bool CheckOrigin()
 {
     return(DependencyCheck.CheckKey(@"Software\Origin"));
 }