From 42243b09a82342bceec00c483655cc3913a976a7 Mon Sep 17 00:00:00 2001 From: Fauze Polpeta Date: Wed, 20 Jun 2018 21:05:45 -0300 Subject: [PATCH] [HOTFIX] Create plugins directory on fresh install prior to HorosCloud deployment --- Horos/Info.plist | 6 +++--- Horos/Sources/PluginManager.m | 39 +++++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/Horos/Info.plist b/Horos/Info.plist index 926ba0c476..584b783fee 100644 --- a/Horos/Info.plist +++ b/Horos/Info.plist @@ -191,7 +191,7 @@ CFBundleExecutable Horos CFBundleGetInfoString - Horos v3.1.0 + Horos v3.1.1 CFBundleIconFile Horos.icns CFBundleIdentifier @@ -203,7 +203,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 3.1.0 + 3.1.1 CFBundleSignature OsiX CFBundleSupportedPlatforms @@ -238,7 +238,7 @@ CFBundleVersion - 20180620 + 20180621 GitHash GitState diff --git a/Horos/Sources/PluginManager.m b/Horos/Sources/PluginManager.m index e4de2f6fba..9eb3133668 100755 --- a/Horos/Sources/PluginManager.m +++ b/Horos/Sources/PluginManager.m @@ -739,27 +739,34 @@ + (void) deployHorosCloudPluginAtPath:(NSString*) path deployedPlugins:(NSMutabl { BOOL foundHorosCloud = NO; - NSNumber* flag = [[NSUserDefaults standardUserDefaults] objectForKey:@"HOROSCLOUD_PLUGIN_DEPLOYED"]; - if (flag == nil || [flag integerValue] == 0) + if ([[NSFileManager defaultManager] fileExistsAtPath:path] == NO) { - for (NSInteger i = deployedPlugins.count-1; i >= 0; --i) + [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil]; + } + else + { + NSNumber* flag = [[NSUserDefaults standardUserDefaults] objectForKey:@"HOROSCLOUD_PLUGIN_DEPLOYED"]; + if (flag == nil || [flag integerValue] == 0) { - NSBundle* bundle = [NSBundle bundleWithPath:[deployedPlugins objectAtIndex:i]]; - NSString* name = [bundle.infoDictionary objectForKey:@"CFBundleName"]; - if (!name) + for (NSInteger i = deployedPlugins.count-1; i >= 0; --i) { - name = [[[deployedPlugins objectAtIndex:i] lastPathComponent] stringByDeletingPathExtension]; - } - - if( [name caseInsensitiveCompare:@"HorosCloud"] == NSOrderedSame ) { - foundHorosCloud = YES; - break; + NSBundle* bundle = [NSBundle bundleWithPath:[deployedPlugins objectAtIndex:i]]; + NSString* name = [bundle.infoDictionary objectForKey:@"CFBundleName"]; + if (!name) + { + name = [[[deployedPlugins objectAtIndex:i] lastPathComponent] stringByDeletingPathExtension]; + } + + if( [name caseInsensitiveCompare:@"HorosCloud"] == NSOrderedSame ) { + foundHorosCloud = YES; + break; + } } } - } - else - { - foundHorosCloud = YES; + else + { + foundHorosCloud = YES; + } } if (!foundHorosCloud)