I have a set of files that need a set of changes applied to them.

In this scenario I have a Java Application Server (distributed via a zip file) that I need to apply a set of known configurations to, and add some jar plugins to a specific folder. I don't want to simply create my own distribution that is pre-modified - I'd like to package only the changed files, and make those applicable to a pristine install.

What is the simplest tool to create such a changeset, and apply that same changeset on someone else's computer?

Ideally the tool could work without having to install anything on the users computer. The workflow would work like this:

  1. Download the original zip file containing the binary distribution of the application to be modified
  2. Unzip that application to any custom location. Maybe a folder under the root of the C drive, maybe the Desktop
  3. Download a file (and maybe the utility) that contains the set of changes
  4. Apply the set of changes to the directory

Some method that will work both in both an automated and manual way would be optimal.

I'd like not to have to set up some sort of server to host the patches. I am okay with installing a tool to be able to create them, as long as I don't have to install anything on the target machine to apply the patch.

I've considered simply creating a zip file with subdirectories. I am not sure what the easiest way to detect the differences and zip only the changes would be. I'd like a foolproof method that doesn't require a ton of manual steps (doing a diff and manually picking out the changes would be too error-prone).

Achieving minimal size is nice, but not required.


The classic toolset is context diff and patch. See a ten minute guide to diff and patch

| improve this answer | |

For my purposes, since the changes were small, it was simpler to create a zip file that contained replacement files than creating a patch. That way I didn't have to mess with p-levels.

To do this, I used Beyond Compare, selected the changed files, copied them out to an identically named directory (with a different parent path), and zipped up that identically named directory.

To apply it, I simply unzip it on top of the existing files, replacing all.

This won't detect whether or not the changes are valid to apply, unlike RedGrittyBrick's answer, which will detect this, but it is simpler to understand and works better for my scenario.

It also turned out I didn't have to automate the process. If you do, there are ways to run diff tools from a batch file, generating a file list to zip up, and using a command line zip utility to store the result.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.