mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
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.
35 lines
855 B
Objective-C
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;
|
|
}
|