Game Launcher

Game Launcher

Developed By: Ertzel

Overview

This program can be used by anyone to automatically update files from a webhost to a computer.

Info

Everything related to this launcher is coded in C# and was done by me for an engine I am working on. I decided to make the Launcher something that I could post on here for other people to use on their own Eclpse or non-Eclipse projects.

The way this launcher works is: You upload a checksum file to your webhost that holds the data to all of your files also on the webhost you wish to update (This file is created by the Checksum Builder included with the launcher). You then simple upload all of your files you wish to download to your host. (Files that go in a folder on the computer are to go in their own subdirectory with that folder name)

When the user first starts up the launcher it will download that checksum file you put online and will use it to check if your client has all of those files or not. If they do it will mark the status of that file as “Pending…” and if they don’t it will be marked as “Missing…” When the user clicks on the Update button it will scan through the list of files from that checksum file and if the file is marked as Missing it will automatically download it to the appropriate folder on your computer (It will create the folder if the path is missing). If the file is marked as Pending, it will then check the checksum value of that file from the checksum file compared against the value of the file the client already has. If the values match up it will be marked as Up To Date! and be skipped. If they do not match up it will replace the clients program with the one on your host.

How To Use

To use this launcher you will need access to a C# compiler as there are certain things you need to change. You will need to go to the frmMain.cs file in the Launcher solution and edit a few variables.

First change the downloadPath value to the full url of your host.

Next change the webNews.Url valye to the url of the webpage you will be using to display your news.

After that change client value to your clients name (and directory if its not in the base directory).

Then if you do not save your checksum file as Eclipse.checksum, you will need to change that anywhere where you see it in the source.

Finally any custom changes you want to make (like the layout or graphics).

Once you have done all of that, compile it and your ready to start using it.

To update you will want to create a folder (something like “Updates”) and place all of your files/folders into it. Then launch the Checksum Builder program and select that folder and click on Build Checksum (again, if you don’t name it Eclipse.checksum you will need to change that in the Launcher’s source). Once you have that file upload it and everything from your Updates folder onto your host. When you make any new updates just replace the current file with the new one in your host and replace the checksum file with the updated one.

Then send out your updater to your clients and they can begin using it! (if you didn’t include certain files needed to run your program into the updates then make sure you send them with the updater).

Example of a checksum file: http://pastebin.com/VBQqV8D7

Screen Shots

! News
!
! On Load
!
! Finished Updating
!
! Checksum Builder
!
! Download: (Coming soon…)

Good stuff.

A lot of ppl will request a compiled version with an editable .ini file.

Btw shouldnt this be in Resources?

Btw shouldnt this be in Resources?

Good point, moved it.

Good stuff.

A lot of ppl will request a compiled version with an editable .ini file.

Ya, when I started making it, I was basing it off of my own engine so I didn’t bother with .ini shit. I’ll probably end up changing those variables to be loaded through a .ini or some sort of file before I release the download link though so people can do it without C#. It’s an easy change once I get around to doing it.

I like it hardcoded because people cant change. Also what program you need to edit the source with?

Although I made it in Visual Studio 2012, you just need anything that can compile C# code to make the changes…

I will work on making certain things stored in an Ini and also editable graphics files for the background and buttons for those people who are to lazy to edit the source or are too nubby to follow basic instructions (Although if you can’t figure out how to edit those things you probably will duck up the Checksum and uploading of the files).

So VS 2010 should work without problems?

So VS 2010 should work without problems?

No, you’ll need Visual C# 2012 unless he targeted the .NET 4.0 framework in lieu of 4.5, in which case you could use Visual C# 2010.

Looks amazing. Can’t wait to play around with it. I’ve never been able to make a proper checksum system in C#

Okay, so after a few failed attempts at trying to save/edit the changeable data by using the launcher’s settings file via a SettingsEditor program I made, I gave in and made a data file that stores the info.

Although I still didn’t make it just a shitty ini file. Now you use the Settings Editor to edit your news url, upload url, client name (the program launched when the user presses play) and your checksum file name. You then click Save Settings and it will create a data.config file that holds all your settings but they are encrypted (because plain text is lame).

You then ship this file with your launcher and it reads from it to set up those variables. I’m still looking into a way of not needing this data file, but for now this will do.

Example of the settings Editor:

!

I like it hardcoded because people cant change. Also what program you need to edit the source with?

lolwut.

Ya, I just kind of ignored that… But thanks for posting so I don’t have to double-post!

Another quick update. You can now customize the background, player button, update button and icon images. I have default ones stored in a graphics file that will come with the launcher, you just edit those images and they are loaded into the launcher when you run it.

I fail at graphics and also purposely made them shitty looking so people will use their own and not stay with the default ones (and if you do, your only making your game look bad with them)

Here is the new look:

!

I also added another textbox to the Settings Editor that allows you to change the text displayed at the top of the Launcher (by default it says Eclipse Launcher)

I think it would be better to not make INIs, you should make another separate configuration where you type the websites, names and blah blah blah, and that would make sort of an INI, but one “codified”) like instead of

website=example.com

it would be sort of

$*+4 ¿_ @#¡‰

but the launcher should still be able to read it, by decoding it.

Ups, i meant separate configuration program, that only the administrator of the game would have.

Which is exactly what I did and posted about in the post 3 above yours…

I made a Settings Editor that is used to create a config file thats encrypted. The admins uses this editor to create the file that is send with the launcher.

Then this launcher is perfect, good job!

What happens if we can’t afford 2012 Visual Studio C# and how did you manage even to buy it?

There is a free version called Visual Studio Express. http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop

This looks amazing cant wait for release

It’s now setup so if you know basic C# you can edit the settings file and delete the data.config file. if the data.config file is not present the Launcher will load its data out of the settings.

Also fixed a few small bugs with file placement and making it so it doesn’t matter what folder your config file or checksum file is in, as long as its in a folder thats part of the main path of the launcher.

Another small change is the launcher goes through and deletes any programs/files/folders that are not in the checksum file (so its not part of the launcher or game). That way you can delete old files by simply removing them from the checksum on your next update patch.

Awesome. :D

when will you put it for download? i want it for my game ^^

Log in to reply