Jump to content

Application Updater


Chronos

Recommended Posts

I've recently been working on a patcher that allows users to very easily add new updates in a drag and drop manner. Because when you're developing a game, the last thing you want to do is think about what you changed in your files since last time right? You want to be able to just drag and drop your files into a folder and be done with it.

 

Well, that's what this updater is all about! Set it up and forget about setting up new updates. All you need to do beyond the initial setup is drop your client files into a folder and run a simple webpage to update the database with all your recent changes. Anything that hasn't been changed will not be copied nor downloaded to your users!

 

The provided patcher application is just a basic patcher with little to nothing special about it, but it's generic enough to do the job for the majority of projects. Of course since the source is provided you're more than welcome to change it to anything you'd like.. or write your own with the provided Api library. Everything in the project is written in C#, and compatible with Mono so it can and will run on a Linux or MacOSX box.

 

Git Repository: https://source.vanharberden.eu/silvester/auto-updater
Latest version: https://source.vanharberden.eu/silvester/auto-updater/tags

 

If you have any problems with the updater, please let me know or create an issue on the repository for me to look at.

Basic How-To

  1. (Optional) Install MySQL Server and import https://source.vanharberden.eu/silvester/auto-updater/blob/master/Database.sql
  2. Upload the WebApi to either a linux box running Mono or IIS.
  3. Configure WebApi's Web.Config file for SQLite or your MySql database.
  4. Configure the UpdaterApplication project's files to point to your webserver.
  5. Upload all client files to a folder called NewFiles in the WebApi directory.
  6. Go to http:///ProcessNewFiles.aspx and wait for it to tell you it's done.
  7. Open your updater and watch it go!
Link to comment
Share on other sites

2 hours ago, Joyce said:

Any particular reason why it uses mysql instead of sqlite? That would drastically cut down on how hard it is to set up. 

Mainly because it's easier to get my TSQL Query transitioned to MySql than to SQLite seeing how it's fairly basic. MySql already doesn't support what I use in my personal version, and SQLite would have me resort to pulling the entire table and running a Linq query against it to get the latest versions of each individual file, whereas in MySql I can simple let the Database engine handle this through the following query:

 

SELECT  id, version, file, hash
FROM (
    SELECT  @row_num := IF(@prev_value=f.file,@row_num+1,1) AS RowNumber, f.id, f.file, f.version, f.hash, @prev_value := f.file
    FROM files f, (SELECT @row_num := 1) x, (SELECT @prev_value := '') y
    WHERE f.version > {0} AND f.version <= {1}
    ORDER BY f.file, f.version DESC
) x
WHERE RowNumber = 1

I suppose I can whip up an SQLite version (Possibly have it as a setting?) as well should people want me to, it's not a very hard thing to do.

 

Anyhow, I might end up making a more detailed guide on how to get this running at some point today, if I get the time to do so.

Link to comment
Share on other sites

I've started work on supporting SQLite as well. Mind you, this means that all queries need to be written in a generic fashion supported by both MySql and SQLite. But since there's not all that many queries going around that shouldn't be too hard to do. I'll push all these changes to a new branch over here: https://source.vanharberden.eu/silvester/auto-updater/tree/SQLite_Addition

 

I've also started filling up the project Wiki, though this is not yet in a state where it can be used as a guide.

 

EDIT: SQLite support has been added.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...