Git Product home page Git Product logo

sparkle-updater's Introduction

sparkle-updater

A cross-platform library for adding automatic software updates to your macOS and Windows applications, using the Sparkle.framework on macOS and the WinSparkle.dll on Windows.

Usage

To use this crate, add it to your Cargo.toml:

[dependencies]
sparkle-updater = "0.1.0"

macOS

On macOS, you will need to include the Sparkle.framework in your application's bundle. You will also need to create an Info.plist file for your application, which should include the following keys:

<key>SUFeedURL</key>
<string>https://example.com/appcast.xml</string>
<key>SUEnableAutomaticChecks</key>
<true/>
<key>SUPublicEDKey</key>
<string>Your Pubkey</string>

Replace https://example.com/appcast.xml with the URL of your appcast file, which contains information about your app's updates. SUEnableAutomaticChecks enables automatic update checks for your app. SUPublicEDKey specifies the base64-encoded public EdDSA key.

To use the sparkle-updater crate in your Rust code, create a new Updater instance:

use sparkle_updater::Updater;

fn main() {
    let updater = Updater::new();

    updater.check_for_updates();
}

Windows

On Windows, you will need to include the WinSparkle.dll in your application's directory, and include the public DSA key in your application's resource file. To do this, create a new .rc file for your application with the following contents:

// Public Key
// Used by WinSparkle
// Verify Signature using DSA public key
DSAPub DSAPEM "dsa_pub.pem"

This assumes that your DSA public key file is named dsa_pub.pem. Make sure to include this file in your app.

To use the sparkle-updater crate in your Rust code, create a new Updater instance:

use sparkle_updater::Updater;

fn main() {
    let updater = Updater::new(
        "https://example.com/appcast.xml",
        "Software\\MyApp",
        None,
    );

    updater.check_for_updates();
}

The first parameter to new() is the URL for the appcast file, while the second parameter is the path in the registry where WinSparkle will store its settings. The third parameter is an optional callback function for handling shutdown requests during updates.

Thanks

Thanks to the Sparkle project and the WinSparkle project for creating the libraries that this crate depends on.

The Sparkle provides a robust and easy-to-use solution for adding automatic software updates to macOS applications, while the WinSparkle provides a similar solution for Windows applications.

Without these projects, it would be much more difficult to add automatic update functionality to our applications. We are grateful for the hard work and dedication of the developers who created and maintain these libraries, and we encourage everyone to check out their projects and contribute if possible.

Thank you, Sparkle and WinSparkle teams!

License

This crate is licensed under the MIT license. See the LICENSE file for details.

sparkle-updater's People

Contributors

hankbao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.