Code Monkey home page Code Monkey logo

updatelib's Introduction

Build Status (Travis-CI) Buitld Status (AppVeyor) Open Issues Codecov MIT License Join the chat at https://gitter.im/MatthiWare/UpdateLib

UpdateLib v0.4.4

A .Net auto update library made in C#

Archived

This repo has been archived. Development will continue in MatthiWare/UpdateLib.Core.

Disclaimer

UpdateLib is currently in development and is not yet ready for use in production environment. UpdateLib should only be used for testing purposes untill the first stable release. Use UpdateLib at your own risk while it is still in development.

Features

  • Generator for the update file with GUI
  • Updating files
  • Updating registry
  • Fail-safe rollback feature
  • Caching system
  • FluentAPI to configure the client-side application

Future

  • Creation of binary patches
  • Rework update generator
  • Extend rollback feature

updatelib's People

Contributors

matthiee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

updatelib's Issues

Rollback feature

We need some rollback system that will restore to previous version in case of an error or user cancel.

[Code coverage] Coveralls.io integration

If anybody knows how to setup coveralls.io using

  • Travis CI / AppVeyor
  • Opencoverage
  • NUnit

Uploading the results fail with: 422 - Couldn't find a repository matching this job.

The script we use to run our tests is currently included in appveyor.yml.
Take a look at the build log for more information.

Dropbox API integration

The original version/idea of this updater used the Dropbox public feature as a way of storing the updates.
As of 15/03/2017 Dropbox will remove this feature [see https://www.dropbox.com/help/16].

We can still use Dropbox if we are going to implement the Dropbox V2 API.

As far as I know we have 2 options:

Use the .Net Dropbox API Library

    pros:
    - will be maintained for us
    - .NET Standard 2.0 support
    
    cons:
    - Extra library in output
    - Overhead (we won't be using most of the features)

Write our own API implementation/wrapper around the Dropbox HTTP API

    pros:
    - Less overhead (we just implement the features we need)
    - No extra library in the output
    - We can use lower .Net version to support more systems
    
    cons:
    - Will take more time
    - If Dropbox upgrades changes his API we need to change our wrapper/impl as well

Implementation details

We do not want to limit ourself to Dropbox so we should not depend on it. We should have an abstract pattern that would allow us to use any provider.

  • New repository needed UpdateLib.Extensions.Dropbox
  • Dropbox registration with extension method UpdateLib.UseDropbox(Func<IOptions<DropboxOptions>> options)

ASP.Net Core Web API + Dashboard

Note: This might be put into its own repo to not bloat the UpdateLib Package.

History

Up until now we used a CLI to create new updates. We used files to communicate between the server and the client.

Future

We should use an Web API that our users can set-up to use to make and manage updates.
This API should expose some Endpoints to allow that

Endpoints

GET /api/updates

Gets a list of all available updates

GET /api/updates/{id}

Gets an update info that contains all the versions that can update to this version with patches

POST /api/updates/{id}

Used to manage the specified update

GET /api/updates/from/{version}

Gets an list with all available version from the specified version

GET /api/updates/from/{version}/{latest or stable}

Gets the latest stable or unstable version from the specified version

GET /api/updates/patch/{id}

Downloads the patch file

POST /api/updates/patch/create

Creates a new patch based on the specified info. This will probably return a task id that can be checked to see if it is completed.

Dashboard

  • Create new patches
  • View and manage patches
  • See update statistics and information
  • See failed updates and rollbacks

Enhanced Rollback Feature

TODO

  • - Keep old files so we can rollback at a later stage (if needed)
  • - Rollback to any previous version

Edits

15 Aug 2018

Removed the rollback UI, if you want to show an UI to your end-user you will have to implement this yourself. After v1.0 we could make a package UpdateLib.UI for example that contains some UI.

Shared or local installation

Consider an option to allow the user to set an option in the updater to use shared or local storage.
Storing the cache files in Roaming AppData might not always be the best option.
In this case the local AppData folder should be considered.

Registry updates

Allow modification of the registry in the updates.

If we have any registry update we need to have admin permission.
Developer needs to configure those updates in the UpdateGenerator (new page).

Needs to be added to the updater GUI.
We need to provide a way of rolling back the registry updates in case of error.
Registry updates need to be encapsulated into the UpdateFile.

Option to enable updating before app start using command line args

In the application entry point we should add logic to allow updating using startup arguments.

Default behaviour: no?

Arguments:

  • /update (update program instantly before the rest of the app is loaded)
  • /silent or /s or /quiet (disable updating UI)

What to do in case of error/exception?

Extracting Zip Feature

The original version did not include a way of extracting zip files.
For this version I would like to implement this without adding too much overhead.

Some options:

ZipStorer looks like the best one for our use case at this point in time.

Patches using Delta Compression

Patching system with delta compression

To create smaller updates and reduce the time, UpdateLib should start using patches.
These patches will be created using the VCDIFF/RFC3284 algorithm.
All the patches for a version will be bundled together with metadata into a single compressed zip archive.

Existing software

Current zip idea/layout

  • patch.zip/
    • delta/
      • delta files
    • new/
      • newly added files
    • metdata file

Metdata file

Metdata file contains pointers more information. This should also contain information about deleted files etc.

Other

The highest compression settings are currently used, might change to find a better compression/time ratio.

xdelta3 -e -f -9 -S -s original.exe updated.exe original.exe.delta
For the zip inflate/deflate using level 9 will be used.

Cache keeps deleted files

When testing the speed of updates I noticed a little bug with the cache.

Case: A file has been added in the cache. Next update the file gets removed but not from the cache.

Cons:

  • Cache file will grow indefinitely
  • Could trick the updater into thinking a file exists while it doesn't exist locally

.NET Core 3.0

Create UI for windows using .NET Core 3.0 Winforms

Using drop-in package: MatthiWare.UpdateLib.Windows

UpdateGenerator

GUI to generate the UpdateFile.

  • Version of the update
  • Folders/Files to include in the update
    • option for custom action for each file
  • Registry updater
  • Generation of the file

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.