public static void InstallSwitch(string AppToInstall) { try { if (Properties.Settings.Default.Drive == String.Empty) { Core.ILogging.Output(true, false, false, false, "The Drive settings field has been left empty. Please configure this and try again.", true); MessageBox.Show("The Drive settings field has been left empty. Please configure this and try again.", "Error: No Drive set", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); Form Fs = new FmSelectSystem(); Fs.Show(); FmSelectSystem.SettingsActive = true; return; } Downloading = true; PackageDownloadComplete = false; PackageProgress = 0; Path = cd + "\\Data\\Cache\\Switch\\" + AppToInstall + ".zip"; Uri URL = new Uri("https://www.switchbru.com/appstore/zips/" + AppToInstall + ".zip"); CacheCheck.PerformCheck(); URLStr = URL.ToString(); GetPackage.DownloadProgressChanged += new DownloadProgressChangedEventHandler(PackageDownloadProgress); GetPackage.DownloadFileCompleted += new AsyncCompletedEventHandler(PackageDownloadedAsync); GetPackage.DownloadFileAsync(URL, Path); return; } catch (Exception ex) { Core.ILogging.Output(true, false, false, false, ex.Message, true); MessageBox.Show(ex.Message + Environment.NewLine + "URL: " + URLStr, "Error:", MessageBoxButtons.OK, MessageBoxIcon.Error); Installing = false; Downloading = false; return; } }
private void FmSelectSystem_Load(object sender, EventArgs e) { LblVersion.Text = "Version: " + Application.ProductVersion; CacheCheck.PerformCheck(); this.Refresh(); return; }