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.

2 Comments

  • gammoudi

    Hi diana,
    I have tried to add your modifications, but i still have the same error message:
    Error! Some required system tools, that are utilized in this sh script, are not installed:
    Tool(s) “patch” is(are) missed, please install it(them).

    • Diana

      Hello there! Are you installing via cygwin? If so, did you make sure to configure it with the “patch” binary? You might need to run the cygwin installer again.

Leave a Reply to Diana Cancel reply

Your email address will not be published. Required fields are marked *