From 0a683817aa0ce5658e20b1477ce939aab0a67b76 Mon Sep 17 00:00:00 2001 From: wangyunxiu <020142103> Date: Wed, 30 Mar 2022 16:51:52 +0800 Subject: [PATCH 1/4] =?UTF-8?q?Windows=E5=B9=B3=E5=8F=B0=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=87=BD=E6=95=B0=20CheckForUpdatesWithoutUI=20=E9=9D=99?= =?UTF-8?q?=E9=BB=98=E6=A3=80=E6=9F=A5=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/auto_updater.dart | 3 +++ windows/auto_updater.cpp | 7 ++++++- windows/auto_updater_plugin.cpp | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/src/auto_updater.dart b/lib/src/auto_updater.dart index 126ae2a..4868379 100644 --- a/lib/src/auto_updater.dart +++ b/lib/src/auto_updater.dart @@ -29,6 +29,9 @@ class AutoUpdater { Future checkForUpdates() async { await _channel.invokeMethod('checkForUpdates'); } + Future checkForUpdatesWithoutUI() async { + await _channel.invokeMethod('checkForUpdatesWithoutUI'); + } } final autoUpdater = AutoUpdater.instance; diff --git a/windows/auto_updater.cpp b/windows/auto_updater.cpp index 6731864..a49440a 100644 --- a/windows/auto_updater.cpp +++ b/windows/auto_updater.cpp @@ -11,6 +11,7 @@ class AutoUpdater { void AutoUpdater::SetFeedURL(std::string feedURL); void AutoUpdater::CheckForUpdates(); + void AutoUpdater::CheckForUpdatesWithoutUI(); private: }; @@ -25,7 +26,11 @@ void AutoUpdater::SetFeedURL(std::string feedURL) { } void AutoUpdater::CheckForUpdates() { - win_sparkle_check_update_with_ui(); + win_sparkle_check_update_with_ui(); +} + +void AutoUpdater::CheckForUpdatesWithoutUI() { + win_sparkle_check_update_without_ui(); } } // namespace diff --git a/windows/auto_updater_plugin.cpp b/windows/auto_updater_plugin.cpp index 764e76c..9d2684d 100644 --- a/windows/auto_updater_plugin.cpp +++ b/windows/auto_updater_plugin.cpp @@ -72,7 +72,10 @@ void AutoUpdaterPlugin::HandleMethodCall( } else if (method_name.compare("checkForUpdates") == 0) { auto_updater->CheckForUpdates(); result->Success(flutter::EncodableValue(true)); - } else { + } else if(method_name.compare("checkForUpdatesWithoutUI") == 0){ + auto_updater->CheckForUpdatesWithoutUI(); + result->Success(flutter::EncodableValue(true)); + }else { result->NotImplemented(); } } From 9cfdb4ef7e54bce224841ddfc1ace0b80352dcc1 Mon Sep 17 00:00:00 2001 From: wangyunxiu <020142103> Date: Thu, 31 Mar 2022 08:34:56 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0Example=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=A2=9EcheckForUpdatesWithoutUI=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/lib/pages/home.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/example/lib/pages/home.dart b/example/lib/pages/home.dart index 6436146..0588073 100644 --- a/example/lib/pages/home.dart +++ b/example/lib/pages/home.dart @@ -25,6 +25,10 @@ class _HomePageState extends State { await autoUpdater.checkForUpdates(); } + void _handleClickCheckForUpdatesWithoutUI() async { + await autoUpdater.checkForUpdatesWithoutUI(); + } + Widget _buildBody(BuildContext context) { return PreferenceList( children: [ @@ -44,6 +48,12 @@ class _HomePageState extends State { _handleClickCheckForUpdates(); }, ), + PreferenceListItem( + title: const Text('checkForUpdatesWithoutUI'), + onTap: () { + _handleClickCheckForUpdatesWithoutUI(); + }, + ), ], ), ], From 26a686a8ecd4dbd6de110d095f16c918fdc83511 Mon Sep 17 00:00:00 2001 From: wangyunxiu <020142103> Date: Thu, 31 Mar 2022 10:20:28 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- windows/auto_updater.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/auto_updater.cpp b/windows/auto_updater.cpp index a49440a..f7bf9ca 100644 --- a/windows/auto_updater.cpp +++ b/windows/auto_updater.cpp @@ -26,11 +26,11 @@ void AutoUpdater::SetFeedURL(std::string feedURL) { } void AutoUpdater::CheckForUpdates() { - win_sparkle_check_update_with_ui(); + win_sparkle_check_update_with_ui(); } void AutoUpdater::CheckForUpdatesWithoutUI() { - win_sparkle_check_update_without_ui(); + win_sparkle_check_update_without_ui(); } } // namespace From 4b53ad4c8c433563aba450cbd80304d6a63c1cd3 Mon Sep 17 00:00:00 2001 From: wangyunxiu <020142103> Date: Wed, 30 Mar 2022 16:51:52 +0800 Subject: [PATCH 4/4] =?UTF-8?q?Windows=E5=B9=B3=E5=8F=B0=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=87=BD=E6=95=B0CheckForUpdatesWithoutUI()=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=9A=E9=9D=99=E9=BB=98=E6=A3=80=E6=9F=A5=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=EF=BC=8C=E5=8F=AA=E6=9C=89=E5=9C=A8=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=B6=E6=89=8D=E4=BC=9A=E5=BC=B9=E5=87=BA?= =?UTF-8?q?Dialog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/lib/pages/home.dart | 10 ++++++++++ lib/src/auto_updater.dart | 3 +++ windows/auto_updater.cpp | 5 +++++ windows/auto_updater_plugin.cpp | 5 ++++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/example/lib/pages/home.dart b/example/lib/pages/home.dart index 6436146..0588073 100644 --- a/example/lib/pages/home.dart +++ b/example/lib/pages/home.dart @@ -25,6 +25,10 @@ class _HomePageState extends State { await autoUpdater.checkForUpdates(); } + void _handleClickCheckForUpdatesWithoutUI() async { + await autoUpdater.checkForUpdatesWithoutUI(); + } + Widget _buildBody(BuildContext context) { return PreferenceList( children: [ @@ -44,6 +48,12 @@ class _HomePageState extends State { _handleClickCheckForUpdates(); }, ), + PreferenceListItem( + title: const Text('checkForUpdatesWithoutUI'), + onTap: () { + _handleClickCheckForUpdatesWithoutUI(); + }, + ), ], ), ], diff --git a/lib/src/auto_updater.dart b/lib/src/auto_updater.dart index 126ae2a..4868379 100644 --- a/lib/src/auto_updater.dart +++ b/lib/src/auto_updater.dart @@ -29,6 +29,9 @@ class AutoUpdater { Future checkForUpdates() async { await _channel.invokeMethod('checkForUpdates'); } + Future checkForUpdatesWithoutUI() async { + await _channel.invokeMethod('checkForUpdatesWithoutUI'); + } } final autoUpdater = AutoUpdater.instance; diff --git a/windows/auto_updater.cpp b/windows/auto_updater.cpp index 6731864..f7bf9ca 100644 --- a/windows/auto_updater.cpp +++ b/windows/auto_updater.cpp @@ -11,6 +11,7 @@ class AutoUpdater { void AutoUpdater::SetFeedURL(std::string feedURL); void AutoUpdater::CheckForUpdates(); + void AutoUpdater::CheckForUpdatesWithoutUI(); private: }; @@ -28,4 +29,8 @@ void AutoUpdater::CheckForUpdates() { win_sparkle_check_update_with_ui(); } +void AutoUpdater::CheckForUpdatesWithoutUI() { + win_sparkle_check_update_without_ui(); +} + } // namespace diff --git a/windows/auto_updater_plugin.cpp b/windows/auto_updater_plugin.cpp index 764e76c..9d2684d 100644 --- a/windows/auto_updater_plugin.cpp +++ b/windows/auto_updater_plugin.cpp @@ -72,7 +72,10 @@ void AutoUpdaterPlugin::HandleMethodCall( } else if (method_name.compare("checkForUpdates") == 0) { auto_updater->CheckForUpdates(); result->Success(flutter::EncodableValue(true)); - } else { + } else if(method_name.compare("checkForUpdatesWithoutUI") == 0){ + auto_updater->CheckForUpdatesWithoutUI(); + result->Success(flutter::EncodableValue(true)); + }else { result->NotImplemented(); } }