Changeset 152

Show
Ignore:
Timestamp:
04/28/08 14:10:20 (3 weeks ago)
Author:
andym
Message:

Added fetching of CFBundleName as a fallback for CFBundleDisplayName in -[NSBundle(SUAdditions) name].
Fixed an uninitialized variable.
Fixed autorelease pool errors during installation thread.
Fixed error including SUInstaller.h from host app.
Patch courtesy Ben Kazez.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/NSBundle+SUAdditions.m

    r144 r152  
    1515{ 
    1616        NSString *name = [self objectForInfoDictionaryKey:@"CFBundleDisplayName"]; 
    17         if (name) 
    18                 return name; 
    19         else 
    20                 return [[[NSFileManager defaultManager] displayNameAtPath:[self bundlePath]] stringByDeletingPathExtension]; 
     17        if (name) return name; 
     18         
     19        name = [self objectForInfoDictionaryKey:@"CFBundleName"]; 
     20        if (name) return name; 
     21         
     22        return [[[NSFileManager defaultManager] displayNameAtPath:[self bundlePath]] stringByDeletingPathExtension]; 
    2123} 
    2224 
  • trunk/SUInstaller.m

    r147 r152  
    2020{ 
    2121        // Search subdirectories for the application 
    22         NSString *currentFile, *newAppDownloadPath = nil, *bundleFileName = [[hostBundle bundlePath] lastPathComponent]
     22        NSString *currentFile, *newAppDownloadPath = nil, *bundleFileName = [[hostBundle bundlePath] lastPathComponent], *alternateBundleFileName = [[hostBundle name] stringByAppendingPathExtension:[[hostBundle bundlePath] pathExtension]]
    2323        BOOL isPackage = NO; 
    2424        NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager] enumeratorAtPath:updateFolder]; 
     
    2626        { 
    2727                NSString *currentPath = [updateFolder stringByAppendingPathComponent:currentFile];               
    28                 if ([[currentFile lastPathComponent] isEqualToString:bundleFileName]) // We found one! 
     28                if ([[currentFile lastPathComponent] isEqualToString:bundleFileName] || 
     29                        [[currentFile lastPathComponent] isEqualToString:alternateBundleFileName]) // We found one! 
    2930                { 
    3031                        isPackage = NO; 
  • trunk/SUPackageInstaller.m

    r147 r152  
    1414+ (void)installPath:(NSString *)path overHostBundle:(NSBundle *)bundle delegate:delegate 
    1515{ 
    16         NSError *error
     16        NSError *error = nil
    1717        BOOL result = YES; 
    1818         
  • trunk/SUPlainInstaller.m

    r147 r152  
    2121+ (void)performInstallationWithInfo:(NSDictionary *)info 
    2222{ 
     23        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 
     24 
    2325        [self installPath:[info objectForKey:SUInstallerPathKey] overHostBundle:[info objectForKey:SUInstallerHostBundleKey] delegate:[info objectForKey:SUInstallerDelegateKey]]; 
     26         
     27        [pool release]; 
    2428} 
    2529 
  • trunk/Sparkle.xcodeproj/project.pbxproj

    r149 r152  
    3737                6171D9070D57B81800BFE886 /* NSFileManager+Aliases.h in Headers */ = {isa = PBXBuildFile; fileRef = 6171D9050D57B81800BFE886 /* NSFileManager+Aliases.h */; settings = {ATTRIBUTES = (Public, ); }; }; 
    3838                6171D9080D57B81800BFE886 /* NSFileManager+Aliases.m in Sources */ = {isa = PBXBuildFile; fileRef = 6171D9060D57B81800BFE886 /* NSFileManager+Aliases.m */; }; 
    39                 618FA5010DAE88B40026945C /* SUInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA4FF0DAE88B40026945C /* SUInstaller.h */; }; 
     39                618FA5010DAE88B40026945C /* SUInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA4FF0DAE88B40026945C /* SUInstaller.h */; settings = {ATTRIBUTES = (Public, ); }; }; 
    4040                618FA5020DAE88B40026945C /* SUInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5000DAE88B40026945C /* SUInstaller.m */; }; 
    4141                618FA5050DAE8AB80026945C /* SUPlainInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA5030DAE8AB80026945C /* SUPlainInstaller.h */; }; 
     
    8282                DAAEFC9B0DA5722F0051E0D0 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; }; 
    8383                DAAEFD4E0DA572330051E0D0 /* relaunch.m in Sources */ = {isa = PBXBuildFile; fileRef = 613242130CD06CEF00106AA4 /* relaunch.m */; }; 
    84                 DAAEFD510DA572550051E0D0 /* relaunch in CopyFiles */ = {isa = PBXBuildFile; fileRef = DAAEFC960DA571DF0051E0D0 /* relaunch */; }; 
     84                DAAEFD510DA572550051E0D0 /* relaunch in Resources */ = {isa = PBXBuildFile; fileRef = DAAEFC960DA571DF0051E0D0 /* relaunch */; }; 
    8585                FAEFA2F70D94AA7500472538 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; 
    8686                FAEFA2F80D94AA7900472538 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; }; 
     
    128128                        files = ( 
    129129                                61407C390A4099050009F71F /* Sparkle.framework in CopyFiles */, 
    130                         ); 
    131                         runOnlyForDeploymentPostprocessing = 0; 
    132                 }; 
    133                 DA142A520CC79E5A00CE54F3 /* CopyFiles */ = { 
    134                         isa = PBXCopyFilesBuildPhase; 
    135                         buildActionMask = 2147483647; 
    136                         dstPath = ""; 
    137                         dstSubfolderSpec = 7; 
    138                         files = ( 
    139                                 DAAEFD510DA572550051E0D0 /* relaunch in CopyFiles */, 
    140130                        ); 
    141131                        runOnlyForDeploymentPostprocessing = 0; 
     
    646636                                8DC2EF540486A6940098B216 /* Sources */, 
    647637                                8DC2EF560486A6940098B216 /* Frameworks */, 
    648                                 DA142A520CC79E5A00CE54F3 /* CopyFiles */, 
    649638                        ); 
    650639                        buildRules = ( 
     
    751740                        buildActionMask = 2147483647; 
    752741                        files = ( 
     742                                DAAEFD510DA572550051E0D0 /* relaunch in Resources */, 
    753743                                610D5A750A1670A4004AAD9C /* SUStatus.nib in Resources */, 
    754744                                61AAE8280A321A7F00D8810D /* Sparkle.strings in Resources */,