From 00953850b319e1aef4929017c89fb81646d5828c Mon Sep 17 00:00:00 2001 From: qianlifeng Date: Wed, 21 Jan 2015 23:00:56 +0800 Subject: [PATCH] Improve the update progress. --- Deploy/NAppUpdate/FeedBuilder.config | 14 ++-- Deploy/NAppUpdate/FeedBuilder.exe | Bin 128512 -> 128512 bytes Wox.Core/UI/ResourceMerger.cs | 2 +- Wox.Core/Updater/UpdaterManager.cs | 77 +++++++++---------- Wox.Core/UserSettings/UserSettingStorage.cs | 3 + Wox.Core/i18n/InternationalizationManager.cs | 2 +- Wox.CrashReporter/ReportWindow.xaml.cs | 6 +- Wox/ActionKeyword.xaml.cs | 8 +- Wox/CustomQueryHotkeySetting.xaml.cs | 12 +-- Wox/HotkeyControl.xaml.cs | 4 +- Wox/Languages/en.xaml | 5 ++ Wox/Languages/zh-cn.xaml | 6 ++ Wox/Languages/zh-tw.xaml | 5 ++ Wox/MainWindow.xaml.cs | 28 ++----- Wox/SettingWindow.xaml | 1 - Wox/SettingWindow.xaml.cs | 53 ++++--------- Wox/Update/NewVersionWindow.xaml | 23 ------ Wox/Update/NewVersionWindow.xaml.cs | 46 ----------- Wox/Update/Release.cs | 16 ---- Wox/Update/UpdateChecker.cs | 55 ------------- Wox/Wox.csproj | 9 --- appveyor.yml | 6 +- 22 files changed, 103 insertions(+), 278 deletions(-) delete mode 100644 Wox/Update/NewVersionWindow.xaml delete mode 100644 Wox/Update/NewVersionWindow.xaml.cs delete mode 100644 Wox/Update/Release.cs delete mode 100644 Wox/Update/UpdateChecker.cs diff --git a/Deploy/NAppUpdate/FeedBuilder.config b/Deploy/NAppUpdate/FeedBuilder.config index f06954dd29..4e99a397fd 100644 --- a/Deploy/NAppUpdate/FeedBuilder.config +++ b/Deploy/NAppUpdate/FeedBuilder.config @@ -1,18 +1,16 @@  - + http://127.0.0.1:8888 True False True - True + False <?xml version="1.0" encoding="utf-16"?> -<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> + <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> True - True - E:\github\Wox\Output\Debug + False + ..\..\Output\Release True False - E:\github\Wox\Output\Update\Update.xml - - http://127.0.0.1:8888 + ..\..\Output\Update\Update.xml diff --git a/Deploy/NAppUpdate/FeedBuilder.exe b/Deploy/NAppUpdate/FeedBuilder.exe index fae2128316308805edcafc2cec6e7f85565ceb9a..278eea2032764079524f266ed1994a142251d284 100644 GIT binary patch delta 12417 zcmaJ|3w#vS)xR^lncdkW3!5dodG73Hlg%a&2nnz743H3Fw8~3FlmZG8s~x`y_=D}}H zpL6a#bMCp1*@X>fTpP}~?!U{i*wVk)d&eUJTg>ohzrfb0TO$5~R*@9| zU${eH6~@L(M;S|mTH$?Tqo7Cj!k3fY7%0}a!jp-;Qy6oa{ap=P z)nX^7*yT31CB?3^v8^fgIvYD9#ol0J$EVneH8y%&ieAQ9<76Nte9QPEFayEP2$rC| zELc&pjUM(!H1Ye;G?a8hscCCYva!E>RM(SW zVp`0}Ziqic%1O6Nl(Nh+@JKzFKaaW#O+17q-(||9A^VGc#SH}@jENP~P#)_lBKfHi z)u)Z`RfMZ}*8#s2@Vf$jcfcC#KRAdht2SO8yO`TsmYj%f( zNytNiQYt)X#FXZFNqw)xZqN>+u>$aGM*)%n=L!HrF<)v>WYAn-#uG}@?2KN&u=kqp zO85Hzrom9c0mL{V+&m-MTNiw_RcKN%_L#jX{Hd}6@)fB+2BrSQ*comtq4KmQsG)(0 z$p_nId=egwVU$RTFknoItVYr7h_nh%?Kv6o2ukiEbNZYpYpOCi8uky+xDIFhr}P;p z2o|20Z(JEI74{mJM#E@tie7{E_tCNGN{sgz<<(`?KZ8esTYU~6LG|b4ZURZ&#{nw) zd1Fa+RCvKyUtOy22U(-t=Vmtq;s?0g2RUfTJ0O=>^5c+8EqOQOGE3eIx!jTuK(4Ul z!;mX2`55GoCI1exB3nTJ10j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PY=LBscGB5laP1W_v diff --git a/Wox.Core/UI/ResourceMerger.cs b/Wox.Core/UI/ResourceMerger.cs index b2167a3cd3..6d7a892982 100644 --- a/Wox.Core/UI/ResourceMerger.cs +++ b/Wox.Core/UI/ResourceMerger.cs @@ -39,7 +39,7 @@ namespace Wox.Core.UI foreach (var pluginI18n in pluginI18ns) { - string languageFile = InternationalizationManager.Internationalization.GetLanguageFile( + string languageFile = InternationalizationManager.Instance.GetLanguageFile( ((IPluginI18n)Activator.CreateInstance(pluginI18n)).GetLanguagesFolder()); if (!string.IsNullOrEmpty(languageFile)) { diff --git a/Wox.Core/Updater/UpdaterManager.cs b/Wox.Core/Updater/UpdaterManager.cs index 7f07171606..c89d651db5 100644 --- a/Wox.Core/Updater/UpdaterManager.cs +++ b/Wox.Core/Updater/UpdaterManager.cs @@ -6,6 +6,8 @@ using System.Windows.Threading; using NAppUpdate.Framework; using NAppUpdate.Framework.Common; using NAppUpdate.Framework.Sources; +using Wox.Core.i18n; +using Wox.Core.UserSettings; using Wox.Infrastructure.Logger; namespace Wox.Core.Updater @@ -31,11 +33,14 @@ namespace Wox.Core.Updater UpdateManager.Instance.UpdateSource = GetUpdateSource(); } + public bool IsUpdateAvailable() + { + return UpdateManager.Instance.UpdatesAvailable > 0; + } + public void CheckUpdate() { - // Get a local pointer to the UpdateManager instance UpdateManager updManager = UpdateManager.Instance; - updManager.BeginCheckForUpdates(asyncResult => { if (asyncResult.IsCompleted) @@ -43,9 +48,9 @@ namespace Wox.Core.Updater // still need to check for caught exceptions if any and rethrow try { - ((UpdateProcessAsyncResult) asyncResult).EndInvoke(); + ((UpdateProcessAsyncResult)asyncResult).EndInvoke(); } - catch(System.Exception e) + catch (System.Exception e) { Log.Error(e); updManager.CleanUp(); @@ -55,7 +60,6 @@ namespace Wox.Core.Updater // No updates were found, or an error has occured. We might want to check that... if (updManager.UpdatesAvailable == 0) { - MessageBox.Show("All is up to date!"); return; } } @@ -63,53 +67,44 @@ namespace Wox.Core.Updater updManager.BeginPrepareUpdates(result => { ((UpdateProcessAsyncResult)result).EndInvoke(); + string updateReady = InternationalizationManager.Instance.GetTranslation("update_wox_update_ready"); + string updateInstall = InternationalizationManager.Instance.GetTranslation("update_wox_update_install"); + updateInstall = string.Format(updateInstall, updManager.UpdatesAvailable); + DialogResult dr = MessageBox.Show(updateInstall, updateReady, MessageBoxButtons.YesNo); - // ApplyUpdates is a synchronous method by design. Make sure to save all user work before calling - // it as it might restart your application - // get out of the way so the console window isn't obstructed - try + if (dr == DialogResult.Yes) { - updManager.ApplyUpdates(true,false,true); - } - catch - { - // this.WindowState = WindowState.Normal; - MessageBox.Show( - "An error occurred while trying to install software updates"); - } - updManager.CleanUp(); + // ApplyUpdates is a synchronous method by design. Make sure to save all user work before calling + // it as it might restart your application + // get out of the way so the console window isn't obstructed + try + { + updManager.ApplyUpdates(true, UserSettingStorage.Instance.EnableUpdateLog, false); + } + catch (System.Exception e) + { + string updateError = + InternationalizationManager.Instance.GetTranslation("update_wox_update_error"); + Log.Error(e); + MessageBox.Show(updateError); + } + + updManager.CleanUp(); + } + else + { + updManager.CleanUp(); + } }, null); }, null); } - public void Reinstall() - { - UpdateManager.Instance.ReinstateIfRestarted(); - } - - private void OnPrepareUpdatesCompleted(bool obj) - { - UpdateManager updManager = UpdateManager.Instance; - - DialogResult dr = MessageBox.Show( - "Updates are ready to install. Do you wish to install them now?", - "Software updates ready", - MessageBoxButtons.YesNo); - - if (dr == DialogResult.Yes) - { - // This is a synchronous method by design, make sure to save all user work before calling - // it as it might restart your application - updManager.ApplyUpdates(true,true,true); - } - } - private IUpdateSource GetUpdateSource() { // Normally this would be a web based source. // But for the demo app, we prepare an in-memory source. - var source = new NAppUpdate.Framework.Sources.SimpleWebSource("http://127.0.0.1:8888/Update.xml"); + var source = new SimpleWebSource("http://127.0.0.1:8888/Update.xml"); return source; } } diff --git a/Wox.Core/UserSettings/UserSettingStorage.cs b/Wox.Core/UserSettings/UserSettingStorage.cs index 9b1af13a61..5f7c243c74 100644 --- a/Wox.Core/UserSettings/UserSettingStorage.cs +++ b/Wox.Core/UserSettings/UserSettingStorage.cs @@ -14,6 +14,9 @@ namespace Wox.Core.UserSettings [JsonProperty] public bool DontPromptUpdateMsg { get; set; } + [JsonProperty] + public bool EnableUpdateLog { get; set; } + [JsonProperty] public string Hotkey { get; set; } diff --git a/Wox.Core/i18n/InternationalizationManager.cs b/Wox.Core/i18n/InternationalizationManager.cs index a1f0a9049c..cfe1ca7fc7 100644 --- a/Wox.Core/i18n/InternationalizationManager.cs +++ b/Wox.Core/i18n/InternationalizationManager.cs @@ -14,7 +14,7 @@ namespace Wox.Core.i18n private static Internationalization instance; private static object syncObject = new object(); - public static Internationalization Internationalization + public static Internationalization Instance { get { diff --git a/Wox.CrashReporter/ReportWindow.xaml.cs b/Wox.CrashReporter/ReportWindow.xaml.cs index 55ec0555b7..ec041fb7cd 100644 --- a/Wox.CrashReporter/ReportWindow.xaml.cs +++ b/Wox.CrashReporter/ReportWindow.xaml.cs @@ -45,7 +45,7 @@ namespace Wox.CrashReporter private void btnSend_Click(object sender, RoutedEventArgs e) { - string sendingMsg = InternationalizationManager.Internationalization.GetTranslation("reportWindow_sending"); + string sendingMsg = InternationalizationManager.Instance.GetTranslation("reportWindow_sending"); tbSendReport.Content = sendingMsg; btnSend.IsEnabled = false; ThreadPool.QueueUserWorkItem(o => SendReport()); @@ -57,11 +57,11 @@ namespace Wox.CrashReporter string response = HttpRequest.Post(APIServer.ErrorReportURL, error, HttpProxy.Instance); if (response.ToLower() == "ok") { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("reportWindow_report_succeed")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("reportWindow_report_succeed")); } else { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("reportWindow_report_failed")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("reportWindow_report_failed")); } Dispatcher.Invoke(new Action(Close)); } diff --git a/Wox/ActionKeyword.xaml.cs b/Wox/ActionKeyword.xaml.cs index e6832be527..96f5e9dcc3 100644 --- a/Wox/ActionKeyword.xaml.cs +++ b/Wox/ActionKeyword.xaml.cs @@ -29,7 +29,7 @@ namespace Wox PluginPair plugin = PluginManager.GetPlugin(pluginId); if (plugin == null) { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("cannotFindSpecifiedPlugin")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("cannotFindSpecifiedPlugin")); Close(); return; } @@ -52,14 +52,14 @@ namespace Wox { if (string.IsNullOrEmpty(tbAction.Text)) { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("newActionKeywordCannotBeEmpty")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("newActionKeywordCannotBeEmpty")); return; } //check new action keyword didn't used by other plugin if (PluginManager.AllPlugins.Exists(o => o.Metadata.ActionKeyword == tbAction.Text.Trim())) { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("newActionKeywordHasBeenAssigned")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("newActionKeywordHasBeenAssigned")); return; } @@ -81,7 +81,7 @@ namespace Wox customizedPluginConfig.Actionword = tbAction.Text.Trim(); } UserSettingStorage.Instance.Save(); - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("succeed")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("succeed")); Close(); } } diff --git a/Wox/CustomQueryHotkeySetting.xaml.cs b/Wox/CustomQueryHotkeySetting.xaml.cs index 2c9bba0c1d..759defa29a 100644 --- a/Wox/CustomQueryHotkeySetting.xaml.cs +++ b/Wox/CustomQueryHotkeySetting.xaml.cs @@ -29,7 +29,7 @@ namespace Wox { if (!ctlHotkey.CurrentHotkeyAvailable) { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("hotkeyIsNotUnavailable")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("hotkeyIsNotUnavailable")); return; } @@ -49,13 +49,13 @@ namespace Wox settingWidow.MainWindow.ChangeQuery(pluginHotkey.ActionKeyword); settingWidow.MainWindow.ShowApp(); }); - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("succeed")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("succeed")); } else { if (updateCustomHotkey.Hotkey != ctlHotkey.CurrentHotkey.ToString() && !ctlHotkey.CurrentHotkeyAvailable) { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("hotkeyIsNotUnavailable")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("hotkeyIsNotUnavailable")); return; } var oldHotkey = updateCustomHotkey.Hotkey; @@ -68,7 +68,7 @@ namespace Wox settingWidow.MainWindow.ShowApp(); settingWidow.MainWindow.ChangeQuery(updateCustomHotkey.ActionKeyword); }); - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("succeed")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("succeed")); } UserSettingStorage.Instance.Save(); @@ -81,7 +81,7 @@ namespace Wox updateCustomHotkey = UserSettingStorage.Instance.CustomPluginHotkeys.FirstOrDefault(o => o.ActionKeyword == item.ActionKeyword && o.Hotkey == item.Hotkey); if (updateCustomHotkey == null) { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("invalidPluginHotkey")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidPluginHotkey")); Close(); return; } @@ -89,7 +89,7 @@ namespace Wox tbAction.Text = updateCustomHotkey.ActionKeyword; ctlHotkey.SetHotkey(updateCustomHotkey.Hotkey, false); update = true; - lblAdd.Text = InternationalizationManager.Internationalization.GetTranslation("update"); + lblAdd.Text = InternationalizationManager.Instance.GetTranslation("update"); } private void BtnTestActionKeyword_OnClick(object sender, RoutedEventArgs e) diff --git a/Wox/HotkeyControl.xaml.cs b/Wox/HotkeyControl.xaml.cs index 1725f64019..bc89336ac2 100644 --- a/Wox/HotkeyControl.xaml.cs +++ b/Wox/HotkeyControl.xaml.cs @@ -99,12 +99,12 @@ namespace Wox if (!CurrentHotkeyAvailable) { tbMsg.Foreground = new SolidColorBrush(Colors.Red); - tbMsg.Text = InternationalizationManager.Internationalization.GetTranslation("hotkeyUnavailable"); + tbMsg.Text = InternationalizationManager.Instance.GetTranslation("hotkeyUnavailable"); } else { tbMsg.Foreground = new SolidColorBrush(Colors.Green); - tbMsg.Text = InternationalizationManager.Internationalization.GetTranslation("succeed"); + tbMsg.Text = InternationalizationManager.Instance.GetTranslation("succeed"); } OnOnHotkeyChanged(); } diff --git a/Wox/Languages/en.xaml b/Wox/Languages/en.xaml index 4f1561034b..54d55f7490 100644 --- a/Wox/Languages/en.xaml +++ b/Wox/Languages/en.xaml @@ -98,4 +98,9 @@ Report failed Wox got an error + + Wox updates available + Wox updates are ready to install. {0} files will be added and replaced, this operation may restart Wox. Do you wish to install them now? + An error occurred while trying to install software updates + \ No newline at end of file diff --git a/Wox/Languages/zh-cn.xaml b/Wox/Languages/zh-cn.xaml index 5e06761f1c..1c341d32eb 100644 --- a/Wox/Languages/zh-cn.xaml +++ b/Wox/Languages/zh-cn.xaml @@ -97,4 +97,10 @@ 发送成功 发送失败 Wox出错啦 + + + Wox更新 + Wox更新啦!{0}个文件会被添加和替换,并且在此过程中可能会重启Wox。你确定需要更新吗? + 更新Wox出错 + \ No newline at end of file diff --git a/Wox/Languages/zh-tw.xaml b/Wox/Languages/zh-tw.xaml index d3c8812995..825679f6e1 100644 --- a/Wox/Languages/zh-tw.xaml +++ b/Wox/Languages/zh-tw.xaml @@ -98,4 +98,9 @@ 發送失敗 Wox出錯啦 + + Wox更新 + Wox更新啦!{0}個文件會被添加和替換,並且在此過程中可能會重啟Wox。你確定需要更新嗎? + 更新Wox出錯 + \ No newline at end of file diff --git a/Wox/MainWindow.xaml.cs b/Wox/MainWindow.xaml.cs index 7a4cd03db1..110faad2bc 100644 --- a/Wox/MainWindow.xaml.cs +++ b/Wox/MainWindow.xaml.cs @@ -24,7 +24,6 @@ using Wox.Infrastructure; using Wox.Infrastructure.Hotkey; using Wox.Plugin; using Wox.Storage; -using Wox.Update; using Brushes = System.Windows.Media.Brushes; using Color = System.Windows.Media.Color; using ContextMenu = System.Windows.Forms.ContextMenu; @@ -124,7 +123,7 @@ namespace Wox public string GetTranslation(string key) { - return InternationalizationManager.Internationalization.GetTranslation(key); + return InternationalizationManager.Instance.GetTranslation(key); } public List GetAllPlugins() @@ -175,7 +174,7 @@ namespace Wox pnlResult.RightMouseClickEvent += pnlResult_RightMouseClickEvent; ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); - InternationalizationManager.Internationalization.ChangeLanguage(UserSettingStorage.Instance.Language); + InternationalizationManager.Instance.ChangeLanguage(UserSettingStorage.Instance.Language); SetHotkey(UserSettingStorage.Instance.Hotkey, OnHotkey); SetCustomPluginHotkey(); @@ -193,7 +192,6 @@ namespace Wox Thread.Sleep(50); PreLoadImages(); }); - CheckUpdate(); } private bool KListener_hookedKeyboardCallback(KeyEvent keyevent, int vkcode, SpecialKeyState state) @@ -215,22 +213,6 @@ namespace Wox ShowContextMenu(result); } - void CheckUpdate() - { - ThreadPool.QueueUserWorkItem(o => - { - Release release = new UpdateChecker().CheckUpgrade(); - if (release != null && !UserSettingStorage.Instance.DontPromptUpdateMsg) - { - Dispatcher.Invoke(new Action(() => - { - NewVersionWindow newVersinoWindow = new NewVersionWindow(); - newVersinoWindow.Show(); - })); - } - }); - } - void MainWindow_Closing(object sender, CancelEventArgs e) { UserSettingStorage.Instance.WindowLeft = Left; @@ -278,7 +260,7 @@ namespace Wox } catch (Exception) { - string errorMsg = string.Format(InternationalizationManager.Internationalization.GetTranslation("registerHotkeyFailed"), hotkeyStr); + string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("registerHotkeyFailed"), hotkeyStr); MessageBox.Show(errorMsg); } } @@ -673,7 +655,7 @@ namespace Wox } catch (Exception ex) { - string errorMsg = string.Format(InternationalizationManager.Internationalization.GetTranslation("couldnotStartCmd"), cmd); + string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("couldnotStartCmd"), cmd); ShowMsg(errorMsg, ex.Message, null); } return false; @@ -691,7 +673,7 @@ namespace Wox } else { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("invalidWoxPluginFileFormat")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidWoxPluginFileFormat")); } } } diff --git a/Wox/SettingWindow.xaml b/Wox/SettingWindow.xaml index 50e5341b9d..704f39936f 100644 --- a/Wox/SettingWindow.xaml +++ b/Wox/SettingWindow.xaml @@ -318,7 +318,6 @@ - diff --git a/Wox/SettingWindow.xaml.cs b/Wox/SettingWindow.xaml.cs index 56152f8c18..e4c43d99d7 100644 --- a/Wox/SettingWindow.xaml.cs +++ b/Wox/SettingWindow.xaml.cs @@ -13,7 +13,6 @@ using System.Windows.Media.Imaging; using Wox.Core.Plugin; using Wox.Plugin; using Wox.Helper; -using Wox.Update; using Application = System.Windows.Forms.Application; using File = System.IO.File; using MessageBox = System.Windows.MessageBox; @@ -218,15 +217,6 @@ namespace Wox #region About tbVersion.Text = ConfigurationManager.AppSettings["version"]; - Release newRelease = new UpdateChecker().CheckUpgrade(); - if (newRelease == null) - { - tbNewVersionAvailable.Visibility = Visibility.Collapsed; - } - else - { - tbNewVersionAvailable.Text = newRelease.version + " available"; - } #endregion @@ -235,7 +225,7 @@ namespace Wox private void LoadLanguages() { - cbLanguages.ItemsSource = InternationalizationManager.Internationalization.LoadAvailableLanguages(); + cbLanguages.ItemsSource = InternationalizationManager.Instance.LoadAvailableLanguages(); cbLanguages.DisplayMemberPath = "Display"; cbLanguages.SelectedValuePath = "LanguageCode"; cbLanguages.SelectedValue = UserSettingStorage.Instance.Language; @@ -244,7 +234,7 @@ namespace Wox void cbLanguages_SelectionChanged(object sender, SelectionChangedEventArgs e) { - InternationalizationManager.Internationalization.ChangeLanguage(cbLanguages.SelectedItem as Language); + InternationalizationManager.Instance.ChangeLanguage(cbLanguages.SelectedItem as Language); } private void EnableProxy() @@ -329,12 +319,12 @@ namespace Wox CustomPluginHotkey item = lvCustomHotkey.SelectedItem as CustomPluginHotkey; if (item == null) { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("pleaseSelectAnItem")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem")); return; } - string deleteWarning = string.Format(InternationalizationManager.Internationalization.GetTranslation("deleteCustomHotkeyWarning"), item.Hotkey); - if (MessageBox.Show(deleteWarning, InternationalizationManager.Internationalization.GetTranslation("delete"), MessageBoxButton.YesNo) == MessageBoxResult.Yes) + string deleteWarning = string.Format(InternationalizationManager.Instance.GetTranslation("deleteCustomHotkeyWarning"), item.Hotkey); + if (MessageBox.Show(deleteWarning, InternationalizationManager.Instance.GetTranslation("delete"), MessageBoxButton.YesNo) == MessageBoxResult.Yes) { UserSettingStorage.Instance.CustomPluginHotkeys.Remove(item); lvCustomHotkey.Items.Refresh(); @@ -354,7 +344,7 @@ namespace Wox } else { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("pleaseSelectAnItem")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem")); } } @@ -488,7 +478,7 @@ namespace Wox pluginTitle.Text = pair.Metadata.Name; pluginTitle.Cursor = Cursors.Hand; pluginActionKeyword.Text = pair.Metadata.ActionKeyword; - pluginAuthor.Text = InternationalizationManager.Internationalization.GetTranslation("author") + ": " + pair.Metadata.Author; + pluginAuthor.Text = InternationalizationManager.Instance.GetTranslation("author") + ": " + pair.Metadata.Author; pluginSubTitle.Text = pair.Metadata.Description; pluginId = pair.Metadata.ID; pluginIcon.Source = ImageLoader.ImageLoader.Load(pair.Metadata.FullIcoPath); @@ -627,17 +617,17 @@ namespace Wox { if (string.IsNullOrEmpty(tbProxyServer.Text)) { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("serverCantBeEmpty")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("serverCantBeEmpty")); return; } if (string.IsNullOrEmpty(tbProxyPort.Text)) { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("portCantBeEmpty")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("portCantBeEmpty")); return; } if (!int.TryParse(tbProxyPort.Text, out port)) { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("invalidPortFormat")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidPortFormat")); return; } } @@ -648,25 +638,25 @@ namespace Wox UserSettingStorage.Instance.ProxyPassword = tbProxyPassword.Password; UserSettingStorage.Instance.Save(); - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("saveProxySuccessfully")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("saveProxySuccessfully")); } private void btnTestProxy_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(tbProxyServer.Text)) { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("serverCantBeEmpty")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("serverCantBeEmpty")); return; } if (string.IsNullOrEmpty(tbProxyPort.Text)) { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("portCantBeEmpty")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("portCantBeEmpty")); return; } int port; if (!int.TryParse(tbProxyPort.Text, out port)) { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("invalidPortFormat")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidPortFormat")); return; } @@ -687,16 +677,16 @@ namespace Wox HttpWebResponse response = (HttpWebResponse)request.GetResponse(); if (response.StatusCode == HttpStatusCode.OK) { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("proxyIsCorrect")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("proxyIsCorrect")); } else { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("proxyConnectFailed")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("proxyConnectFailed")); } } catch { - MessageBox.Show(InternationalizationManager.Internationalization.GetTranslation("proxyConnectFailed")); + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("proxyConnectFailed")); } } @@ -704,14 +694,5 @@ namespace Wox { Process.Start("http://www.getwox.com"); } - - private void tbNewVersionAvailable_MouseUp(object sender, MouseButtonEventArgs e) - { - Release newRelease = new UpdateChecker().CheckUpgrade(); - if (newRelease != null) - { - Process.Start("http://www.getwox.com/release/version/" + newRelease.version); - } - } } } diff --git a/Wox/Update/NewVersionWindow.xaml b/Wox/Update/NewVersionWindow.xaml deleted file mode 100644 index 924e61a202..0000000000 --- a/Wox/Update/NewVersionWindow.xaml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/Wox/Update/NewVersionWindow.xaml.cs b/Wox/Update/NewVersionWindow.xaml.cs deleted file mode 100644 index 8ef0447828..0000000000 --- a/Wox/Update/NewVersionWindow.xaml.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using Wox.Core.Version; - -namespace Wox.Update -{ - public partial class NewVersionWindow : Window - { - public NewVersionWindow() - { - InitializeComponent(); - - tbCurrentVersion.Text = VersionManager.Instance.CurrentVersion.ToString(); - Release newRelease = new UpdateChecker().CheckUpgrade(); - if (newRelease == null) - { - tbNewVersion.Visibility = Visibility.Collapsed; - } - else - { - tbNewVersion.Text = newRelease.version; - } - } - - private void tbNewVersion_MouseUp(object sender, MouseButtonEventArgs e) - { - Release newRelease = new UpdateChecker().CheckUpgrade(); - if (newRelease != null) - { - Process.Start("http://www.getwox.com/release/version/" + newRelease.version); - } - } - } -} diff --git a/Wox/Update/Release.cs b/Wox/Update/Release.cs deleted file mode 100644 index 3664f5f2fa..0000000000 --- a/Wox/Update/Release.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Wox.Update -{ - public class Release - { - public string version { get; set; } - public string download_link { get; set; } - public string download_link1 { get; set; } - public string download_link2 { get; set; } - public string description { get; set; } - } -} diff --git a/Wox/Update/UpdateChecker.cs b/Wox/Update/UpdateChecker.cs deleted file mode 100644 index 65fb0c4d3f..0000000000 --- a/Wox/Update/UpdateChecker.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.IO; -using System.Linq; -using System.Net; -using System.Text; -using Newtonsoft.Json; -using Wox.Core; -using Wox.Core.UserSettings; -using Wox.Core.Version; -using Wox.Helper; -using Wox.Infrastructure; -using Wox.Infrastructure.Http; - -namespace Wox.Update -{ - public class UpdateChecker - { - private static Release newRelease; - private static bool checkedUpdate = false; - - /// - /// If new release is available, then return the new release - /// otherwise, return null - /// - /// - public Release CheckUpgrade(bool forceCheck = false) - { - if (checkedUpdate && !forceCheck) return newRelease; - string json = HttpRequest.Get(APIServer.LastestReleaseURL,HttpProxy.Instance); - if (string.IsNullOrEmpty(json)) return null; - - try - { - newRelease = JsonConvert.DeserializeObject(json); - if (!IsNewerThanCurrent(newRelease)) - { - newRelease = null; - } - checkedUpdate = true; - } - catch{} - - return newRelease; - } - - private bool IsNewerThanCurrent(Release release) - { - if (release == null) return false; - - return new SemanticVersion(release.version) > VersionManager.Instance.CurrentVersion; - } - } -} diff --git a/Wox/Wox.csproj b/Wox/Wox.csproj index 7339787130..a71e300ffc 100644 --- a/Wox/Wox.csproj +++ b/Wox/Wox.csproj @@ -113,11 +113,6 @@ - - NewVersionWindow.xaml - - - MSBuild:Compile Designer @@ -235,10 +230,6 @@ Designer PreserveNewest - - Designer - MSBuild:Compile - diff --git a/appveyor.yml b/appveyor.yml index 67d04c4cd9..56829a53ff 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,7 @@ build: after_test: - ps: .\deploy\nuget\pack.ps1 - - ps: .\deploy\Installer\pack.ps1 + - cmd: .\deploy\NAppUpdate\build.bat deploy: provider: NuGet @@ -32,5 +32,5 @@ artifacts: - path: '*.nupkg' name: nugetpackage - - path: Output\Wox-setup.exe - name: setup + - path: Output\Update + name: update-binary