Index: trunk/Cocoa/F-Script Anywhere/Source/DeVercruesseProcessManager.m
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/DeVercruesseProcessManager.m	(revision 231)
+++ trunk/Cocoa/F-Script Anywhere/Source/DeVercruesseProcessManager.m	(revision 342)
@@ -54,4 +54,5 @@
     if( self == defaultManager )
         defaultManager = nil;
+	[super dealloc];
 }
 
Index: trunk/Cocoa/F-Script Anywhere/Source/F-Script Anywhere.xcodeproj/project.pbxproj
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/F-Script Anywhere.xcodeproj/project.pbxproj	(revision 231)
+++ trunk/Cocoa/F-Script Anywhere/Source/F-Script Anywhere.xcodeproj/project.pbxproj	(revision 342)
@@ -8,13 +8,8 @@
 
 /* Begin PBXBuildFile section */
-		256669AE0A1D8DE30006AC79 /* DSCL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 256669AD0A1D8DE30006AC79 /* DSCL.framework */; };
-		25666AD30A1D96DE0006AC79 /* DSCL.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 256669AD0A1D8DE30006AC79 /* DSCL.framework */; };
 		25666ADA0A1D97B50006AC79 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25666AD90A1D97B50006AC79 /* CoreFoundation.framework */; };
-		25666BE70A1DAA1D0006AC79 /* AddToProcMod in Resources */ = {isa = PBXBuildFile; fileRef = 25666BE10A1DAA050006AC79 /* AddToProcMod */; };
-		25666BEC0A1DAA410006AC79 /* procmod.m in Sources */ = {isa = PBXBuildFile; fileRef = 25666BEB0A1DAA410006AC79 /* procmod.m */; };
-		25666C100A1DACEB0006AC79 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25666C0F0A1DACEB0006AC79 /* Foundation.framework */; };
 		25666C4E0A1DAE4D0006AC79 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25666C4D0A1DAE4D0006AC79 /* Security.framework */; };
-		25666CA60A1DB1BD0006AC79 /* DSCL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 256669AD0A1D8DE30006AC79 /* DSCL.framework */; };
 		258C27790A25A57200AC22BB /* FScript.framework in Resources */ = {isa = PBXBuildFile; fileRef = F5EFC2C3020A6C2601AEEDB1 /* FScript.framework */; };
+		25D8A24C0CBD347A00EFA0BD /* Certificate.cer in Resources */ = {isa = PBXBuildFile; fileRef = 25D8A24B0CBD347A00EFA0BD /* Certificate.cer */; };
 		25EADA9609CD2D7100BCD8E1 /* bytesex.c in Sources */ = {isa = PBXBuildFile; fileRef = 25EADA9509CD2D7100BCD8E1 /* bytesex.c */; };
 		E14C18BD05A4DE25000D4AF3 /* FSAInterpreterPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5680F7A020D0D0401AEEC37 /* FSAInterpreterPanel.nib */; };
@@ -96,11 +91,4 @@
 
 /* Begin PBXContainerItemProxy section */
-		25666BE50A1DAA120006AC79 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = 25666BE00A1DAA050006AC79;
-			remoteInfo = AddToProcMod;
-		};
 		E1D652BB057666690054F5D1 /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
@@ -126,5 +114,4 @@
 			dstSubfolderSpec = 10;
 			files = (
-				25666AD30A1D96DE0006AC79 /* DSCL.framework in CopyFiles */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -150,9 +137,8 @@
 		256669AD0A1D8DE30006AC79 /* DSCL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = DSCL.framework; sourceTree = "<group>"; };
 		25666AD90A1D97B50006AC79 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
-		25666BE10A1DAA050006AC79 /* AddToProcMod */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = AddToProcMod; sourceTree = BUILT_PRODUCTS_DIR; };
-		25666BEB0A1DAA410006AC79 /* procmod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = procmod.m; sourceTree = "<group>"; };
 		25666C0F0A1DACEB0006AC79 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
 		25666C4D0A1DAE4D0006AC79 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
 		258C25590A259B6E00AC22BB /* FScript.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = FScript.framework; sourceTree = "<group>"; };
+		25D8A24B0CBD347A00EFA0BD /* Certificate.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = Certificate.cer; sourceTree = "<group>"; };
 		25EADA9509CD2D7100BCD8E1 /* bytesex.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = bytesex.c; path = "../Darwin source/Commands/Apple/cctools/libstuff/bytesex.c"; sourceTree = SOURCE_ROOT; };
 		29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
@@ -223,13 +209,4 @@
 
 /* Begin PBXFrameworksBuildPhase section */
-		25666BDF0A1DAA050006AC79 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				25666CA60A1DB1BD0006AC79 /* DSCL.framework in Frameworks */,
-				25666C100A1DACEB0006AC79 /* Foundation.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
 		E1D652010575B3D50054F5D1 /* Frameworks */ = {
 			isa = PBXFrameworksBuildPhase;
@@ -246,5 +223,4 @@
 				E1EE9A270575769600F2D92C /* Cocoa.framework in Frameworks */,
 				E1EE9A280575769600F2D92C /* Carbon.framework in Frameworks */,
-				256669AE0A1D8DE30006AC79 /* DSCL.framework in Frameworks */,
 				25666ADA0A1D97B50006AC79 /* CoreFoundation.framework in Frameworks */,
 				25666C4E0A1DAE4D0006AC79 /* Security.framework in Frameworks */,
@@ -271,15 +247,6 @@
 				E1EE9A4F057576A700F2D92C /* F-Script Anywhere.bundle */,
 				E1D652040575B3D50054F5D1 /* SCPatchLoader.bundle */,
-				25666BE10A1DAA050006AC79 /* AddToProcMod */,
 			);
 			name = Products;
-			sourceTree = "<group>";
-		};
-		256666B80A1D86D80006AC79 /* procmod */ = {
-			isa = PBXGroup;
-			children = (
-				25666BEB0A1DAA410006AC79 /* procmod.m */,
-			);
-			name = procmod;
 			sourceTree = "<group>";
 		};
@@ -319,4 +286,5 @@
 			isa = PBXGroup;
 			children = (
+				25D8A24B0CBD347A00EFA0BD /* Certificate.cer */,
 				258C25590A259B6E00AC22BB /* FScript.framework */,
 				29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
@@ -449,5 +417,4 @@
 				F574ADD6020AC10F01AEEDB1 /* NJRScrollView.h */,
 				F574ADD5020AC10F01AEEDB1 /* NJRScrollView.m */,
-				256666B80A1D86D80006AC79 /* procmod */,
 				F5EFC2E7020A8F7F01AEEDB1 /* libMatch.h */,
 				F5EFC2E8020A8F7F01AEEDB1 /* libMatch.c */,
@@ -512,20 +479,4 @@
 
 /* Begin PBXNativeTarget section */
-		25666BE00A1DAA050006AC79 /* AddToProcMod */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 25666BED0A1DAA410006AC79 /* Build configuration list for PBXNativeTarget "AddToProcMod" */;
-			buildPhases = (
-				25666BDE0A1DAA050006AC79 /* Sources */,
-				25666BDF0A1DAA050006AC79 /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = AddToProcMod;
-			productName = AddToProcMod;
-			productReference = 25666BE10A1DAA050006AC79 /* AddToProcMod */;
-			productType = "com.apple.product-type.tool";
-		};
 		E1D651FA0575B3D50054F5D1 /* Bundle Loader */ = {
 			isa = PBXNativeTarget;
@@ -563,5 +514,4 @@
 				E1EE9AA60575939700F2D92C /* PBXTargetDependency */,
 				E1D652BC057666690054F5D1 /* PBXTargetDependency */,
-				25666BE60A1DAA120006AC79 /* PBXTargetDependency */,
 			);
 			name = Application;
@@ -595,12 +545,13 @@
 			isa = PBXProject;
 			buildConfigurationList = 25EAD8F709CD1E3900BCD8E1 /* Build configuration list for PBXProject "F-Script Anywhere" */;
+			compatibilityVersion = "Xcode 2.4";
 			hasScannedForEncodings = 1;
 			mainGroup = 29B97314FDCFA39411CA2CEA /* PatchTest */;
 			projectDirPath = "";
+			projectRoot = "";
 			targets = (
 				E1EE9A010575769600F2D92C /* Application */,
 				E1EE9A4E057576A700F2D92C /* Bundle */,
 				E1D651FA0575B3D50054F5D1 /* Bundle Loader */,
-				25666BE00A1DAA050006AC79 /* AddToProcMod */,
 			);
 		};
@@ -619,5 +570,4 @@
 			buildActionMask = 2147483647;
 			files = (
-				25666BE70A1DAA1D0006AC79 /* AddToProcMod in Resources */,
 				E1D652AA0575B5F10054F5D1 /* SCPatchLoader.bundle in Resources */,
 				E1EE9AA90575945300F2D92C /* F-Script Anywhere.bundle in Resources */,
@@ -631,4 +581,5 @@
 				258C27790A25A57200AC22BB /* FScript.framework in Resources */,
 				E1FD011605B91232001DABE0 /* mach_error descriptions.strings in Resources */,
+				25D8A24C0CBD347A00EFA0BD /* Certificate.cer in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -659,12 +610,4 @@
 
 /* Begin PBXSourcesBuildPhase section */
-		25666BDE0A1DAA050006AC79 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				25666BEC0A1DAA410006AC79 /* procmod.m in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
 		E1D651FE0575B3D50054F5D1 /* Sources */ = {
 			isa = PBXSourcesBuildPhase;
@@ -718,9 +661,4 @@
 
 /* Begin PBXTargetDependency section */
-		25666BE60A1DAA120006AC79 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = 25666BE00A1DAA050006AC79 /* AddToProcMod */;
-			targetProxy = 25666BE50A1DAA120006AC79 /* PBXContainerItemProxy */;
-		};
 		E1D652BC057666690054F5D1 /* PBXTargetDependency */ = {
 			isa = PBXTargetDependency;
@@ -795,58 +733,4 @@
 
 /* Begin XCBuildConfiguration section */
-		25666BEE0A1DAA410006AC79 /* Development */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				COPY_PHASE_STRIP = NO;
-				FRAMEWORK_SEARCH_PATHS = (
-					"$(FRAMEWORK_SEARCH_PATHS)",
-					"$(SRCROOT)",
-				);
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_ENABLE_FIX_AND_CONTINUE = YES;
-				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
-				GCC_MODEL_TUNING = G5;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				INSTALL_PATH = "$(HOME)/bin";
-				PREBINDING = NO;
-				PRODUCT_NAME = AddToProcMod;
-				ZERO_LINK = YES;
-			};
-			name = Development;
-		};
-		25666BEF0A1DAA410006AC79 /* Deployment */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = (
-					ppc,
-					i386,
-				);
-				COPY_PHASE_STRIP = YES;
-				FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)\"";
-				GCC_ENABLE_FIX_AND_CONTINUE = NO;
-				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
-				GCC_MODEL_TUNING = G5;
-				PREBINDING = NO;
-				PRODUCT_NAME = AddToProcMod;
-				ZERO_LINK = NO;
-			};
-			name = Deployment;
-		};
-		25666BF00A1DAA410006AC79 /* Default */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				FRAMEWORK_SEARCH_PATHS = (
-					"$(FRAMEWORK_SEARCH_PATHS)",
-					"$(SRCROOT)",
-				);
-				GCC_ENABLE_FIX_AND_CONTINUE = YES;
-				GCC_MODEL_TUNING = G5;
-				INSTALL_PATH = "$(HOME)/bin";
-				PREBINDING = NO;
-				PRODUCT_NAME = AddToProcMod;
-				ZERO_LINK = YES;
-			};
-			name = Default;
-		};
 		25EAD8EC09CD1E3900BCD8E1 /* Development */ = {
 			isa = XCBuildConfiguration;
@@ -987,4 +871,10 @@
 					suppress,
 					"-lstuff",
+					"-weak_framework",
+					FScript,
+					"-sectcreate",
+					__TEXT,
+					__info_plist,
+					"Info-Application.plist",
 				);
 				PREBINDING = YES;
@@ -1029,4 +919,8 @@
 					"-weak_framework",
 					FScript,
+					"-sectcreate",
+					__TEXT,
+					__info_plist,
+					"Info-Application.plist",
 				);
 				PREBINDING = YES;
@@ -1060,4 +954,10 @@
 					suppress,
 					"-lstuff",
+					"-weak_framework",
+					FScript,
+					"-sectcreate",
+					__TEXT,
+					__info_plist,
+					"Info-Application.plist",
 				);
 				PREBINDING = YES;
@@ -1078,4 +978,6 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				MACOSX_DEPLOYMENT_TARGET = 10.1;
+				SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
 			};
 			name = Development;
@@ -1084,4 +986,5 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
 			};
 			name = Deployment;
@@ -1090,4 +993,5 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
 			};
 			name = Default;
@@ -1096,14 +1000,4 @@
 
 /* Begin XCConfigurationList section */
-		25666BED0A1DAA410006AC79 /* Build configuration list for PBXNativeTarget "AddToProcMod" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				25666BEE0A1DAA410006AC79 /* Development */,
-				25666BEF0A1DAA410006AC79 /* Deployment */,
-				25666BF00A1DAA410006AC79 /* Default */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Default;
-		};
 		25EAD8EB09CD1E3900BCD8E1 /* Build configuration list for PBXNativeTarget "Bundle" */ = {
 			isa = XCConfigurationList;
Index: trunk/Cocoa/F-Script Anywhere/Source/FSAApp.mm
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/FSAApp.mm	(revision 231)
+++ trunk/Cocoa/F-Script Anywhere/Source/FSAApp.mm	(revision 342)
@@ -27,5 +27,4 @@
 #import "FSAApp.h"
 #import "FSAnywhere.h"
-#import <DSCL/PathManager.h>
 #import <CoreFoundation/CoreFoundation.h>
 #import <ApplicationServices/ApplicationServices.h>
@@ -45,5 +44,5 @@
     { 5, @"F-Script Anywhere must be installed in a Cocoa application running as the current user.\n\nYou may be attempting to install in a setuid application, which is not supported" },
     { 11, @"F-Script Anywhere cannot be installed in itself.\n\nIf you wish to install F-Script Anywhere in itself, make a copy of the F-Script Anywhere application and install one copy into the other" },
-    { smUnExBusErr, @"a bus error occurred.\n\nTry switching to the application first then using F-Script AnywhereÕs dock menu to install" },
+    { smUnExBusErr, @"a bus error occurred.\n\nTry switching to the application first then using F-Script Anywhere's dock menu to install" },
     { fnfErr, @"F-Script Anywhere was unable to locate its component to install in the application.  Please try reinstalling F-Script Anywhere" },
     { cfragDupRegistrationErr, @"another running copy of F-Script Anywhere is already installed in the application"},
@@ -222,93 +221,36 @@
 }
 
--(tDirStatus)authorizeAndAddToProcMod:(NSString *)username
-{
-    OSStatus myStatus;
-    
-    if(![self createAuthorization])
-        return eDSAuthFailed;
-    
-    NSString *myToolPath = [[NSBundle mainBundle] pathForResource:@"AddToProcMod" ofType:@""];
-    char *myArguments[] = { (char *)[username UTF8String], NULL };
-    FILE *myCommunicationsPipe = NULL;
-    char myReadBuffer[128];
-    myStatus = AuthorizationExecuteWithPrivileges(myAuthorizationRef, [myToolPath UTF8String],
-                                                  myFlags, myArguments,
-                                                  &myCommunicationsPipe);
-    
-    int didRead = 0;
-    int lastRead;
-    while((lastRead = read(fileno(myCommunicationsPipe), myReadBuffer, sizeof(myReadBuffer) - didRead - 1)) && (lastRead > 0))
-        didRead += lastRead;
-    
-    myReadBuffer[didRead - 1] = 0;
-    
-    return (tDirStatus)strtol(myReadBuffer, NULL, 10);
-}
-
 - (void)finishLaunching
 {
     mach_port_t     taskOfOurProcess = mach_task_self();
     mach_port_t     machPortForProcess;
-    
-    if(task_for_pid(taskOfOurProcess, 1, &machPortForProcess) != KERN_SUCCESS){ // launchd should always be pid 1
-        if(![[NSUserDefaults standardUserDefaults] objectForKey:@"doPathCheck"])
-            [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"doPathCheck"];
-        
-        if([[NSUserDefaults standardUserDefaults] boolForKey:@"doPathCheck"]){
-top:
-            PathManager *pm = [[PathManager alloc] initWithLocalNode];
-            [pm backupStack];
-            @try {
-                [pm cd:@"/Groups/procmod"];
-            } @catch ( NSException *exception ) {
-                goto next;  // this means we must be on ppc 10.4 or less.
-            }
-            CFDictionaryRef sessionInfoDict = CGSessionCopyCurrentDictionary();
-            if(sessionInfoDict){
-                CFStringRef shortUserName = (CFStringRef)CFDictionaryGetValue(sessionInfoDict, kCGSessionUserNameKey);
-                if(![[[pm lastObject] readArray:@"GroupMembership"] containsObject:(NSString *)shortUserName]){
-                    switch([[NSAlert alertWithMessageText:[NSString stringWithFormat:@"User %@ not in the procmod group", shortUserName]
-                                            defaultButton:@"Add me"
-                                          alternateButton:@"Disable checking"
-                                              otherButton:@"Ignore message"
-                                informativeTextWithFormat:@"F-Script Anywhere requires that you add yourself to the procmod "
-                        "group in order for it to function properly. If you like, F-Script Anywhere can automatically add you "
-                        "to the procmod group."] runModal]){
-                        case NSAlertDefaultReturn:
-                        {
-                            tDirStatus status = [self authorizeAndAddToProcMod:(NSString *)shortUserName];
-                            if(status != eDSNoErr){
-                                [[NSAlert alertWithMessageText:@"Error adding to procmod group"
-                                                 defaultButton:nil
-                                               alternateButton:nil
-                                                   otherButton:nil
-                                     informativeTextWithFormat:@"There was an error (%@) adding you to the procmod group. ", [[NSClassFromString(@"DSoStatus") sharedInstance] stringForStatus:status]] runModal];
-                            } else {
-                                [[NSAlert alertWithMessageText:@"Adding user procmod group succeeded"
-                                                 defaultButton:nil
-                                               alternateButton:nil
-                                                   otherButton:nil
-                                     informativeTextWithFormat:@"You may have to wait a few minutes until the system updates its caches (or alternatively, reboot your machine) before things will work properly."] runModal];
-                            }
-                        }
-                            [pm restoreStack];
-                            [pm release];
-                            goto top;
-                        case NSAlertAlternateReturn:
-                            [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"doPathCheck"];
-                            break;
-                        default:
-                            break;
-                    }            
-                }
-            }
-            [pm restoreStack];
-            [pm release];
-        }
+    /* under new rules for task_for_pid, only processes with proper permissions can call task_for_pid successfullly */
+    int ourPid = [[NSProcessInfo processInfo] processIdentifier];
+    NSLog(@"our pid %d", ourPid);
+    if(task_for_pid(taskOfOurProcess, ourPid, &machPortForProcess) == KERN_SUCCESS){ // launchd should always be pid 1
+        mach_port_deallocate(taskOfOurProcess, machPortForProcess);
     } else {
-        mach_port_deallocate(taskOfOurProcess, machPortForProcess);
-    }
-next:
+        int result = NSRunInformationalAlertPanel(
+                                                  NSLocalizedString(@"Certificate not trusted", "Framework not found alert title"),
+                                                  NSLocalizedString(@"Due to new security features in Leopard, F-Script Anywhere requires you to to trust the signature on the current application. "
+                                                                    "You have several options:\n"
+                                                                    "1. You can add the signing certificate automatically to your keychain, in which case you should click \"OK\" in the next dialog box to add the certificate to your keychain, and then \"Always Trust.\"\n"
+                                                                    "2. You can quit F-Script Anywhere, create a signing authority on your local machine, trust it, and then sign the application binary yourself.\n"
+                                                                    @"Note that if you add the certificate properly and you still get an F-Script Anywhere error when injecting, you may need to restart your computer to clear the proper keychain caches.", @"no certificate warning message"),
+                                                  NSLocalizedString(@"Add certificate", "'add certificate button title"),
+                                                  NSLocalizedString(@"Quit", "Quit button title"),
+                                                  NULL);
+        switch (result) {
+            case NSAlertDefaultReturn:
+                NSString *certPath = [[NSBundle mainBundle] pathForResource:@"Certificate" ofType:@"cer"];
+                [[NSWorkspace sharedWorkspace] openURL:[NSURL fileURLWithPath:certPath]];
+                break;
+            case NSAlertAlternateReturn:
+                [self terminate: self];
+                break;
+            default:
+                break;
+        }        
+    }
     patchController = new FSAPatchController(self);
     patchController->AddPatch((CFStringRef)PatchBundleIdentifier, CFSTR("Contents/Resources/"),
Index: trunk/Cocoa/F-Script Anywhere/Source/FSAAppList.m
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/FSAAppList.m	(revision 231)
+++ trunk/Cocoa/F-Script Anywhere/Source/FSAAppList.m	(revision 342)
@@ -320,5 +320,4 @@
         NSAssert1([cell isKindOfClass: [NJRLabeledImageCell class]], @"Cell is not what we expected, instead %@", cell);
         [(NJRLabeledImageCell *)cell setImage: [app img]];
-        [(NJRLabeledImageCell *)cell setImageCacheSource: app];
     }
 }
Index: trunk/Cocoa/F-Script Anywhere/Source/Info-Application.plist
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/Info-Application.plist	(revision 231)
+++ trunk/Cocoa/F-Script Anywhere/Source/Info-Application.plist	(revision 342)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
@@ -25,9 +25,11 @@
 	<string>FSAn</string>
 	<key>CFBundleVersion</key>
-	<string>1.3</string>
+	<string>1.3.1</string>
 	<key>NSMainNibFile</key>
 	<string>MainMenu</string>
 	<key>NSPrincipalClass</key>
 	<string>FSAApp</string>
+	<key>SecTaskAccess</key>
+	<string>allowed</string>
 </dict>
 </plist>
Index: trunk/Cocoa/F-Script Anywhere/Source/NJRLabeledImageCell.h
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/NJRLabeledImageCell.h	(revision 231)
+++ trunk/Cocoa/F-Script Anywhere/Source/NJRLabeledImageCell.h	(revision 342)
@@ -31,5 +31,4 @@
 @private
     NSImage *image;
-    id imageCacheSource;
 }
 
@@ -38,5 +37,4 @@
 - (void)setImage:(NSImage *)anImage;
 - (NSImage *)image;
-- (void)setImageCacheSource:(id)aSource;
 
 - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
Index: trunk/Cocoa/F-Script Anywhere/Source/NJRLabeledImageCell.m
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/NJRLabeledImageCell.m	(revision 231)
+++ trunk/Cocoa/F-Script Anywhere/Source/NJRLabeledImageCell.m	(revision 342)
@@ -38,5 +38,4 @@
 - (void)dealloc {
     [image release];
-    [imageCacheSource release];
     image = nil;
     [super dealloc];
@@ -58,11 +57,4 @@
 - (NSImage *)image {
     return image;
-}
-
-- (void)setImageCacheSource:(id)aSource {
-    if (aSource != imageCacheSource) {
-        [imageCacheSource release];
-        imageCacheSource = [aSource retain];
-    }
 }
 
@@ -102,60 +94,54 @@
         imageSize = NSMakeSize(cellFrame.size.height - 1, cellFrame.size.height - 1);
 
-        preferredRep = [[[imageCacheSource cachedImage] representations] objectAtIndex: 0];
-        if (preferredRep != nil && abs([preferredRep size].width - imageSize.width) < 1 && abs([preferredRep size].height != imageSize.height) < 1) {
-            [self setImage: [imageCacheSource cachedImage]];
-            // FSALog(@"%@ accepting cached image: %@", [self stringValue], preferredRep);
-        } else {
-            NSArray	*imageReps = [image representations];
-            int		i, repCount = [imageReps count];
-            NSSize	repSize;
-            
-            preferredRep = [imageReps objectAtIndex: 0];
-            // FSALog(@"%@ rejecting cached image: %@", [self stringValue], preferredRep);
-            for (i = 1 ; i < repCount ; i++) {
-                rep = [imageReps objectAtIndex: i];
-                repSize = [rep size];
-                if (repSize.width == imageSize.width && repSize.height == imageSize.height) {
-                    preferredRep = rep;
-                    break;
-                }
-                if (repSize.width >= imageSize.width || repSize.height >= imageSize.height) {
-                    // pick the smallest of the larger representations
-                    if (repSize.width <= [preferredRep size].width ||
-                        repSize.height <= [preferredRep size].height) preferredRep = rep;
-                } else {
-                    // or the largest of the smaller representations
-                    if (repSize.width >= [preferredRep size].width ||
-                        repSize.height >= [preferredRep size].height) preferredRep = rep;
-                }
-            }
-            /* // Working code as of OS X 10.0.4; this breaks in 10.1
-                for (i = repCount - 1 ; i >= 0 ; i--) {
-                    rep = [imageReps objectAtIndex: i];
-                    if (rep != preferredRep) {
-                        [image removeRepresentation: rep];
-                    }
-                }
-            // End working code
-            */
-            // Begin workaround code for bug in OS X 10.1 (removeRepresentation: has no effect)
-            if ([preferredRep size].width > imageSize.width || [preferredRep size].height > imageSize.height) {
-                NSImage *scaledImage = [[NSImage alloc] initWithSize: imageSize];
-                NSRect rect = { NSZeroPoint, imageSize };
-                FSALog(@"rescaling %@", [self stringValue]);
-                [scaledImage setFlipped: [controlView isFlipped]]; // XXX this works, but is correct?
-                [scaledImage lockFocus];
-                [preferredRep drawInRect: rect];
-                [scaledImage unlockFocus];
-                [image release];
-                image = scaledImage;
-            } else if (repCount > 1) {
-                NSImage *sizedImage = [[NSImage alloc] initWithSize: [preferredRep size]];
-                [sizedImage addRepresentation: preferredRep];
-                [image release];
-                image = sizedImage;
-            }
-            // End workaround code
-        }
+		NSArray	*imageReps = [image representations];
+		int		i, repCount = [imageReps count];
+		NSSize	repSize;
+		
+		preferredRep = [imageReps objectAtIndex: 0];
+		// FSALog(@"%@ rejecting cached image: %@", [self stringValue], preferredRep);
+		for (i = 1 ; i < repCount ; i++) {
+			rep = [imageReps objectAtIndex: i];
+			repSize = [rep size];
+			if (repSize.width == imageSize.width && repSize.height == imageSize.height) {
+				preferredRep = rep;
+				break;
+			}
+			if (repSize.width >= imageSize.width || repSize.height >= imageSize.height) {
+				// pick the smallest of the larger representations
+				if (repSize.width <= [preferredRep size].width ||
+					repSize.height <= [preferredRep size].height) preferredRep = rep;
+			} else {
+				// or the largest of the smaller representations
+				if (repSize.width >= [preferredRep size].width ||
+					repSize.height >= [preferredRep size].height) preferredRep = rep;
+			}
+		}
+		/* // Working code as of OS X 10.0.4; this breaks in 10.1
+		 for (i = repCount - 1 ; i >= 0 ; i--) {
+		 rep = [imageReps objectAtIndex: i];
+		 if (rep != preferredRep) {
+		 [image removeRepresentation: rep];
+		 }
+		 }
+		 // End working code
+		 */
+		// Begin workaround code for bug in OS X 10.1 (removeRepresentation: has no effect)
+		if ([preferredRep size].width > imageSize.width || [preferredRep size].height > imageSize.height) {
+			NSImage *scaledImage = [[NSImage alloc] initWithSize: imageSize];
+			NSRect rect = { NSZeroPoint, imageSize };
+			FSALog(@"rescaling %@", [self stringValue]);
+			[scaledImage setFlipped: [controlView isFlipped]]; // XXX this works, but is correct?
+			[scaledImage lockFocus];
+			[preferredRep drawInRect: rect];
+			[scaledImage unlockFocus];
+			[image release];
+			image = scaledImage;
+		} else if (repCount > 1) {
+			NSImage *sizedImage = [[NSImage alloc] initWithSize: [preferredRep size]];
+			[sizedImage addRepresentation: preferredRep];
+			[image release];
+			image = sizedImage;
+		}
+		// End workaround code
         
         NSDivideRect(cellFrame, &imageFrame, &cellFrame,
@@ -176,9 +162,7 @@
             fromRect: NSOffsetRect(imageFrame, -imageFrame.origin.x, -imageFrame.origin.y)
             operation: NSCompositeSourceOver fraction: 1.0];
-        [imageCacheSource setCachedImage: image];
     }
     [self setAttributedStringValue:
         [[self stringValue] asAttributedStringTruncatedToWidth: cellFrame.size.width - 4]];
-    [self setImageCacheSource: nil]; // without this, we crash (multiple cells get created!)
     [super drawWithFrame: cellFrame inView: controlView];
 }
Index: trunk/Cocoa/F-Script Anywhere/Source/SCPatch/Common/SCPatchMessenger.cp
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/SCPatch/Common/SCPatchMessenger.cp	(revision 231)
+++ trunk/Cocoa/F-Script Anywhere/Source/SCPatch/Common/SCPatchMessenger.cp	(revision 342)
@@ -1,3 +1,4 @@
 #include <Carbon/Carbon.h>
+#include <sys/time.h>
 #include <syslog.h> 
 #include <unistd.h> 
Index: trunk/Cocoa/F-Script Anywhere/Source/SCPatch/SCPatchController/SCPatchLoader.c
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/SCPatch/SCPatchController/SCPatchLoader.c	(revision 231)
+++ trunk/Cocoa/F-Script Anywhere/Source/SCPatch/SCPatchController/SCPatchLoader.c	(revision 342)
@@ -11,5 +11,5 @@
 #undef USE_CFRUNLOOP
 #undef CHECK_SYMBOL_REFERENCES
-#define SCPL_DEBUG_LOG
+#undef SCPL_DEBUG_LOG
 
 #ifdef SCPL_DEBUG_LOG
Index: trunk/Cocoa/F-Script Anywhere/Source/mach_inject/mach_inject.h
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/mach_inject/mach_inject.h	(revision 231)
+++ trunk/Cocoa/F-Script Anywhere/Source/mach_inject/mach_inject.h	(revision 342)
@@ -19,5 +19,5 @@
 #ifndef		_mach_inject_
 #define		_mach_inject_
-
+#define __DARWIN_UNIX03 0
 #include <sys/types.h>
 #include <mach/error.h>
Index: trunk/Cocoa/F-Script Anywhere/Source/main.m
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/main.m	(revision 231)
+++ trunk/Cocoa/F-Script Anywhere/Source/main.m	(revision 342)
@@ -1,6 +1,8 @@
 #import <Cocoa/Cocoa.h>
+#import <Foundation/NSDebug.h>
 
 int main(int argc, const char *argv[])
 {
+	NSZombieEnabled = 1;
     return NSApplicationMain(argc, argv);
 }
Index: trunk/Cocoa/F-Script Anywhere/Source/procmod.m
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/procmod.m	(revision 231)
+++ 	(revision )
@@ -1,29 +1,0 @@
-/*
- *  main.c
- *  F-Script Anywhere
- *
- *  Created by Robert Chin on 5/19/06.
- *  Copyright 2006 __MyCompanyName__. All rights reserved.
- *
- */
-
-#import <DSCL/PathManager.h>
-#import <CoreFoundation/CoreFoundation.h>
-#import <ApplicationServices/ApplicationServices.h>
-#import <Foundation/Foundation.h>
-
-int main(int argc, char **argv)
-{
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    PathManager *engine = [[PathManager alloc] initWithLocalNode];
-    [engine backupStack];
-    [engine cd:@"/Groups/procmod"];
-    tDirStatus status = [engine appendToRecord:nil
-					   key:@"GroupMembership"
-					values:[NSArray arrayWithObject:[NSString stringWithUTF8String:argv[1]]]];
-    [engine restoreStack];
-    [engine release];
-    printf("%d", status);
-    [pool release];
-    return 0;
-}
