Files
Sparkle/sparkle-cli/main.m
T
Zorg e1b13f9c67 Add sparkle-cli tool that can update any arbitrary app
I added an application target but it's really intended to be used as a command line tool. The reason being was that it was the easiest way to bundle the Sparkle framework, I've found.

Note this doesn't work perfectly yet, but it's a good start. Trying to update anything that's not Sparkle based will crash for instance. And it will use the installer progress tool which may be undesirable.
2016-04-11 01:29:08 -04:00

35 lines
855 B
Objective-C

//
// main.m
// sparkle-cli
//
// Created by Mayur Pawashe on 4/10/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "AppDelegate.h"
int main(int argc, const char *argv[])
{
@autoreleasepool
{
if (argc != 2) {
printf("Usage: %s <path to bundle to update>\n", argv[0]);
return EXIT_FAILURE;
}
AppDelegate *delegate = [[AppDelegate alloc] initWithBundlePath:argv[1]];
if (delegate == nil) {
printf("Error: Failed to initialize sparkle. Is the bundle you specified valid?\n");
return EXIT_FAILURE;
}
NSApplication *application = [NSApplication sharedApplication];
[application setDelegate:delegate];
[application run];
}
return EXIT_SUCCESS;
}