private async void MainWindow_Loaded(object sender, RoutedEventArgs e) { if (Environment.OSVersion.Version < minimumOSVersion) { this.ShowError("Thank you for using Mix It Up, but unfortunately we only support Windows 8 & higher. If you are running Windows 8 or higher and see this message, please contact Mix It Up support for assistance."); this.Close(); return; } await Task.Run(() => { try { if (InstallerHelpers.DownloadMixItUp()) { if (InstallerHelpers.CreateMixItUpShortcut()) { Process.Start(Path.Combine(InstallerHelpers.StartMenuDirectory, InstallerHelpers.ShortcutFileName)); this.Dispatcher.Invoke(() => { this.Close(); }); } } return; } catch (Exception ex) { System.IO.File.WriteAllText("MixItUp-Installer-Log.txt", ex.ToString()); } this.ShowError("We were unable to download the latest Mix It Up version. Please contact [email protected] for assistance."); }); }
private async void MainWindow_Loaded(object sender, RoutedEventArgs e) { if (Environment.OSVersion.Version < minimumOSVersion) { this.ShowError("Thank you for using Mix It Up, but unfortunately we only support Windows 8 & higher. If you are running Windows 8 or higher and see this message, please contact Mix It Up support for assistance."); this.Close(); return; } await Task.Run(async() => { try { if (InstallerHelpers.DownloadMixItUp()) { if (InstallerHelpers.IsMixItUpAlreadyInstalled()) { this.ShowMessage("We've detected that Mix It Up is already installed. Would you like us to keep your existing settings?"); do { await Task.Delay(1000); } while (response == null); this.ShowRegularView(); InstallerHelpers.DeleteExistingInstallation(response.GetValueOrDefault()); } InstallerHelpers.InstallMixItUp(); if (InstallerHelpers.CreateMixItUpShortcut()) { Process.Start(Path.Combine(InstallerHelpers.StartMenuDirectory, InstallerHelpers.ShortcutFileName)); this.Dispatcher.Invoke(() => { this.Close(); }); } } return; } catch (Exception ex) { System.IO.File.WriteAllText("MixItUp-Installer-Log.txt", ex.ToString()); } this.ShowError("We were unable to download the latest Mix It Up version. Please contact [email protected] for assistance."); }); }