
Files requierd for standalone build:
art +
    backdrop +
        updater_bg.png
    buttons +
        down.png
        up.png
    gui +
        normal.png
        updater_current.png
        updater_total.png
    soundlib.xml
data +
    config +
        gldrivers.xml (From CS)
    shader +
        or_lighting.xml (From CS)
    ttf +
        arial.ttf
        verdana.ttf   
    updater +
        updaterwindow.xml
    imagelist.xml
    ok.xml
    prefs.xml
csbmpimg.dll (From CS)
csddsimg.dll (From CS)
csfont.dll (From CS)
csgifimg.dll (From CS)
csjngimg.dll (From CS)
csjpgimg.dll (From CS)
cspngimg.dll (From CS)
cssgiimg.dll (From CS)
cssynldr.dll (From CS)
cstgaimg.dll (From CS)
cswalimg.dll (From CS)
engine.dll (From CS)
fontplex.dll (From CS)
freefnt2.dll (From CS)
glrender3d.dll (From CS)
glshader_fixed.dll (From CS)
glwin32.dll (From CS)
imgplex.dll (From CS)
libcurl.dll
libfreetype2.dll (From CS)
libjpeg.dll (From CS)
libmng.dll (From CS)
libpng.dll (From CS)
libz.dll (From CS)
ogg.dll (From CS)
pssound.csplugin
pssound.dll
psupdater.cfg
rendstep_std.dll (From CS)
reporter.dll (From CS)
shadermgr.dll (From CS)
sndogg.dll (From CS)
sndplex.dll (From CS)
sndsoft.dll (From CS)
sndwav.dll (From CS)
sndwaveout.dll (From CS)
stdrep.dll (From CS)
updater.exe
updaterconfig.xml
vfs.cfg (From CS)
vfs.dll (From CS)
vorbis.dll (From CS)
vorbisfile.dll (From CS)
xmlread.dll (From CS)
xmlshader.dll (From CS)


TODO:
	-create missing directories. [ok]
	-remove empty directories
	-give feedback about download process. [ok]
	-abilty to sign data with pgp?
	-implement config files and backup creation possibility [ok]
		(MOVEFILEAWAY mode).
	-make updater able to update itself. [ok]
	-compress files? [ok]
	-binary patching?
	-SubRegistryFiles for saving download bandwith (linux/windows in
	 separate subregsitryfiles?)
	-Implement variables for stuff like CS install dir.
	-respect textfile and executable flag.
	-Create a real repository and config for planeshift.
	-Save directory of files in the registry xml and not in the config.
	Also a list of mirrors in there would be nice (the question is just
	how to choose the mirrors - randomly?)

Usage:
-Updater Client. Just setup the server in updaterconfig.xml and start the
updater.
-Creating server repositories. You can let the updater create a
serverrpository file for you. Just start the updater with the following command line:
updater --create=E:\WWW\updater (Or whatever you have)
and it will create everything for you, including copy the files

DESIGN:

A repository is either the files we have on disk or the files on server.
The state of the repository is represented by a registry file in xml format.
Here's an example:

<registry>
<module name="linux">
     <file path="bin/psclient" md5="..." executable="1"/>
     <file path="doc/test1.txt" md5="..."/>
     <file path="doc/test2.txt" md5="..."/>
</module>
<module name="common">
    
    <zip file="art/fakemodels.zip">
            <add zipfile="file1" realfile="art/fakemodels.zip/file1" size="5832" md5="6714962a5993f26cd16e383ea9749a61" />
            <add zipfile="file1" realfile="art/fakemodels.zip/file2" size="3240" md5="6591bcb0b6cf56437922c9d004b7617c" />
            <!-- NOTICE: fakemodels.zip is a directory, not a zip file -->
            <remove file="file3" />
     </zip>
     <file path="bin/README" md5="..." textfile="1"/>
     <file path="art/music.mp3" md5="..."/>
     <file path="my.cfg" config="1" />
</module>
</registry>

The repository is divided into several modules. The user can specify in his
config file which modules he wants to download and updat. The md5 is a 32
characters long md5sum in hex format as it is created by the linux md5sum
utility (example: e7ddbfaf6f45ec93186434e59f1a335b)
The textfile flag results in correct CR/LF line endings on
windows/unix. The executable flags results in the unix executable bit being
set. File permissions on unix should probably be better set in the updater
config and not in the registry. The config flag marks the file as config file
file, when we're updating that file and are detecting user changes then we'll
create a backup.

The server is just a normal http or ftp server from which we're loading
the registry file. The client then tries to get his repository (the
filsystem) synced with the server one. By comparing his old registry
with the one he downloaded from the server. The client will have a config file
which selects which modules to update so we're able to differentiate
between linux/windows and other things. Eventually we might also introduce
condition flags which can be enabled/disabled in the config as well.
Comparing files should be based on datestamp numbers and then on md5 (the
additional datestamp number test avoids downloading older versions from server
than the one currently installed and we can postpone the md5 checksum creation
to files which really changed.)



In Code: (it's not all implemented yet)
A downloader class should be able to download an url and provide some
continuing feedback about the progree somehow (some push or poll strategy of
the update notifications).

The Registry Class holds the a list of the file tree and is able to
    -Load/Write the registry to an xml file on the disk
    -Download an xml from http/ftp server
    -Compare 2 Registries
	(needed when updating the client)
    -Compare the Registry with the current filesystem
	(needed when creating registry descriptions for the server)

The compare operations will produce a Changelist class whic is a list of
actions to get the 2 repositories in sync. It contains: fileadded,
fileremoved, filechanged, directory created, directory removed. This
changelist can be saved into xml format as well to get passed to the real
updater when we're having a splitted downloader/updater structure.

We should have a SyncRepository Class which handles syncing client to server:
    -For fileadded, filechanged, fileremoved check md5. If it's different than
    the one in our repository description make a backup because the user seems
    to have changed the file.
    -For fileadded download a new file from server (eventually with tricks
	    like compressed files on the server which get decompressed)
    -For fileremoved delete the file
    -For filechanged try finding possible patchfiles to apply or just download
	the file from server

Alternatively we could first in the downloader part let all needed files from
the changelist get loaded and then just copy the files around in the update
phase, or we're applying possible changes directly while downloading although
this will probably clash with the windows file protection for opened files.

Random technical notes:
    -I tried using vfs, but the functionality is too limited. I need tests to
    differentiate directories/files. Also setting permissions on unix may be
    needed later.
    -I wanted to introduce a little newer coding style to planeshift. So we're
    using exceptions and namespaces here.
    -The changelist, Registry and Downloader class should be moved to a lib so
    that it is easy to integrate them with a gui into the main planeshift
    client.

