• Random

    Magento – Applying Security Patches on Windows

    As an addendum to the previous post, I wanted to add Windows specific information.

    I use Cygwin to apply Magento patches. Make sure to configure Cygwin to install the patch binary.

    Now, you’re going to have to make a small edit to the .sh file. Look for the second occurrence of PATCH_BIN – it should look something like this:

    PATCH_APPLY_REVERT_RESULT=`$SED_BIN -e '1,/^__PATCHFILE_FOLLOWS__$/d' "$CURRENT_DIR""$BASE_NAME" | $PATCH_BIN $DRY_RUN_FLAG $REVERT_FLAG -p0`

    You’ll want to surround $PATCH_BIN with double quotes – that’s because, chances are, the location of Cygwin is going to contain spaces, which is going to cause issues when executed in the command line. So, change it to look something like this:

    PATCH_APPLY_REVERT_RESULT=`$SED_BIN -e '1,/^__PATCHFILE_FOLLOWS__$/d' "$CURRENT_DIR""$BASE_NAME" | "$PATCH_BIN" $DRY_RUN_FLAG $REVERT_FLAG -p0`

    Other than that, you should be able to run the patch as detailed in the previous post.