macOS: Software update fixes.

Run our software update checks in the foreground.

Post NSApplicationWillTerminateNotification prior to exiting the
application. This *should* start the automatic updater if a new version
of Wireshark was downloaded in the background, but is difficult to test
without a fully signed and notarized application bundle.

Bug: 16416
Change-Id: I212dbb42e1cafff713ff195b448c2799750bc6ac
Reviewed-on: https://code.wireshark.org/review/36221
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Gerald Combs 2020-02-27 12:03:49 -08:00 committed by Anders Broman
parent 00edddb9ba
commit b3871fb864
3 changed files with 18 additions and 1 deletions

View File

@ -22,6 +22,8 @@ void sparkle_software_update_init(const char *url, bool enabled, int interval);
void sparkle_software_update_check(void);
void sparkle_software_update_cleanup(void);
#endif // SPARKLE_BRIDGE_H
/*

View File

@ -27,7 +27,21 @@ void sparkle_software_update_init(const char *url, bool enabled, int interval)
void sparkle_software_update_check(void)
{
[[SUUpdater sharedUpdater] checkForUpdatesInBackground];
[[SUUpdater sharedUpdater] checkForUpdates: [[NSApplication sharedApplication] delegate]];
}
// Sparkle requires NSApplicationWillTerminateNotification in order to
// properly update in the background.
//
// https://github.com/sparkle-project/Sparkle/issues/232
// https://github.com/sparkle-project/Sparkle/issues/892
// https://github.com/sparkle-project/Sparkle/issues/839
void sparkle_software_update_cleanup()
{
[[NSNotificationCenter defaultCenter]
postNotificationName:@"NSApplicationWillTerminateNotification"
object:nil];
}
/*

View File

@ -149,6 +149,7 @@ software_update_check(void) {
/** Clean up software update checking.
*/
void software_update_cleanup(void) {
sparkle_software_update_cleanup();
}
const char *software_update_info(void) {