Skip to content
This repository has been archived by the owner on Mar 4, 2023. It is now read-only.
Dirk Eisenberg edited this page Apr 1, 2017 · 4 revisions

Basic Setup

Follow these simple steps, and you’ll have your app auto-updating in no time.

Linking the NetSparkle Framework

Add a reference to the NetSparkle-framework in your visual studion project. All referenced assemblies will be part of your applications output directory, ensure that you add the NetSparkle-library into the binary distribution of your application.

Set up a NetSparkle updater object

Open up your main forms code (e.g. Form1) and go to the constructor of the class. Add a private attribute of type Sparkle above the constructore, e.g. private Sparkle _sparkle; Instanciate the sparkle autoupdater directly after InitializeComponents(); in the form contructor, e.g. _sparkle = new Sparkle("http://yourappcastserver/yourappcastdocument.xml");

    public partial class MainForm : Form 
    { 
        private Sparkle _sparkle; 
               
        public MainForm() 
        {            
            InitializeComponent();       
  
            _sparkle = new Sparkle(http://update.applimit.com/netsparkle/versioninfo.xml); 
            _sparkle.StartLoop(true);    
        } 
    }

Segue for security concerns

Since NetSparkle is downloading executable code to your users’ systems, you must be very careful about security. To let NetSparkle be sure an update came from you (instead of a malicious attacker), you must do one of two things:

Include a DSA signature of the SHA-1 hash of your published update file. (See “How to generate a DSA signature”) Deliver your update and your appcast through SSL.

Publish your appcast

NetSparkle uses Sparkle compatible appcasts to get information about software updates. An appcast is an RSS feed with some extra information for NetSparkle’s purposes. Make a copy of the sample appcast included in the Extras directory of the NetSparkle distribution. Read the sample appcast to familiarize yourself with the format, then edit out all the items and add one for the new version of your app by following the instructions at Publishing an Update. Upload your appcast to a webserver.

Test NetSparkle out

Make sure the version specified for the update in your appcast is greater than the assembly version defined in the Assembly.cs of the app you’re running. Run your app. The update process should proceed as expected.

Next steps

That’s it! You’re done! You don’t have to do any more. But you might want to:

NetSparkle can be configured with registry values which are stored under HKCU\Software\Vendor\Application. The following value are supported and stored as REG_SZ values independently of their logical meaning:

  • CheckForUpdate - Enables (True) automatic updates or disables (False) automatic updates
  • SkipThisVersion - Skips a specific update
  • ShowDiagnosticWindow - shows (True) a diagnostic window for debugging issues with the update check

Get involved

NetSparkle needs help in the localization area, if you are interested in just visit our localization section. It's very easy and costs you just a couple of minutes!