Setting up a proper autoupdater
As many of you guys know, I’ve modified Robin’s old boring updater several times now… And updated and fixed it a few times, this time around I fixed every bug I could find and rewrote a few pieces of it to work much more fluently, removed a ton of unessecary junk and made it a lot easier to configure.
So then, let’s get started shall we?
- FTP Knowledge
- A website with FTP Access
- An FTP Client
- MSINET.OCX (From the Visual Basic 6 Service Pack 6)
Note that you will need to include MSINET.OCX in your installer or runtime file installer and have them register the file for your game if you want everyone to be able to use this patcher. OR try shipping it alongside your executable, although I wouldn’t really recommend doing this.
Download The Updater
Seems like a fairly important step right? Just download the file linked below and extract it anywhere on your computer.
Logging into your FTP Account
First thing you’ll need to do is pull up your FTP client and log into your website, go to where you want your patch folder to be located,and make a new folder… In my case, I will use /updates/.
Getting the files on there
Now, go make a news page. Dooo eeeeet.
Done? Good, upload it to your update folder, or anywhere else on your website if you prefer it to be elsewhere. After this, go into the location you extracted the updater files to, go into the Server folder and upload these files to your update folder.
Yes, the file is called update.txt, why you ask? Why not *.ini? Well, most webhosts do not have a MIME filter addition for *.ini files, and thus do not allow them to be downloaded. a *.txt is fairly universal and will work on just about any webhost, so I changed it around. :]
Do note that Version1 is not empty, you can put your entire game client in here if you wish, and only install the updater on someone’s computer with version=0 in the local config file, this will then download the client through the updater. you can’t have empty *.rar files sadly.
Setting up the client side
Hopefully you know the URL of your own site, as you’ll need this! Head into the Client folder of your extracted files, and copy the following files and folders to your game client’s folder:
- Data Files
The other files are not needed by the compiled binary, note that Data Files\graphics\gui\updater contain the graphic files used by the launcher. Update,jpg is used when the game is updating, and Launch.jpg when it’s done and ready to launch.
Now then, let’s go into Data Files and edit UpdateConfig.ini… You’ll notice the following lines:
The URL to your website, it’s really not used right now… But I never removed the option. :]
The URL that points to your update directory we made before, make sure it ends with a / to have it function!
The URL that points to your news page, for patch information and whatnot.
The version of your local client.
The name of your client’s executable to launch when a player hits the Launch button.
Configure them appropriately, and if you’re lost here’s an example:
[UPDATER] GameWebsite=http://www.touchofdeathforums.com/ updateURL=http://184.108.40.206/updates/ NewsURL=http://220.127.116.11/updates/news.html Version= 1 ClientName= Client.exe
It points to my testing server. :] It should be up for the most part, but I added it on here to just allow you to see what needs to have what entered.
Uploading an Update
Well, now you have an updater… But no idea how to make updates! No worries, just make sure you keep track of what you updated. You simply need to put ALL the files you changed with their file hierarchy* in a new versionX.rar file, where X is your new version number(So if we’re going from Version 1, make it 2).
Done? Alright, let’s upload it to our webserver’s update folder next to the other version rar files. Once the upload has been completed, open up update.txt and change the version number to your latest version you just uploaded, the next time you run your patcher it will update your game files with the new patch! It’s that simple. :]
Note that you can NOT EVER include unRAR.dll or Launcher.exe in your version.rar files, this will cause errors with extracting the files.
(*= If a file is in Data Files\Graphics on the client, it has to be in Data Files\Graphics in the *.rar file as well)
Do my players need WinRAR installed?
No, they do not. unrar.dll handles this for them. :]
Can I use this on XXX webhost?
Don’t know nor care, it’s your responsibility to find out if your host allows hotlinking or not.
OMG IT CRASHES!!!1111ONEONEONE
Congratulations for handing me the most useless report ever. Here’s a hammer to pound your skull in.
Can I use this with XXXXX Program?
Yup, this isn’t bound to just Eclipse… It can pretty much update anything you want to really.