In Vista it was particularly frustrating figuring out how to do this in Windows:
patch -p0 <patchfile...something that's pretty simple in the UNIX shell of your choice.
I started by installing GNU Patch for Windows... but Vista didn't want to run it because of Windows UAC. Also, to me it seemed too cumbersome to have to open up a Windows commmand prompt JUST to apply patches, when I was doing everything else from the Windows Explorer UI thanks to the awesome TortoiseCVS.
So, here's what I did:
- Install GNU Patch for windows, using the Binaries ZIP file; I installed it in C:\Program Files
- Make sure patch.exe now lives in c:\program files\patch\bin\patch.exe
- Create the .bat file c:\program files\patch\bin\patch.bat with these commands:
@echo off "c:\program files\patch\bin\patch" -p0 < %1 pause
- Create two .manifest files to keep UAC happy:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges> <requestedExecutionLevel level="asInvoker"/> </requestedPrivileges> </security> </trustInfo> </assembly>
With the exact above contents of patch.exe.manifest
- Associate .batch files with the new patch.bat file. You can do this by creating an empty file and renaming it something.patch. On Windows Explorer, right-click this new file and use the "Open with" option, and tell Windows to always use c:\program files\patch\bin\patch.bat to open this file type.
Tip: Always remember to place your patches in the correct directory!