private void InitUpdateWebPlugin(string url)
 {
     if (!url.Contains("battlelog-web-plugins")) throw new ArgumentException();
     string filename = Path.GetFileName(new Uri(url).LocalPath);
     var dl = new UIDownloader(url, filename, "Downloading Battlelog Web Plugins...");
     dl.DownloadComplete += (s, e) =>
     {
         dl.SyncCloseWindow();
         Process.Start(e.completedFilePath).WaitForExit();
         this.battlelogWebview.Reload(true);
     };
     dl.Show();
     dl.Start();
         
 }
Exemple #2
0
 internal async Task UpdateBattlelogium()
 {
                 string url = await new WebClient().DownloadStringTaskAsync("http://battlelogium.github.io/Battlelogium/releaseinfo/download/installer");
                 this.mainWindow.Dispatcher.Invoke(() => this.mainWindow.Hide());
                 string filename = Path.GetFileName(new Uri(url).LocalPath);
                 var dl = new UIDownloader(url, filename, "Updating Battlelogium...");
                 dl.DownloadComplete += (s, e) =>
                 {
                     dl.SyncCloseWindow();
                     Process.Start(e.completedFilePath, @"update "+"\""+Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)+"\"");
                     this.mainWindow.Dispatcher.Invoke(() => this.mainWindow.Close());
                 };
                 dl.Show();
                 dl.Start();
 }