Skip to content
Browse files

First commit

  • Loading branch information...
1 parent 98b8aac commit f9bb4a6a7d2a1cad74a768a029dc94005154ea9d @suhastech committed Oct 2, 2012
Showing with 7,503 additions and 1 deletion.
  1. +15 −0 LaunchHelper/AppDelegate.h
  2. +33 −0 LaunchHelper/AppDelegate.m
  3. +36 −0 LaunchHelper/LaunchHelper-Info.plist
  4. +7 −0 LaunchHelper/LaunchHelper-Prefix.pch
  5. +8 −0 LaunchHelper/LaunchHelper.entitlements
  6. +29 −0 LaunchHelper/en.lproj/Credits.rtf
  7. +2 −0 LaunchHelper/en.lproj/InfoPlist.strings
  8. +3,191 −0 LaunchHelper/en.lproj/MainMenu.xib
  9. +14 −0 LaunchHelper/main.m
  10. +3 −1 README.md
  11. +476 −0 SandboxedLaunchAtLogin.xcodeproj/project.pbxproj
  12. +7 −0 SandboxedLaunchAtLogin.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  13. BIN ...tLogin.xcodeproj/project.xcworkspace/xcuserdata/sharma.xcuserdatad/UserInterfaceState.xcuserstate
  14. +86 −0 SandboxedLaunchAtLogin.xcodeproj/xcuserdata/sharma.xcuserdatad/xcschemes/LaunchHelper.xcscheme
  15. +86 −0 ...edLaunchAtLogin.xcodeproj/xcuserdata/sharma.xcuserdatad/xcschemes/SandboxedLaunchAtLogin.xcscheme
  16. +32 −0 SandboxedLaunchAtLogin.xcodeproj/xcuserdata/sharma.xcuserdatad/xcschemes/xcschememanagement.plist
  17. +17 −0 SandboxedLaunchAtLogin/AppDelegate.h
  18. +70 −0 SandboxedLaunchAtLogin/AppDelegate.m
  19. +34 −0 SandboxedLaunchAtLogin/SandboxedLaunchAtLogin-Info.plist
  20. +7 −0 SandboxedLaunchAtLogin/SandboxedLaunchAtLogin-Prefix.pch
  21. +8 −0 SandboxedLaunchAtLogin/SandboxedLaunchAtLogin.entitlements
  22. +29 −0 SandboxedLaunchAtLogin/en.lproj/Credits.rtf
  23. +2 −0 SandboxedLaunchAtLogin/en.lproj/InfoPlist.strings
  24. +3,297 −0 SandboxedLaunchAtLogin/en.lproj/MainMenu.xib
  25. +14 −0 SandboxedLaunchAtLogin/main.m
View
15 LaunchHelper/AppDelegate.h
@@ -0,0 +1,15 @@
+//
+// AppDelegate.h
+// LaunchHelper
+//
+// Created by Suhas Sharma on 02/10/12.
+// Copyright (c) 2012 Suhas Sharma. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+@interface AppDelegate : NSObject <NSApplicationDelegate>
+
+
+
+@end
View
33 LaunchHelper/AppDelegate.m
@@ -0,0 +1,33 @@
+//
+// AppDelegate.m
+// LaunchHelper
+//
+// Created by Suhas Sharma on 02/10/12.
+// Copyright (c) 2012 Suhas Sharma. All rights reserved.
+//
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+- (void)dealloc
+{
+ [super dealloc];
+}
+
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
+{
+
+ NSString *appPath = [[[[[[NSBundle mainBundle] bundlePath]
+ stringByDeletingLastPathComponent]
+ stringByDeletingLastPathComponent]
+ stringByDeletingLastPathComponent]
+ stringByDeletingLastPathComponent];
+ NSLog(@"Launching %@", appPath);
+
+ [[NSWorkspace sharedWorkspace] launchApplication:appPath];
+
+ [NSApp terminate:nil];
+}
+
+@end
View
36 LaunchHelper/LaunchHelper-Info.plist
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.suhastech.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${MACOSX_DEPLOYMENT_TARGET}</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2012 Suhas Sharma. All rights reserved.</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>LSBackgroundOnly</key>
+ <true/>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
View
7 LaunchHelper/LaunchHelper-Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'LaunchHelper' target in the 'LaunchHelper' project
+//
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
View
8 LaunchHelper/LaunchHelper.entitlements
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>com.apple.security.app-sandbox</key>
+ <true/>
+</dict>
+</plist>
View
29 LaunchHelper/en.lproj/Credits.rtf
@@ -0,0 +1,29 @@
+{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\paperw9840\paperh8400
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
+
+\f0\b\fs24 \cf0 Engineering:
+\b0 \
+ Some people\
+\
+
+\b Human Interface Design:
+\b0 \
+ Some other people\
+\
+
+\b Testing:
+\b0 \
+ Hopefully not nobody\
+\
+
+\b Documentation:
+\b0 \
+ Whoever\
+\
+
+\b With special thanks to:
+\b0 \
+ Mom\
+}
View
2 LaunchHelper/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
View
3,191 LaunchHelper/en.lproj/MainMenu.xib
3,191 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
14 LaunchHelper/main.m
@@ -0,0 +1,14 @@
+//
+// main.m
+// LaunchHelper
+//
+// Created by Suhas Sharma on 02/10/12.
+// Copyright (c) 2012 Suhas Sharma. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+int main(int argc, char *argv[])
+{
+ return NSApplicationMain(argc, (const char **)argv);
+}
View
4 README.md
@@ -1,4 +1,6 @@
SandboxedLaunchAtLogin
======================
-Sandboxing makes launching apps at login is a bit tricky.
+Sandboxing makes launching apps at login is a bit tricky.
+
+A simple demo of how it can be done.
View
476 SandboxedLaunchAtLogin.xcodeproj/project.pbxproj
@@ -0,0 +1,476 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ BA3AE0E3161A2C3600D03F6D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BA3AE0E2161A2C3600D03F6D /* Cocoa.framework */; };
+ BA3AE0ED161A2C3600D03F6D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BA3AE0EB161A2C3600D03F6D /* InfoPlist.strings */; };
+ BA3AE0EF161A2C3600D03F6D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BA3AE0EE161A2C3600D03F6D /* main.m */; };
+ BA3AE0F3161A2C3600D03F6D /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = BA3AE0F1161A2C3600D03F6D /* Credits.rtf */; };
+ BA3AE0F6161A2C3600D03F6D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BA3AE0F5161A2C3600D03F6D /* AppDelegate.m */; };
+ BA3AE0F9161A2C3600D03F6D /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = BA3AE0F7161A2C3600D03F6D /* MainMenu.xib */; };
+ BA3AE105161A2C5600D03F6D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BA3AE0E2161A2C3600D03F6D /* Cocoa.framework */; };
+ BA3AE10B161A2C5600D03F6D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BA3AE109161A2C5600D03F6D /* InfoPlist.strings */; };
+ BA3AE10D161A2C5600D03F6D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BA3AE10C161A2C5600D03F6D /* main.m */; };
+ BA3AE111161A2C5600D03F6D /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = BA3AE10F161A2C5600D03F6D /* Credits.rtf */; };
+ BA3AE114161A2C5600D03F6D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BA3AE113161A2C5600D03F6D /* AppDelegate.m */; };
+ BA3AE117161A2C5700D03F6D /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = BA3AE115161A2C5700D03F6D /* MainMenu.xib */; };
+ BA3AE124161A30FF00D03F6D /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BA3AE120161A2F7F00D03F6D /* ServiceManagement.framework */; };
+ BA3AE128161A324B00D03F6D /* LaunchHelper.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = BA3AE103161A2C5600D03F6D /* LaunchHelper.app */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ BA3AE127161A324300D03F6D /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = Contents/Library/LoginItems;
+ dstSubfolderSpec = 1;
+ files = (
+ BA3AE128161A324B00D03F6D /* LaunchHelper.app in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ BA3AE0DE161A2C3600D03F6D /* SandboxedLaunchAtLogin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SandboxedLaunchAtLogin.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BA3AE0E2161A2C3600D03F6D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
+ BA3AE0E5161A2C3600D03F6D /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
+ BA3AE0E6161A2C3600D03F6D /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
+ BA3AE0E7161A2C3600D03F6D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ BA3AE0EA161A2C3600D03F6D /* SandboxedLaunchAtLogin-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SandboxedLaunchAtLogin-Info.plist"; sourceTree = "<group>"; };
+ BA3AE0EC161A2C3600D03F6D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ BA3AE0EE161A2C3600D03F6D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ BA3AE0F0161A2C3600D03F6D /* SandboxedLaunchAtLogin-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SandboxedLaunchAtLogin-Prefix.pch"; sourceTree = "<group>"; };
+ BA3AE0F2161A2C3600D03F6D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = "<group>"; };
+ BA3AE0F4161A2C3600D03F6D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ BA3AE0F5161A2C3600D03F6D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ BA3AE0F8161A2C3600D03F6D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
+ BA3AE103161A2C5600D03F6D /* LaunchHelper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LaunchHelper.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BA3AE108161A2C5600D03F6D /* LaunchHelper-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LaunchHelper-Info.plist"; sourceTree = "<group>"; };
+ BA3AE10A161A2C5600D03F6D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ BA3AE10C161A2C5600D03F6D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ BA3AE10E161A2C5600D03F6D /* LaunchHelper-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LaunchHelper-Prefix.pch"; sourceTree = "<group>"; };
+ BA3AE110161A2C5600D03F6D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = "<group>"; };
+ BA3AE112161A2C5600D03F6D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ BA3AE113161A2C5600D03F6D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ BA3AE116161A2C5700D03F6D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
+ BA3AE120161A2F7F00D03F6D /* ServiceManagement.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ServiceManagement.framework; path = System/Library/Frameworks/ServiceManagement.framework; sourceTree = SDKROOT; };
+ BA3AE122161A30A700D03F6D /* SandboxedLaunchAtLogin.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = SandboxedLaunchAtLogin.entitlements; sourceTree = "<group>"; };
+ BA3AE123161A30AB00D03F6D /* LaunchHelper.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = LaunchHelper.entitlements; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ BA3AE0DB161A2C3600D03F6D /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BA3AE124161A30FF00D03F6D /* ServiceManagement.framework in Frameworks */,
+ BA3AE0E3161A2C3600D03F6D /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BA3AE100161A2C5600D03F6D /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BA3AE105161A2C5600D03F6D /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ BA3AE0D3161A2C3600D03F6D = {
+ isa = PBXGroup;
+ children = (
+ BA3AE120161A2F7F00D03F6D /* ServiceManagement.framework */,
+ BA3AE0E8161A2C3600D03F6D /* SandboxedLaunchAtLogin */,
+ BA3AE106161A2C5600D03F6D /* LaunchHelper */,
+ BA3AE0E1161A2C3600D03F6D /* Frameworks */,
+ BA3AE0DF161A2C3600D03F6D /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ BA3AE0DF161A2C3600D03F6D /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ BA3AE0DE161A2C3600D03F6D /* SandboxedLaunchAtLogin.app */,
+ BA3AE103161A2C5600D03F6D /* LaunchHelper.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ BA3AE0E1161A2C3600D03F6D /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ BA3AE0E2161A2C3600D03F6D /* Cocoa.framework */,
+ BA3AE0E4161A2C3600D03F6D /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ BA3AE0E4161A2C3600D03F6D /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ BA3AE0E5161A2C3600D03F6D /* AppKit.framework */,
+ BA3AE0E6161A2C3600D03F6D /* CoreData.framework */,
+ BA3AE0E7161A2C3600D03F6D /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ BA3AE0E8161A2C3600D03F6D /* SandboxedLaunchAtLogin */ = {
+ isa = PBXGroup;
+ children = (
+ BA3AE122161A30A700D03F6D /* SandboxedLaunchAtLogin.entitlements */,
+ BA3AE0F4161A2C3600D03F6D /* AppDelegate.h */,
+ BA3AE0F5161A2C3600D03F6D /* AppDelegate.m */,
+ BA3AE0F7161A2C3600D03F6D /* MainMenu.xib */,
+ BA3AE0E9161A2C3600D03F6D /* Supporting Files */,
+ );
+ path = SandboxedLaunchAtLogin;
+ sourceTree = "<group>";
+ };
+ BA3AE0E9161A2C3600D03F6D /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ BA3AE0EA161A2C3600D03F6D /* SandboxedLaunchAtLogin-Info.plist */,
+ BA3AE0EB161A2C3600D03F6D /* InfoPlist.strings */,
+ BA3AE0EE161A2C3600D03F6D /* main.m */,
+ BA3AE0F0161A2C3600D03F6D /* SandboxedLaunchAtLogin-Prefix.pch */,
+ BA3AE0F1161A2C3600D03F6D /* Credits.rtf */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ BA3AE106161A2C5600D03F6D /* LaunchHelper */ = {
+ isa = PBXGroup;
+ children = (
+ BA3AE123161A30AB00D03F6D /* LaunchHelper.entitlements */,
+ BA3AE112161A2C5600D03F6D /* AppDelegate.h */,
+ BA3AE113161A2C5600D03F6D /* AppDelegate.m */,
+ BA3AE115161A2C5700D03F6D /* MainMenu.xib */,
+ BA3AE107161A2C5600D03F6D /* Supporting Files */,
+ );
+ path = LaunchHelper;
+ sourceTree = "<group>";
+ };
+ BA3AE107161A2C5600D03F6D /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ BA3AE108161A2C5600D03F6D /* LaunchHelper-Info.plist */,
+ BA3AE109161A2C5600D03F6D /* InfoPlist.strings */,
+ BA3AE10C161A2C5600D03F6D /* main.m */,
+ BA3AE10E161A2C5600D03F6D /* LaunchHelper-Prefix.pch */,
+ BA3AE10F161A2C5600D03F6D /* Credits.rtf */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ BA3AE0DD161A2C3600D03F6D /* SandboxedLaunchAtLogin */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = BA3AE0FC161A2C3600D03F6D /* Build configuration list for PBXNativeTarget "SandboxedLaunchAtLogin" */;
+ buildPhases = (
+ BA3AE0DA161A2C3600D03F6D /* Sources */,
+ BA3AE0DB161A2C3600D03F6D /* Frameworks */,
+ BA3AE0DC161A2C3600D03F6D /* Resources */,
+ BA3AE127161A324300D03F6D /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = SandboxedLaunchAtLogin;
+ productName = SandboxedLaunchAtLogin;
+ productReference = BA3AE0DE161A2C3600D03F6D /* SandboxedLaunchAtLogin.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BA3AE102161A2C5600D03F6D /* LaunchHelper */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = BA3AE118161A2C5700D03F6D /* Build configuration list for PBXNativeTarget "LaunchHelper" */;
+ buildPhases = (
+ BA3AE0FF161A2C5600D03F6D /* Sources */,
+ BA3AE100161A2C5600D03F6D /* Frameworks */,
+ BA3AE101161A2C5600D03F6D /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = LaunchHelper;
+ productName = LaunchHelper;
+ productReference = BA3AE103161A2C5600D03F6D /* LaunchHelper.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ BA3AE0D5161A2C3600D03F6D /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0440;
+ ORGANIZATIONNAME = "Suhas Sharma";
+ };
+ buildConfigurationList = BA3AE0D8161A2C3600D03F6D /* Build configuration list for PBXProject "SandboxedLaunchAtLogin" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = BA3AE0D3161A2C3600D03F6D;
+ productRefGroup = BA3AE0DF161A2C3600D03F6D /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ BA3AE0DD161A2C3600D03F6D /* SandboxedLaunchAtLogin */,
+ BA3AE102161A2C5600D03F6D /* LaunchHelper */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ BA3AE0DC161A2C3600D03F6D /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BA3AE0ED161A2C3600D03F6D /* InfoPlist.strings in Resources */,
+ BA3AE0F3161A2C3600D03F6D /* Credits.rtf in Resources */,
+ BA3AE0F9161A2C3600D03F6D /* MainMenu.xib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BA3AE101161A2C5600D03F6D /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BA3AE10B161A2C5600D03F6D /* InfoPlist.strings in Resources */,
+ BA3AE111161A2C5600D03F6D /* Credits.rtf in Resources */,
+ BA3AE117161A2C5700D03F6D /* MainMenu.xib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ BA3AE0DA161A2C3600D03F6D /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BA3AE0EF161A2C3600D03F6D /* main.m in Sources */,
+ BA3AE0F6161A2C3600D03F6D /* AppDelegate.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BA3AE0FF161A2C5600D03F6D /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BA3AE10D161A2C5600D03F6D /* main.m in Sources */,
+ BA3AE114161A2C5600D03F6D /* AppDelegate.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ BA3AE0EB161A2C3600D03F6D /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ BA3AE0EC161A2C3600D03F6D /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ BA3AE0F1161A2C3600D03F6D /* Credits.rtf */ = {
+ isa = PBXVariantGroup;
+ children = (
+ BA3AE0F2161A2C3600D03F6D /* en */,
+ );
+ name = Credits.rtf;
+ sourceTree = "<group>";
+ };
+ BA3AE0F7161A2C3600D03F6D /* MainMenu.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ BA3AE0F8161A2C3600D03F6D /* en */,
+ );
+ name = MainMenu.xib;
+ sourceTree = "<group>";
+ };
+ BA3AE109161A2C5600D03F6D /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ BA3AE10A161A2C5600D03F6D /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ BA3AE10F161A2C5600D03F6D /* Credits.rtf */ = {
+ isa = PBXVariantGroup;
+ children = (
+ BA3AE110161A2C5600D03F6D /* en */,
+ );
+ name = Credits.rtf;
+ sourceTree = "<group>";
+ };
+ BA3AE115161A2C5700D03F6D /* MainMenu.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ BA3AE116161A2C5700D03F6D /* en */,
+ );
+ name = MainMenu.xib;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ BA3AE0FA161A2C3600D03F6D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ BA3AE0FB161A2C3600D03F6D /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+ BA3AE0FD161A2C3600D03F6D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_ENTITLEMENTS = SandboxedLaunchAtLogin/SandboxedLaunchAtLogin.entitlements;
+ CODE_SIGN_IDENTITY = "Suhas Sharma";
+ COMBINE_HIDPI_IMAGES = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "SandboxedLaunchAtLogin/SandboxedLaunchAtLogin-Prefix.pch";
+ INFOPLIST_FILE = "SandboxedLaunchAtLogin/SandboxedLaunchAtLogin-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE = "";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ BA3AE0FE161A2C3600D03F6D /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_ENTITLEMENTS = SandboxedLaunchAtLogin/SandboxedLaunchAtLogin.entitlements;
+ CODE_SIGN_IDENTITY = "Suhas Sharma";
+ COMBINE_HIDPI_IMAGES = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "SandboxedLaunchAtLogin/SandboxedLaunchAtLogin-Prefix.pch";
+ INFOPLIST_FILE = "SandboxedLaunchAtLogin/SandboxedLaunchAtLogin-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE = "";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+ BA3AE119161A2C5700D03F6D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_ENTITLEMENTS = LaunchHelper/LaunchHelper.entitlements;
+ CODE_SIGN_IDENTITY = "Suhas Sharma";
+ COMBINE_HIDPI_IMAGES = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "LaunchHelper/LaunchHelper-Prefix.pch";
+ INFOPLIST_FILE = "LaunchHelper/LaunchHelper-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE = "";
+ SKIP_INSTALL = YES;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ BA3AE11A161A2C5700D03F6D /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_ENTITLEMENTS = LaunchHelper/LaunchHelper.entitlements;
+ CODE_SIGN_IDENTITY = "Suhas Sharma";
+ COMBINE_HIDPI_IMAGES = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "LaunchHelper/LaunchHelper-Prefix.pch";
+ INFOPLIST_FILE = "LaunchHelper/LaunchHelper-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE = "";
+ SKIP_INSTALL = YES;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ BA3AE0D8161A2C3600D03F6D /* Build configuration list for PBXProject "SandboxedLaunchAtLogin" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ BA3AE0FA161A2C3600D03F6D /* Debug */,
+ BA3AE0FB161A2C3600D03F6D /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ BA3AE0FC161A2C3600D03F6D /* Build configuration list for PBXNativeTarget "SandboxedLaunchAtLogin" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ BA3AE0FD161A2C3600D03F6D /* Debug */,
+ BA3AE0FE161A2C3600D03F6D /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
+ BA3AE118161A2C5700D03F6D /* Build configuration list for PBXNativeTarget "LaunchHelper" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ BA3AE119161A2C5700D03F6D /* Debug */,
+ BA3AE11A161A2C5700D03F6D /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = BA3AE0D5161A2C3600D03F6D /* Project object */;
+}
View
7 SandboxedLaunchAtLogin.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:SandboxedLaunchAtLogin.xcodeproj">
+ </FileRef>
+</Workspace>
View
BIN ...codeproj/project.xcworkspace/xcuserdata/sharma.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
View
86 ...oxedLaunchAtLogin.xcodeproj/xcuserdata/sharma.xcuserdatad/xcschemes/LaunchHelper.xcscheme
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0440"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "BA3AE102161A2C5600D03F6D"
+ BuildableName = "LaunchHelper.app"
+ BlueprintName = "LaunchHelper"
+ ReferencedContainer = "container:SandboxedLaunchAtLogin.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "BA3AE102161A2C5600D03F6D"
+ BuildableName = "LaunchHelper.app"
+ BlueprintName = "LaunchHelper"
+ ReferencedContainer = "container:SandboxedLaunchAtLogin.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "BA3AE102161A2C5600D03F6D"
+ BuildableName = "LaunchHelper.app"
+ BlueprintName = "LaunchHelper"
+ ReferencedContainer = "container:SandboxedLaunchAtLogin.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "BA3AE102161A2C5600D03F6D"
+ BuildableName = "LaunchHelper.app"
+ BlueprintName = "LaunchHelper"
+ ReferencedContainer = "container:SandboxedLaunchAtLogin.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
View
86 ...AtLogin.xcodeproj/xcuserdata/sharma.xcuserdatad/xcschemes/SandboxedLaunchAtLogin.xcscheme
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0440"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "BA3AE0DD161A2C3600D03F6D"
+ BuildableName = "SandboxedLaunchAtLogin.app"
+ BlueprintName = "SandboxedLaunchAtLogin"
+ ReferencedContainer = "container:SandboxedLaunchAtLogin.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "BA3AE0DD161A2C3600D03F6D"
+ BuildableName = "SandboxedLaunchAtLogin.app"
+ BlueprintName = "SandboxedLaunchAtLogin"
+ ReferencedContainer = "container:SandboxedLaunchAtLogin.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "BA3AE0DD161A2C3600D03F6D"
+ BuildableName = "SandboxedLaunchAtLogin.app"
+ BlueprintName = "SandboxedLaunchAtLogin"
+ ReferencedContainer = "container:SandboxedLaunchAtLogin.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "BA3AE0DD161A2C3600D03F6D"
+ BuildableName = "SandboxedLaunchAtLogin.app"
+ BlueprintName = "SandboxedLaunchAtLogin"
+ ReferencedContainer = "container:SandboxedLaunchAtLogin.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
View
32 ...dLaunchAtLogin.xcodeproj/xcuserdata/sharma.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SchemeUserState</key>
+ <dict>
+ <key>LaunchHelper.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>1</integer>
+ </dict>
+ <key>SandboxedLaunchAtLogin.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>BA3AE0DD161A2C3600D03F6D</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ <key>BA3AE102161A2C5600D03F6D</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
View
17 SandboxedLaunchAtLogin/AppDelegate.h
@@ -0,0 +1,17 @@
+//
+// AppDelegate.h
+// SandboxedLaunchAtLogin
+//
+// Created by Suhas Sharma on 02/10/12.
+// Copyright (c) 2012 Suhas Sharma. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+@interface AppDelegate : NSObject <NSApplicationDelegate>
+
+@property (assign) IBOutlet NSWindow *window;
+@property (assign) IBOutlet NSButton *launchAtLoginCheckbox;
+- (IBAction)toggleLaunchAtLogin:(id)sender;
+
+@end
View
70 SandboxedLaunchAtLogin/AppDelegate.m
@@ -0,0 +1,70 @@
+//
+// AppDelegate.m
+// SandboxedLaunchAtLogin
+//
+// Created by Suhas Sharma on 02/10/12.
+// Copyright (c) 2012 Suhas Sharma. All rights reserved.
+//
+
+#import "AppDelegate.h"
+#import <ServiceManagement/ServiceManagement.h>
+
+@implementation AppDelegate
+@synthesize launchAtLoginCheckbox;
+
++ (void)initialize {
+ NSDictionary * defaults = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], @"launchAtLogin",nil];
+ [[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
+
+
+}
+
+- (void)dealloc
+{
+ [super dealloc];
+}
+
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
+{
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"launchAtLogin"]) {
+ [[self launchAtLoginCheckbox] setState:NSOnState];
+
+ } else {
+
+ [[self launchAtLoginCheckbox] setState:NSOffState];
+ }
+}
+
+- (IBAction)toggleLaunchAtLogin:(id)sender {
+
+ if ([sender state] == NSOffState) {
+ [self toggleState:NO];
+
+ } else if ([sender state] == NSOnState) {
+ [self toggleState:YES];
+ }
+
+
+}
+
+- (void) toggleState:(BOOL) state{
+
+ // Not calling LSRegisterURL due to sandbox limitation. So, this might sometimes pick up wrong binaries in dev environment. Highly unlikely in production.
+
+ if (!SMLoginItemSetEnabled((CFStringRef)@"com.suhastech.LaunchHelper",
+ state)) {
+ NSAlert* alert = [[NSAlert alloc] init];
+ [alert addButtonWithTitle:@"OK"];
+
+
+ [alert setMessageText:@"Couldn't change the 'Launch at login' state"];
+
+ [alert beginSheetModalForWindow:[self window] modalDelegate:self didEndSelector:nil contextInfo:nil];
+ [alert release];
+ } else {
+
+ [[NSUserDefaults standardUserDefaults] setBool:state forKey:@"launchAtLogin"];
+ }
+}
+
+@end
View
34 SandboxedLaunchAtLogin/SandboxedLaunchAtLogin-Info.plist
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.suhastech.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${MACOSX_DEPLOYMENT_TARGET}</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2012 Suhas Sharma. All rights reserved.</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
View
7 SandboxedLaunchAtLogin/SandboxedLaunchAtLogin-Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'SandboxedLaunchAtLogin' target in the 'SandboxedLaunchAtLogin' project
+//
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
View
8 SandboxedLaunchAtLogin/SandboxedLaunchAtLogin.entitlements
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>com.apple.security.app-sandbox</key>
+ <true/>
+</dict>
+</plist>
View
29 SandboxedLaunchAtLogin/en.lproj/Credits.rtf
@@ -0,0 +1,29 @@
+{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\paperw9840\paperh8400
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
+
+\f0\b\fs24 \cf0 Engineering:
+\b0 \
+ Some people\
+\
+
+\b Human Interface Design:
+\b0 \
+ Some other people\
+\
+
+\b Testing:
+\b0 \
+ Hopefully not nobody\
+\
+
+\b Documentation:
+\b0 \
+ Whoever\
+\
+
+\b With special thanks to:
+\b0 \
+ Mom\
+}
View
2 SandboxedLaunchAtLogin/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
View
3,297 SandboxedLaunchAtLogin/en.lproj/MainMenu.xib
3,297 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
14 SandboxedLaunchAtLogin/main.m
@@ -0,0 +1,14 @@
+//
+// main.m
+// SandboxedLaunchAtLogin
+//
+// Created by Suhas Sharma on 02/10/12.
+// Copyright (c) 2012 Suhas Sharma. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+int main(int argc, char *argv[])
+{
+ return NSApplicationMain(argc, (const char **)argv);
+}

0 comments on commit f9bb4a6

Please sign in to comment.
Something went wrong with that request. Please try again.