From 0d06eb1f9a46f7d32a956bfb72d85d8236e4f991 Mon Sep 17 00:00:00 2001
From: Jordi Boggiano <j.boggiano@seld.be>
Date: Mon, 11 Mar 2013 10:13:45 +0100
Subject: [PATCH] Avoid overwriting existing windows .bat proxies if they were
 provided by the package

---
 src/Composer/Installer/LibraryInstaller.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/Composer/Installer/LibraryInstaller.php b/src/Composer/Installer/LibraryInstaller.php
index 4eef2a479..009239af6 100644
--- a/src/Composer/Installer/LibraryInstaller.php
+++ b/src/Composer/Installer/LibraryInstaller.php
@@ -203,8 +203,13 @@ class LibraryInstaller implements InstallerInterface
                     file_put_contents($link, $this->generateUnixyProxyCode($binPath, $link));
                     chmod($link, 0777 & ~umask());
                     $link .= '.bat';
+                    if (file_exists($link)) {
+                        $this->io->write('    Skipped installation of '.$bin.'.bat proxy for package '.$package->getName().': a .bat proxy was already installed');
+                    }
+                }
+                if (!file_exists($link)) {
+                    file_put_contents($link, $this->generateWindowsProxyCode($binPath, $link));
                 }
-                file_put_contents($link, $this->generateWindowsProxyCode($binPath, $link));
             } else {
                 $cwd = getcwd();
                 try {