[Contribution] The Warzone2100 Updater!
Posted: 29 Aug 2010, 03:38
Okay, here's something for all you Windows users who have been asking about an updater. Here's the solution, or well at least part of it. Introducing: The Warzone2100 updater!
It's plain c code, written and compiled on Linux but in theory it should work just as well with Mingw or Cygwin. It works, at least. And it's easy to administrate. There are a few things that need fixing that I've been too lazy to take care of so far, namely:
This is from a test run. As you can see all of the files i unzipped from the installer are being downloaded into the empty application directory.
The updater only depends on libcurl, and is intelligent enough to keep track of what version was updated to.
That's it Feel free to put this on the svn, that way people can help hack on it.
It's plain c code, written and compiled on Linux but in theory it should work just as well with Mingw or Cygwin. It works, at least. And it's easy to administrate. There are a few things that need fixing that I've been too lazy to take care of so far, namely:
- The database is not implemented. Its purpose is to make sure that an unmodified file is not downloaded. Until it's fixed, each new release will cause a download of all the files.
- Hashchecking, to make sure that the files were downloaded Ok. After all, we do already have the hashes so they should just be compared.
- Run mode, simply add the code to load Warzone. This way you could use wzupdater to launch the game, always being up to date.
This is from a test run. As you can see all of the files i unzipped from the installer are being downloaded into the empty application directory.
Code: Select all
noccy@noccy-desktop:~/Development/c/wzupdater$ cd test
noccy@noccy-desktop:~/Development/c/wzupdater/test$ ls
wzupdater
noccy@noccy-desktop:~/Development/c/wzupdater/test$ ./wzupdater
Looking for updates: Latest is 2.3.4
An update is available! Downloading manifest
Checking files: 0 in database, 54 new, 0 needs updating.
Downloading ./Readme.en.html [ 1/54] . 28.57kB
Downloading ./mp.wz [ 2/54] ... 715.03kB
Downloading ./COPYING [ 3/54] . 17.59kB
Downloading ./dbghelp.dll [ 4/54] ... 1020.63kB
Downloading ./Readme.de.html [ 5/54] .. 30.53kB
Downloading ./Readme.en [ 6/54] . 20.11kB
Downloading ./oalinst.exe [ 7/54] ... 790.52kB
Downloading ./locale/ru/LC_MESSAGES/warzone2100.mo [ 8/54] . 404.00b
Downloading ./locale/zh_CN/LC_MESSAGES/warzone2100.mo [ 9/54] . 407.00b
Downloading ./locale/es/LC_MESSAGES/warzone2100.mo [10/54] . 404.00b
Downloading ./locale/la/LC_MESSAGES/warzone2100.mo [11/54] . 404.00b
Downloading ./locale/da/LC_MESSAGES/warzone2100.mo [12/54] . 404.00b
Downloading ./locale/uk/LC_MESSAGES/warzone2100.mo [13/54] . 404.00b
Downloading ./locale/nl/LC_MESSAGES/warzone2100.mo [14/54] . 404.00b
Downloading ./locale/ko/LC_MESSAGES/warzone2100.mo [15/54] . 404.00b
Downloading ./locale/en_GB/LC_MESSAGES/warzone2100.mo [16/54] . 407.00b
Downloading ./locale/zh_TW/LC_MESSAGES/warzone2100.mo [17/54] . 407.00b
Downloading ./locale/sl/LC_MESSAGES/warzone2100.mo [18/54] . 404.00b
Downloading ./locale/cs/LC_MESSAGES/warzone2100.mo [19/54] . 404.00b
Downloading ./locale/pl/LC_MESSAGES/warzone2100.mo [20/54] . 404.00b
Downloading ./locale/et/LC_MESSAGES/warzone2100.mo [21/54] . 404.00b
Downloading ./locale/fy/LC_MESSAGES/warzone2100.mo [22/54] . 404.00b
Downloading ./locale/fr/LC_MESSAGES/warzone2100.mo [23/54] . 404.00b
Downloading ./locale/lt/LC_MESSAGES/warzone2100.mo [24/54] . 404.00b
Downloading ./locale/fi/LC_MESSAGES/warzone2100.mo [25/54] . 404.00b
Downloading ./locale/hr/LC_MESSAGES/warzone2100.mo [26/54] . 404.00b
Downloading ./locale/ro/LC_MESSAGES/warzone2100.mo [27/54] . 404.00b
Downloading ./locale/de/LC_MESSAGES/warzone2100.mo [28/54] . 404.00b
Downloading ./locale/sk/LC_MESSAGES/warzone2100.mo [29/54] . 404.00b
Downloading ./locale/it/LC_MESSAGES/warzone2100.mo [30/54] . 404.00b
Downloading ./locale/nb/LC_MESSAGES/warzone2100.mo [31/54] . 404.00b
Downloading ./locale/pt_BR/LC_MESSAGES/warzone2100.mo [32/54] . 407.00b
Downloading ./locale/ga/LC_MESSAGES/warzone2100.mo [33/54] . 404.00b
Downloading ./locale/pt/LC_MESSAGES/warzone2100.mo [34/54] . 404.00b
Downloading ./warzone2100.exe [35/54] ........................................................................ 20.61mB
Downloading ./styles/readme.screen.css [36/54] . 392.00b
Downloading ./styles/readme.print.css [37/54] . 391.00b
Downloading ./dbghelp.dll.license.txt [38/54] . 12.42kB
Downloading ./AUTHORS [39/54] . 1.86kB
Downloading ./base.wz [40/54] ......................................................................................................... 30.11mB
Downloading ./music/track3.ogg [41/54] . 384.00b
Downloading ./music/track2.ogg [42/54] . 384.00b
Downloading ./music/music.wpl [43/54] . 383.00b
Downloading ./music/track1.ogg [44/54] . 384.00b
Downloading ./music/menu.ogg [45/54] . 382.00b
Downloading ./Readme.de [46/54] . 22.10kB
Downloading ./ChangeLog [47/54] . 103.67kB
Downloading ./fonts/DejaVuSans-Bold.ttf [48/54] . 393.00b
Downloading ./fonts/$PLUGINSDIR/LangDLL.dll [49/54] . 397.00b
Downloading ./fonts/DejaVuSans.ttf [50/54] . 388.00b
Downloading ./fonts/fonts.conf [51/54] . 384.00b
Downloading ./mods/multiplay/ntw.wz [52/54] . 389.00b
Downloading ./mods/multiplay/dydo-ai.wz [53/54] . 393.00b
Downloading ./mods/multiplay/old-1.10-balance.wz [54/54] . 402.00b
noccy@noccy-desktop:~/Development/c/wzupdater/test$ ls
AUTHORS ChangeLog dbghelp.dll fonts mods music Readme.de Readme.en styles wzupdate.latest wzupdater
base.wz COPYING dbghelp.dll.license.txt locale mp.wz oalinst.exe Readme.de.html Readme.en.html warzone2100.exe wzupdate.md5
noccy@noccy-desktop:~/Development/c/wzupdater/test$
That's it Feel free to put this on the svn, that way people can help hack on it.