update install scripts

This commit is contained in:
Mengjuei 2012-03-21 22:40:18 -07:00
parent b9f736a49d
commit 185b9cbfb1
1 changed files with 7 additions and 2 deletions

View File

@ -72,14 +72,20 @@ class InstallerAppDelegate(NSObject):
packagePath = NSBundle.mainBundle().pathForResource_ofType_("McBopomofo", "app") packagePath = NSBundle.mainBundle().pathForResource_ofType_("McBopomofo", "app")
McBopomofoPath = os.path.join(inputMethodDir, "McBopomofo.app") McBopomofoPath = os.path.join(inputMethodDir, "McBopomofo.app")
WrongPath = os.path.join(McBopomofoPath, "McBopomofo.app") WrongPath = os.path.join(McBopomofoPath, "McBopomofo.app")
if os.path.exists(WrongPath) is True: if os.path.exists(WrongPath) is True:
try: try:
shutil.rmtree(WrongPath) shutil.rmtree(WrongPath)
except: except:
"""do nothing""" """do nothing"""
if os.path.exists(McBopomofoPath) is True: if os.path.exists(McBopomofoPath) is True:
if os.path.isfile(McBopomofoPath) is True:
try:
call(["/bin/rm","-f",McBopomofoPath])
except:
"""do nothing"""
try: try:
call(["/bin/cp", "-R", packagePath, inputMethodDir]) call(["/bin/cp", "-R", packagePath, inputMethodDir])
except: except:
@ -95,7 +101,6 @@ class InstallerAppDelegate(NSObject):
NSLocalizedString("OK", ""), None, None) NSLocalizedString("OK", ""), None, None)
NSApp.terminate_(self) NSApp.terminate_(self)
print McBopomofoPath
try: try:
call([os.path.join(McBopomofoPath, "Contents/MacOS/McBopomofo"), "install"]) call([os.path.join(McBopomofoPath, "Contents/MacOS/McBopomofo"), "install"])
except: except: