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!

Last edited Mar 12, 2011 at 7:24 AM by dei79, version 18

Comments

Paul_S May 18, 2011 at 8:34 PM 
There is nowhere near enough detailed information and examples to complete a project here, or to evaluate your project for suitability. Unfortunately this is the norm for the internet. Even your code example does not follow the content of your text -- where is the "private attribute"? My application consists of a suite of 5 exe files, and is normally distributed using a single .msi file. I give the users a web link to a zip file that contains a single .msi file. How is an auto update with sparkle handled in this situation?

chrisdoman May 17, 2011 at 3:28 PM 
Incase you can't see it the namespace is:
using AppLimit.NetSparkle;

Slesa Mar 8, 2011 at 12:57 PM 
A small german review is available on http://joergpreiss.wordpress.com/2011/03/07/automatische-updates/