BitsUpdater

BitsUpdater is .NET library written in C# for automatic application update using Background Intelligent Transfer Service (BITS). This service is used by Windows Update and is friendly to network resources. Library has GUI tool for generating secure packages.

http://blog.chodounsky.net/2010/08/03/automatic-application-update-with-bitsupdater/

This project uses SharpBITS.NET library.

Features

Usage


static void Main(string[] args)
{
    BitsUpdater updater = new BitsUpdater("http://chodounsky.net/projects/BitsUpdater.Example/UpdateManifest.xml"
                                                             , Directory);
    RegisterUpdaterEvents(updater);
    updater.ResumePreviousDownload();
    updater.CheckUpdateAsync();
}

private static void RegisterUpdaterEvents(BitsUpdater updater)
{
    updater.UpdateDownloaded += (s, e) =>
        {
            Console.WriteLine("Update package is downloaded. Starting to apply update.");
            updater.Update(PublicToken);
        };

    updater.UpdateDownloadError += (s, e) =>
        {
            Console.WriteLine("Download error(" + e.Code + ") occured: " + e.Description);
        };

    updater.UpdateDownloadProgressChanged += (s, e) =>
        {
            Console.WriteLine("Downloaded " + e.BytesTranferred/1024 + "/" + e.BytesTotal/1024);
        };

    updater.UpdateChecked += (s, e) =>
        {
            if (e.UpdatesAvailable)
            {
                Console.WriteLine("New updates are ready to download!");
                updater.Download();
            }
            else
            {
                Console.WriteLine("There are no new updates.");
            }
        };
}

Requirements

Screenshots

Assembly Token which you have to provide to BitsUpdater Update method BitsUpdatePacker is simple but effective tool for creating update packages