Clarify delegate typing as id.
[sparkle2.git] / SUUtilities.m
blob251d38fa3f1703f66415cad58599cacfd151d8e2
1 //
2 //  SUUtilities.m
3 //  Sparkle
4 //
5 //  Created by Andy Matuschak on 9/12/07.
6 //  Copyright 2007 __MyCompanyName__. All rights reserved.
7 //
9 #import "SUUtilities.h"
10 #import "BLAuthentication.h"
12 // Make sure it's really /Library/Application Support/Sparkle
13 NSString *SUSupportFolderPath()
15     FSRef folder;
16     OSErr err = noErr;
17     CFURLRef url;
18     NSString *result = nil;
19         
20     err = FSFindFolder(kOnSystemDisk, kApplicationSupportFolderType, false, &folder);
21     if (err == noErr) {
22         url = CFURLCreateFromFSRef(kCFAllocatorDefault, &folder);
23         result = [[(NSURL *)url path] stringByAppendingPathComponent:@"Sparkle"];
24     }
25         
26     return result;
29 BOOL SUSetupSupportFolder()
31         return [[BLAuthentication sharedInstance] executeCommand:@"/bin/mkdir" withArgs:[NSArray arrayWithObjects:@"-p", SUSupportFolderPath(), nil]];