Index: trunk/Cocoa/F-Script Anywhere/Source/DeVercruesseProcessManager.m
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/DeVercruesseProcessManager.m	(revision 229)
+++ trunk/Cocoa/F-Script Anywhere/Source/DeVercruesseProcessManager.m	(revision 230)
@@ -175,7 +175,6 @@
     }
     
-    [processes setSet: temp];
+    [processes setSet:[temp autorelease]];
     [pool release];
-    [temp release];
 }
 
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 229)
+++ trunk/Cocoa/F-Script Anywhere/Source/F-Script Anywhere.xcodeproj/project.pbxproj	(revision 230)
@@ -16,4 +16,5 @@
 		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 */; };
 		25EADA9609CD2D7100BCD8E1 /* bytesex.c in Sources */ = {isa = PBXBuildFile; fileRef = 25EADA9509CD2D7100BCD8E1 /* bytesex.c */; };
 		E14C18BD05A4DE25000D4AF3 /* FSAInterpreterPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5680F7A020D0D0401AEEC37 /* FSAInterpreterPanel.nib */; };
@@ -94,30 +95,4 @@
 /* End PBXBuildFile section */
 
-/* Begin PBXBuildStyle section */
-		4A9504CCFFE6A4B311CA0CBA /* Development */ = {
-			isa = PBXBuildStyle;
-			buildSettings = {
-				COPY_PHASE_STRIP = NO;
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_ENABLE_FIX_AND_CONTINUE = YES;
-				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				OPTIMIZATION_CFLAGS = "-O0";
-				ZERO_LINK = NO;
-			};
-			name = Development;
-		};
-		4A9504CDFFE6A4B311CA0CBA /* Deployment */ = {
-			isa = PBXBuildStyle;
-			buildSettings = {
-				COPY_PHASE_STRIP = YES;
-				GCC_ENABLE_FIX_AND_CONTINUE = NO;
-				OTHER_CFLAGS = "-DFSA_DEBUG=0";
-				ZERO_LINK = NO;
-			};
-			name = Deployment;
-		};
-/* End PBXBuildStyle section */
-
 /* Begin PBXContainerItemProxy section */
 		25666BE50A1DAA120006AC79 /* PBXContainerItemProxy */ = {
@@ -125,5 +100,5 @@
 			containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
 			proxyType = 1;
-			remoteGlobalIDString = 25666BE00A1DAA050006AC79 /* AddToProcMod */;
+			remoteGlobalIDString = 25666BE00A1DAA050006AC79;
 			remoteInfo = AddToProcMod;
 		};
@@ -179,4 +154,5 @@
 		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>"; };
 		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>"; };
@@ -204,5 +180,5 @@
 		E1EE98BD0575626E00F2D92C /* mach_inject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mach_inject.h; sourceTree = "<group>"; tabWidth = 4; usesTabs = 1; };
 		E1EE9A2F0575769600F2D92C /* Info-Application.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "Info-Application.plist"; sourceTree = "<group>"; };
-		E1EE9A300575769600F2D92C /* F-Script Anywhere.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = "F-Script Anywhere.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+		E1EE9A300575769600F2D92C /* F-Script Anywhere.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "F-Script Anywhere.app"; sourceTree = BUILT_PRODUCTS_DIR; };
 		E1EE9A4F057576A700F2D92C /* F-Script Anywhere.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "F-Script Anywhere.bundle"; sourceTree = BUILT_PRODUCTS_DIR; };
 		E1F3DF910579172A00E952A5 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/FSA.strings; sourceTree = "<group>"; };
@@ -226,5 +202,5 @@
 		F59279FB01FED0C901AEEC37 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
 		F5B11ED902E67DB101AEEDB1 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
-		F5EFC2C3020A6C2601AEEDB1 /* FScript.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FScript.framework; path = /Library/Frameworks/FScript.framework; sourceTree = "<absolute>"; };
+		F5EFC2C3020A6C2601AEEDB1 /* FScript.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = FScript.framework; sourceTree = "<group>"; };
 		F5EFC2C9020A6CD101AEEDB1 /* DeVercruesseProcess.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = DeVercruesseProcess.m; sourceTree = "<group>"; };
 		F5EFC2CA020A6CD101AEEDB1 /* DeVercruesseProcessManager.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = DeVercruesseProcessManager.m; sourceTree = "<group>"; };
@@ -343,4 +319,5 @@
 			isa = PBXGroup;
 			children = (
+				258C25590A259B6E00AC22BB /* FScript.framework */,
 				29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
 				F5680F7A020D0D0401AEEC37 /* FSAInterpreterPanel.nib */,
@@ -544,12 +521,4 @@
 			buildRules = (
 			);
-			buildSettings = {
-				GCC_ENABLE_FIX_AND_CONTINUE = YES;
-				GCC_MODEL_TUNING = G5;
-				INSTALL_PATH = "$(HOME)/bin";
-				PREBINDING = NO;
-				PRODUCT_NAME = AddToProcMod;
-				ZERO_LINK = YES;
-			};
 			dependencies = (
 			);
@@ -570,15 +539,4 @@
 			buildRules = (
 			);
-			buildSettings = {
-				GCC_PRECOMPILE_PREFIX_HEADER = YES;
-				GCC_PREFIX_HEADER = "$(SDKROOT)/$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h";
-				GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
-				GCC_WARN_UNKNOWN_PRAGMAS = NO;
-				INFOPLIST_FILE = "Bundle Loader-Info.plist";
-				INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
-				OTHER_CFLAGS = "";
-				PRODUCT_NAME = SCPatchLoader;
-				WARNING_CFLAGS = "-Wmost";
-			};
 			dependencies = (
 			);
@@ -586,31 +544,4 @@
 			productName = Bundle;
 			productReference = E1D652040575B3D50054F5D1 /* SCPatchLoader.bundle */;
-			productSettingsXML = "<?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\">
-<plist version=\"1.0\">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>English</string>
-	<key>CFBundleExecutable</key>
-	<string>Bundle</string>
-	<key>CFBundleGetInfoString</key>
-	<string></string>
-	<key>CFBundleIconFile</key>
-	<string></string>
-	<key>CFBundleIdentifier</key>
-	<string>com.MySoftwareCompany.Bundle</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundlePackageType</key>
-	<string>APPL</string>
-	<key>CFBundleShortVersionString</key>
-	<string></string>
-	<key>CFBundleSignature</key>
-	<string>????</string>
-	<key>CFBundleVersion</key>
-	<string>1.0.0d1</string>
-</dict>
-</plist>
-";
 			productType = "com.apple.product-type.bundle";
 		};
@@ -629,27 +560,4 @@
 			buildRules = (
 			);
-			buildSettings = {
-				FRAMEWORK_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks";
-				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/include\"";
-				INFOPLIST_FILE = "Info-Application.plist";
-				INSTALL_PATH = /;
-				LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/libstuff\"";
-				OTHER_LDFLAGS = (
-					"-multiply_defined",
-					suppress,
-					"-lstuff",
-				);
-				PREBINDING = YES;
-				PRODUCT_NAME = "F-Script Anywhere";
-				SECTORDER_FLAGS = "";
-				WARNING_CFLAGS = (
-					"-Wno-long-double",
-					"-Wmost",
-					"-Wno-four-char-constants",
-					"-Wno-unknown-pragmas",
-				);
-				WRAPPER_EXTENSION = app;
-				ZERO_LINK = NO;
-			};
 			dependencies = (
 				E1EE9AA60575939700F2D92C /* PBXTargetDependency */,
@@ -674,14 +582,4 @@
 			buildRules = (
 			);
-			buildSettings = {
-				FRAMEWORK_SEARCH_PATHS = /Volumes/Ti/Library/Frameworks;
-				GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
-				GCC_WARN_UNKNOWN_PRAGMAS = NO;
-				INFOPLIST_FILE = "Bundle-Info.plist";
-				INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
-				OTHER_CFLAGS = "";
-				PRODUCT_NAME = "F-Script Anywhere";
-				SECTORDER_FLAGS = "";
-			};
 			dependencies = (
 			);
@@ -689,31 +587,4 @@
 			productName = Bundle;
 			productReference = E1EE9A4F057576A700F2D92C /* F-Script Anywhere.bundle */;
-			productSettingsXML = "<?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\">
-<plist version=\"1.0\">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>English</string>
-	<key>CFBundleExecutable</key>
-	<string>Bundle</string>
-	<key>CFBundleGetInfoString</key>
-	<string></string>
-	<key>CFBundleIconFile</key>
-	<string></string>
-	<key>CFBundleIdentifier</key>
-	<string>com.MySoftwareCompany.Bundle</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundlePackageType</key>
-	<string>APPL</string>
-	<key>CFBundleShortVersionString</key>
-	<string></string>
-	<key>CFBundleSignature</key>
-	<string>????</string>
-	<key>CFBundleVersion</key>
-	<string>1.0.0d1</string>
-</dict>
-</plist>
-";
 			productType = "com.apple.product-type.bundle";
 		};
@@ -724,12 +595,4 @@
 			isa = PBXProject;
 			buildConfigurationList = 25EAD8F709CD1E3900BCD8E1 /* Build configuration list for PBXProject "F-Script Anywhere" */;
-			buildSettings = {
-				MACOSX_DEPLOYMENT_TARGET = 10.2;
-				SDKROOT = /Developer/SDKs/MacOSX10.2.7.sdk;
-			};
-			buildStyles = (
-				4A9504CCFFE6A4B311CA0CBA /* Development */,
-				4A9504CDFFE6A4B311CA0CBA /* Deployment */,
-			);
 			hasScannedForEncodings = 1;
 			mainGroup = 29B97314FDCFA39411CA2CEA /* PatchTest */;
@@ -766,4 +629,5 @@
 				E1D6B7EA05A4AAE2003838B0 /* Localizable.strings in Resources */,
 				E14C1ECF05A8DB19000D4AF3 /* Ellipsis.tiff in Resources */,
+				258C27790A25A57200AC22BB /* FScript.framework in Resources */,
 				E1FD011605B91232001DABE0 /* mach_error descriptions.strings in Resources */,
 			);
@@ -954,9 +818,10 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				ARCHS = (
+					ppc,
+					i386,
+				);
 				COPY_PHASE_STRIP = YES;
-				FRAMEWORK_SEARCH_PATHS = (
-					"$(FRAMEWORK_SEARCH_PATHS)",
-					"$(SRCROOT)",
-				);
+				FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)\"";
 				GCC_ENABLE_FIX_AND_CONTINUE = NO;
 				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
@@ -1111,8 +976,14 @@
 				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
 				GCC_OPTIMIZATION_LEVEL = 0;
-				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/include\"";
+				HEADER_SEARCH_PATHS = (
+					"$(HEADER_SEARCH_PATHS_QUOTED_1)",
+				);
+				HEADER_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/include\"";
 				INFOPLIST_FILE = "Info-Application.plist";
 				INSTALL_PATH = /;
-				LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/libstuff\"";
+				LIBRARY_SEARCH_PATHS = (
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/libstuff\"";
 				OPTIMIZATION_CFLAGS = "-O0";
 				OTHER_LDFLAGS = (
@@ -1145,11 +1016,18 @@
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks",
-					"$(SRCROOT)",
-				);
+					"$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)",
+				);
+				FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)\"";
 				GCC_ENABLE_FIX_AND_CONTINUE = NO;
-				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/include\"";
+				HEADER_SEARCH_PATHS = (
+					"$(HEADER_SEARCH_PATHS_QUOTED_1)",
+				);
+				HEADER_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/include\"";
 				INFOPLIST_FILE = "Info-Application.plist";
 				INSTALL_PATH = /;
-				LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/libstuff\"";
+				LIBRARY_SEARCH_PATHS = (
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/libstuff\"";
 				OTHER_CFLAGS = "-DFSA_DEBUG=0";
 				OTHER_LDFLAGS = (
@@ -1157,4 +1035,6 @@
 					suppress,
 					"-lstuff",
+					"-weak_framework",
+					FScript,
 				);
 				PREBINDING = YES;
@@ -1178,8 +1058,14 @@
 					"$(SRCROOT)",
 				);
-				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/include\"";
+				HEADER_SEARCH_PATHS = (
+					"$(HEADER_SEARCH_PATHS_QUOTED_1)",
+				);
+				HEADER_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/include\"";
 				INFOPLIST_FILE = "Info-Application.plist";
 				INSTALL_PATH = /;
-				LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/libstuff\"";
+				LIBRARY_SEARCH_PATHS = (
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
+				);
+				LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../Darwin source/Commands/Apple/cctools/libstuff\"";
 				OTHER_LDFLAGS = (
 					"-multiply_defined",
Index: trunk/Cocoa/F-Script Anywhere/Source/FSAApp.h
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/FSAApp.h	(revision 229)
+++ trunk/Cocoa/F-Script Anywhere/Source/FSAApp.h	(revision 230)
@@ -26,4 +26,5 @@
 
 #import <Cocoa/Cocoa.h>
+#import <Security/Authorization.h>
 #import "FSAAppList.h"
 
@@ -48,7 +49,10 @@
     IBOutlet FSAAppList *appList;
     FSAPatchController *patchController;
+    AuthorizationRef myAuthorizationRef;
+    AuthorizationFlags myFlags;
 }
 
 - (IBAction)installBundleInSelectedApp:(id)sender;
+-(BOOL)createAuthorization;
 
 @end
Index: trunk/Cocoa/F-Script Anywhere/Source/FSAApp.mm
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/FSAApp.mm	(revision 229)
+++ trunk/Cocoa/F-Script Anywhere/Source/FSAApp.mm	(revision 230)
@@ -30,5 +30,4 @@
 #import <CoreFoundation/CoreFoundation.h>
 #import <ApplicationServices/ApplicationServices.h>
-#import <Security/Authorization.h>
 #import <Security/AuthorizationTags.h>
 
@@ -121,4 +120,61 @@
 }
 
+-(void)installFScript
+{
+    OSStatus myStatus;
+
+    NSString *installPath = nil;
+    if([[NSFileManager defaultManager] fileExistsAtPath:@"/Library/Frameworks/FScript.framework"])
+        installPath = @"/Library/Frameworks/FScript.framework";
+    if([[NSFileManager defaultManager] fileExistsAtPath:[@"~/Library/Frameworks/FScript.framework" stringByExpandingTildeInPath]])
+        installPath = [@"~/Library/Frameworks/FScript.framework" stringByExpandingTildeInPath];
+    
+    if(installPath){
+        [[NSFileManager defaultManager] removeFileAtPath:installPath handler:nil];
+    }
+    
+    if(!installPath){
+        switch([[NSAlert alertWithMessageText:@"Install F-Script"
+                                defaultButton:@"Current User"
+                              alternateButton:@"All Users"
+                                  otherButton:nil
+                    informativeTextWithFormat:@"No previous version of F-Script found. You can choose to install for just your current user (~/Library/Frameworks) or for all users (/Library/Frameworks)."] runModal]){
+            case NSAlertDefaultReturn:  // Current user
+                installPath = [@"~/Library/Frameworks/FScript.framework" stringByExpandingTildeInPath];
+                break;
+            case NSAlertAlternateReturn: // All users
+                installPath = @"/Library/Frameworks/FScript.framework";
+                break;
+            default:
+                break;
+        }        
+    }
+    
+    NSString *fromPath = [[NSBundle mainBundle] pathForResource:@"FScript" ofType:@"framework"];
+    if(![[NSFileManager defaultManager] fileExistsAtPath:[installPath stringByDeletingLastPathComponent]]){
+        if ([[NSFileManager defaultManager] isWritableFileAtPath:installPath]){
+            [[NSFileManager defaultManager] createDirectoryAtPath:[installPath stringByDeletingLastPathComponent]
+                                                       attributes:nil];
+        } else {
+            [self createAuthorization];
+            NSString *myToolPath = @"/bin/mkdir";
+            char *myArguments[] = { (char *)[[installPath stringByDeletingLastPathComponent] UTF8String], NULL };
+            myStatus = AuthorizationExecuteWithPrivileges(myAuthorizationRef, [myToolPath UTF8String],
+                                                          myFlags, myArguments,
+                                                          NULL);
+        }
+    }
+    if([[NSFileManager defaultManager] isWritableFileAtPath:[installPath stringByDeletingLastPathComponent]]){
+        [[NSFileManager defaultManager] copyPath:fromPath toPath:installPath handler:nil];
+    } else {
+        [self createAuthorization];
+        NSString *myToolPath = @"/bin/cp";
+        char *myArguments[] = { "-r", (char *)[fromPath UTF8String], (char *)[installPath UTF8String], NULL };
+        myStatus = AuthorizationExecuteWithPrivileges(myAuthorizationRef, [myToolPath UTF8String],
+                                                      myFlags, myArguments,
+                                                      NULL);
+    }    
+}
+
 - (BOOL)_shouldContinueAfterFrameworkErrorPanelReturnedWithResult:(int)result;
 {
@@ -126,6 +182,7 @@
         case NSAlertOtherReturn:
             return true;
-        case NSAlertAlternateReturn:
-            [[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString: FSA_FScriptURL]];
+        case NSAlertAlternateReturn: /* Install from resources */
+            [self installFScript];
+            return true;
         case NSAlertDefaultReturn:
         default:
@@ -135,14 +192,16 @@
 }
 
--(tDirStatus)authorizeAndAddToProcMod:(NSString *)username
-{
+-(BOOL)createAuthorization
+{
+    if(myAuthorizationRef)
+        return YES;
+    
     OSStatus myStatus;
-    AuthorizationFlags myFlags = kAuthorizationFlagDefaults;
-    AuthorizationRef myAuthorizationRef;
+    myFlags = kAuthorizationFlagDefaults;
     
     myStatus = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
                                    myFlags, &myAuthorizationRef);
     if(myStatus != errAuthorizationSuccess)
-        return eDSAuthFailed;
+        return NO;
     
     AuthorizationItem myItems = {kAuthorizationRightExecute, 0, NULL, 0};
@@ -157,7 +216,16 @@
     
     if(myStatus != errAuthorizationSuccess) 
+        return NO;
+    
+    myFlags = kAuthorizationFlagDefaults;
+    return YES;
+}
+
+-(tDirStatus)authorizeAndAddToProcMod:(NSString *)username
+{
+    OSStatus myStatus;
+    
+    if(![self createAuthorization])
         return eDSAuthFailed;
-    
-    myFlags = kAuthorizationFlagDefaults;
     
     NSString *myToolPath = [[NSBundle mainBundle] pathForResource:@"AddToProcMod" ofType:@""];
@@ -176,6 +244,4 @@
     myReadBuffer[didRead - 1] = 0;
     
-    AuthorizationFree(myAuthorizationRef, kAuthorizationFlagDefaults);
-
     return (tDirStatus)strtol(myReadBuffer, NULL, 10);
 }
@@ -274,8 +340,8 @@
         int result = NSRunInformationalAlertPanel(
             NSLocalizedString(@"F-Script Framework Not Found", "Framework not found alert title"),
-            NSLocalizedString(@"F-Script Anywhere requires the F-Script framework be installed in a Frameworks directory, such as ~/Library/Frameworks or /Library/Frameworks.\n\nTo download F-Script, please visit its Web site\n%@.\n\nIf you believe this message is in error, click '%@'.",
+            NSLocalizedString(@"F-Script Anywhere requires the F-Script framework be installed in a Frameworks directory, such as ~/Library/Frameworks or /Library/Frameworks.\n\nTo download F-Script, please visit its Web site\n%@.\n\nThis package also includes a copy of F-Script for your convenience that can be installed easily by clicking below. Note that there may be a more recent version of F-Script available from the F-Script web site.\n\nIf you believe this message is in error, click '%@'.",
                               "Framework not found alert message, F-Script Web site URL parameter, 'Continue' button parameter"),
             NSLocalizedString(@"Quit", "Quit button title"),
-            NSLocalizedString(@"Get F-Script", "'Get F-Script' button title"),
+            NSLocalizedString(@"Install F-Script", "'Get F-Script' button title"),
             NSLocalizedString(@"Continue", "Continue button title"),
             FSA_FScriptURL, NSLocalizedString(@"Continue", ""));
@@ -290,15 +356,20 @@
             int result = NSRunInformationalAlertPanel(
 		NSLocalizedString(@"F-Script Framework Too Old", "Framework too old alert title"),
-		NSLocalizedString(@"F-Script Anywhere %s requires version %@ or later of the F-Script framework be installed in a Frameworks directory, such as ~/Library/Frameworks or /Library/Frameworks. The installed version is %@.\n\nTo upgrade F-Script, please visit its Web site\n%@.\n\nTo use this version of F-Script regardless of the problems you may experience, click '%@'.",
+		NSLocalizedString(@"F-Script Anywhere %s requires version %@ or later of the F-Script framework be installed in a Frameworks directory, such as ~/Library/Frameworks or /Library/Frameworks. The installed version is %@.\n\nTo upgrade F-Script, please visit its Web site\n%@.\n\nThis package also includes a copy of F-Script for your convenience that can be installed easily by clicking below. Note that there may be a more recent version of F-Script available from the F-Script web site.\n\nTo use this version of F-Script regardless of the problems you may experience, click '%@'.",
                                   "Framework too old alert message, FSA version parameter, minimum F-Script version parameter, current F-Script version parameter, F-Script Web site URL parameter, 'Continue' button parameter"),
 		NSLocalizedString(@"Quit", "Quit button title"),
-                NSLocalizedString(@"Get F-Script", "'Get F-Script' button title"),
+                NSLocalizedString(@"Install F-Script", "'Get F-Script' button title"),
                 NSLocalizedString(@"Continue", "Continue button title"),
                 FSA_VERSION, FSA_FScriptMinimumVersion, frameworkVersion,
-                FSA_FScriptURL, NSLocalizedString(@"Continue", ""));
+                FSA_FScriptURL, NSLocalizedString(@"Install F-Script", ""));
             if (![self _shouldContinueAfterFrameworkErrorPanelReturnedWithResult: result]) return;
         }
     }
 
+    if(myAuthorizationRef){
+        AuthorizationFree(myAuthorizationRef, kAuthorizationFlagDefaults);
+        myAuthorizationRef = nil;
+    }
+    
     NSNotificationCenter *workspaceNotificationCenter = [[NSWorkspace sharedWorkspace] notificationCenter];
     [workspaceNotificationCenter
Index: trunk/Cocoa/F-Script Anywhere/Source/Read Me
===================================================================
--- trunk/Cocoa/F-Script Anywhere/Source/Read Me	(revision 229)
+++ trunk/Cocoa/F-Script Anywhere/Source/Read Me	(revision 230)
@@ -91,6 +91,9 @@
    (and if not, to prompt you if you want to add yourself) -- something
    that is necessary for use of FSA on x86.
+
+4. Unzip FScript.framework.zip, or put a newer version of FScript.framework
+   in the project path. This is used for the FScript framework auto installer.
    
-3. Open 'F-Script Anywhere.xcodeproj' in Xcode and build the Application
+5. Open 'F-Script Anywhere.xcodeproj' in Xcode and build the Application
    target.  This target depends on the Bundle and Bundle Loader
    targets, so you don't need to build them separately.  You
