/// <summary> /// Checks if there are any updates for the mod loader. /// </summary> public static async Task CheckForLoaderUpdatesAsync() { // Check for loader updates. try { using (var manager = new UpdateManager( new GithubPackageResolver("Reloaded-Project", "Reloaded-II", "Release.zip"), new ArchiveExtractor())) { // Check for new version and, if available, perform full update and restart var result = await manager.CheckForUpdatesAsync(); if (result.CanUpdate) { ActionWrappers.ExecuteWithApplicationDispatcher(() => { var dialog = new ModLoaderUpdateDialog(manager, result.LastVersion); dialog.ShowDialog(); }); } } } catch (Exception) { MessageBox.Show(_xamlCheckUpdatesFailed.Get()); } }
/// <summary> /// Checks if there are any updates for the mod loader. /// </summary> public static async Task CheckForLoaderUpdatesAsync() { if (!_hasInternetConnection) { return; } // Check for loader updates. try { using (var manager = new UpdateManager( new GithubPackageResolver(Misc.Constants.GitRepositoryAccount, Misc.Constants.GitRepositoryName, Constants.GitRepositoryReleaseName), new ArchiveExtractor())) { // Check for new version and, if available, perform full update and restart var result = await manager.CheckForUpdatesAsync(); if (result.CanUpdate) { ActionWrappers.ExecuteWithApplicationDispatcher(() => { var dialog = new ModLoaderUpdateDialog(manager, result.LastVersion); dialog.ShowDialog(); }); } } } catch (Exception) { MessageBox.Show(_xamlCheckUpdatesFailed.Get()); } }