//프로그램 종료 전 public SmartUpdater(ISmartUpdatable applicationInfo, UpdateWindow win) { type = 1; this.applicationInfo = applicationInfo; this.win = win; this.bgWorker = new BackgroundWorker(); this.bgWorker.DoWork += new DoWorkEventHandler(bgWorker_DoWork); this.bgWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgWorker_RunWorkerCompleted); }
/// <summary> /// The OnContentRendered. /// </summary> /// <param name="e">The e<see cref="EventArgs"/>.</param> protected override void OnContentRendered(EventArgs e) { base.OnContentRendered(e); if (AppSettings.Default.VersionAutoCheck) { var version = Application.Current.MainWindow.GetType() .Assembly .GetCustomAttribute <AssemblyInformationalVersionAttribute>() .InformationalVersion; try { var verCheck = new VersionCheck(version, AppSettings.Default.PackageUrl); if (verCheck.DoesUpdateExist && (AppSettings.Default.IncludePrereleaseVersions || verCheck.LastestVersionIsPrerelease == false)) { var win = new UpdateWindow(verCheck); WpfHelper.SetWindowSettings(this); win.ShowDialog(); } } catch { // Ignore exceptions here. } } }
public static void UpdateLoader() { var result = GetLoaderVersionInfo(); try { if (File.Exists(SetupFile)) { Thread.Sleep(1000); File.Delete(SetupFile); } } catch { MessageBox.Show(Utility.GetMultiLanguageText("FailedToDelete")); Environment.Exit(0); } if (result.Item1) { var window = new UpdateWindow(); window.UpdateUrl = result.Item2; window.ShowDialog(); } }
public void InitializeVersionController() { ComponentFactory.GetComponent <IXapVersionController>().AutoCheckIntervalTime = TimeSpan.FromMinutes(8); ComponentFactory.GetComponent <IXapVersionController>().XapVersionChangedCompleted += (sender, args) => { m_xapVersionList = args.XapVersionList; Deployment.Current.Dispatcher.BeginInvoke(() => { if (!Application.Current.IsRunningOutOfBrowser) { var box = new UpdateWindow(m_xapVersionList); box.ShowWindow(); } else { //在OOB模式,判断是否存在主框架XAP包更新 var b = m_xapVersionList.Any(item => item.XapName.Equals(CPApplication.Current.FrameworkXapName, StringComparison.OrdinalIgnoreCase)); //如果主框架包没有更新,则显示提示框 if (!b) { var box = new UpdateWindow(m_xapVersionList); box.ShowWindow(); } else { m_isFirstCheck = false; Application.Current.CheckAndDownloadUpdateAsync(); } } }); }; }
public void Back() { audioSource.PlayOneShot(backClip); if (isSelect) { if (isUpdate) { UpdateWindow.SetActive(false); SelectedWindow.SetActive(true); isUpdate = false; } else { PrevWindow.SetActive(true); SelectedWindow.SetActive(false); isSelect = false; Snap.GetComponent <HorizontalScrollSnap>().enabled = true; Snap.GetComponent <ScrollRect>().enabled = true; } } else { SceneManager.LoadScene("Menu"); } }
private void MetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (ServerCheckThread != null) { ServerCheckThread.Abort(); //a join would not work, so we have to be..forcefully... } List <string> lastOpenFiles = new List <string>(); EditorElement[] editors = GetAllEditorElements(); bool? SaveUnsaved = null; if (editors != null) { for (int i = 0; i < editors.Length; ++i) { if (File.Exists(editors[i].FullFilePath)) { lastOpenFiles.Add(editors[i].FullFilePath); if (editors[i].NeedsSave) { if (SaveUnsaved == null) { var result = MessageBox.Show(this, "Save all unsaved files?", "Saving", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { SaveUnsaved = true; } else { SaveUnsaved = false; } } if (SaveUnsaved.Value) { editors[i].Close(true, true); } else { editors[i].Close(false, false); } } else { editors[i].Close(false, false); } } } } Program.OptionsObject.LastOpenFiles = lastOpenFiles.ToArray(); #if !DEBUG if (Program.UpdateStatus.IsAvailable) { UpdateWindow updateWin = new UpdateWindow(Program.UpdateStatus) { Owner = this }; updateWin.ShowDialog(); } #endif }
internal static void LoaderUpdateRoutine(UpdateWindow ui, Dictionary <string, object> args) { #if DEBUG return; #endif var updateData = (UpdateData)args["updateData"]; if (updateData != null) { ui.CurrentProgress = 0; ui.OveralMaxProgress = 100; var currentFilePath = Process.GetCurrentProcess().MainModule.FileName; if (!Md5Hash.Compare(Md5Hash.ComputeFromFile(currentFilePath), updateData.Loader.MD5, true)) { ui.Details = MultiLanguage.Text.UpdateDetailsLoaderDownloading; if (!DownloadFile(updateData.Loader.Download, currentFilePath)) { ExitDownloadError(currentFilePath); } args["restartRequired"] = true; } } }
/// <summary> /// Główna funkcja aktualizacji /// </summary> /// <param name="appName">Nazwa aplikacji</param> /// <param name="includeBeta">Czy brać pod uwagę pliki beta?</param> public static void Update(string appName) { if (!IsInternetAvailible()) { return; } try { // Sprawdź aktualizację, pokaż okno itp. INCLUDE_BETA = IsBetaTester(appName); var fileArray = GetUpdateData(appName); var isUpdateAvailible = IsUpdateAvailible(fileArray, appName); var isForceUpdateAvailible = IsForceUpdateAvailible(fileArray); // Czy dostępna jest aktualizcaja? if (isUpdateAvailible) { Application.Current.Dispatcher.Invoke(delegate { UpdateWindow window = new UpdateWindow(appName, isForceUpdateAvailible, GetActiveVersion(), GetUpdateVersion(fileArray, appName)); window.ShowDialog(); }); } } catch { MessageBox.Show( "Update check failed.\nCheck our fanpage for updates:\nhttps://www.facebook.com/ZCodeApps/", "ZCode Updater", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void OpenHyperlink(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) { var p = e.Parameter.ToString(); if (p == "later") { Close(); } else if (p == "ignore") { AppSettings.Current.IgnoredVer = _release.NewVerString; AppSettings.SaveCurrent(); Close(); } else if (p == "update") { UpdateWindow updateWindow = new UpdateWindow(_release, _mainWindow); updateWindow.Show(); Close(); } else { Process.Start(p); } }
public void StartAll(bool restartStopping) { // check for missing components if (UpdateWindow.isComponentMissing()) { mainForm.startUpdateCheck(); return; } if (workers.Values.Count == 0) { NewWorker(freeWorkerName(), false); } foreach (JobWorker w in workers.Values) { if (!w.IsEncoding) { w.StartEncoding(false); } else if (restartStopping && w.Status == JobWorkerStatus.Stopping) { w.SetRunning(); } } refresh(); }
private void BtnUpdate_Click(object sender, RoutedEventArgs e) { UpdateWindow updateWindow = new UpdateWindow(_release, _mainWindow); updateWindow.Show(); Close(); }
/// <summary> /// This is where we check for updates, once the window is loaded. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void Window_ContentRendered(object sender, EventArgs e) { isRendered = true; UpdateCheckProgressBar.Visibility = Visibility.Visible; UpdateCheckLabel.Visibility = Visibility.Visible; bool updateAvailable = await Task.Run(() => UpdateChecker.CheckForUpdates()); isBackgroundUpdateChecking = true; if (updateAvailable) { this.Title = $"{this.Title} [Outdated])"; string content = $"Found a new version ({UpdateChecker.latest}), currently using {UpdateChecker.current}. Check it out?\n\nChangelog ({UpdateChecker.latest}): {UpdateChecker.changelog}"; MessageBoxResult result = MessageBox.Show(content, "Update", MessageBoxButton.YesNo, MessageBoxImage.Information); if (result == MessageBoxResult.Yes) { UpdateWindow uw = new UpdateWindow(UpdateChecker.latest); if (!uw.isClosing) { uw.Show(); } } } isBackgroundUpdateChecking = false; UpdateCheckProgressBar.Visibility = Visibility.Hidden; UpdateCheckLabel.Visibility = Visibility.Hidden; }
//private void OpenHyperlink(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) //{ // var p = e.Parameter.ToString(); // if (p == "later") // { // Close(); // } // else if (p == "ignore") // { // AppSettings.Default.IgnoredVer = _release.NewVerString; // AppSettings.SaveDefault(); // Close(); // } // else if (p == "update") // { // UpdateWindow updateWindow = new UpdateWindow(_release, _mainWindow); // updateWindow.Show(); // Close(); // } // else // Process.Start(p); //} private void Update_Click(object sender, System.Windows.RoutedEventArgs e) { var updateWindow = new UpdateWindow(_release, _mainWindow); updateWindow.Show(); Close(); }
public static void UpdateSystem() { IsRunning = true; Log.Instance.DoLog("Running elobuddy system updater."); var updateWindow = new UpdateWindow(); updateWindow.BeginUpdate( new UpdateWindow.UpdateWindowDelegate[] { LoaderUpdateRoutines.InitializeUpdateRoutine, LoaderUpdateRoutines.LoaderUpdateRoutine, LoaderUpdateRoutines.SystemFilesUpdateRoutine, LoaderUpdateRoutines.PatchFilesUpdateRoutine, LoaderUpdateRoutines.InstallFilesRoutine }, null); object json; updateWindow.Args.TryGetValue("updateDataJson", out json); LatestUpdateJson = (json ?? string.Empty).ToString(); updateWindow.Args.TryGetValue("coreJson", out json); LatestCoreJson = (json ?? string.Empty).ToString(); Log.Instance.DoLog("Elobuddy system updater has finished updating."); IsRunning = false; Events.RaiseOnSystemUpdateFinished(EventArgs.Empty); }
public static void UpdateLoader() { var result = GetLoaderVersionInfo(); try { if (File.Exists(SetupFile)) { Thread.Sleep(1000); File.Delete(SetupFile); } } catch (Exception e) { MessageBox.Show("Could not delete update file, please delete it manually and restart LeagueSharp"); Environment.Exit(0); } if (result.Item1) { var window = new UpdateWindow(); window.UpdateUrl = result.Item2; window.ShowDialog(); } }
private void updateTaskWorker_Click(object sender, RoutedEventArgs e) { TasksList path = todoListWorker.SelectedItem as TasksList; UpdateWindow uw = new UpdateWindow(path.id, priv, path.worker, path.name, path.difficulty, path.status, path.natureWork, path.timeLeft); uw.Show(); }
private void UpdateBtn_Click(object sender, RoutedEventArgs e) { if (!WindowHelpers.IsWindowOpen(typeof(UpdateWindow))) { UpdateWindow updateWindow = new UpdateWindow(); updateWindow.Show(); } }
/* The window is closing */ private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { /* Take care of external changes in the update window */ UpdateWindow.ExternalSaveConfiguration(appName, ref iniData, ref newIniData); /* Write our settings to our .ini file */ iniParser.WriteFile(iniFile, newIniData); }
static void Main() { if (Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); #if DEBUG Debug.WriteLine("Wallet starting ..."); //AllocConsole(); #endif XDocument xdoc = null; try { xdoc = XDocument.Load("http://localhost/pure/update/update.xml"); } catch { } if (xdoc != null) { Version version = Assembly.GetExecutingAssembly().GetName().Version; Version minimum = Version.Parse(xdoc.Element("update").Attribute("minimum").Value); if (version < minimum) { using (UpdateWindow dialog = new UpdateWindow(xdoc)) { dialog.ShowDialog(); } return; } } Form startForm; startForm = new MainForm(); if (File.Exists(Constant.PEER_STATE_PATH)) { using (FileStream fs = new FileStream(Constant.PEER_STATE_PATH, FileMode.Open, FileAccess.Read, FileShare.Read)) { LocalNode.LoadState(fs); } } using (Blockchain.RegisterBlockchain(new LevelDBBlockchain("chain"))) using (Constant.LocalNode = new LocalNode()) { Constant.LocalNode.UpnpEnabled = true; Application.Run(startForm); } using (FileStream fs = new FileStream(Constant.PEER_STATE_PATH, FileMode.Create, FileAccess.Write, FileShare.None)) { LocalNode.SaveState(fs); } }
internal static void smethod_5() { string text1 = new WebClient().DownloadString("http://updates.buddyauth.com/GetVersion?filter=Hearthbuddy"); if (text1 == "Unknown Version") { throw new Exception("There is no version information available from the server."); } Version version = new Version(text1); bool? nullable = null; Version version2 = Assembly.GetEntryAssembly().GetName().Version; if (version == version2) { ilog_0.InfoFormat("{0} [{1}] is up to date!", "Hearthbuddy", version2); } else if ((version2.Minor >= version.Minor) && (version2.Major >= version.Major)) { if (version < version2) { nullable = true; } else if (version > version2) { nullable = false; } if (nullable.HasValue) { bool?nullable2; if (CommandLine.Arguments.Exists("autoupdate")) { nullable2 = true; } else if (!nullable.Value) { nullable2 = new UpdateWindow("Hearthbuddy").ShowDialog(); } else { nullable2 = false; } if (nullable2.HasValue && nullable2.Value) { string exePath = Path.Combine(Path.GetTempPath(), string.Format("buddyupdater{0}.exe", Environment.TickCount)); new DownloadingWindow("Hearthbuddy", exePath).ShowDialog(); MessageBox.Show("Hearthbuddy will now close. Please restart it.", "Hearthbuddy", MessageBoxButton.OK, MessageBoxImage.Hand); Environment.Exit(0); } } } else { string format = string.Format("{0} [{1}] is now out-of-date. A new installation is required. Please check the forums for more information: https://www.thebuddyforum.com/hearthbuddy-forum/", "Hearthbuddy", version2); ilog_0.ErrorFormat(format, Array.Empty <object>()); MessageBox.Show(format, "Hearthbuddy", MessageBoxButton.OK, MessageBoxImage.Hand); Environment.Exit(0); } }
public static void ShowUpdateWindow() { var updateWindow = new UpdateWindow(); var updateViewModel = new UpdateViewModel(); updateWindow.DataContext = updateViewModel; updateViewModel.Update(); updateWindow.ShowDialog(); }
public static void UpdateLoader(Tuple<bool, string> versionCheckResult) { if (versionCheckResult.Item1 && (versionCheckResult.Item2.StartsWith("https://github.com/LeagueSharp/") || versionCheckResult.Item2.StartsWith("https://github.com/joduskame/") || versionCheckResult.Item2.StartsWith("https://github.com/Esk0r/"))) { var window = new UpdateWindow(); window.UpdateUrl = versionCheckResult.Item2; window.ShowDialog(); } }
public void UpdateMethod() { if (SelectedMember != null) { update = new UpdateWindow(); update.Show(); Messenger.Default.Send(SelectedMember); } }
public static async Task UpdateLoader(string url) { if (UpdateWhiteList.Any(url.StartsWith)) { var window = new UpdateWindow(UpdateAction.Loader, url); window.Show(); await window.Update(); } }
/// <summary> /// 打开更新窗口 /// </summary> private void OpenUpdateWindowClick() { // 更新窗口要以对话框形式处理 var UpdateWindow = new UpdateWindow { Owner = MainWindow.MainWindowIns }; UpdateWindow.ShowDialog(); }
private void MetroWindow_Closing(object sender, CancelEventArgs e) { ServerCheckThread?.Abort(); //a join would not work, so we have to be..forcefully... var lastOpenFiles = new List <string>(); var editors = GetAllEditorElements(); bool?SaveUnsaved = null; if (editors != null) { foreach (var editor in editors) { if (File.Exists(editor.FullFilePath)) { lastOpenFiles.Add(editor.FullFilePath); if (editor.NeedsSave) { if (SaveUnsaved == null) { var result = MessageBox.Show(this, Program.Translations.GetLanguage("SavingUFiles"), Program.Translations.GetLanguage("Saving"), MessageBoxButton.YesNo, MessageBoxImage.Question); SaveUnsaved = result == MessageBoxResult.Yes; } if (SaveUnsaved.Value) { editor.Close(true); } else { editor.Close(false, false); } } else { editor.Close(false, false); } } } } Program.OptionsObject.LastOpenFiles = lastOpenFiles.ToArray(); Program.discordClient.Dispose(); #if !DEBUG if (Program.UpdateStatus.IsAvailable) { var updateWin = new UpdateWindow(Program.UpdateStatus) { Owner = this }; updateWin.ShowDialog(); } #endif }
internal static void InitializeUpdateRoutine(UpdateWindow ui, Dictionary <string, object> args) { if (_webClient != null) { _webClient.Dispose(); } _webClient = new WebClient(); _webClient.DownloadProgressChanged += delegate(object sender, DownloadProgressChangedEventArgs eventArgs) { ui.MaxProgress = 100; ui.CurrentProgress = eventArgs.ProgressPercentage; }; // Cleanup after update if (File.Exists(Constants.LoaderTempFileName)) { File.Delete(Constants.LoaderTempFileName); } ui.OveralMaxProgress = 100; ui.OveralCurrentProgress = 100; ui.MaxProgress = 0; ui.Status = MultiLanguage.Text.UpdateStatusLoader; ui.Details = MultiLanguage.Text.UpdateDetailsLoader; args["updateDataJson"] = DownloadString(Constants.DependenciesJsonUrl); args["coreJson"] = DownloadString(Constants.CoreJsonUrl); try { args["updateData"] = JsonConvert.DeserializeObject <UpdateData>((string)args["updateDataJson"]); args["coreData"] = JsonConvert.DeserializeObject <CoreNewsList>((string)args["coreJson"]); } catch (Exception ex) { args["updateData"] = null; args["coreData"] = null; Log.Instance.DoLog(string.Format("Unexpected error while deserializing update data during InitializeUpdateRoutine. Exception: {0} \r\n", ex), Log.LogType.Error); MessageBox.Show(string.Format(MultiLanguage.Text.ErrorUpdateFailedToDeserialize, ex), MultiLanguage.Text.TitleMsgBoxUpdateFailedToDeserialize, MessageBoxButton.OK, MessageBoxImage.Error); } if (args["updateData"] == null) { Log.Instance.DoLog("No update data could be retrieved.", Log.LogType.Error); } if (args["coreData"] == null) { Log.Instance.DoLog("No core update data could be retrieved.", Log.LogType.Error); } }
public void ClearAll() { try { if (this.resultWindow != null) { this.resultWindow.Close(); } if (this.searchWindow != null) { this.searchWindow.Close(); } if (this.systemSettingWindow != null) { this.systemSettingWindow.Close(); } if (this.aboutWindow != null) { this.aboutWindow.Close(); } if (this.closingTipWindow != null) { this.closingTipWindow.Close(); } if (this.updateWindow != null) { this.updateWindow.Close(); this.updateWindow = null; } if (this.groupManagerWindow != null) { this.groupManagerWindow.Close(); } if (this.messageCenterWindow != null) { this.messageCenterWindow.Close(); } if (this.systemSettingWindow != null) { this.systemSettingWindow.Close(); } if (this.logonSettingWindow != null) { this.logonSettingWindow.Close(); this.logonSettingWindow = null; } this.ClearEntGroupManagerWindows(); } catch (System.Exception ex) { this.logger.Error(ex.ToString()); } }
/// <summary> /// Stops the timer and shows the <see cref="UpdateWindow"/> /// </summary> private void UpdateTimer_Tick(object sender, EventArgs e) { if (updateTimer != null) { updateTimer.Stop(); updateTimer.Tick -= UpdateTimer_Tick; } UpdateWindow updateWindow = new UpdateWindow(); updateWindow.ShowDialog(); }
private void Update_Click(object sender, RoutedEventArgs e) { if (SelectedStaff is null) { MessageBox.Show("Please select row"); return; } var staff1 = _context.Staffs.FirstOrDefault(s => s.Id == SelectedStaff.Id); UpdateWindow w1 = new UpdateWindow(staff1); w1.ShowDialog(); }
public static async Task UpdateLoader(Tuple <bool, string> versionCheckResult) { if (versionCheckResult.Item1 && (versionCheckResult.Item2.StartsWith("https://github.com/LeagueSharp/") || versionCheckResult.Item2.StartsWith("https://github.com/joduskame/") || versionCheckResult.Item2.StartsWith("https://github.com/Esk0r/"))) { var window = new UpdateWindow(UpdateAction.Loader, versionCheckResult.Item2); window.Show(); await window.Update(); } }
private void RunSystemDownloadButton_Click(object sender, RoutedEventArgs e) { UpdateWindow lUpdateWind = new UpdateWindow("Update In Progress", "Please wait as the application updates the database"); CommandProcessor lCommandProc = new CommandProcessor(); Thread lSysUp = new Thread( () => lCommandProc.SystemUpdate(lUpdateWind, gSession.Server, gSession.POSInfo)); lSysUp.Start(); lUpdateWind.ShowDialog(); }
public void handleCommandline(CommandlineParser parser) { foreach (string file in parser.failedUpgrades) System.Windows.Forms.MessageBox.Show("Failed to upgrade '" + file + "'.", "Upgrade failed", MessageBoxButtons.OK, MessageBoxIcon.Error); if (parser.upgradeData.Count > 0) { UpdateWindow update = new UpdateWindow(this, Settings); foreach (string file in parser.upgradeData.Keys) update.UpdateVersionNumber(file, parser.upgradeData[file]); update.SaveSettings(); } }
private void ExitProcessing() { if (check.IsAvailableUpdate) { UpdateWindow updatewin = new UpdateWindow(); updatewin.initSmartUpdate(new AppInfo(this)); bool result = (bool)updatewin.ShowDialog(); if (result == true) { } else if (result == false) { //MessageBoxOrange.ShowDialog("the update download was cancelled."); } } notify.Visible = false; notify.Dispose(); // SaveTempList(); SaveConfig(); musicCollection.Clear(); myPlayListCollection.Clear(); WebBrowserHelper.ClearCache(); webBrowser.Dispose(); (Application.Current as App).msgBroker.MessageReceived -= msgBroker_MessageReceived; }