Application to keep games up to date by automatically downloading and applying patches.
- Everything should be streamlined for the player. First goal of the Launcher is to make players life simpler.
- If anything is a lossy operation - cancel early and advise player to downloading a full build as usual. Later on we could split assets into app-managed (e.g. stock maps) and user-managed (maps, mods). App-managed will be updated, user-managed will be left untouched.
- Patchmaker is intended to fit in into build process. Hence no GUI, just the log.
- Launcher is transitioning from Prototype to Beta stage, so many things are still in the code, rather than configurable from UI or commandline.
- We have agreed to use Sem-Ver-based numbering for builds (Major.Minor.Patch.Rev-Branch). For patching we really need just the Rev and Branch though.
- Launcher. Activated by running the exe as usual. Checks game verion, downloads and installs patches.
- Patchmaker. Activated by dragging a 7z build on to the exe. Creates patches between pairs of builds.
- Identifies build version of a folder it is run in.
- Queries server for available builds and patches.
- Downloads and patches on command. Before patching will verify all the affected files (to avoid data loss).
- Identifies build version of a dropped file and looks for a previous build version.
- Unpacks both of them and creates a diff between them.
- Packs the diff into a patch.
- 7zip exe (path set in TKMSettings.PATH_TO_7ZIP). Only for Patchmaker.
- Server with API to list available builds and patches (TKMSettings.SERVER_ADDRESS and TKMSettings.SERVER_FILE_LIST_GET). Only for Launcher.
- hdiffz.dll (included. Compiled from https://github.com/Kromster80/HDiffPatch). For both modes.
- Game build should consist of 1 folder containing all the games data.
- It should also include "version" file stating the gamea build branch and version.
- It should be packed into 7zip right after generation, to avoid any temp/OS files being generated inside.
- Package should be named according to rules (specified in TKMSettings) with branch marker (optional) and revision number.
- Patchmaker needs newer version 7zip package to start. It will try to find previous version 7zip package.
- If previous version is found, Patchmaker will generate a patch.
- Generated patch needs to be uploaded to the webserver.
- Patcher needs to be launched from the games folder. It will detect games version from "version" file.
- It will query webserver for list of available builds and patches and determine if patching can be performed.
- On players command, Patcher will download and apply 1 or more consequtive patches till the latest version.
- If any patch could result in data loss, patching will be calcelled.
- Open src\KM_Settings.pas and fill in constants.
- Update game build process to generate "version" file in the games root folder containing game version string.
- Change graphics in the src\Form_Main.dfm image.
- You can tweak diff settings in the TKMHDiffPatch constats (affects diff generation speed vs size)