From ec66ad6385c3b1fe04649cecc701da9ceecd497e Mon Sep 17 00:00:00 2001 From: Mengjuei Date: Thu, 20 Oct 2011 23:38:06 -0700 Subject: [PATCH] update the script --- pyInstaller/InstallerAppDelegate.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pyInstaller/InstallerAppDelegate.py b/pyInstaller/InstallerAppDelegate.py index 005b170b..588a2dbf 100755 --- a/pyInstaller/InstallerAppDelegate.py +++ b/pyInstaller/InstallerAppDelegate.py @@ -64,7 +64,7 @@ class InstallerAppDelegate(NSObject): def agreeLicenseAction_(self, sender): self.window.orderOut_(None) from subprocess import call - call(["killall", "McBopomofo"]) + call(["/usr/bin/killall", "McBopomofo"]) inputMethodDir = os.path.expanduser("~/Library/Input Methods") if os.path.exists(inputMethodDir) is False: @@ -74,18 +74,19 @@ class InstallerAppDelegate(NSObject): McBopomofoPath = os.path.join(inputMethodDir, "McBopomofo.app") if os.path.exists(McBopomofoPath) is True: try: - shutil.rmtree(McBopomofoPath) + call(["/bin/cp", "-R", packagePath, McBopomofoPath]) except: NSRunAlertPanel(NSLocalizedString("Failed to install McBopomofo!", ""), - NSLocalizedString("Failed to remove existing installation.", ""), + NSLocalizedString("Failed to overwrite existing installation.", ""), NSLocalizedString("OK", ""), None, None) - try: - shutil.copytree(packagePath, McBopomofoPath) - except: - NSRunAlertPanel(NSLocalizedString("Failed to install McBopomofo!", ""), - NSLocalizedString("Failed to copy application.", ""), - NSLocalizedString("OK", ""), None, None) - NSApp.terminate_(self) + else: + try: + shutil.copytree(packagePath, McBopomofoPath) + except: + NSRunAlertPanel(NSLocalizedString("Failed to install McBopomofo!", ""), + NSLocalizedString("Failed to copy application.", ""), + NSLocalizedString("OK", ""), None, None) + NSApp.terminate_(self) print McBopomofoPath try: