Changeset 1314
- Timestamp:
- 08/21/2010 08:43:14 PM (18 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/CommonMediaPlayer/Classes/CMPPlayerManager.h
r1259 r1314 72 72 } 73 73 74 static inline BOOL needCopyWithAlways(NSString *frameworkPath, NSString *myFrameworkPath) 75 { 76 NSFileManager *fm = [NSFileManager defaultManager]; 77 BOOL isDir = NO; 78 FrameworkLoadPrint(@"Checking if dir exists"); 79 if(![fm fileExistsAtPath:frameworkPath isDirectory:&isDir] || !isDir) 80 return YES; 81 82 NSBundle *bundle = [NSBundle bundleWithPath:frameworkPath]; 83 NSString *execPath = [bundle executablePath]; 84 NSBundle *myBundle = [NSBundle bundleWithPath:myFrameworkPath]; 85 NSString *myExecPath = [myBundle executablePath]; 86 if(![fm contentsEqualAtPath:execPath andPath:myExecPath]) 87 return YES; 88 return NO; 89 } 90 74 91 static BOOL createDirectoryTree(NSFileManager *fm, NSString *directory) 75 92 { … … 169 186 NSString *frameworkPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Frameworks/CommonMediaPlayer.framework"]; 170 187 FrameworkLoadPrint(@"Path is at %@", frameworkPath); 188 NSString *frameworkInFrap = [frapPath stringByAppendingPathComponent:@"Contents/Frameworks/CommonMediaPlayer.framework"]; 171 189 #ifdef FrameworkAlwaysCopy 172 BOOL neededCopy = YES;190 BOOL neededCopy = needCopyWithAlways(frameworkPath, frameworkInFrap); 173 191 #else 174 192 BOOL neededCopy = needCopy(frameworkPath); … … 178 196 { 179 197 NSFileManager *fm = [NSFileManager defaultManager]; 180 NSString *frameworkInFrap = [frapPath stringByAppendingPathComponent:@"Contents/Frameworks/CommonMediaPlayer.framework"];181 198 FrameworkLoadPrint(@"Going to copy %@", frameworkInFrap); 182 199 BOOL success = [fm removeFileAtPath:frameworkPath handler:nil];
