Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Testing of plugin installer

  • Loading branch information...
commit a7c949e53d1ff87ea0c1db0a935d0cacf1baa9ca 1 parent c311a9f
Marcus S. Zarra authored
View
2  Daemon/Classes/AppDelegate.h
@@ -26,7 +26,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//
-@interface AppDelegate : NSObject <NSApplicationDelegate>
+@interface AppDelegate : NSObject
{
NSStatusItem *statusItem;
}
View
68 Daemon/Classes/ZSyncDaemon.m
@@ -1,7 +1,22 @@
#import "ZSyncDaemon.h"
+#define ZSyncVersionNumber @"ZSyncVersionNumber"
+
@implementation ZSyncDaemon
++ (NSBundle*)myBundle
+{
+ NSString *path = [[NSBundle mainBundle] pathForResource:@"ZSyncInstaller" ofType:@"bundle"];
+ return [NSBundle bundleWithPath:path];
+}
+
++ (NSBundle*)daemonBundle
+{
+ NSBundle *myBundle = [self myBundle];
+ NSString *path = [myBundle pathForResource:@"ZSyncDaemon" ofType:@"app"];
+ return [NSBundle bundleWithPath:path];
+}
+
+ (NSString*)basePath
{
//Build our standard install path
@@ -56,10 +71,7 @@ + (BOOL)isDaemonInstalled:(NSError**)error;
if (error) {
return NO;
}
- if (![[NSFileManager defaultManager] createDirectoryAtPath:basePath
- withIntermediateDirectories:YES
- attributes:nil
- error:error]) {
+ if (![[NSFileManager defaultManager] createDirectoryAtPath:basePath withIntermediateDirectories:YES attributes:nil error:error]) {
return NO;
}
}
@@ -69,22 +81,36 @@ + (BOOL)isDaemonInstalled:(NSError**)error;
+ (BOOL)installDaemon:(NSError**)error;
{
- NSString *myBundlePath = [[NSBundle mainBundle] bundlePath];
- NSString *applicationPath = [self applicationPath];
+ NSString *basePath = [self basePath];
NSFileManager *fileManager = [NSFileManager defaultManager];
+ BOOL isDirectory = NO;
+
+ if (![fileManager fileExistsAtPath:basePath isDirectory:&isDirectory]) {
+ if (![[NSFileManager defaultManager] createDirectoryAtPath:basePath withIntermediateDirectories:YES attributes:nil error:error]) {
+ return NO;
+ }
+ } else if (!isDirectory) {
+ NSString *errorDesc = [NSString stringWithFormat:@"Unknown file at base installation path: %@", basePath];
+ NSDictionary *dictionary = [NSDictionary dictionaryWithObject:errorDesc forKey:NSLocalizedDescriptionKey];
+ *error = [NSError errorWithDomain:@"ZSync" code:1123 userInfo:dictionary];
+ return NO;
+ }
+
+ NSString *myBundlePath = [[self daemonBundle] bundlePath];
+ NSString *applicationPath = [self applicationPath];
return [fileManager copyItemAtPath:myBundlePath toPath:applicationPath error:error];
}
+ (BOOL)stopDaemon:(NSError**)error
{
- NSString *appName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleExecutable"];
+ NSString *appName = [[[self myBundle] infoDictionary] objectForKey:@"CFBundleExecutable"];
NSString *command = [NSString stringWithFormat:@"tell application \"%@\" to quit", appName];
NSAppleScript *quitScript;
quitScript = [[NSAppleScript alloc] initWithSource:command];
NSDictionary *errorDict = nil;
// TODO: This should be turned into an NSError response
if (![quitScript executeAndReturnError:&errorDict]) {
- ALog(@"Failure. What does it look like: %@", errorDict);
+ NSAssert1(NO, @"Failure. What does it look like: %@", errorDict);
[quitScript release], quitScript = nil;
return NO;
}
@@ -94,11 +120,11 @@ + (BOOL)stopDaemon:(NSError**)error
+ (BOOL)updateInstalledApplication:(NSError**)error;
{
- NSString *appName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleExecutable"];
+ NSString *appName = [[[self myBundle] infoDictionary] objectForKey:@"CFBundleExecutable"];
if ([self isDaemonRunning] && ![self stopDaemon:error]) return NO;
- NSString *myBundlePath = [[NSBundle mainBundle] bundlePath];
+ NSString *myBundlePath = [[self myBundle] bundlePath];
NSString *applicationPath = [self applicationPath];
NSString *basePath = [self basePath];
@@ -164,7 +190,7 @@ + (BOOL)installPluginAtPath:(NSString*)path intoDaemonWithError:(NSError**)error
if (!isDaemonInstalled) {
if (![self installDaemon:error]) return NO;
} else {
- NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
+ NSDictionary *infoDictionary = [[self daemonBundle] infoDictionary];
NSInteger currentVersionNumber = [[infoDictionary objectForKey:ZSyncVersionNumber] integerValue];
NSBundle *installed = [NSBundle bundleWithPath:[self applicationPath]];
@@ -184,8 +210,22 @@ + (BOOL)installPluginAtPath:(NSString*)path intoDaemonWithError:(NSError**)error
}
//Install the plugin
- NSString *pluginPath = [[self pluginPath] stringByAppendingPathComponent:[path lastPathComponent]];
+ NSString *pluginPath = [self pluginPath];
NSFileManager *fileManager = [NSFileManager defaultManager];
+ BOOL isDirectory = NO;
+
+ if (![fileManager fileExistsAtPath:pluginPath isDirectory:&isDirectory]) {
+ if (![[NSFileManager defaultManager] createDirectoryAtPath:pluginPath withIntermediateDirectories:YES attributes:nil error:error]) {
+ return NO;
+ }
+ } else if (!isDirectory) {
+ NSString *errorDesc = [NSString stringWithFormat:@"Unknown file at base installation path: %@", pluginPath];
+ NSDictionary *dictionary = [NSDictionary dictionaryWithObject:errorDesc forKey:NSLocalizedDescriptionKey];
+ *error = [NSError errorWithDomain:@"ZSync" code:1123 userInfo:dictionary];
+ return NO;
+ }
+
+ pluginPath = [pluginPath stringByAppendingPathComponent:[path lastPathComponent]];
if (![fileManager copyItemAtPath:path toPath:pluginPath error:error]) {
return NO;
}
@@ -198,7 +238,7 @@ + (BOOL)installPluginAtPath:(NSString*)path intoDaemonWithError:(NSError**)error
+ (BOOL)isDaemonRunning;
{
- NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
+ NSDictionary *infoDictionary = [[self daemonBundle] infoDictionary];
NSString *myBundleID = [infoDictionary objectForKey:@"CFBundleIdentifier"];
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
@@ -212,7 +252,7 @@ + (BOOL)isDaemonRunning;
+ (void)startDaemon;
{
- NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
+ NSDictionary *infoDictionary = [[self myBundle] infoDictionary];
NSString *appName = [infoDictionary objectForKey:@"CFBundleExecutable"];
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
View
34 Daemon/Info-Installer.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>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string>icon.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.zarrastudios.zsync.${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>LSUIElement</key>
+ <true/>
+ <key>NSPrincipalClass</key>
+ <string>ZSyncDaemon</string>
+ <key>ZSyncVersionNumber</key>
+ <string>1</string>
+</dict>
+</plist>
View
87 Daemon/Info.plist
@@ -1,36 +1,59 @@
<?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>NSMainNibFile</key>
- <string>MainMenu</string>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string>com.yourcompany.${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>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleShortVersionString</key>
- <string>1.0</string>
- <key>LSMinimumSystemVersion</key>
- <string>${MACOSX_DEPLOYMENT_TARGET}</string>
- <key>CFBundleVersion</key>
- <string>1</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
- <key>LSUIElement</key>
- <true/>
- <key>ZSyncVersionNumber</key>
- <string>1</string>
-</dict>
+ <dict>
+
+ <key>UTExportedTypeDeclarations</key>
+ <array>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>com.apple.bundle</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>ZSync Plugin</string>
+ <key>UTTypeIdentifier</key>
+ <string>com.zarrastudios.zsync.plugin</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>zsyncPlugin</string>
+ </array>
+ </dict>
+ </dict>
+ </array>
+
+
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string>icon.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.zarrastudios.zsync.${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>LSUIElement</key>
+ <true/>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>ZSyncVersionNumber</key>
+ <string>1</string>
+ </dict>
</plist>
View
4 Daemon/Prefix.pch
@@ -2,6 +2,4 @@
#import <Cocoa/Cocoa.h>
#import <CoreData/CoreData.h>
#import "ZSync.h"
-#endif
-
-#define ZSyncVersionNumber @"ZSyncVersionNumber"
+#endif
View
129 Daemon/ZSyncDaemon.xcodeproj/project.pbxproj
@@ -24,10 +24,23 @@
B691FB8E10ED875800207210 /* PairingCodeWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = B691FB8810ED875800207210 /* PairingCodeWindowController.m */; };
B691FB8F10ED875800207210 /* ZSyncHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = B691FB8B10ED875800207210 /* ZSyncHandler.m */; };
B691FBBD10ED884000207210 /* SyncServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B691FBBC10ED884000207210 /* SyncServices.framework */; };
+ B6DEEC0611BA16A90036A137 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = B6DEEC0511BA16A90036A137 /* icon.icns */; };
+ B6DEEC3A11BA18970036A137 /* ZSyncDaemon.m in Sources */ = {isa = PBXBuildFile; fileRef = B63F9CAB11B2EF6700811EB1 /* ZSyncDaemon.m */; };
+ B6DEEC3D11BA18C00036A137 /* ZSyncDaemon.app in Resources */ = {isa = PBXBuildFile; fileRef = 8D1107320486CEB800E47090 /* ZSyncDaemon.app */; };
B6EC175D10F5033E0051FD2E /* GTMNSData+zlib.m in Sources */ = {isa = PBXBuildFile; fileRef = B6EC175C10F5033E0051FD2E /* GTMNSData+zlib.m */; };
B6EC179F10F509010051FD2E /* libMYNetwork-Desktop.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B6EC179E10F509010051FD2E /* libMYNetwork-Desktop.a */; };
/* End PBXBuildFile section */
+/* Begin PBXContainerItemProxy section */
+ B6DEEC3811BA187F0036A137 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 8D1107260486CEB800E47090;
+ remoteInfo = ZSyncDaemon;
+ };
+/* End PBXContainerItemProxy section */
+
/* Begin PBXFileReference section */
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
@@ -74,6 +87,9 @@
B691FBA910ED879D00207210 /* TCPListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TCPListener.h; sourceTree = "<group>"; };
B691FBAA10ED879D00207210 /* ZSyncShared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZSyncShared.h; sourceTree = "<group>"; };
B691FBBC10ED884000207210 /* SyncServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SyncServices.framework; path = System/Library/Frameworks/SyncServices.framework; sourceTree = SDKROOT; };
+ B6C5981811BA1B2D007CB1E1 /* Info-Installer.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-Installer.plist"; sourceTree = "<group>"; };
+ B6DEEC0511BA16A90036A137 /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = icon.icns; sourceTree = "<group>"; };
+ B6DEEC2F11BA18680036A137 /* ZSyncInstaller.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZSyncInstaller.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
B6EC175A10F5033E0051FD2E /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMDefines.h; sourceTree = "<group>"; };
B6EC175B10F5033E0051FD2E /* GTMNSData+zlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GTMNSData+zlib.h"; sourceTree = "<group>"; };
B6EC175C10F5033E0051FD2E /* GTMNSData+zlib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "GTMNSData+zlib.m"; sourceTree = "<group>"; };
@@ -93,6 +109,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ B6DEEC2D11BA18680036A137 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@@ -119,6 +142,7 @@
isa = PBXGroup;
children = (
8D1107320486CEB800E47090 /* ZSyncDaemon.app */,
+ B6DEEC2F11BA18680036A137 /* ZSyncInstaller.bundle */,
);
name = Products;
sourceTree = "<group>";
@@ -142,6 +166,7 @@
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
+ B6C5981811BA1B2D007CB1E1 /* Info-Installer.plist */,
B691FB4910ED857100207210 /* Info.plist */,
B691FB4A10ED857100207210 /* Prefix.pch */,
B691FB3C10ED855F00207210 /* main.m */,
@@ -173,6 +198,7 @@
B63F9C2011B2EA1300811EB1 /* Images */ = {
isa = PBXGroup;
children = (
+ B6DEEC0511BA16A90036A137 /* icon.icns */,
B63F9C2111B2EA2800811EB1 /* menubar.png */,
);
name = Images;
@@ -274,6 +300,24 @@
productReference = 8D1107320486CEB800E47090 /* ZSyncDaemon.app */;
productType = "com.apple.product-type.application";
};
+ B6DEEC2E11BA18680036A137 /* ZSyncInstaller */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = B6DEEC3711BA18680036A137 /* Build configuration list for PBXNativeTarget "ZSyncInstaller" */;
+ buildPhases = (
+ B6DEEC2B11BA18680036A137 /* Resources */,
+ B6DEEC2C11BA18680036A137 /* Sources */,
+ B6DEEC2D11BA18680036A137 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ B6DEEC3911BA187F0036A137 /* PBXTargetDependency */,
+ );
+ name = ZSyncInstaller;
+ productName = ZSyncInstaller;
+ productReference = B6DEEC2F11BA18680036A137 /* ZSyncInstaller.bundle */;
+ productType = "com.apple.product-type.bundle";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -294,6 +338,7 @@
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* ZSyncDaemon */,
+ B6DEEC2E11BA18680036A137 /* ZSyncInstaller */,
);
};
/* End PBXProject section */
@@ -308,6 +353,15 @@
B691FB8C10ED875800207210 /* PairingWindow.xib in Resources */,
B64FE70410EE728F00B15A8F /* clientDescription.plist in Resources */,
B63F9C2211B2EA2800811EB1 /* menubar.png in Resources */,
+ B6DEEC0611BA16A90036A137 /* icon.icns in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ B6DEEC2B11BA18680036A137 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ B6DEEC3D11BA18C00036A137 /* ZSyncDaemon.app in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -330,8 +384,24 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ B6DEEC2C11BA18680036A137 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ B6DEEC3A11BA18970036A137 /* ZSyncDaemon.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXSourcesBuildPhase section */
+/* Begin PBXTargetDependency section */
+ B6DEEC3911BA187F0036A137 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 8D1107260486CEB800E47090 /* ZSyncDaemon */;
+ targetProxy = B6DEEC3811BA187F0036A137 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
/* Begin PBXVariantGroup section */
B691FB3E10ED855F00207210 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
@@ -362,6 +432,56 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
+ B6DEEC3211BA18680036A137 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
+ INFOPLIST_FILE = "Info-Installer.plist";
+ INSTALL_PATH = "$(HOME)/Library/Bundles";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ AppKit,
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = ZSyncInstaller;
+ WRAPPER_EXTENSION = bundle;
+ };
+ name = Debug;
+ };
+ B6DEEC3311BA18680036A137 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
+ INFOPLIST_FILE = "Info-Installer.plist";
+ INSTALL_PATH = "$(HOME)/Library/Bundles";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ AppKit,
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = ZSyncInstaller;
+ WRAPPER_EXTENSION = bundle;
+ ZERO_LINK = NO;
+ };
+ name = Release;
+ };
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -433,6 +553,15 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
+ B6DEEC3711BA18680036A137 /* Build configuration list for PBXNativeTarget "ZSyncInstaller" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ B6DEEC3211BA18680036A137 /* Debug */,
+ B6DEEC3311BA18680036A137 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ZSyncDaemon" */ = {
isa = XCConfigurationList;
buildConfigurations = (
View
2  DesktopCode/ZSyncHandler.m
@@ -45,8 +45,8 @@ + (id)shared;
if (!zsSharedSyncHandler) {
zsSharedSyncHandler = [[ZSyncHandler alloc] init];
}
- return zsSharedSyncHandler;
}
+ return zsSharedSyncHandler;
}
- (NSMutableArray*)connections
View
BIN  Images/icon.icns
Binary file not shown
View
BIN  Images/icon128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  Images/icon256.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  Images/icon32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2  SampleDesktop/Classes/AppDelegate.h
@@ -17,6 +17,8 @@
@property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel;
@property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext;
+- (void)validateZSync;
+
- (IBAction)saveAction:(id)sender;
- (IBAction)addData:(id)sender;
- (IBAction)changeData:(id)sender;
View
11 SampleDesktop/Classes/AppDelegate.m
@@ -1,4 +1,5 @@
#import "AppDelegate.h"
+#import "ZSyncDaemon.h"
@interface AppDelegate()
@@ -24,6 +25,7 @@ - (NSString*)applicationSupportDirectory
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification
{
+ [self validateZSync];
[self performSync:self];
}
@@ -65,6 +67,15 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender
return NSTerminateNow;
}
+- (void)validateZSync;
+{
+ Class zsync = [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"ZSyncInstaller" ofType:@"bundle"]] principalClass];
+ NSString *path = [[NSBundle mainBundle] pathForResource:@"SampleDesktop" ofType:@"zsyncPlugin"];
+ NSError *error = nil;
+ ZAssert([zsync installPluginAtPath:path intoDaemonWithError:&error], @"Error installing plugin: %@", [error userInfo]);
+ DLog(@"validation complete");
+}
+
- (ISyncClient*)syncClient;
{
NSString *clientIdentifier = [[NSBundle mainBundle] bundleIdentifier];
View
177 SampleDesktop/SampleDesktop.xcodeproj/project.pbxproj
@@ -10,6 +10,7 @@
770B37ED0679A11B001EADE2 /* DataModel.xcdatamodel in Sources */ = {isa = PBXBuildFile; fileRef = 770B37EC0679A11B001EADE2 /* DataModel.xcdatamodel */; };
77C8280E06725ACE000B614F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 77C8280C06725ACE000B614F /* AppDelegate.m */; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+ B62DD01111BA1FA100AD6EAB /* SampleDesktop.zsyncPlugin in Resources */ = {isa = PBXBuildFile; fileRef = B62DD00911BA1F5500AD6EAB /* SampleDesktop.zsyncPlugin */; };
B633AFEA10C149A8009101EF /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B633AFE910C149A8009101EF /* CoreData.framework */; };
B6457E4110B059EC00A96714 /* SyncServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6457E4010B059EC00A96714 /* SyncServices.framework */; };
B6510A7E10F1067500D22FBC /* App.icns in Resources */ = {isa = PBXBuildFile; fileRef = B6510A7D10F1067500D22FBC /* App.icns */; };
@@ -18,9 +19,17 @@
B691FC4A10ED8E7400207210 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = B691FC4710ED8E7400207210 /* MainMenu.xib */; };
B691FCCF10ED92A500207210 /* ZSyncSample.syncschema in Resources */ = {isa = PBXBuildFile; fileRef = B6457E3110B058CD00A96714 /* ZSyncSample.syncschema */; };
B691FD5310EDA99200207210 /* clientDescription.plist in Resources */ = {isa = PBXBuildFile; fileRef = B691FC7310ED907400207210 /* clientDescription.plist */; };
+ B6C5980D11BA1AD7007CB1E1 /* ZSyncInstaller.bundle in Resources */ = {isa = PBXBuildFile; fileRef = B6DEEC3611BA18680036A137 /* ZSyncInstaller.bundle */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
+ B62DD00E11BA1F9000AD6EAB /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = B62DD00811BA1F5500AD6EAB;
+ remoteInfo = SampleDesktopPlugin;
+ };
B6457E3010B058CD00A96714 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = B6457E2C10B058CD00A96714 /* SyncSchema.xcodeproj */;
@@ -35,6 +44,27 @@
remoteGlobalIDString = 8D5B49AC048680CD000E48DA;
remoteInfo = SyncSchema;
};
+ B6C5980711BA1AAB007CB1E1 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = B6DEEBE011BA15400036A137 /* ZSyncDaemon.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = B6DEEC2E11BA18680036A137;
+ remoteInfo = ZSyncInstaller;
+ };
+ B6DEEBE411BA15400036A137 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = B6DEEBE011BA15400036A137 /* ZSyncDaemon.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 8D1107320486CEB800E47090;
+ remoteInfo = ZSyncDaemon;
+ };
+ B6DEEC3511BA18680036A137 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = B6DEEBE011BA15400036A137 /* ZSyncDaemon.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = B6DEEC2F11BA18680036A137;
+ remoteInfo = ZSyncInstaller;
+ };
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
@@ -48,6 +78,8 @@
77C8280C06725ACE000B614F /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; explicitFileType = text.plist.xml; fileEncoding = 4; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* SampleDesktop.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleDesktop.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ B62DD00911BA1F5500AD6EAB /* SampleDesktop.zsyncPlugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SampleDesktop.zsyncPlugin; sourceTree = BUILT_PRODUCTS_DIR; };
+ B62DD00A11BA1F5500AD6EAB /* SampleDesktopPlugin-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SampleDesktopPlugin-Info.plist"; sourceTree = "<group>"; };
B633AFE910C149A8009101EF /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
B6457E2C10B058CD00A96714 /* SyncSchema.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SyncSchema.xcodeproj; path = SyncSchema/SyncSchema.xcodeproj; sourceTree = "<group>"; };
B6457E4010B059EC00A96714 /* SyncServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SyncServices.framework; path = System/Library/Frameworks/SyncServices.framework; sourceTree = SDKROOT; };
@@ -56,6 +88,8 @@
B691FC4610ED8E7400207210 /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
B691FC4810ED8E7400207210 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
B691FC7310ED907400207210 /* clientDescription.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = clientDescription.plist; sourceTree = "<group>"; };
+ B6DEEBE011BA15400036A137 /* ZSyncDaemon.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ZSyncDaemon.xcodeproj; path = ../Daemon/ZSyncDaemon.xcodeproj; sourceTree = SOURCE_ROOT; };
+ B6DEEC1411BA17190036A137 /* ZSyncDaemon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZSyncDaemon.h; path = ../Daemon/Classes/ZSyncDaemon.h; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -69,6 +103,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ B62DD00711BA1F5500AD6EAB /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@@ -105,6 +146,7 @@
isa = PBXGroup;
children = (
8D1107320486CEB800E47090 /* SampleDesktop.app */,
+ B62DD00911BA1F5500AD6EAB /* SampleDesktop.zsyncPlugin */,
);
name = Products;
sourceTree = "<group>";
@@ -118,6 +160,7 @@
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
+ B62DD00A11BA1F5500AD6EAB /* SampleDesktopPlugin-Info.plist */,
);
name = SampleDesktop;
sourceTree = "<group>";
@@ -125,6 +168,8 @@
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
+ B6DEEBE011BA15400036A137 /* ZSyncDaemon.xcodeproj */,
+ B6DEEC1411BA17190036A137 /* ZSyncDaemon.h */,
B691FC4310ED8E6300207210 /* main.m */,
32CA4F630368D1EE00C91783 /* Prefix.pch */,
);
@@ -170,6 +215,15 @@
name = Products;
sourceTree = "<group>";
};
+ B6DEEBE111BA15400036A137 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ B6DEEBE511BA15400036A137 /* ZSyncDaemon.app */,
+ B6DEEC3611BA18680036A137 /* ZSyncInstaller.bundle */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -184,7 +238,9 @@
buildRules = (
);
dependencies = (
+ B62DD00F11BA1F9000AD6EAB /* PBXTargetDependency */,
B6457E3510B058FE00A96714 /* PBXTargetDependency */,
+ B6C5980811BA1AAB007CB1E1 /* PBXTargetDependency */,
);
name = SampleDesktop;
productInstallPath = "$(HOME)/Applications";
@@ -192,6 +248,23 @@
productReference = 8D1107320486CEB800E47090 /* SampleDesktop.app */;
productType = "com.apple.product-type.application";
};
+ B62DD00811BA1F5500AD6EAB /* SampleDesktopPlugin */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = B62DD00D11BA1F5600AD6EAB /* Build configuration list for PBXNativeTarget "SampleDesktopPlugin" */;
+ buildPhases = (
+ B62DD00511BA1F5500AD6EAB /* Resources */,
+ B62DD00611BA1F5500AD6EAB /* Sources */,
+ B62DD00711BA1F5500AD6EAB /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = SampleDesktopPlugin;
+ productName = SampleDesktopPlugin;
+ productReference = B62DD00911BA1F5500AD6EAB /* SampleDesktop.zsyncPlugin */;
+ productType = "com.apple.product-type.bundle";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -214,10 +287,15 @@
ProductGroup = B6457E2D10B058CD00A96714 /* Products */;
ProjectRef = B6457E2C10B058CD00A96714 /* SyncSchema.xcodeproj */;
},
+ {
+ ProductGroup = B6DEEBE111BA15400036A137 /* Products */;
+ ProjectRef = B6DEEBE011BA15400036A137 /* ZSyncDaemon.xcodeproj */;
+ },
);
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* SampleDesktop */,
+ B62DD00811BA1F5500AD6EAB /* SampleDesktopPlugin */,
);
};
/* End PBXProject section */
@@ -230,6 +308,20 @@
remoteRef = B6457E3010B058CD00A96714 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
+ B6DEEBE511BA15400036A137 /* ZSyncDaemon.app */ = {
+ isa = PBXReferenceProxy;
+ fileType = wrapper.application;
+ path = ZSyncDaemon.app;
+ remoteRef = B6DEEBE411BA15400036A137 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ B6DEEC3611BA18680036A137 /* ZSyncInstaller.bundle */ = {
+ isa = PBXReferenceProxy;
+ fileType = wrapper.cfbundle;
+ path = ZSyncInstaller.bundle;
+ remoteRef = B6DEEC3511BA18680036A137 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
@@ -237,6 +329,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ B62DD01111BA1FA100AD6EAB /* SampleDesktop.zsyncPlugin in Resources */,
+ B6C5980D11BA1AD7007CB1E1 /* ZSyncInstaller.bundle in Resources */,
B691FCCF10ED92A500207210 /* ZSyncSample.syncschema in Resources */,
B691FC4910ED8E7400207210 /* InfoPlist.strings in Resources */,
B691FC4A10ED8E7400207210 /* MainMenu.xib in Resources */,
@@ -245,6 +339,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ B62DD00511BA1F5500AD6EAB /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -258,14 +359,31 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ B62DD00611BA1F5500AD6EAB /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
+ B62DD00F11BA1F9000AD6EAB /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = B62DD00811BA1F5500AD6EAB /* SampleDesktopPlugin */;
+ targetProxy = B62DD00E11BA1F9000AD6EAB /* PBXContainerItemProxy */;
+ };
B6457E3510B058FE00A96714 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = SyncSchema;
targetProxy = B6457E3410B058FE00A96714 /* PBXContainerItemProxy */;
};
+ B6C5980811BA1AAB007CB1E1 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = ZSyncInstaller;
+ targetProxy = B6C5980711BA1AAB007CB1E1 /* PBXContainerItemProxy */;
+ };
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@@ -356,6 +474,56 @@
};
name = Release;
};
+ B62DD00B11BA1F5600AD6EAB /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
+ INFOPLIST_FILE = "SampleDesktopPlugin-Info.plist";
+ INSTALL_PATH = "$(HOME)/Library/Bundles";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ AppKit,
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = SampleDesktop;
+ WRAPPER_EXTENSION = zsyncPlugin;
+ };
+ name = Debug;
+ };
+ B62DD00C11BA1F5600AD6EAB /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
+ INFOPLIST_FILE = "SampleDesktopPlugin-Info.plist";
+ INSTALL_PATH = "$(HOME)/Library/Bundles";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ AppKit,
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = SampleDesktop;
+ WRAPPER_EXTENSION = zsyncPlugin;
+ ZERO_LINK = NO;
+ };
+ name = Release;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -377,6 +545,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ B62DD00D11BA1F5600AD6EAB /* Build configuration list for PBXNativeTarget "SampleDesktopPlugin" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ B62DD00B11BA1F5600AD6EAB /* Debug */,
+ B62DD00C11BA1F5600AD6EAB /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
View
22 SampleDesktop/SampleDesktopPlugin-Info.plist
@@ -0,0 +1,22 @@
+<?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>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
Please sign in to comment.
Something went wrong with that request. Please try again.