aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPAppController.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2011-01-13 08:50:41 +0000
committerBibiko <bibiko@eva.mpg.de>2011-01-13 08:50:41 +0000
commit82fefc621680e1a3a7721b159239595364bd5e55 (patch)
tree03e03cdafc09f79f97051e84cd10c7e64ae3003c /Source/SPAppController.m
parent15ad4cdf44427d5a9595a0d7a15257ed79eae8ae (diff)
downloadsequelpro-82fefc621680e1a3a7721b159239595364bd5e55.tar.gz
sequelpro-82fefc621680e1a3a7721b159239595364bd5e55.tar.bz2
sequelpro-82fefc621680e1a3a7721b159239595364bd5e55.zip
• fixed issue while updating a Bundle by identifying it via UUID but different spBundle file name
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r--Source/SPAppController.m5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m
index ee400a06..7f405dba 100644
--- a/Source/SPAppController.m
+++ b/Source/SPAppController.m
@@ -568,10 +568,11 @@ YY_BUFFER_STATE yy_scan_string (const char *);
NSInteger answer = [alert runModal];
if(answer == NSAlertDefaultReturn) {
NSError *error = nil;
- NSString *moveToTrashCommand = [NSString stringWithFormat:@"osascript -e 'tell application \"Finder\" to move (POSIX file \"%@\") to the trash'", newPath];
+ NSString *removePath = [[[installedBundleUUIDs objectForKey:[cmdData objectForKey:SPBundleFileUUIDKey]] objectForKey:@"path"] substringToIndex:([[[installedBundleUUIDs objectForKey:[cmdData objectForKey:SPBundleFileUUIDKey]] objectForKey:@"path"] length]-[SPBundleFileName length]-1)];
+ NSString *moveToTrashCommand = [NSString stringWithFormat:@"osascript -e 'tell application \"Finder\" to move (POSIX file \"%@\") to the trash'", removePath];
[moveToTrashCommand runBashCommandWithEnvironment:nil atCurrentDirectoryPath:nil error:&error];
if(error != nil) {
- NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:NSLocalizedString(@"Error while moving “%@” to Trash.", @"Open Files : Bundle : Already-Installed : Delete-Old-Error : Could not delete old bundle before installing new version."), [[installedBundleUUIDs objectForKey:[cmdData objectForKey:SPBundleFileUUIDKey]] objectForKey:@"path"]]
+ NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:NSLocalizedString(@"Error while moving “%@” to Trash.", @"Open Files : Bundle : Already-Installed : Delete-Old-Error : Could not delete old bundle before installing new version."), removePath]
defaultButton:NSLocalizedString(@"OK", @"Open Files : Bundle : Already-Installed : Delete-Old-Error : OK button")
alternateButton:nil
otherButton:nil