[RELEASE] Launcher/Updater [Source]

07/23/2012 10:47 TheChinStrap#1
Hello everyone...

For those of you that don't know me, and those that do and don't recognize the username... I go by Montesboogey, previously on Epvp as Urusendayo. I've lost my account info and unfortunately had to re-register. I've been away for quite some time as I've been caring for my brother in the cancer hospital. (Still fighting strong, the brave bastard) Anyway...

I've done a bit of development recently and since I cannot currently afford to have my server running again any time soon I thought I'd share my stuff around.

I haven't seen a launcher/updater on here and I've seen people in the past asking for one, not to mention countless servers operating without one, so i thought I'd release mine.

It was made in Visual Studio 2012 Ultimate RC (Tested and works fine in VS-2010) in C#. Details are as follows:
  • Checks for local version in client folder
  • If version file does not exist it assumes the version is "1.0" and creates a version file
  • Checks xml file on server for updates
  • Downloads updates for all greater versions than the client's current version (updates all in zip file format only)
  • Extracts zip files
  • Delete's zip files after extraction
  • Updates version file in client folder
  • And, finally, unlocks the "START GAME" button

How to edit
Open up the sln file in "VS Project" folder with Visual Studio 2010 or Visual Studio 2012 RC:
[Only registered and activated users can see links. Click Here To Register...]

Look for:
Code:
string Server = "http://127.0.0.1/Updates/";
Change [Only registered and activated users can see links. Click Here To Register...] to whichever url you will be hosting your updates.
Important to note: the url must end with a "/".
Example:
Wrong way:
Code:
http://127.0.0.1/Updates
Right way:
Code:
http://127.0.0.1/Updates/
Open the "Upload to Webserver" folder:
[Only registered and activated users can see links. Click Here To Register...]
Upload the contents of this folder to wherever you will be hosting your updates. (With exception of the html folder all other files are required or updating will NOT work.)

In Visual Studio, select the WebBrowser Control (In this case named "patchNotes") and change the url from "http://127.0.0.1/" to whichever url you will be displaying in your launcher:
[Only registered and activated users can see links. Click Here To Register...]
I have provided a page, located in "Upload to Webserver\html". (Based on Luis Zuno's "Zen" template as a boilerplate.) There is also a psd file located in "Resources" which contains the background and logo source. You may use these however you like.

Next you will want to edit you xml file (Updates.xml) to represent your downloads.
Code:
<?xml version="1.0" encoding="utf-8" ?>
<theupdates>

  <update>
* * <version>1.1</version>
* * <file>V1-1.zip</file>
* </update>

  <update>
* * <version>1.2</version>
* * <file>V1-2.zip</file>
* </update>

  <update>
* * <version>1.3</version>
* * <file>V1-3.zip</file>
* </update>

</theupdates>
This is quite straight forward. Please note, you cannot use decimals "." in the file name or it will return an error. Also note the update MUST be a zip file. The entire program is dependent on this.

To add an update, simply add it to the "Update.xml"-
Code:
<update>
* * <version>1.4.1</version>
* * <file>V1-4-1.zip</file>
* </update>
And change the version in the "version.txt" on the server.

I have provided a sample launcher in the "Sample Launcher" directory. You can open this up to see it in action. I recommend running it from there rather than using it in a client folder as it will download some "dummy files". if it works correctly you should see it download 3 zip folders, extract them, delete them, then create a "version" file. Inside the "Resource" folder you will then see a "1", "2", and "3" file.

(Also note the launcher NEEDS the provided dll file to function)

And that about covers it. If you have any questions or comments, feel free to post them here or pm me. If you decide to use my launcher, proper credits are appreciated. ;)

Please, please, please do not flame. I may not be the most gifted C# programmer, but I'm making the effort.

Enjoy :)

[Only registered and activated users can see links. Click Here To Register...]
07/23/2012 12:39 TheAgame#2
Good work :) Thanks
07/23/2012 15:35 AngelOwns#3
Great Job ...
07/23/2012 16:02 TheChinStrap#4
-null
07/23/2012 17:10 M>M#5
it's like the one i made but i don't use xml i use a text file :P

it's easy to make one just make a simple downloader and add a zip unpacker and you have and a text or xml file for the version and you will have a good updater launcher for your server
and try to add a try icon for those who have a low download rate
and you will have the same launcher i made ;)
07/23/2012 18:56 TheChinStrap#6
Quote:
Originally Posted by M>M View Post
it's like the one i made but i don't use xml i use a text file :P

it's easy to make one just make a simple downloader and add a zip unpacker and you have and a text or xml file for the version and you will have a good updater launcher for your server
and try to add a try icon for those who have a low download rate
and you will have the same launcher i made ;)
Well, This is a basic launcher that I made for the people here on epvp. I didn't do a whole lot with the design because people will obviously change that about as they see fit. Same goes for the buttons and so on.
07/26/2012 11:54 gruce#7
that don't updating with me -_-
07/26/2012 12:23 Tofrum#8
Ill add this thread to rdc, and ill add your name and M>M to the devs page
07/26/2012 15:14 gruce#9
dud ..

m>m
he is hawas ~~
07/26/2012 15:21 Tofrum#10
Quote:
Originally Posted by gruce View Post
dud ..

m>m
he is hawas ~~
Yeh i found about that, added M and removed hawas

U developed something/ coded something?? (gruce)
07/26/2012 15:26 gruce#11
yes ,

and now i want rappelz kts to add new item from kts ;)


want pic ?


ok


see this !!


[Only registered and activated users can see links. Click Here To Register...]


New Pet's :)


want the link fast please
07/26/2012 15:30 Tofrum#12
Then ill add u to the list

Im arabian dude...
07/26/2012 15:34 gruce#13
thx me 2
07/27/2012 05:32 TheChinStrap#14
Quote:
Originally Posted by [Co-Admin]Tofrum View Post
Ill add this thread to rdc, and ill add your name and M>M to the devs page
I don't mind if you put my stuff up for download on your page, as long as you ask first. If you're going to add me to your page put me down as "Montesboogey".
09/24/2012 05:02 Izannami#15
Thanks for your work, i searched a lot for some example of code, cuz i want to programe my own adn your work is good as tutorial how it may looks. THANKS AGAIN and keep your work up ^^