Some notes about this readme: this file contains extra information not found in the readme from the NSIS distribution, specifically about the User Interface of VPatch (the GUI) and the VAppend command line utility to create standalone patches.
Step 1. Start the interface (VPatchGUI.exe).
Step 2. Hit the "Add new version" button. Now, select the latest version of your file. Right after that, another file selection screen pops up. Now, select all older versions of your file (which need to be updated).
Step 3. You're set, you can add more files if you want through the "Add new version" button.
Step 4. Configuration: By default a "Block size" of 64 is configured. If you make it smaller, you will get smaller patch files. You can set this to 16 to squeeze out even that last byte, but applying the patch file can get slower when using such small block sizes. Also, memory usage during patch generation will be higher.
Step 5. Hit "Generate patches" from the Action menu. Your patches are now being generated.
Step 6. If you select "Create patch file" now, the program will create an PAT which contains the information needed to update all old files to new versions. This PAT file can be used to update files. If you want to do this with NSIS, see the other readme file. If you want to use it standalone, you should create an EXE file instead of a PAT file. However, the recommended way to use patches with NSIS now uses plugins, see the other readme for info about that.
Make sure you have the source file (original version) and the target file (version to update to). For example, I have DATA.DTA (currently on user system) and DATA_20.DTA (v2.0 of this data file). Now call GenPat.exe:
GENPAT (sourcefile) (targetfile) (patchfile)
In my example, I use the following call:
GENPAT data.dta data_20.dta data.pat
Now, the patch will be generated. This will take some time. You can repeat
this step for multiple different files:
GENPAT title.pcx title2.pcx data.pat
Note: GenPat returns an error code if something went wrong as of v2.1. Please see the other readme for a description of these error codes.
The patch files created in step 1 should now be attached to the VPatch runtime. Or read the alternative step 2 below. Once attached, you can run this file on the target system and it will update the files. In order to piece the patch files together, use VAppend.exe:
VAPPEND (patchfile) [output file] [runtime]
This will create a file called VPatch.exe by default, which is the actual patch. The default runtime is VPatch.bin. In my example:
VAPPEND data.pat
So this is the same call as:
VAPPEND data.pat vpatch.exe vpatch.bin
Note that "vpatch.bin" corresponds to "Create EXE" in the GUI and that "vpatchdll.bin" corresponds to "Create DLL" in the GUI. The stand-alone patch (which is not attached to a runtime) is the one you get if you use "Create PAT" in the GUI.
If you want to use your patch in NSIS, please read the other readme. This description is about the stand-alone EXE version.
Now that the patch is ready, you (could) use it. You can call VPatch.exe in the following way:
VPATCH.EXE (sourcefile) (outputfile)
IMPORTANT: You must specify the full filename of VPatch, so VPatch.exe. If you call it using just "VPatch" then you will get an error.
In the example this would be:
VPATCH.EXE data.dta data.new
This way, VPatch will use data.dta and patch it. It will create data.new, which contains the new version. The original data.dta isn't touched. If the file data.new isn't created, an error must have occured.
If you have multiple files attached, you can make multiple calls to VPatch. The program will automatically choose the correct patch for the file:
VPATCH.EXE data.dta data.new
VPATCH.EXE title.pcx title.out
If you do not want to attach your patch file to a runtime, you can also use it in a more stand-alone manner using the VPatchPrompt.exe runtime. This runtime will first check if it has a patch attached and, if it does not, it will take the patch file as the first command-line argument:
VPATCHPROMPT.EXE (patchfile) (sourcefile) (outputfile)
Another feature of this runtime is that it will prompt the user for a filename, if a command-line argument is not specified. Therefore, if you call VPatchPrompt without arguments, you will be prompted for all three command-line options (or, if you have attached a patch to the VPatchPrompt runtime using VAppend, it will only prompt for the source and output files).