使用mac的sparkle框架自动或无提示更新

时间:2014-08-06 06:17:37

标签: macos sparkle

我正在尝试使用Sparkle框架对我的mac应用程序进行自动或无提示更新,并在我的info.plist中将关键字SUEnableAutomaticChecks添加到YES。我在AppController中编写代码如下:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    //Sparkle auto update
    SUUpdater *sparkleUpdater = [SUUpdater sharedUpdater];
    [sparkleUpdater checkForUpdates:self];
    sparkleUpdater.delegate = [[NRMUpdateDelegate alloc] init];
    [sparkleUpdater setAutomaticallyChecksForUpdates:YES];
    [sparkleUpdater setAutomaticallyDownloadsUpdates:YES];
    [sparkleUpdater checkForUpdatesInBackground];
}

我仍然在获取更新程序窗口以更新安装新版本。我想在后台做所有这些。

任何人都可以建议我怎么做....

1 个答案:

答案 0 :(得分:0)

根据文档,

[sparkleUpdater checkForUpdates:self];

/*!
    Explicitly checks for updates and displays a progress dialog while doing so.

    This method is meant for a main menu item.
    Connect any menu item to this action in Interface Builder,
    and Sparkle will check for updates and report back its findings verbosely
    when it is invoked.
 */