diff options
author | Gerald Combs <gerald@wireshark.org> | 2019-11-14 08:08:28 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2019-11-15 18:39:04 +0000 |
commit | 02057200fd73fc70cc4a6eeece5c033c14f0c50a (patch) | |
tree | 37582235a0d91441aeae1f07a61f6d735070e609 /ui/macosx/sparkle_bridge.m | |
parent | fd4bb1e392839954c959a76af35c6eec6448add9 (diff) |
macOS: Add support for automatic updates using Sparkle.
Add support for automatic updates using the Sparkle framework. Add
FindSparkle.cmake and associated CMake plumbing. Add a public key and
other info to Info.plist.in. Add ui/macosx/sparkle_bridge.{h,m}, which
wraps the Sparkle API. Make code that's specific to WinSparkle
Windows-only.
Add Sparkle installation steps to the macos-setup scripts. Sparkle
prints a warning if your bundle is unsigned (which is the case during
development) so disable installing it by default.
Updating here takes a long time. We might be able to fix that by
shipping our DSYMs separately.
Change-Id: I6cc6671db5657dadc514bda6bf6e1c8bbc9468a5
Reviewed-on: https://code.wireshark.org/review/35090
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/macosx/sparkle_bridge.m')
-rw-r--r-- | ui/macosx/sparkle_bridge.m | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ui/macosx/sparkle_bridge.m b/ui/macosx/sparkle_bridge.m new file mode 100644 index 0000000000..a78d6a953e --- /dev/null +++ b/ui/macosx/sparkle_bridge.m @@ -0,0 +1,44 @@ +/* sparkle_bridge.m + * + * C wrapper for the Sparkle API + * + * Wireshark - Network traffic analyzer + * By Gerald Combs <gerald@wireshark.org> + * Copyright 1998 Gerald Combs + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include <ui/macosx/sparkle_bridge.h> + +#import <Cocoa/Cocoa.h> + +#import <Sparkle.h> + +// https://sparkle-project.org/documentation/customization/ +// Sparkle stores its state in ~/Library/Preferences/org.wireshark.Wireshark.plist + +void sparkle_software_update_init(const char *url, bool enabled, int interval) +{ + [[SUUpdater sharedUpdater] setAutomaticallyChecksForUpdates: enabled]; + [[SUUpdater sharedUpdater] setUpdateCheckInterval: interval]; + [[SUUpdater sharedUpdater] setFeedURL: [NSURL URLWithString: [[NSString alloc] initWithUTF8String: url] ]]; +} + +void sparkle_software_update_check(void) +{ + [[SUUpdater sharedUpdater] checkForUpdatesInBackground]; +} + +/* + * Editor modelines + * + * Local Variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * ex: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ |