sparkle

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2023 License: BSD-2-Clause, MIT Imports: 6 Imported by: 1

README

Go Sparkle

go.dev reference

This package provides (incomplete) go bindings for Sparkle created by Andy Matuschak.

Sparkle is a secure and reliable software update framework for Cocoa developers.

See https://sparkle-project.org/ for more information about Sparkle.

Documentation

See the GoDoc and Sparkle's documentation (you can ignore point 1 & 2 in the docs).

Getting started

Download the Sparkle framework from https://github.com/sparkle-project/Sparkle/releases/2.5.1 and move the Sparkle.framework directory from the archive into your bundle's Frameworks directory (e.g. YourBundle.app/Contents/Frameworks/).

Configure Sparkle's defaults using your bundle's Info.plist (see https://sparkle-project.org/documentation/customization/). Only use the functions this package exposes to allow your users to change the defaults.

Ensure your binary is built with CGO_LDFLAGS set to -Wl,-rpath,@loader_path/../Frameworks e.g.

CGO_LDFLAGS='-Wl,-rpath,@loader_path/../Frameworks' go build .

Publish your updates as an appcast. See https://sparkle-project.org/documentation/publishing/.

See the example for more details.

Caveats

Sparkle requires a Cocoa run loop to work and as such can only be used by Go apps with a Cocoa UI such as webview/webview or therecipe/qt.

Migrating to v0.1.0

The Get prefix was removed from all function names to make them match C functions in the Sparkle framework e.g. GetFeedURL is now FeedURL etc.

Documentation

Rendered for darwin/amd64

Overview

Package sparkle provides go bindings for Sparkle.

Sparkle is a secure and reliable software update framework for Cocoa developers. See https://github.com/sparkle-project/Sparkle for more info.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutomaticallyChecksForUpdates

func AutomaticallyChecksForUpdates() bool

Returns whether or not to check for updates automatically.

Setting this property will persist in the host bundle's user defaults. The update schedule cycle will be reset in a short delay after the property's new value is set. This is to allow reverting this property without kicking off a schedule change immediately

func AutomaticallyDownloadsUpdates

func AutomaticallyDownloadsUpdates() bool

Returns whether or not updates can be automatically downloaded in the background.

Note that automatic downloading of updates can be disallowed by the developer or by the user's system if silent updates cannot be done (eg: if they require authentication). In this case, -automaticallyDownloadsUpdates will return NO regardless of how this property is set.

func CheckForUpdateInformation

func CheckForUpdateInformation()

Begins a "probing" check for updates which will not actually offer to update to that version.

However, the delegate methods SUUpdaterDelegate::updater:didFindValidUpdate: and SUUpdaterDelegate::updaterDidNotFindUpdate: will be called, so you can use that information in your UI.

Updates that have been skipped by the user will not be found.

func CheckForUpdates

func CheckForUpdates()

Explicitly checks for updates and displays a progress dialog while doing so.

This method is meant for a main menu item. Connect any menu item to this action in Interface Builder, and Sparkle will check for updates and report back its findings verbosely when it is invoked.

This will find updates that the user has opted into skipping.

func CheckForUpdatesInBackground

func CheckForUpdatesInBackground()

Checks for updates, but does not display any UI unless an update is found.

This is meant for programmatically initating a check for updates. That is, it will display no UI unless it actually finds an update, in which case it proceeds as usual.

If automatic downloading of updates it turned on and allowed, however, this will invoke that behavior, and if an update is found, it will be downloaded in the background silently and will be prepped for installation.

This will not find updates that the user has opted into skipping.

func DecryptionPassword

func DecryptionPassword() string

Returns the decryption password used for extracting updates shipped as Apple Disk Images (dmg)

func FeedURL

func FeedURL() string

Returns the URL of the appcast used to download update information.

func LastUpdateCheckDate

func LastUpdateCheckDate() time.Time

Returns the date of last update check.

func ResetUpdateCycle

func ResetUpdateCycle()

Appropriately schedules or cancels the update checking timer according to the preferences for time interval and automatic checks.

This call does not change the date of the next check, but only the internal NSTimer.

func SendsSystemProfile

func SendsSystemProfile() bool

Returns whether or not the user's system profile information is sent when checking for updates.

func SetAutomaticallyChecksForUpdates

func SetAutomaticallyChecksForUpdates(check bool)

Sets whether or not to check for updates automatically.

func SetAutomaticallyDownloadsUpdates

func SetAutomaticallyDownloadsUpdates(check bool)

Sets whether or not updates can be automatically downloaded in the background.

Note that automatic downloading of updates can be disallowed by the developer or by the user's system if silent updates cannot be done (eg: if they require authentication). In this case, `sparkle.GetAutomaticallyDownloadsUpdates` will return NO regardless of how this property is set.

Setting this property will persist in the host bundle's user defaults.

func SetDecryptionPassword

func SetDecryptionPassword(url string)

Sets the decryption password used for extracting updates shipped as Apple Disk Images (dmg)

func SetFeedURL

func SetFeedURL(url string)

Sets the URL of the appcast used to download update information.

Setting this property will persist in the host bundle's user defaults. If you don't want persistence, you may want to consider instead implementing SUUpdaterDelegate::feedURLStringForUpdater: or SUUpdaterDelegate::feedParametersForUpdater:sendingSystemProfile:

This property must be called on the main thread.

func SetSendsSystemProfile

func SetSendsSystemProfile(check bool)

Sets whether or not the user's system profile information is sent when checking for updates.

Setting this property will persist in the host bundle's user defaults.

func SetUpdateCheckInterval

func SetUpdateCheckInterval(duration time.Duration)

Sets the automatic update check interval.

Setting this property will persist in the host bundle's user defaults. The update schedule cycle will be reset in a short delay after the property's new value is set. This is to allow reverting this property without kicking off a schedule change immediately

func SetUserAgentString

func SetUserAgentString(ua string)

Sets the user agent used when checking for updates.

func UpdateCheckInterval

func UpdateCheckInterval() time.Duration

Returns the current automatic update check interval.

func UpdateInProgress

func UpdateInProgress() bool

Returns whether or not an update is in progress.

func UserAgentString

func UserAgentString() string

Returns the user agent used when checking for updates.

Types

This section is empty.

Directories

Path Synopsis
Package sparkle contains required external dependencies from Sparkle.
Package sparkle contains required external dependencies from Sparkle.
Headers
Package headers contains required external dependencies from Sparkle.
Package headers contains required external dependencies from Sparkle.
PrivateHeaders
Package private_headers contains required external dependencies from Sparkle.
Package private_headers contains required external dependencies from Sparkle.
example module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL