Sparkle冻结"正在安装更新..."

Sparkle Freezes on "Installing update..."

I'm trying to implement Sparkle in a brackets-shell application. I believe I have everything set up properly, but it seems to fail.

It will run through the update, find the update, get it ready and then when I hit the "Install and Relaunch" button, it will sit on the "Installing update..." screen indefinitely.

I thought that perhaps it was brackets-shell not wanting to close out its last child, so I tried to implement the updaterWillRelaunchApplication delegate method. I tried adding it right before the function which I call to check for my updates, like this:

@implementation NSObject (SUUpdaterDelegateInformalProtocol)
- (void)updaterWillRelaunchApplication:(SUUpdater *)updater {
    NSLog(@"Closing properly");
    // code to close properly
}
@end

However, I never see that log message called, which I'm assuming means my delegate isn't being called.

So, I basically have two questions:

  • Am I implementing the delegate properly? I'm a complete XCode novice, so I just know it looks about like what the examples I saw online were, and it compiles. Does it matter where I declare the delegate?
  • Any idea why Sparkle might be freezing if it isn't because its exiting improperly?

Thanks.

Update

I've discovered a very odd and interesting behavior. If I don't have any of the windows (my app window or the Sparkle window) focused when it finishes the update, it will work completely fine. If I have either focused, what happens is my main window will close (like it's trying to restart), but the Sparkle window stays open. I then have to right-click and close the app.

However, if right after I hit the "Install and Relaunch" button I flip over to another application (like Chrome), it will go through just fine in the background. It seems that Sparkle won't close itself if it has focus. Very odd.

As kind of a workaround, I manually set the "enable automatic updates" to true so it does everything without that final window, which works... but isn't really ideal.

I had a same issue like you have.After some head scratching moment i found out that inside sparkle.framework -->Resources-->Autoupdate. when i saw the contents it didnt have the Autoupdate as executable(Contents-->MacOS-->Autoupdate). After make it as executable it relaunched perfectly.