Commit Graph
157 Commits
Author SHA1 Message Date
Andy Matuschak 2dfa8e0982 In an attempt to improve 10.3 support, I've added a new build configuration: Release (GC-support; 10.5-only). Compile with this if your app uses garbage collection. The normal Release configuration will compile 10.3-compatible-y with no GC support. sparkle-1.5b1 2008-05-31 22:53:56 -07:00
Andy Matuschak 1cab1cb203 Fixes bug 228455
Added a sample appcast showing how things work and demonstrating a couple more complicated features. I may fill this out more later.
2008-05-31 00:22:46 -07:00
Andy Matuschak 5c32832eed Fixes bug 228446
Finally adding real delegate support. The following methods are implemented; the comments document them.

If you have suggestions for other methods that would be useful, feel free to suggest them.

// Use this to override the default behavior for Sparkle prompting the user about automatic update checks.
- (BOOL)shouldPromptForPermissionToCheckForUpdates;

// Implement this if you want to do some special handling with the appcast once it finishes loading.
- (void)appcastDidFinishLoading:(SUAppcast *)appcast;

// If you're using special logic or extensions in your appcast, implement this to use your own logic for finding
// a valid update, if any, in the given appcast.
- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast;

// Sent when a valid update is found by the update driver.
- (void)didFindValidUpdate:(SUAppcastItem *)update;

// Sent when the user makes a choice in the update alert dialog (install now / remind me later / skip this version).
- (void)userChoseAction:(SUUpdateAlertChoice)action forUpdate:(SUAppcastItem *)update;

// Sent immediately before installing the specified update.
- (void)updateWillInstall:(SUAppcastItem *)update;

// Return YES to delay the relaunch until you do some processing; invoke the given NSInvocation to continue.
- (BOOL)shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update untilInvoking:(NSInvocation *)invocation;

// Called immediately before relaunching.
- (void)updaterWillRelaunchApplication;
2008-05-31 00:13:38 -07:00
Andy Matuschak ebb1f01735 Removed the checkInterval IV and factored out its assignment to a checkInterval method in SUUpdater. Now when future updates are scheduled after an initial one exits, they'll use the current interval. 2008-05-30 22:38:33 -07:00
Andy Matuschak 57b5a17a0a Fixed some formatting stuff. 2008-05-30 22:31:47 -07:00
Andy Matuschak 49cfd57682 Fixed a confounding bug that somehow slipped in: when an update check was aborted, I was calling -automaticallyUpdates to determine whether I should reschedule another update check.
This is dumb, because that method denotes whether the user's chosen to automatically update to available new versions.

Now it does the right thing.
2008-05-30 22:27:00 -07:00
Andy Matuschak 43ee59357d Fixes bug 236235.
Sparkle now gies visual indication that it's checking for updates when hte update's user initiated. ie: it pops up a status controller saying "checking for updates..."

What was SUUserInitiatedUpdateDriver is now SUUIBasedUpdateDriver; SUUserInitiatedUpdateDriver now is a subclass of that, along with SUScheduledUpdateDriver. This is a happy little refactoring that let me remove some redundant code.
2008-05-30 22:15:24 -07:00
Andy Matuschak 8b3d15b306 Moved the check for whether the host is running from a disk image to SUBasicUpdateDriver so that all drivers could take advantage of this check. 2008-05-30 21:51:34 -07:00
Andy Matuschak 21b4aeeb3b Fixes bug 228454.
Added support for a SUPublicDSAKeyFile, so people don't have to copy/paste their entire DSA public key into their Info.plist.

Basically: specify a filename in your Info.plist under the key SUPublicDSAKeyFile, and Sparkle will look for a file of that name in the app's resources directory and load its contents to use as the DSA public key.
2008-05-30 21:46:08 -07:00
Andy Matuschak 6f3d124868 Fixing bug 228469:
Now if the developer sets a value for SUEnableAutomaticChecks in Info.plist, we assume that's a good default value to take, and we don't ask the user what he wants to do on startup. If he doesn't specify any preference of his own, we take the Info.plist value to be the canonical one.
2008-05-30 21:34:23 -07:00
Andy Matuschak de7db2d716 Sparkle now works correctly with LSUIElements: it focuses them before displaying the update alert. This fixes bug 228471. 2008-05-30 21:23:56 -07:00
Andy Matuschak fcaf871636 Oops, fixing a problem with revision 133, which added fancy version labeling scripts. Now we add /usr/local/bin to the path as well. We still don't fail gracefully if we can't find bzr because I can't figure out how to do that. Hm... 2008-05-30 21:09:12 -07:00
Andy Matuschak a66d40e035 Changed from CFPreferencesCopyValue to CFPreferencesCopyAppValue (the recommended function) so that Sparkle can now get global preferences. This fixes bug #228457. 2008-05-30 19:43:36 -07:00
Andy Matuschak a418c8093f Fixed a bug where the update alert would report the internal version number of the update instead of the human-readable one (CFBundleShortVersionString, when available). Thanks for pointing that out, Daniel! 2008-05-30 14:14:29 -07:00
Andy Matuschak b07190a7f6 Adding automagic bzr version numbering (ooh so shiny!) 2008-05-29 23:26:32 -07:00
Andy Matuschak 2f953611db Closing two units-related bugs: 231767 and 231598. Units now display in appropriate magnitudes (mb, kb, etc) and also in correct caps.
Thanks to Jonas Witt for the patch!
2008-05-22 22:59:06 -07:00
Jonas Witt 487c8a389d updated the '%@ of %@' string in all localizations
added kB/MB in german (trivial)
added kB in russian
2008-05-18 14:28:28 +02:00
Jonas Witt ce94db5e4e made byte units localizable, updated english strings file 2008-05-18 14:18:49 +02:00
Jonas Witt a0ee0f3f5b added formatted file size output 2008-05-18 13:07:42 +02:00
Andy Matuschak 6d8f5be18c Merging in David Smith's branch to fix bug #230123. We now copy the relaunch tool out of the host before installing the update; that way, we can use the old version's tool. This insures us against future changes in the relaunch method. 2008-05-15 10:58:49 -07:00
David Smith 93de812aeb At Andy's suggestion, don't bother with overly paranoid fallback behavior. If we can't copy to NSTemporaryDirectory(), something is very very wrong and we should bail. This greatly simplifies some things and lets me clean up the copy of relaunch once it's done. :) 2008-05-15 00:49:54 -07:00
David Smith f1198d8167 Actually works now, but leaves one leftover copy of relaunch in NSTemporaryDirectory() 2008-05-14 22:48:19 -07:00
David Smith c722b09ba6 Merge in trunk 2008-05-14 21:42:38 -07:00
Andy Matuschak e208b1ac42 Fixes bug #230451: all the new headers are now public in the Sparkle target. Sorry about that! 2008-05-14 14:38:14 -07:00
Andy Matuschak d06b2f5dad Fixes bug #228449: now the appcast doesn't run the RSS feed fetching in another thread; it just uses NSURLConnection's asynchronous capabilities (which don't leak memory like the synchronous methods) and some delegate methods. 2008-05-14 14:33:00 -07:00
Andy Matuschak ce43721233 Fixing bug #230347: "If automatic checks is off, check for updates is triggered and then remind me later is checked, the dialog keeps coming back" Thanks, Scott Gruby! 2008-05-14 09:56:53 -07:00
David Smith 55690853a7 OK, so aux executables don't work in frameworks. Who knew? :) 2008-05-14 00:11:28 -07:00
David Smith 3852809c7b Initial work on copying the relauncher to NSTemporaryDirectory() 2008-05-14 00:00:14 -07:00
Andy Matuschak 25d1c54766 Merging in David Smith's spotlightfixes branch, which fixes #2 of bug #228484: "Force Spotlight to index the new app (for people who use it as a launcher) by running mdimport with NSTask." 2008-05-13 23:40:21 -07:00
David Smith 072a73b375 Run mdimport on bundles after installing them 2008-05-13 23:31:58 -07:00
Andy Matuschak 8dfd93e1c3 Made the error displayed on download failure human-friendly. 2008-05-13 22:29:56 -07:00
Andy Matuschak 49f717c1b1 Fixes #230173 by removing partially downloaded files on download error.
Sparkle no longer leaks the NSURLDownload if the download fails.
2008-05-13 22:25:56 -07:00
Andy Matuschak 7c709cb9fe Fixing #228470; SUUnarchiver now makes its delegate calls on the main thread instead of unsafely performing them on the alternate thread. 2008-05-13 18:01:22 -07:00
Andy Matuschak ff5001fe41 Changed calls to longValue to calls to doubleValue; using the former is potentially a problem when something's saved as an NSString when we expect an NSNumber. This'll handle both cases. 2008-05-13 15:41:25 -07:00
Andy Matuschak a39f0cfd00 Oops! Removed all the localized .nibs I just deleted from the Xcode project so that Sparkle will actually, you know, compile. Also added Test Application/main.m back in; it somehow didn't make the transition. 2008-05-11 17:47:06 -07:00
Andy Matuschak 62946680b4 Sparkle now migrates SUCheckAtStartup preferences from pre-startup-refactoring. Thanks to Jonas Witt for the patch. 2008-05-09 10:26:22 -07:00
Andy Matuschak 95ec8936e9 Added string files for current translations of nibs and removed all nibs for non-English localizations so that Sparkle doesn't freak out and crash on them. 2008-05-08 23:53:22 -07:00
Andy Matuschak 1264a6b3a7 Sparkle now finds the newest update in an appcast for which the host meets the minimum system requirements. This fixes bug 228485. Thanks to Stuart Morgan for the patch. 2008-05-08 23:44:48 -07:00
Andy Matuschak 80721a028d Initial conversion from SVN 2008-05-08 18:18:39 -07:00
andym 1e0496af72 Now SUUpdater removes itself as an observer of an update driver before it releases it. 2008-05-08 16:41:22 +00:00
andym ea6661c4da Added 2008 iMac to the model translation list. 2008-05-08 07:23:12 +00:00
andym bc3be9a1f2 Touched practically every line of code in a super-monster-awesome refactoring. Please read:
- Broke out SUUpdater functionality into update drivers. There's a basic one from which everything else inherits, then a user-initiated one, an automatic one, and a scheduled one. It's super-clean-and-shiny.
- Destroyed the abomination that was SUStatusChecker. In its place is SUProbingUpdateDriver, which is like 10 lines long.
- Made automatic installation less stupid. It used to install, THEN offer to relaunch. That's dumb, beacuse if the user says no, the app is running from the trash. Now it offers to install and relaunch or to install on quit.
- Renamed like every method and symbol. I hope you didn't branch anything.
- Reorganized the project hierarchy to be much clearer and easier to navigate.
- Reworked the error system to no use NSError instead of exceptions; extra technical information is now logged to the console so that we can find problems.
- A bunch of other small bugfixes in things I noticed along the way but no longer remember.
- Probably a ton of other stuff.
Read over the code and see what I've done. Then PLEASE test this with your app internally and let me know how it goes. This revision is hereby NOT YET DECLARED SAFE FOR PUBLIC RELEASE. But because I'm still using SVN, this is how things have to be.
2008-05-08 07:12:41 +00:00
andym 0e997002d1 Added fetching of CFBundleName as a fallback for CFBundleDisplayName in -[NSBundle(SUAdditions) name].
Fixed an uninitialized variable.
Fixed autorelease pool errors during installation thread.
Fixed error including SUInstaller.h from host app.
Patch courtesy Ben Kazez.
2008-04-29 05:10:20 +00:00
andym 6147f96af1 Because we use CF calls to update user defaults for the sake of bundles, our synchronize calls don't cause NSUserDefaultsControllers to update. I can't totally fix this for non-app bundles, since there's no way I know of to get an NSUserDefaults object for their defaults, but this patch will fix things for apps.
Thanks to boredzo for reporting the bug.
Fixes #185.
2008-04-22 02:37:15 +00:00
andym 0b5a6b2321 Moved some update alert things into bindings for code simpliciation.
Removed the frame saving feature from the update alert, as it was causing bugs and didn't seem particularly useful.
Fixes #164; thanks to Adam Radestock for his help.
2008-04-17 02:26:50 +00:00
andym 05bbafcc01 Doh added missing unit test info.plist. Sorry, guys. 2008-04-17 00:30:54 +00:00
andym db443909ed Finally added unit tests.
For now, covering only version comparison.
Actually found and fixed a bug that made 1.0b1 < 1.0a1
Feel free to add more tests.
2008-04-16 13:34:45 +00:00
andym 49e3d819bf Major refactoring, yay.
Moved out installation phase to separate classes, separating packages and flat-file installs.
Made the DMG cleanup less horrifying.
All-around prettification.
This may or may not break the world; please let me know.
2008-04-15 15:22:18 +00:00
andym 0e3ad17435 Removed an extraneous build phase that was necessary for relaunch.app and which may have been causing problems for people. 2008-04-08 02:18:12 +00:00
andym b010f1aaf0 Removed extraneous source file I forgot about.
Fixed a stupid error in the last build which prevented Sparkle from actually, you know, working.
Also, revision 144 is a patch courtesy Cedric Luthi; many thanks to him for a great contribution.
2008-04-04 16:00:50 +00:00