Changeset 452
- Timestamp:
- 04/19/07 21:35:48 (1 year ago)
- Files:
-
- trunk/CPFPerianPrefPaneController.m (modified) (5 diffs)
- trunk/Plists/PerianPane-Info.plist (modified) (1 diff)
- trunk/Plists/PerianUpdateChecker-Info.plist (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/CPFPerianPrefPaneController.m
r418 r452 7 7 #define LastInstalledVersionKey CFSTR("LastInstalledVersion") 8 8 9 @interface NSString (VersionStringCompare) 10 - (BOOL)isVersionStringOlderThan:(NSString *)older; 11 @end 12 13 @implementation NSString (VersionStringCompare) 14 - (BOOL)isVersionStringOlderThan:(NSString *)older 15 { 16 if([self compare:older] == NSOrderedAscending) 17 return TRUE; 18 if([self hasPrefix:older] && [self length] > [older length] && [self characterAtIndex:[older length]] == 'b') 19 //1.0b1 < 1.0, so check for it. 20 return TRUE; 21 return FALSE; 22 } 23 @end 24 9 25 @interface CPFPerianPrefPaneController(_private) 10 26 - (void)setAC3DynamicRange:(float)newVal; … … 132 148 { 133 149 NSString *currentVersion = [infoDict objectForKey:BundleVersionKey]; 134 if([currentVersion compare:myVersion] == NSOrderedAscending)150 if([currentVersion isVersionStringOlderThan:myVersion]) 135 151 ret = InstallStatusOutdated; 136 137 ret = InstallStatusInstalled;152 else 153 ret = InstallStatusInstalled; 138 154 } 139 155 … … 147 163 148 164 return setWrongLocationInstalled(ret); 165 } 166 167 - (void)setInstalledVersionString 168 { 169 NSString *path = [[self basePathForType:ComponentTypeQuickTime user:userInstalled] stringByAppendingPathComponent:@"Perian.component"]; 170 171 NSDictionary *infoDict = [NSDictionary dictionaryWithContentsOfFile:[path stringByAppendingPathComponent:@"Contents/Info.plist"]]; 172 if(infoDict != nil) 173 { 174 NSString *currentVersion = [infoDict objectForKey:BundleVersionKey]; 175 [textField_currentVersion setStringValue:currentVersion]; 176 } 177 else 178 [textField_currentVersion setStringValue:@"-"]; 149 179 } 150 180 … … 175 205 { 176 206 NSDictionary *infoDict = [[self bundle] infoDictionary]; 177 installStatus = [self installStatusForComponent:@"Perian.component" type:ComponentTypeQuickTime withMyVersion:[infoDict objectForKey:BundleVersionKey]]; 207 NSString *myVersion = [infoDict objectForKey:BundleVersionKey]; 208 209 [self setInstalledVersionString]; 210 installStatus = [self installStatusForComponent:@"Perian.component" type:ComponentTypeQuickTime withMyVersion:myVersion]; 178 211 if(currentInstallStatus(installStatus) == InstallStatusNotInstalled) 179 212 { … … 242 275 NSString *lastInstVersion = [self getStringFromKey:LastInstalledVersionKey forAppID:perianAppID]; 243 276 NSString *myVersion = [[[self bundle] infoDictionary] objectForKey:BundleVersionKey]; 244 if((lastInstVersion == nil || [lastInstVersion compare:myVersion] == NSOrderedAscending) && installStatus != InstallStatusInstalled)277 if((lastInstVersion == nil || [lastInstVersion isVersionStringOlderThan:myVersion]) && installStatus != InstallStatusInstalled) 245 278 { 246 279 /*Check for temp after an update */ trunk/Plists/PerianPane-Info.plist
r364 r452 33 33 <string>????</string> 34 34 <key>CFBundleVersion</key> 35 <string>1.0 </string>35 <string>1.0b1</string> 36 36 <key>CFBundleName</key> 37 37 <string>Perian</string> trunk/Plists/PerianUpdateChecker-Info.plist
r443 r452 18 18 <string>????</string> 19 19 <key>CFBundleVersion</key> 20 <string> 0.5</string>20 <string>1.0b1</string> 21 21 <key>NSMainNibFile</key> 22 22 <string>UpdateCheckerMainMenu</string>
