Autoupdate.app can crash in the middle of installing an update, leaving
the user with a broken application. The crash is caused by the status
window’s controller (SUStatusController) being prematurely deallocated
before the window is closed. This change prevents such a crash by
keeping a strong reference to the SUStatusController in
TerminationListener.
Don't delete the log file and log app name to it when only checking for
updates - this is something done frequently, on many apps' startup.
Instead, clear the log before writing the first entry to it, so that it
stays untouched if there's nothing to add to it.
Log the application name before the first "real" log entry, instead of
doing it unconditionally every time checkForUpdatesWithDriver: is called.
This way, we don't rely on automatic scheme creation in Travis, nor do
we have to update the Makefile for Travis if we want to add an
additional test target to the project.
Also, Travis should now build all targets (including BinaryDelta and
Sparkle Test App), giving us better build coverage.
This helps ensure that all code paths are compiled during development, reducing the chance of build errors (especially in CI). Additionally, developers can change these values without having to rebuild Sparkle (but it is still safe because modifying the plist will break the code-signing seal).
I think the test framework saw `setTestFeedURL` as a setter. This change changes it to `testSetTestFeedURL`, which will run as a test.
And for some odd reason, crashes.
* 'ARC' of https://github.com/MaddTheSane/Sparkle:
Fix a release bug.
Force Xcode to use spaces on source code files.
Convert Sparkle to ARC, take three.
They’re faster, even if they’re used outside of ARC.
Use dispatch functions to spin off new threads.
Update the Binary Delta tool's class to be better.
This is only true because we’re targeting x86_64 on OS X. The same is true for all iOS architectures, but not i386 on OS X.
Use CFBridgingRelease in a few places: it acts just like [(id)CFMakeCollectable(obj) autorelease] on non-ARC code, but is a bit cleaner.
Getting rid of unneeded parentheses.
Remove more pre-10.7-only code.
Add comments.
More property declarations.
Make SUUpdatePermissionPromptDelegateInformalProtocol a protocol with the name SUUpdatePermissionPromptDelegateProtocol.
* pull/295/head:
Quiet a warning caused by using a non-constant template format string.
Take care not to attempt copying the finish_installation.app unless we have actually succeeded in locating it. In the strange scenario that the finish_installation.app was not present in the Sparkle bundle, the target path was evaluated as being the host app's Application Support folder itself, and Sparkle would proceed to completely wipe out the host's Application Support folder as it tried to copy the non-existent
Conflicts:
SUUIBasedUpdateDriver.m
* origin/quiet-automatic-update:
Allow manual checks when an install on quit update is pending
Allow the delegate to trigger a silent install and relaunch
Support silent relaunches
Increment the sudden termination counter if installing on quit
Set up install on quit for critical automatic updates too
Updating Sparkle.strings for the new, more strongly worded strings that are displayed for a 'critical update'
Prompts the user to update after a week (rather than a day) if he doesn't quit the app.
Adding <sparkle:tags> appcast item element, <sparkle:criticalUpdate /> tag
Fixed a no-autorelease-pool leak.
We have this check box that says "Automatically download and install updates in the future." But we only download them automatically. We still ask permission again before installing them.
Conflicts:
SUBasicUpdateDriver.m
en.lproj/Sparkle.strings
finish_installation.m
* vslavik:
Disable -Werror in release builds.
Another Werror to remove
Need to turn this -Werror off too
Build only active ARCH (at Xcode5 suggestion)
Clang errors when format strings expected but aren’t provided
Setting Deployment Target 10.7 globally
Removing unneeded GC configurations
Removing GC target
remove SDK
Conflicts:
Configurations/ConfigFrameworkReleaseGCSupport.xcconfig
SUUIBasedUpdateDriver.m
Sparkle.xcodeproj/project.pbxproj
* blackpixel:
Fixed issue with icon
New icon
Updated icon.
Switched the icon to be representative of the app. We'll want to find a better way of doing this once we have multiple apps pointed at this repo.
fixed a 'content rectangle not entirely onscreen' warning
updated sends system profile to use info.plist if user defaults key isn't present
Support for notifications on some updater events
Fix warnings
fixed the Debug App Store configuration.. it was misnamed and causing a build error.
fixing up the xcode configs to match ours for simpler building
Conflicts:
Sparkle.xcodeproj/project.pbxproj
Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme
th.lproj/Sparkle.strings
* uliwitness:
Revert "Switch off secure updates for now"
Shut up all of Xcode's complaints.
Don't look at error variables if result says success.
Less warnings.
Shut up some warnings & make build with newer Xcode.
Less unsafety with format strings.
Switch off secure updates for now
Quick hack to make this build again. Should probably just move to Sparkle mainline, now that they're halfway current.
Satisfy some overly picky compilers.
Make this build on 10.7. Might break building on earlier OSes.
Removed the pt_PT localization from Uli's branch, since it was largely untranslated, and used the one from master instead.
Fixed layout of localization XIBs
we use *.pkg installer and restart system in the installer.
In this case, "Application Support" directory is corrupted
by unnecessary pkg files.
We need to scan files under "Application Support" directory
and examine whether pkg file or not.
It is quite annoying.
Therefore, this patch changes location of
finish_installation.app and pkg files to
"~/Library/Application Support/APPNAME/.Sparkle".
Then, we can remove finish_installation.app and pkg files
certainly.
-[SUHost installationPath] can return different values before and after
the installation is performed, because it may attempt to normalize the
installation path--but only if the normalized version of the path isn't
already present. Which it would be after the installation had completed.
Now we only compute the installation path once for the whole installation
process.
Thanks to Mattt Thompson (@mattt) for tag-team-ing this with me.
With this change, if your app deploys only to 10.6+, then you can
dispense altogether with the DSA signatures on future updates to your
application: just make sure the "to" version satisfies the "from"
version's Apple code signing requirements. Most of you are probably
already doing that, and if you're not, you should be anyway.
Specifically, Sparkle validates the designated requirement of the "from"
version against the "to" version. By default, as of this writing, that
means that the bundle identifiers must be the same, and that the leaf
certificate of the signature is the same. So if you keep code signing
your app with the same cert, Sparkle will Just Work without any
additional DSA signature nonsense for you to deal with.
Traditional Sparkle DSA signatures will still be honored.
This support has only been extended to updates to the main app bundle.
If you're updating some other bundle, you will have to use DSA signatures
to secure your updates in the future.
***IMPORTANT: previously, Sparkle considered an update "safe" if both the
appcast and update were distributed over https. That is nowhere near as
strong a verification measure as code signing or the old-school DSA
signatures, so with this change, support for unsigned, https-distributed
updates has been removed. If you're targeting 10.6+, start code-signing
your apps if you haven't already, and everything will be fine. If you're
targeting earlier OS Xs, you'll need to start adding DSA signatures to
your appcasts. When you link this changed version of Sparkle into your
app, it will warn you on launch if you are not code signed and do not
have a DSA public key specified in your Info.plist.
The SUDiskImageUnarchiver shouldn't know about UI, and besides,
it's important that update drivers which should not display UI (like
the automatically-installing and probing drivers) should not display
password prompts.
External entities are no longer parsed in appcasts: pre-10.7, we use the
"tidy" option for XML document parsing, which happens to behave this way,
and in 10.7+ we use a new explicit option for this behavior.
This is useful for situations like a background app that updates a
parent preference pane but wants to maintain defaults in the background
app's domain.
When merging Uli Kusterer's branch, we left enabled a preprocessor flag that would disable DSA checking and downgrade prevention. That should not have been merged into master. My apologies to the community for not noticing this sooner.
These fixes remove the use of the File Manager API that was causing crashes on Lion. This should resolve issue #827357. We are now using NSFileManager instead of the older File Manager API, but only on 10.6 and later. These changes should work for those targeting 10.4, but will allow users running 10.7 to still update without crashing.
You would use this like:
<item>
<title>My great update</title>
...
<sparkle:tags>
<sparkle:criticalUpdate />
</sparkle:tags>
</item>
The behavior of this tag presently is: rather than waiting for the user to quit the app (or for some large amount of time to pass), the user will be prompted to install the update (with a stronger message) immediately upon its receipt. This behavior could be improved for the manual update case as well.
We can also use this new mechanism to create special behavior for e.g. paid updates.
With this patch, we make good on the description of that box: updates are automatically installed when the app is quit. No user intervention involved whatsoever if they checked that box.
If the user doesn't quit the app for a day after the update is downloaded, we'll show the dialog we've always used for automatically downloaded updates (Install Now / Install on Quit / Skip This Update).
Highlights:
- appcast entries with a "new version" but without a download (paid updates, update notification for users of dropped HW)
- installation now happens in a tool, rather than in the app being replaced
- Sparkle-related logs now separated into a separate file ~/Library/Logs/SparkleUpdateLog.log for easier QA/triage
- tons of small bug fixes
- more details at https://github.com/andymatuschak/Sparkle/pull/18
According to openssl documentation EVP_Verify should be accompanied by
calls to EVP_MD_CTX_init and _cleanup to avoid memory leaks. Not sure, but
adding for conformity's sake.
According to FIPS 186-2 standard DSA keys should be >= 512 and <= 1024 bits.
Using a 2048 bit key on my system yields an openssl error in Sparkle's
SUDSAVerifier and causes the update to be rejected.
The error says (can be read only after hacking on Sparkle's code):
error:0A071066:dsa routines:DSA_do_verify:bad q value
bsdiff-produced patch is included in xar archive, where it's compressed
with bzip2 a second time. Leaving the bsdiff output uncompressed makes
it possible to compress it better in xar (e.g. using LZMA2 or gzip,
either of which performs better on some files).
Changes header signature of bsdiff patch file to BSDIFN40 to clearly
mark the format as different.
Backward compatibility is preserved, bspatch can read both BSDIFF40 and
BSDIFN40 formats.
Delta updates code uses libxar, which is only available in 10.5+, and
Sparkle framework fails to load on 10.4 because of it. Instead of having
hard dependency on libxar, Sparkle now links with it weakly and checks
for its availability at runtime. This required bumping Xcode project
compatibility to 3.2 to get weak linking support.
With this change, delta updates are still not supported on 10.4, but
Sparkle runs there again and just ignores the deltas. This should be
good enough given 10.4's age and shrinking user base.
- It made bracketed build numbers look like components of the version, which gave wrong results
- Added a test for one such broken build-numbered version number
TODO: Tests currently fail for Patrick's version numbers. Will have to write a smarter parser, or split this into two version comparator classes.
- We now correctly handle the case where the containing directory doesn't allow us adding files without authorization (e.g. /Applications).
- We do the quarantine release *before* the copy.
long installations have a program in the Dock
short installations just look like the program is restarting
some variable renaming to no longer have camelCasePath for char *
added SystemConfiguration.framework to Sparkle
added SUWindowController.m to finish_installation_tool
added SUStatusController.m to finish_installation_tool
now compiles Sparkle. Now going to fix the testbuild
- It contains its own copy of Sparkle.strings and SUUpdateStatus.nib so it can show its progress prettier
- We call TransformProcessType() before our first call to [NSApplication sharedApplication], so we can be launched as a command line tool and get a proper window server connection, and so our progress bars animate.
- We still support the old "relaunch"-style mode of operation, just by not passing the folder to install. This is useful for other relaunch occasions, like setting one's own dock icon flag.
- To do: Make sample app use the new finish_installation.
- Changed NTSynchronousTask to also give the status return value and direct stderror output to the outputData.
- Changed includes so this builds as part of an app, too, not just as a framework
- Made sure SUAppcast's dealloc releases some leaked ivars.
- Added infoURL, extracted from link, that can point to a "more Info" page for download-less URLs
- Added support for version attribute on item so we can support update notifications that don't include an enclosure (e.g. paid upgrades, or upgrades that would require a system update)
- Added/improved a few description methods to ease debugging.
- Added SULog so one can ask for a special log with additional information when there are update issues.
- Added mayUpdateAndRestart for apps that absolutely, positively can't restart right now (e.g. cuz they're burning a CD and would produce a coaster).
- Added updaterWillRelaunchApplication delegate method, analogous to the notification. Useful to have app delegate quit helper apps during installation.
- Made SUBasicUpdateDriver's abortUpdate implicitly retain/autorelease the update driver, because the notification center otherwise releases it and it goes away, causing crashes in superclass's abortUpdate.
- Merge of SUKeepDownloadOnFailedInstallKey and SUFixedHTMLDisplaySizeKey.
- Avoid a few warnings about missing prototypes
- Be paranoid, hdiutil can verify the download again, so let it. Better for internal apps where we turn off DSA checks, too.
- SUHost has an -installationPath now, independent from the bundlePath, so one can normalize the app name from "MyApp 1.1b4" back to "MyApp" Users assume the file name contains the correct version number when there is one in it. Saves support a few round-trips each time.
- Be better at threading: Try calling non-thread-safe methods on main thread only, and don't assume delegates know when they need to be thread-safe, call them on main thread where possible.
- Added a method to put the old copy of the app in the trash. 1.5git changed in this spot, so I didn't actually merge the code that uses it back in yet.
- Fix version comparison so it doesn't get confused by bracketed build numbers in version strings
- Make sure cancel button is disabled during extraction, otherwise user would crash.
- Don't put auto-update window at floating window level. It's huge and can't be switched to background! If you're an NSBGOnly where you need that, turn it on only in that case, but don't generally do such nonsense.
- Hide release notes view if there aren't any.
- Test whether we are on dial-up before checking for updates in background. It's not nice to cause (possibly expensive) dial-up periodically.
- Temporarily comment out DSA complaints for easier testing.
- Don't store (possibly already invalidated) one-shot NSTimers in an ivar. It's bad style. Retain it instead.
- Decompress some monster expressions with nested method calls in ternary operators and nested in method calls again.
- Don't use implicit "id" for params or return types.
- finish_installation now puts up a progress window, so user knows update is still not finished.
- Use ThreadSafePreferences (included dummy version that uses regular prefs for projects that don't use ThreadSafePreferences).
- Todo later: Change finish_installation to be prettier.
for quit, updates and relaunches the app, so
updates don't happen while app is still running.
NSBundle gets royally confused and points to the
old path (loading new NIBs into the old app in the
worst case) when you move a running app.
- Temp folder is now user's desktop, as
NSTemporaryDirectory() doesn't stay the same
between two separate apps, and may be emptied on quit.
- Relaunch gets created in App Support now, for
same reasons as above.
- Less dependency on prefix headers, that only leads
to lazy, un-reusable code.
- changed some #include to #import
- fixed some NULL -> nil Cocoa coding conventions
- added new compiler warnings and fixed some warnings they generated
- check for nil from NSTemporaryDirectory
- added missing files to unit test and test app targets
- added xcconfig files for unit test target
- added @private to some ivars
- changes some variables from signed to unsigned as appropriate
- changed from base 2 to base 10 measurements of file size, consistent with both the actual meaning of metric prefixes and Apple's new policy as of 10.6
- reduced some unneeded copy-paste of code
- fixed failure to check for null from malloc and unneeded check against null before calling free
- OSErr was incorrectly used instead of OSStatus
- added some consts & statics to global strings
- fixed some issues discovered by static analysis
- fixed some 64bit issues, mostly related to casting and the use of slightly incorrect types/sizes
- some dealloc methods were using accessors, changed to access ivars directly, as per Apple guidelines
- removed old NS_DURING, NS_HANDLER, NS_ENDHANDLER macros
- fixed a bug where immutable data was being mutated
- removed all instance of "== YES" as they are dangerous
- removed some redundant nil checks
- fixed some leaks
- conditionally replaced deprecated method usage
- cleanup CF/NSMakeCollectable usage
- fixed bug in GC where memory could be collected too early due to lack of strong references when using UTF8String
- prevent passing null to CFRelease
Bug #389869: "Sparkle runs thread-unsafe code on secondary threads"
Bug #312995: "Canceling authentication request causes crash on next update"
Bug #388793: "Need to notify SUUpdateDriverFinishedNotification on main thread"
The unfortunate side-effect of this fix is that all the file-handling code is now CoreServices-based, since NSFileManager is not thread-safe. This is disgusting and will be stricken from all records when installation is performed by relaunch in Next Major, as it should have been in the first place.
There's slightly less concurrency as a result as all archiving operations are now performed
serially on the main thread. Since these make up a small percentage of the overall runtime,
the increased portability makes this a reasonable tradeoff.
the delta updates that are available for a given version.
The appcast would look a little something like the following:
<enclosure url="http://you.com/app/Your Great App 2.0.zip" sparkle:version="2.0" length="1623481" type="application/octet-stream" sparkle:dsaSignature="BAFJW4B6B1K1JyW30nbkBwainOzrN6EQuAh" />
<sparkle:deltas>
<enclosure url="http://you.com/app/Your Great App 1.5 to 2.0.delta" sparkle:version="2.0" sparkle:deltaFrom="1.5" length="642381" type="application/octet-stream" sparkle:dsaSignature="MCa1JyW30nbkBwaC0CFBfeinOzrN6EQuAh=" />
<enclosure url="http://you.com/app/Your Great App 1.4 to 2.0.delta" sparkle:version="2.0" sparkle:deltaFrom="1.4" length="928231" type="application/octet-stream" sparkle:dsaSignature="B6B1K1JyW30nbkBDBfeinOAszrN6Ea1JyW3" />
</sparkle:deltas>
The delta file is a custom format created from the xar container format. It describes the necessary
modifications to transform the contents of the old directory in to the contents of the new. Binary
diffs are used to compress the differences between large files such as Mach-O binaries. The binary
diffs are generated by bsdiff and applied via bspatch, both from bsdiff 4.3, the source of which is
included and used under a BSD-style license.
Thanks to Hofman for the patch! Now the update cycle will be started once the SUUpdater instance is instantiated; bundles no longer need to expressly start the update cycle.
This one's a little experimental. Credits to Hofman for the patch. This changes the appcast fetching over to NSURLDownload from NSURLConnection. Test, please!
Sparkle is now willing to install a bundle in the archive with the same bundle identifier as the running app as a fallback strategy.
Thanks to Jim Turner for the patch.
Sparkle is now installing .pkgs by launching Installer.app with open instead of NSWorkspace; the latter resulted in strange window ordering. Thanks to Peter Speck for the patch.
When determining LSUIElement status, Sparkle now asks the process manager instead of checking Info.plist; this'll support apps that change their LSUIElement status at runtime.
This patch prevents malicious downgrades, which are still possible with DSA validation: suppose there's some (signed) version with a security hole. A malicious attacker could serve an appcast with that version's URL and DSA signature, but a higher version number, forcing the user to "upgrade" to the version with the security hole.
While I was at it, I fixed a bug that should have completely stopped .pkg installation from working since 1.5b1. Why didn't I hear anything about that? Does anyone actually use .pkgs? It still needs testing to be sure it works.
I included some scripts to help you along, though. IANASG (I Am Not a Security Guy), though, so if you know your shit, feel free to do it on your own as before.
Added backwards compatibility support for Sparkle 1.1's behavior of disabling automatic updates when the check interval was 0.
Sparkle will now properly reset the update cycle when setAutomaticallyChecksForUpdates or setUpdateCheckInterval is called for non-.app bundles.
SUUpdater now implements two new keys: "automaticallyDownloadsUpdates" and "sendsSystemProfile".
Here's the current state of the setting keys, as documented by Christiaan Hofman:
* UserDefaults through SUUpdater accessors with default value in Info.plist:
SUFeedURL
SUScheduledCheckInterval
SUEnableAutomaticChecks
SUSendProfileInfo
SUAutomaticallyUpdate
* Info.plist only (app settings):
SUShowReleaseNotes
SUPublicDSAKey
SUPublicDSAKeyFile
SUExpectsDSASignature
SUEnableSystemProfiling
* UserDefaults only (private persistent state):
SUHasLaunchedBefore
SUSkippedVersion
SULastCheckTime
SULastProfileSubmitDate
This revision also corrects a compilation error from r285.
Refactoring some code through new simplified "objectForKey" and "boolForKey" methods on SUHost which abstract the behavior of a user defaults preference defaulting to an info.plist setting. Thanks to Christiaan Hofman for the patch.
Sparkle now requires custom feed parameters to include a "displayKey" and "displayVersion" key. These will be displayed to the user in the initial permission dialog so that he knows what he's getting.
Sparkle will now clean up the hsot app's name and version before sending it as the user agent string; some non-ASCII characters were causing problems before.
Additionally, Sparkle now uses the bzr revision encoded in the framework's CFBundleVersion as the version it sends for itself in the user agent string; before this value was hardcoded, which was dumb.
When checking to see if an app is an LSUIElement, Sparkle now checks the info dictionary of the main bundle instead of the info dictionary of the host bundle. That didn't work at all for plugins.
Added a delegate method called pathToRelaunchForUpdater: which can be used for plugins to provide the path which should be used when relaunching the client after installing an update.
Merging in rearchitecting work done in lp:~andymatuschak/sparkle/rearchitecting. There are some MAJOR compatibility issues you'll notice if you do most non-default things with Sparkle, so please read the commit log. Delegate methods are changed and most API is private now, to summarize.
Made Sparkle.h no longer a massive multi-headed abomination: now only SUAppcastItem, SUAppcast and SUUpdater (and SUVersionComparisonProtocol because it's part of the delegate protocol) are public.
COMPATIBILITY ISSUE:
This means there's no longer a public SUProbingUpdateDriver or a checkForUpdatesWithDriver: method. Now use checkForUpdateInformation. I may change that API before release, though. I'm thinking it might be better to give the delegate the opportunity to reject a potential update instead: then you'd just call checkForUpdatesInBackground and override that delegate method to always return NO. We'll see.
COMPATIBILITY ISSUE:
Changed updatePreferencesChanged to resetUpdateCycle to give better semantics for bundle-ish apps which need to start the update cycle manually since applicationDidFinishLaunching: won't do the right thing.
Fixes from Matt Stevens:
"For background applications (menu bar, completely UI-less, etc) there are a couple of issues with Sparkle notifications:
- When prompts such as the initial prompt to enable update checking are displayed they can be hidden behind other windows since the background app is not in focus. This can cause problems, as these prompts run modally and can stop the application from functioning without the user knowing why.
- If the update notification window is displayed and the user clicks away to another application, the window disappears and there is no way to get it back since there is no other UI to cause the app to activate. In this case the update should probably operate as a standard window since it is effectively operating as the application's UI."
SULocalizedString now uses a hardcoded identifier for Sparkle instead of trying to detect it with bundleForClass:[self class]. A little more robust, a little more brittle.
Made a first crack at redifining the SUUpdater delegate protocol. Still not sure about a couple things, so please don't change your delegate methods to conform until this gets merged into trunk.
Also made the SUUpdateDrivers not have the updater's delegate as their delegate (that was really icky). Now they're just coupled with the SUUpdater, which is icky as well, but less icky, at least.
I've undone all the UTI nonsense: I don't see any reason to use it if the underlying frameworks are just going to do dumber path extension comparison that what I'm already doing. I've switched back to the tried-and-true method.
I also made SUUnarchiver* path-based instead of NSURL-based because I realized that the latter didn't make any sense given that we're only unarchiving local files.
Removed NSWorkspace+RBAdditions: we're now checking if the volume is read-only instead of specifically whether it's a disk image.
This also means the warning string changed. Sorry, localizers!
This should fix the DSA-signing-on-tar-gzs issue. Sparkle now doesn't let NSURLDownload extract .gzips for us, which was making the data being verified different from the data being signed.
This was indicative of a much greater problem! A missing comma totally broke piped unarchiving, and somehow neither the compiler nor I caught it before the release. 1.5b4, here we come...
This should fix the .tar.bz2 and .tar.gz cases. Basically, Launch Services isn't smart enough to see both parts of the extension. When it sees a .bz2 or a .gz, I assume it's a .tar.bz2 or a .tar.gz, because that's what makes sense. Don't use plain .bz2 or .gzs!
Added a delegate method:
- (id <SUVersionComparison>)versionComparatorForHostBundle:(NSBundle *)hb;
Override this to specify a custom SUVersionComparison implementor to be used.
Now removing the RSS class and and NSString+extras to be replaced by a much simpler implementation based on NSXMLDocument directly in SUAppcast! But this will probably break things for certain edge-case appcasts, so please file bugs if things no longer work for you.
Thanks to Christiaan Hofman for the patch!
* Add a target to build Sparkle API documentation using Doxygen. (Jake Petroules)
# 1.7.0
* Dropped support for OS X 10.6. Sparkle now supports 10.7 and newer (including 10.10 Yosemite) on 64-bit Intel Macs (the last 32-bit Mac was released in 2006).
* Removed use of deprecated functions (Zachary Waldowski)
* Switched to modern Obj-C runtime and new literals syntax
* Removed pre-10.7 code. (C.W. Betts)
* Use more Blocks/libdispatch code. (C.W. Betts)
* Cleaned up and improved security of `generate_keys`/`sign_update` scripts
* We have this check box that says "Automatically download and install updates in the future." But we only download them automatically. We still ask permission again before installing them. (Andy Matuschak)
# 1.5.0-beta6
* Important Changes
* Sparkle now requires DSA signatures on your updates. Check the documentation for more information on how to set that up if you don't already sign your updates. You can bypass this requirement if you deliver both your appcast and your updates over SSL.
* Sparkle will no longer display release notes located at file:// URLs, since Javascript on such a page would be able to read files on your file system.
* For security reasons, Sparkle will refuse to install updates which appear to "downgrade" the app.
* SUUpdater now implements new keys: "automaticallyDownloadsUpdates", "lastUpdateCheckDate", and "sendsSystemProfile."
* Fixed a bug that could prevent SUProbingUpdateDriver from working.
* Fixed a bug that prevented the updaterWillRelaunchApplication: delegate method from getting called.
* Fixed displaying release notes transmitted "loose" in the <description> key.
* Fixed Sparkle compilation on 10.4 systems.
* Fixed a bug that could cause window confusion if an app changed its LSUIElement at runtime.
* Added support for Sparkle 1.1's behavior of disabling updates when the check interval is 0.
* Sparkle can now handle appending parameters to URLs which already have parameters.
* If an update's sparkle:shortVersionString is the same as the host's CFBundleShortVersionString, the sparkle:version and CFBundleVersion will be presented in parentheticals.
# 1.5.0-beta5
* Important Changes!
* Made every Sparkle class private except for SUUpdater, SUAppcast, SUAppcastItem, and the SUVersionComparisonProtocol.
* There is now a single SUUpdater singleton for every host bundle; instead of -[SUUpdater setHostBundle], you can use +[SUUpdater updaterForBundle].
* Redefined the (entire) delegate protocol accordingly.
* Renamed -[SUUpdater updatePreferencesChanged] to -[SUUpdater resetUpdateCycle]. This provides better semantics for non-apps, which need to start the update cycle manually.
* -[SUUpdater checkForUpdatesWithDriver] is private. If you were using SUProbingUpdateDriver, you can now use -[SUUpdater checkForUpdateInformation] for a similar effect.
* All the user defaults keys are now private; instead, SUUpdater is KVC-compliant for automaticallyChecksForUpdates, updateCheckInterval, and feedURL.
* Reduced the size of the English-only framework by 25%.
* System profiling information is now only submitted to the server once per week; this will help normalize your statistics across users with different interval preferences.
* The feedParamatersForUpdater: delegate method now requires "displayKey" and "displayVersion" keys so that it can inform the user what's being sent.
* Added a delegate method called pathToRelaunchForUpdater: which can be used for plugins to provide the path which should be used when relaunching the client after installing an update.
* Added support for xml:lang to pick localized nodes in appcasts (for release notes, etc).
* Fixed a bug which would cause the "checking for updates" window to not disappear in certain extraordinary error conditions.
* Fixed a DSA signature checking bug for .tar.gz archives.
* Sparkle now refuses to update on any read-only volume, not just dmgs.
* Sparkle will clean up the host app's name and version before sending it as the user agent string; some non-ASCII characters were causing problems.
* Added an Italian localization courtesy Michele Longhi.
* Added a Swedish localization courtesy Daniel Bergman.
* Fixes to the French localization courtesy Ronald Leroux and Yann Ricqueberg.
* Fixes to the German localization courtesy Sven-S. Porst.
* Fixes to the Russian localization courtesy Alexander Bykov and Anton Sotkov.
* Fixed a number of issues related to archive format detection: I reverted back to extensions from UTIs.
* Focus behavior fixes for LSUIElement apps.
* The status window progress bar now animates even when indeterminate.
* Major refactorings to improve functionality for non-app bundles.
# 1.5.0-beta4
* Fixed a critical bug which prevented non-.dmgs from unarchiving properly.
* Added reporting of 64-bit capability to the profiling system.
# 1.5.0-beta3
* Added a new delegate method to SUUpdater.h to allow delegates to specify custom version comparators.
* Added a German localization, courtesy the Camino localizer team: Dominik Tobschall, Tobias Stohr, and Friedemann Bochow.
* Bug fixes:
* Fixed a serious bug which could cause a server to be DDoS'd (or the host app to crash!) if an appcast fails to be parsed.
* Fixed .tbz extraction if the archive was made with Stuffit.
* Fixed support for .tar.bz2 and .tar.gz; Sparkle has to assume the archive is a tar when it sees "bz2" and "gz"; don't use those without tarring.
* Fixed a typo which caused the shouldPromptForPermissionToCheckForUpdatesToHostBundle: method to not work in 1.5b2.
* Fixed .zip extraction on Tiger (Apple changed the UTI between releases)
* Fixed a crasher on Tiger.
* Fixed display of the default app icon when the host app doesn't have an icon.
* Sparkle now displays a sensible progress string and uses an indeterminate progress bar when the server doesn't report a file size.
* Fixed some memory leaks.
# 1.5.0-beta2
* Compatibility Issues:
* Most of the delegate method selectors have changed to scale better. See SUUpdater.h for changes; you'll likely have to make changes if you implement any delegate methods.
* If you're using .tar.gz or .tar.bz2 archives, name them ".tbz" or ".tgz" instead; Sparkle now uses UTIs for archive detection, and it's not smart about double extensions.
* I'm no longer supporting 10.3. This may or may not work on Panther—probably not.
* Sparkle's no longer built for ppc64 by default. If you want to ship that, feel free to build your own, but this saves a few hundred k.
* Enhancements:
* Sparkle now detects if the preferences for automatic update checks or the time interval change mid-cycle.
* If your product is a non-.app, you need to clue Sparkle in on the change by calling [[SUUpdater sharedUpdater] updatePreferencesChanged].
* Added a cancel to the "checking for updates..." dialog.
* Sparkle now cleans up all its litter in /tmp.
* Made SUUpdater's delegate an IBOutlet so you can hook it up in IB.
* Bug fixes:
* Sparkle no longer crashes on non-GC hosts when the user cancels an update's downloads.
* Sparkle no longer gets stuck in an inconsistent state or crashes when it can't parse the appcast on scheduled updates.
* Added the sharedUpdater method to SUUpdater, as it should have been.
* Fixed a bug where the "checking for updates..." window wouldn't go away if an error occurs while checking for updates.
* Made the dual-mode build configuration actually use the .xcconfig which builds it with GC support. (oops!)
* Fixed relaunching for prefpanes.
* Sparkle no longer fails to install updates on Snow Leopard (though there's still an issue with trashing the old version of the app, but it seems to be a 10.6 bug)
* Sparkle now handles redirects correctly under Tiger.
* Fixed the installation path for non-.app bundles.
* Fixed a bug which could crash Sparkle under non-English locales.
* Fixed a weird race condition which could cause the relaunch tool to never notice that its target relaunched.
* Fixed a bug where if the host app is inactive when an update occurs, the update alert sometimes doesn't become key.
* Minor textual fixes.
* Localizations:
* Dutch: Maarten Van Coile
* French: Yann Ricquebourg
* Spanish: Ernesto Gomez Cereijo
# 1.5.0-beta1
* The most important things to know:
* The 10.3 support is untested at best; sketchy at worst. Test with it thoroughly before you use it.
* Sparkle now asks for permission to update on second launch; don't be surprised at that. You can change that behavior with a delegate method; read SUUpdater.h for more info.
* We no longer distinguish between "check on startup" and "scheduled updates"; everything is scheduled, with the default being every day.
* The test application is using the new profiling features, but that's only for demonstration: these are off by default. More on this later.
* There are no localizations yet.
* New features:
* Sparkle now supports .pkgs. Just name the .pkg the name of the app and put in the update archive.
* Sparkle now sends optional demographic profiling information; set SUEnableSystemProfiling to YES in your Info.plist and check out the GET data sent to your webserver when fetching the appcast. More on this in the documentation. The test application has this on so you can see the behavior.
* Sparkle now supports updating non-.apps. Just call -setHostBundle: on the global SUUpdater to let it know what you're trying to update.
* Sparkle now supports garbage collection in the host app. Use "Sparkle-with-GC.framework" for that, but be aware it's 10.5-only.
* Sparkle is now 64-bit compatible, compiling both ppc64 and x86_64.
* Sparkle now supports a sparkle:minimumSystemVersion key you can set on appcast items. It does what you think it does.
* Sparkle now checks to see if the host app is running from a disk image and refuses to update if it is. (10.4+ only)
* Added support for entities in enclosure paths.
* The file size output is now formatted prettily.
* Sparkle now gives visual indication that it's checking for updates when the update's user initiated. ie: it pops up a status controller saying "checking for updates..."
* Added support for an SUPublicDSAKeyFile, so people don't have to copy/paste their entire key into their Info.plist. Set this key in your Info.plist to the filename of the key in your Resources directory.
* Added an actually maintainable codebase.
* Changes:
* Sparkle version comparison is now dramatically less stupid and verified by a bunch of unit tests. If something doesn't work the way you think it should, add a test to SUVersionComparisonTest.m
* Added a minimum to the check interval so that developers don't accidentally release their apps into the wild with 60-second test check intervals and have DOS-attack-like results. It's an hour now for release mode; feel free to change it.
* The relaunching process now uses a separate helper app, which is a much more robust method.
* Changed CFBundleShortVersionString behavior: Sparkle no longer uses Apple's about box style of displaying ShortVersionString (CFBundleVersion) when the latter is available.
* No more MD5 checking. Use DSA: it's actually secure.
* The abomination that was SUStatusChecker is dead. Use SUProbingUpdateDriver instead.
* Bugfixes:
* Fixed a huge bug with fully-automatic updating: before, if the user chose to relaunch later, the app would be running from the trash for a while. Now the buttons are "install and relaunch" or "install later."
* Sparkle forces Spotlight to reindex the updated app so that it won't keep pointing to the one in the trash.
* Sparkle trims whitespace from around DSA signatures; this could cause crashes before.
* Fixed a bug where the user choosing to skip a version would inhibit future automatic updates until the next launch.
* Fixed a bug that could occur when the app has a localized CFBundleName.
* .dmgs now work on Leopard.
* The status controller's button now sizes appropriately to the localization.
* Sparkle now works correctly with LSUIElement apps: it focuses them before displaying the update alert.
* Sparkle now deletes failed partial downloads.
* The update alert no longer floats above everything in the app.
* Fixed varied and sundry memory leaks.
* A ton of other things that I've forgotten or were too small to mention!
# 1.1
* Optimized framework size: now only 1.4mb with all localizations and 384kb with only English (an English-only version is in the Extras folder).
* Added a new SUStatusChecker class for programmatically determining if a new version is available (see the docs); thanks, Evan Schoenberg!
* Added support for apps using SIGCHLD; thanks, Augie Fackler!
* Added a zh_CN update from JT Lee
* Added a Polish update from Piotr Chylinski
* Fixed DMG support for images with /Applications symlinks.
* Fixed a really stupid interval-checking bug that could cause repeated hits to the appcast.
* Fixed a bug where the check interval would be inconsistent if a value of 0 was stored in the user defaults.
# 1.0
* Additions:
* Added real version comparison courtesy Kevin Ballard: Sparkle now knows that 0.89 < 1.0a3 < 1.0.
* Added many localizations courtesy David Kocher's localization team.
* Added a much better installation mechanism courtesy Allan Odgaard.
* Added a user agent string to the RSS fetch request.
* Added support for CFBundleShortVersionString in addition to CFBundleVersion, and support for a sparkle:shortVersionString attribute on the enclosure.
* Added support for CFBundleDisplayName if available.
* Changes:
* Automatic updating is now allowed by default, but only if DSA signing is on.
* Pressing Escape or closing the update alert now reminds the user later.
* Now when there's a stored check interval, Sparkle doesn't check immediately on startup the first time the app is launched because the user hasn't consented to it yet.
* The update alert now remembers its size and floats.
* Bug Fixes:
* Fixed installation of DMGs with multiple files enclosed.
* Fixed a nasty memory leak.
* Fixed a bug wherein having no value for allowing automatic updates would display a checkbox for the updates but would not honor it.
* Fixed a bug in zip extraction that occurred in Panther.
* Fixed release notes caching.
* Fixed a bug wherein Sparkle refused to authenticate the installation if the user had cancelled authentication previously in that session.
* Fixed a weird bug that would cause a second help menu to appear on first launch.
* Fixed a bug that could occur when changing the scheduled check interval.
* Fixed a bug wherein the host app could crash if the user clicked Remind Me Later before the release notes finished loading.
* Fixed a bug wherein the behavior was undefined if the user manually initiated a check when an automatic one was already taking place.
* Fixed wrapping on the description field in the update alert.
# 1.0-beta3
* Fixed a nasty crasher that occurred often when the user was not connected to the internet.
# 1.0-beta2
* Major Improvements:
* Fully automatic updating! (see the Documentation: this is beta and off by default)
* Added support for DSA signatures (see the Documentation).
* Added support for MD5 sum verification.
* Added Security.framework-based authentication for installing to privileged directories.
* Huge refactoring of the codebase: there's now a Sparkle Xcode project, Sparkle is now a framework, and everything is modular / abstracted. And no more code-generated interface.
* Minor Improvements:
* A SUUpdaterWillRestartNotification is sent out before restarting now.
* Added key equivalents to alert panel buttons.
* Error handling is much prettier now: technical messages are not presented to the user anymore.
* There's now a test app for developers to see what Sparkle's like before using it.
* Wrote new, pretty, extremely thorough documentation.
* Bug Fixes:
* Relaunch behavior is much improved and shouldn't fail in huge apps anymore.
* Fixed a bug wherein a failing tar command could crash the host app.
* Sparkle now looks at InfoPlist.strings in addition to Info.plist.
* Fixed some stupid typos.
# 1.0-beta1
* Major New Features:
* Sparkle now supports scheduled periodic updates—read the Readme for information on how to use it.
* Sparkle now supports WebKit-based release notes (for CSS and full HTML), which it displays in the main update alert, not a separate panel. The Readme has much more information. Sparkle will, of course, fall back on NSTextView if the host app does not include WebKit.
* Minor New Features:
* Added support for .zip update archives.
* Added support for .dmg update archives.
* Implemented Remind Me Later to replace simple update cancellation.
* Implemented Skip This Version functionality.
* Added support for multiple feeds via the user defaults SUFeedURL key taking precedent over the one in Info.plist.
* Added support for Sparkle's custom XML namespace, which is optional but may prove useful. See the Readme for more information.
* Bug Fixes:
* Sparkle will no longer enter an inconsistent state if the user tries to update again while one is already in progress.
* Sparkle now uses CFBundleName to determine the application's name instead of the app's filename.
* Sparkle no longer crashes if the user cancels during extraction.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// Copyright 2007 Andy Matuschak. All rights reserved.
//
#ifndef NSBUNDLE_PLUS_ADDITIONS_H
#define NSBUNDLE_PLUS_ADDITIONS_H
#import <Cocoa/Cocoa.h>
@interfaceNSBundle(SUAdditions)
/*!
@method
@abstract Returns a name for the bundle suitable for display to the user.
@discussion This is performed by asking NSFileManager for the display name of the bundle.
*/
-(NSString*)name;
/*!
@method
@abstract Returns the current internal version of the bundle.
@discussion This uses the CFBundleVersion info value. This string is not appropriate for display to users: use -displayVersion instead.
*/
-(NSString*)version;
/*!
@method
@abstract Returns the bundle's version, suitable for display to the user.
@discussion If the CFBundleShortVersionString is available and different from the CFBundleVersion, this looks like CFBundleShortVersionString (CFBundleVersion). If the version strings are the same or CFBundleShortVersionString is not defined, this is equivalent to -version.
*/
-(NSString*)displayVersion;
/*!
@method
@abstract Returns a suitable icon for this bundle.
@discussion Uses the CFBundleIconFile icon if defined; otherwise, uses the default application icon.
*/
-(NSImage*)icon;
/*!
@method
@abstract Returns whether the application is running from a disk image.
*/
-(BOOL)isRunningFromDiskImage;
/*!
@method
@abstract Returns a profile of the users system useful for statistical purposes.
@discussion Returns an array of dictionaries; each dictionary represents a piece of data and has keys "key", "visibleKey", "value", and "visibleValue".
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUAuthenticationFailureuserInfo:[NSDictionarydictionaryWithObject:@"Couldn't get permission to authenticate."forKey:NSLocalizedDescriptionKey]];
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUFileCopyFailureuserInfo:[NSDictionarydictionaryWithObject:[NSStringstringWithFormat:@"Couldn't move %@ to %@.",dst,tmpPath]forKey:NSLocalizedDescriptionKey]];
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUFileCopyFailureuserInfo:[NSDictionarydictionaryWithObject:[NSStringstringWithFormat:@"Couldn't copy %@ to %@.",src,dst]forKey:NSLocalizedDescriptionKey]];
An easy-to-use software update framework for Cocoa developers.

## Changes since 1.5b
* Up-to-date with 10.10 SDK and Xcode 6. Supports OS X 10.7+.
* Cleaned up and modernized code, using ARC and Autolayout.
* Merged bugfixes, security fixes and some features from multiple Sparkle forks.
* Truly automatic background updates (no UI at all) when user agreed to "Automatically download and install updates in the future."
* Ability to mark updates as critical.
* Progress and status notifications for the host app.
* Name of finish_installation.app can be configured to match your app's name.
## Features
* True self-updating—the user can choose to automatically download and install all updates.
* Displays a detailed progress window to the user.
* Supports authentication for installing in secure locations.
* Supports Apple code signing and DSA signatures for ultra-secure updates.
* Easy to install. Sparkle requires no code in your app, so it's trivial to upgrade or remove the framework.
* Uses appcasts for release information. Appcasts are supported by 3rd party update-tracking programs and websites.
* Displays release notes to the user via WebKit.
* Sparkle doesn't bug the user until second launch for better first impressions.
* Seamless integration—there's no mention of Sparkle; your icons and app name are used.
* Deep delegate support to make Sparkle work exactly as you need.
* Optionally sends system information to the server when checking for updates.
* Supports bundles, preference panes, plugins, and other non-.app software. Can install .pkg files for more complicated products.
* Supports branches due to minimum OS version requirements.
## Developers
Building Sparkle requires Xcode 5 or above.
### API
Sparkle is built with `-fvisibility=hidden -fvisibility-inlines-hidden` which means no symbols are exported by default.
If you are adding a symbol to the public API you must decorate the declaration with the `SU_EXPORT` macro (grep the source code for examples).
### Building the distribution package
`cd` to the root of the Sparkle source tree and run `make release`. Sparkle-*VERSION*.tar.bz2 will be created in a temporary directory and revealed in Finder after the build has completed.
Alternatively, build the Distribution scheme in the Xcode UI.
error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUAppcastParseErroruserInfo:[NSDictionarydictionaryWithObject:SULocalizedString(@"An error occurred while parsing the update feed.",nil)forKey:NSLocalizedDescriptionKey]];
}
@catch(NSException*parseException)
{
error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUAppcastParseErroruserInfo:[NSDictionarydictionaryWithObject:[NSStringstringWithFormat:SULocalizedString(@"An error occurred while parsing the update feed: %@",nil),[parseExceptionreason]]forKey:NSLocalizedFailureReasonErrorKey]];
[selfreportError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUAppcastParseErroruserInfo:[NSDictionarydictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while parsing the update feed.",nil),NSLocalizedDescriptionKey,[parseExceptionreason],SUTechnicalErrorInformationKey,nil]]];
[NSExceptionraise:@"SUAppcastException"format:@"Couldn't find a version string for %@! You need a sparkle:version attribute.",[enclosureobjectForKey:@"url"]];
return[NSStringstringWithFormat:SULocalizedString(@"A new version of %@ is ready to install!",nil),[hostBundlename]];
}
-(NSString*)descriptionText
{
return[NSStringstringWithFormat:SULocalizedString(@"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?",nil),[hostBundlename],[hostBundledisplayVersion]];
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SURunningFromDiskImageErroruserInfo:[NSDictionarydictionaryWithObject:[NSStringstringWithFormat:SULocalizedString(@"%1$@ can't be updated when it's running from a disk image. Move %1$@ to your Applications folder, relaunch it from there, and try again.",nil),[hostBundlename]]forKey:NSLocalizedDescriptionKey]]];
return;
}
SUAppcast*appcast=[[SUAppcastalloc]init];
CFRetain(appcast);// We'll manage the appcast's memory ourselves so we don't have to make it an IV to support GC.
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUNoUpdateErroruserInfo:[NSDictionarydictionaryWithObject:[NSStringstringWithFormat:SULocalizedString(@"You already have the newest version of %@.",nil),[hostBundlename]]forKey:NSLocalizedDescriptionKey]]];
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUTemporaryDirectoryErroruserInfo:[NSDictionarydictionaryWithObject:[NSStringstringWithFormat:@"Can't make a temporary directory for the update download at %@.",tempDir]forKey:NSLocalizedDescriptionKey]]];
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SURelaunchErroruserInfo:[NSDictionarydictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while downloading the update. Please try again later.",nil),NSLocalizedDescriptionKey,[errorlocalizedDescription],NSLocalizedFailureReasonErrorKey,nil]]];
}
-(void)extractUpdate
{
// DSA verification, if activated by the developer
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUSignatureErroruserInfo:[NSDictionarydictionaryWithObject:@"The update is improperly signed."forKey:NSLocalizedDescriptionKey]]];
NSLog(@"Sparkle Error: No valid unarchiver for %@!",downloadPath);
[selfunarchiverDidFail:nil];
return;
}
CFRetain(unarchiver);// Manage this memory manually so we don't have to make it an IV.
[unarchiversetDelegate:self];
[unarchiverstart];
}
-(void)unarchiverDidFinish:(SUUnarchiver*)ua
{
if(ua){CFRelease(ua);}
[selfinstallUpdate];
}
-(void)unarchiverDidFail:(SUUnarchiver*)ua
{
if(ua){CFRelease(ua);}
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUUnarchivingErroruserInfo:[NSDictionarydictionaryWithObject:SULocalizedString(@"An error occurred while extracting the archive. Please try again later.",nil)forKey:NSLocalizedDescriptionKey]]];
// Note that we explicitly use the host app's name here, since updating plugin for Mail relaunches Mail, not just the plugin.
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SURelaunchErroruserInfo:[NSDictionarydictionaryWithObjectsAndKeys:[NSStringstringWithFormat:SULocalizedString(@"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@.",nil),[[NSBundlemainBundle]name]],NSLocalizedDescriptionKey,[NSStringstringWithFormat:@"Couldn't find the relauncher (expected to find it at %@)",relaunchPath],NSLocalizedFailureReasonErrorKey,nil]]];
// We intentionally don't abandon the update here so that the host won't initiate another.
[[NSFileManagerdefaultManager]removeFileAtPath:relaunchPathhandler:NULL];// Clean up the copied relauncher.
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUInstallationErroruserInfo:[NSDictionarydictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while installing the update. Please try again later.",nil),NSLocalizedDescriptionKey,[errorlocalizedDescription],NSLocalizedFailureReasonErrorKey,nil]]];
[self_finishInstallationWithResult:NOhostBundle:hostBundleerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUMissingUpdateErroruserInfo:[NSDictionarydictionaryWithObject:@"Couldn't find an appropriate update in the downloaded package."forKey:NSLocalizedDescriptionKey]]delegate:delegate];
// Copyright 2007 Andy Matuschak. All rights reserved.
//
#ifndef SUSTANDARDVERSIONCOMPARATOR_H
#define SUSTANDARDVERSIONCOMPARATOR_H
#import "SUVersionComparisonProtocol.h"
/*!
@class
@abstract Sparkle's default version comparator.
@discussion This comparator is adapted from MacPAD, by Kevin Ballard. It's "dumb" in that it does essentially string comparison, in components split by character type.
[profileArrayaddObject:[NSDictionarydictionaryWithObjects:[NSArrayarrayWithObjects:@"ncpu",@"Number of CPUs",[NSNumbernumberWithInt:value],[NSNumbernumberWithInt:value],nil]forKeys:profileDictKeys]];
NSAlert*alert=[NSAlertalertWithMessageText:SULocalizedString(@"You're up to date!",nil)defaultButton:SULocalizedString(@"OK",nil)alternateButton:nilotherButton:nilinformativeTextWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.",nil),[hostBundlename],[hostBundledisplayVersion]];
[statusControllersetStatusText:[NSStringstringWithFormat:SULocalizedString(@"%@ of %@",nil),[NSNumberhumanReadableSizeFromDouble:[statusControllerprogressValue]],[NSNumberhumanReadableSizeFromDouble:[statusControllermaxProgressValue]]]];
return[NSStringstringWithFormat:SULocalizedString(@"A new version of %@ is available!",nil),[hostBundlename]];
}
-(NSString*)descriptionText
{
return[NSStringstringWithFormat:SULocalizedString(@"%@ %@ is now available\u2014you have %@. Would you like to download it now?",nil),[hostBundlename],[updateItemdisplayVersionString],[hostBundledisplayVersion]];
Loaded 100 of 463 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.