/// <summary> /// Uninstall the app /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Uninstall(object sender, RoutedEventArgs e) { if (MessageBox.Show("Do you really want to uninstall this program ?", "Uninstall", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { Install install = new Install(PROGRAMS_PATH, INSTALL_PATH, TEMP_PATH, DL_FILE_NAME, UNINSTALLBAT_PATH); string info = install.Uninstall(); if (info != null) { MessageBox.Show(info, "Uninstall", MessageBoxButton.OK, MessageBoxImage.Information); } } }
private async void StartInstall(GitHubReleaseFetcher.DownloadableFiles[] downloadableFiles) { Install install = new Install(PROGRAMS_PATH, INSTALL_PATH, TEMP_PATH, DL_FILE_NAME, UNINSTALLBAT_PATH); install.PreInstall(); foreach (GitHubReleaseFetcher.DownloadableFiles downloadable in downloadableFiles) { dlLbl.Content = "Téléchargement de " + downloadable; string url = GitHubReleaseFetcher.GetReleaseAssetUrl(downloadable); DownloadFile dlFile = new DownloadFile(); dlFile.onProgressChanged += (object sender, DownloadProgressChangedEventArgs e) => { DownLoadProgress.Value = e.ProgressPercentage; }; // need to change the DL_FILE_NAME Task t = dlFile.DownloadFromUrl(new Uri(url), System.IO.Path.Combine(TEMP_PATH, downloadable.ToString()), null); await t; } install.InstallApp(downloadableFiles, () => { ShowNextGrid(); }); }