Fixed typos in the following keys:
"An error occurred during installation. Please try again later."
"An error occurred in retrieving update information. Please try again later."
Added missing key that fell back to English:
"Cancel Update" = "בטל עדכון"; (Inside alert when using a button to let user check for updates)
* Improver read-only error message German
Updated the "read-only volume" error to reflect the real-world scenarios users run into.
It's almost never a CD, it's nearly always running from ~/Downloads or the .dmg if you still ship your app that way.
Amend to avoid gender issue
Victor committed
a01979c
1 changed file
Instead of addressing the user, which might cause gender issues, string has been adapted to include “app” (masculine, in accordance with Apple's terminology).
Would translate back as “The app is up-to-date!”
The SULastCheckTimeKey preference (a/k/a "default"), which is stored
in ~/Library/Preferences/….plist, was used to store the date of the
last update check.
That causes a problem if the storage is read-only (for example, if the
.plist file is “locked” (has the uchg or schg flag set) or if the
SULastCheckTimeKey key "exists in a domain that precedes the
application domain the search list"). The date would never be modified,
and the old date would cause a new update check to be queued at the end
of an update check. If application or bundle was up-to-date, or the
user had chosen to skip the update that was available, this would cause
update checks to happen as often as the computer and network would
allow, many times each second.
The new code uses an instance variable to store the value. The variable
is initially loaded from the “SULastCheckTimeKey” preference, and each
time the variable is modified its new value is stored to that
preference. However, the variable, not the preference, is used when
calculating whether enough time has passed since the last update check
to warrant another check. The variable will always (after the first
update check) have the "correct" value, and update checks will not be
done more frequently than desired.
10.11 SDK does not contain the os_log API yet. Code is modified
in such a way that it compiles with older SDKs, and falls back
to the old implementation even if it runs on 10.12.
This updates the podspec to include the bin scripts in Pods directory
when using CocoaPods. This way users don't also have to download the
Sparkle repo out of band to sign releases.
Generalize message to user as the previous setence was more like "Anonymous system profile information is used to help **our company** plan future development work."
While this may or may not be perfect, this should improve code quality by preventing new code that is introduced that creates tight coupling. This test is performed when make test is executed.
I avoided retrieving objc_dep in a way that make test would require an internet connection. I also added the executable bit to the objc_dep script, and a source.txt file indicating where the source came from.
PlistBuddy always touches its output file, even if the value written is
identical to the value already there. In such case, Xcode sees
Info.plist as modified, therefore sees the entire target as modified and
re-runs potentially expensive operations like copying frameworks or
signing.
Avoid unnecessary build operations by checking the previous
CFBundleShortVersionString if Info.plist already exists and only
updating it if necessary.
* origin/master:
Explain why I'm not relying on the compiler to throw linkage errors
Add AppKitPrevention header to reduce redundancy.
Add AppKit prevention guards to modules that shouldn't import it
Add Obj-C generics where applicable
Adds test cases for "sparkle:criticalUpdate" tag. (#999)
* Adds a test case for the "criticalUpdate" appcast tag (not as a XCTest but simply as an assert inside the test app, because I was lazy and am working on an older Xcode version that does not support the currently needed swift version for the XCTest in SUAppcastTest.swift).
* Tests the "criticalUpdate" appcast tag, using the proper XCTest swift class. I haven't tested this, though, due to the lack of the needed Xcode version.
* Test case for Appcast now checks all 4 items for the correct "criticalUpdate" state.
* Adds a test case for the "criticalUpdate" appcast tag (not as a XCTest but simply as an assert inside the test app, because I was lazy and am working on an older Xcode version that does not support the currently needed swift version for the XCTest in SUAppcastTest.swift). (reverted from commit 3ce1c9790b)
We use the cached host bundle if the host bundle is equal to the main bundle.
Otherwise we read in the latest Info dictionary every time.
The cached case is the most common case. The odd case (updating other bundles) is less common. Thus we have better performance for the common case, and we retain correct code in both cases.
Also we invoke our own implementation of -objectForInfoDictionaryKey: rather than NSBundle's implementation in a few places.
With this change, we ensure distinct per-app, per-process logging.
Note that the global file ~/Library/Logs/SparkleUpdateLog.log is no longer written into.
On 10.12 and above, SULog uses the os_log APIs. You may want to use log(1) to view logs in addition to Console.app. See the WWDC video on the new logging API and how the Console app has changed.
On older systems, this uses ASL (Apple System Log).
We don't want to reinvent logging, or rely on 3rd party libraries, thus we use what the system provides to us.
Two logging levels were added: Default and Error. The code documents their intended purpose. Now when you call SULog you must make a decision which level to use rather than rely on an implicit level.
I have been receiving unarchiver test errors lately (after the unarchiver blocks changes) somewhat rarely (it's very hard to reproduce) when running all the tests locally. Thus, hoping this change may make a difference.
Interactive package installs now need to be opted into (foo.sparkle_interactive.pkg or foo.sparkle_interactive.mpkg)
The website documentation may need to be updated later, and this should be noted as an important point in the change log.
Returning nil from these delegate methods is equivalent to not implementing the delegate method. The caller should be able to make this kind of decision when implementing an optional delegate method.
Also create SUUpdaterPrivate protocol to expose as little as possible to the internal update drivers. Ideally this would be minimized and not even exist at all, but I don't want to make the architectural and potential backwards-incompatible changes required to do that.
Fix status text during download (e.g. "10MB of 22MB") so that it no
longer distractingly jumps around and flickers. This was caused by two
things:
1. Flicker on macOS >= 10.8 due to the use of NSByteCountFormatter's
default mode which isn't optimized for stable display and is not
suitable for rapidly updated values.
2. Smaller movements of text on macOS >= 10.11 due to the use of San
Francisco font's default variant, where digits don't have fixed
width.
Fixed by using monospacedDigitSystemFontOfSize for the text field and
enabling NSByteCountFormatter's zeroPadsFractionDigits mode.
This fixes a bug where the status would stay at "Extracting update" after validation from the 1st delta patch failed, and it continued on to a full download.
With Carthage, if Sparkle is included as a Git submodule (e.g. with the --use-submodules option), the main module's .gitignore can't reach all the way inside the submodule to ignore the added Carthage/Build symlink, and Git keeps complaining about untracked changes in the submodule forever, which is very annoying. To avoid that issue, ignore here in Sparkle instead.
This removes the reachability code that we have for background scheduled updates.
Apple (and others) don't recommend using reachability to test if a network connection is online.
See:
http://stackoverflow.com/questions/7178330/what-is-the-advantage-of-using-reachabilityhttps://www.mikeash.com/pyblog/friday-qa-2013-06-14-reachability.html (just the comments)
Apple 2012/2011 WWDC videos on networking
Also, our current reachability code is rather illogical:
* reachabilityResult is always NO
* isNetworkReachable is always YES
* flags is ignored
* horrible use of dispatch_sync & putFeedURLIntoDictionary is terrifying
* NSException handling shouldn't be done
Removing this code which wasn't even coded properly, and which would still be misusing the reachability API anyway, also leads to removing some multithreading races and simpler logic :)
• In ConfigCommon.xcconfig, removed references to CLANG_WARN_OBJC_RECEIVER_WEAK and -Wno-receiver-is-weak, because apparently these had been deprecated and are now no longer recognized.
• In SUAppcast.m, changed to method which can accept nil.
• In SUOperatingSystem.h, added a check for nil which probably never happens.
• In SUUpdateAlert.m, swapped receiver with parameter in -isEqualToString, 3 places, so that nonnull parameter could never be nil.
• In SUUpdater.m, added NSLocalizedString() wrappers around 8 recently-added (in the last few years, I think) user-facing warning strings.
This changes the way we authorize & execute commands, and how we wait for their completion. In order to obtain the correct child to wait (instead of another one terminating intermediately), we use a wrapper tool (fileop) to output its pid onto the communication pipe that we read from the other end.
* origin/master: (31 commits)
Fix indentation with bspatch.c
Fix warnings for bsdiff.c
Improve error handling on readfile()
Don't forget to free the buffer on failure
Don't exit the program on failure for bsdiff.c
Don't exit the program on failure for bspatch.c
Use FILE* functions in bspatch.c
Use FILE* (fopen/fread/etc) functions for bsdiff.c
Fix warnings for bspatch
Don't hide warnings for bsdiff/bspatch
Reorganize checks for clarity
Update changelog
Update screenshot with new logo.
Remove Sparkle.png. This does not appear to be used anywhere anymore.
Set correct DPI for all images (72 for @1x, 144 for @2x).
Assign newly added icon images in asset catalog (#801) (#804)
Update app icon for Autoupdate.app (#347)
Updated sponsored by text and links (#800)
Upgrade warning to alert for signing update over HTTP with no DSA key
Clear update caches directory before downloading new update
...
This aims to make it impossible to have download data accumulate inside the caches directory.
We still try to deal with if an intermediate file is created at the path we want.
appCachePath method was also moved away from SUHost into SUBasicUpdateDriver which is the only class that needs it.
This method also has very little to do with host bundles.
appCachePath is also called less when checking for the existence of intermediate file paths.
Lastly, we now create a directory whose name is the sparkle bundle ID instead of just "Sparkle"
This is to improve potential name collision issues.
We want to wipe the caches directory we create for the test app data on launch,
and want to make sure no other data is being inserted into the same directory.
Before, Sparkle was inserting data into the same directory when downloading an update.
This fixes issues with updating modification/access time, and changing owner/group
where symbolic links used to be followed. Symbolic link tests are included.
If permissions are abnormal during cleanup or somewhere along the lines, it may be
possible to bring up authorization dialog that is not really needed. Prevent this from happening.
We would want to restrict authorization from being possible anyway when not needed.
Most of this is removing Obj-C subscripting usage
Some bits are adding pragma ignores to places where we are careful to not use the API at runtime on older OS's
Note that for NSMutableDictionary:
x[y] = z is not the same as [x setObject:z forKey:y]
In particular, z can be nil for subscripting (removing the element if it exists) where it cannot for setObject:forKey:
Personally I like the non-subscripting semantics better. Most cases we were using this we were checking if the object was non-nil anyway
I added public DSA file, automatic update checking, disabled system profiling
in the unit test's info.plist so that SUUpdater won't complain that DSA is missing,
and it won't prompt for update permission the first time.
I also made SUUpdater use the correct bundle in SUUpdaterTest
This fixes the issue where if an update alert is present for a long time,
and the user dismisses it, they may be prompted with another update alert
immediately after.
Sparkle's past behavior was sorting appcast items by published dates and
picking the first compatible item. However, it makes more sense to pick
the compatible item with the highest version (see issue #31).
The NSDate instance creation & sorting has also been removed from the code.
The methods we were using to parse the string into a NSDate have been deprecated,
and are strongly discouraged. Namely, all methods taking an arbitrary/natural string
have been nuked signaling they were probably a really bad idea. Furthermore, the
date code we had created a NSCalendarDate which has been long deprecated.
So we just don't handle date parsing. Even if there is a proper format for the pubDate,
It is an extra burden on the developer to insert a conforming date.
And we shouldn't want to rely on a potentially error-prone input field.
Webview having local file access doesn't seem worse than the app having local file access, but still it seems like a bad idea that relies on files being in predetermined location.
afpAccessDenied can be returned even when not using a AFP mount,
at least according to my testing.
Having an installation do a copy (because of different mounts) and auth
may not be a likely scenario, so this may not be hit often.
This removes run-time warnings that SUFileManager and SUOperatingSystem are
defined in both the test app and the framework, and which one
is used is undefined.
Add the capability to set a decryption password for updating with an
encrypted dmg file.
This enables the the ability to update using an encrypted disk image without having to prompt the user for a password. This is useful when access to the application binaries is only available via distribution or from a location in which authentication is required. This can help prevent an attacker from having unwanted access to application binaries for reverse engineering.
This assists with a defense in depth approach to security.
The move operation now does an explict copy & remove.
We also copy items using FSCopyObjectSync due to issues
existing in copyfile (and NSFileManager).
Both of these fix bugs in some cases where items cannot be moved
from one network drive to another. In my testing before this patch,
I was unable to get the test application to launch and was unable
to move the old installation to the trash.
If we don't do this, Finder may not report the correct file size for the new update.
The system also may not register the new app in its database if we don't do this.
We may have been able to get away with not doing this before because we used to perform a copy
to install the update. However, now updates in some cases can be done with only move operations.
This should also be an alternative way of addressing issue #508
This fixes an issue where the vertical border of the release notes view would sometimes not be visible.
Instead of making the widths of the views equal, we use the trailing property.
This is consistent with leading and bottom being used elsewhere
* Fix uid / gid not being applied to the root path or non-directory inputs
* Remove the code that released quarantines using the NSURL way.
It turned out not to be very reliable and didn't pass the tests.
More explanation is given in the code.
* Prefix private methods with _ and expose some of them to the tests
awakeFromNib should never be used; proper window loading methods
from the window controller should be used instead. awakeFromNib
can also be called multiple times in certain scenarios.
* All supported compression formats are now tested including dmg, which
has a license agreement included
* The hash of the extracted directory is now checked, which encompasses
every file's existence, its contents, and its permissions.
* Re-written using Swift
* Fix issue #608. From the framework, the error is logged via SULog.
From the tool, the error is logged to stderr. Uses NSError handling for
both.
* Move patch version validation for creating a binary diff into the
BinaryDelta tool
* Add parameter assertions to createBinaryDelta and handle if
-getFileSystemRepresentation:maxLength: fails
* 'info-only-updates' of https://github.com/danielpunkass/Sparkle:
Put back some "—" characters that had shifted to "--" in the mix.
Update string formulation to use the new separated localized strings for each case. Also update the code formatting a bit to be at least a little internally consistent. Switch to using dot notation within this method.
Revise approach for localizing the "Would you like to learn more about this update on the web?" case.
Revisions for style as requested.
Remove old localized string which is now superseded by broken-down versions.
Finesse the wording of the message displayed in SUUpdateAlert when the item is "information only."
Declare informationOnlyUpdate as a property of SUAppcastItem.
By not taking account the rare case, we simplify the code by having
less duplication. The tradeoff is that the rare case will be slightly
less efficient.
* Do all the installation work after the runloop is set up (hope this helps #441)
* TerminationListener only does termination listening now..
* Renamed folderpath to updateFolderPath. Likewise with some other variables. Since these are passed by command line arguments, updateFolderPath cannot be nil, so those checks for if folderpath is nil in the old code is removed
* Removed pointless global variable access [SUInstaller updateFolder]
* Old code does not handle if host path is not installation path *and* host path is not desired executable path. This does.
We also add height constraints to the automatically install & download updates button. Since we don't have a custom layout view, we also shouldn't call -[NSView setNeedsLayout:]
Fixes#369
Previously I had broken down the description text into one localizable string for the main clause of the sentence, e.g.: "MyApp 1.1 is available--you have 1.0", and separate localizable strings for the follow-up question about whether to download or get more information. This breakdown didn't work well with some languages e.g. Arabic where the existing localization mixes the placeholder values differently. The new approach is to localize the two complete sentences separately. Unfortunately this means that for the "Would you like to learn more about this update on the web?" case, the localization is missing for all languages except English. But, at least the localization files are properly populated with the expected keys, and await localization updates when possible.
I also spotted a few instances in which an outdated version of the existing localization key was being used (with parens instead of --), so there was no localization occurring in those cases. I fixed those by updating the key to match the current status quo.
* sparkle-project/master:
Use NSByteCountFormatter if available.
Fix a few more easy translation issues.
Fix some simple translation issues.
Delete languages which don't actually have any translations.
Add existing localization files to Xcode project.
Add SparkleLocalizations.swift to the Xcode project.
Use NSXML the whole way through for building the report document.
Remove unused temporaryName: parameter and supporting code.
CheckLocalizations: use swift shebang
CheckLocalizations: use NSUserDefaults to read args
CheckLocalizations: add a helper for error handling
CheckLocalizations: escape HTML
Add script to generate a report comparing the Sparkle.strings files
Previously when an information-only update is displayed to the user, it uses the inappropriate text "Would you like to download it now?" Since the alert is modified in this case to provide a 'Learn More' button, then text should match the action that is being offered. In this commit I break the localized string up into parts such that the notice about the updated version is the same in either case, but the action offered differs depending on the type of update being presented.
Note that this commit only represents changes to the English Sparkle.strings file. Until and unless localized versions of Sparkle.strings add translations for the new broken-up strings, they will display this information in English only.
Declaring a property makes it obvious where changes to the logic about whether an update is "information only" should be made, and leaves the code at the calling point more readable. Instead of inferring that an appast item is information only by the simple omission of a fileURL, require that it also have a infoURL.
The temporaryName: parameter to SUPlainInstaller's copyPathWithAuthentication... method was not being used internally but was still mucking up the (already long) method signature for the method and related methods up the chain. Also remove related, no-longer-used temporaryNameForPath method.
Nothing inside an app/update bundle should be altered anyway, and these permissions will be lost by revision control systems. They also conflict with BinaryDelta's permissions validation
Since it is possible for the user to see these strings, we should not make them seem as 'gibberish' or unfriendly. More detailed error information is logged to the console.
The improvements we want to achieve:
* Stability - No more corrupt / incomplete updates by ensuring atomic move operations
* Efficiency - Faster updates because of reduction of file copies that need to be done
* Separation from Host and Helper - No usage of SUFileManager in the host application
* Cleanness - Minimized deprecated APIs (no FSPathMakeRef, FSGetCatalogInfo, FSFindFolder, etc), use modern Cocoa APIs when possible, robust error handling, strong documentation, easier to read code.
Many other small notes:
* SUFileManager does not have class methods. Methods across an instance share an AuthorizationRef, instead of having to authorize every time a privileged operation needs to be done
* The odd logic of `while (authStat == errAuthorizationDenied)` was removed
* Instead of checking if we have write access, we try to invoke a normal operation first. If that doesn't work, with the right error returned back, we try authorizing, which is what Apple recommends doing
* The trash is not used as a temporary location anymore. Rather we now request for a temporary directory to be created. This is more likely to succeed too (eg: on a drive that has no trash folder)
* The old method for releasing the quarantine did not work until I used the "com.apple.quarantine" key instead of the LS constant that was being used.
* For the old method for releasing the quarantine, we now check if a file has the quarantine xattr bit set before removing it. Just like how the new method works.
* Quarantines can now be removed with authorization
* The result of calling temporaryNameForPath: was never actually used in the old code
* -[NSString fileSystemRepresentation] which can throw an exception is not used. Only getFileSystemRepresentation:maxLength: is used and the error on it is always checked
* The desperate/hopeless check for if the code signature for the update is valid after the installation is complete is removed
Potential issues that still needs to be looked in to:
* Currently the method to move a file to the trash only works on 10.8+
* Appending of version number / picking destination name of app moved to trash
Instead of relying on whether the DSA signature is provided in the appcast (which we can't trust), we rely on detecting if the public key in the new and old app differ. If they differ, then the code signatures from both apps must match. The idea is that code signing is reliable in being able to tell that the Info.plist and public DSA files came from the developer and are intact. This still allows a developer to lose access to their DSA private key, or to their Apple code signature, and be able to push new updates (as long as they didn't lose access to both). The new change, however, is that if the new app has a public DSA key, then the appcast item must have a DSA signature for the app, even if the app is code signed.
appcastDidFinishLoading: was declared in SUUIBasedUpdateDriver, but
defined and used in SUUIBasedUpdateDriver. Move the declaration back to
the base class where it belongs.
If the original app is signed, and the update is not, this is actually fine if the DSA validation goes through. And this may be desirable for people that don't want to pay cash to code sign their application anymore.
If an invalid DSA or invalid code signature is provided, the update will fail, regardless if one of these requirements is valid. The logic before is that the update will succeed if either a valid DSA or matched code signature is provided.
This still allows a code signature to change, be added, or be removed, as long as the DSA and the code signature (if provided) is valid. If no DSA is provided, then this is not possible, and the code signature from the host and update app must match.
Before, an extract was assumed if nothing else matched. This can get quite confusing when adding new properties, so we shouldn't treat any property to be handled if nothing else was handled.
Related: Issue #441
I have no evidence that this is the cause of the issue, but from what we do know from the crash logs submitted, it looks like Sparkle crashes or errors on the main thread. It also looks like it might be from an object release rather than copying (which is done on a different thread) being the issue (see issue #417 also). I'm leaning towards this being an issue after the project was converted to ARC.
Since BinaryDelta can still create patches for older versions, and since I've made fixes recently even for version 1 patches, we should increment this counter.
This will break backwards compatibility with version 1 patches, which generated tree hashes differently and did not handle applying permission changes in some cases.
A version flag is also added to BinaryDelta create for creating patches an older version of BinaryDelta apply can handle. This is only meant for transition purposes.
Rationale: given a before-hash and an after-hash, there should only be one way to create the diff file. It was possible to violate this before, if we let a file differ in a permission bit that wasn't executable.
This should help prevent situations like issue #441 where Sparkle
creates broken app bundles. In this case, the update will just report
as a failure instead of succeeding.
There's a zipped up sample app in the unit test target. This gets unzipped to
a temporary folder and there are three versions of it: the original which is not
code signed at all, another with a valid code signature, and a third which
has had one of its resources removed after code signing to make it invalid.
The API docs say "For bundles, pass a URL to the root directory of the bundle…
If you pass a URL to the main executable of a bundle, the bundle as a whole is generally recognized."
My initial attempt did not work correctly for directories that differed in permissions (since it removed them and all the files inside them). We are now setting a property for permission changes which can happen when a binary diff is created, or when it is skipped. Still have to figure out how backwards compatibility is going to work now..
BinaryDelta can now create proper diffs in the case if a non-executable file becomes an executable file, or vise versa. Currently for simplicit
y and backward-compatibility we delete then extract if an executable difference is found, rather than creating a diff. Files that contain an executable difference are unlikely to be large anyway.
We also change the tree hash function so it can track executable permission differences on files. It also now tracks file types so it is less collision-resistant for example in the case where a regular file becoming a symlink could have resulted in the same hash. Because the tree hash function changed, major & minor versioning to the format was introduced. Older minor versions remain compatible, but older major versions do not. In this case, we've only bumped the minor version. In this case, older versions can apply a patch created by a newer version, and newer versions can apply a patch created by an older version.
More error handling is now checked, some code improvements were made, and some adjustments were made to the tests with regard to the changes above.
Since a function for creating diffs is now exposed, this should make testing easier
This is also consistent with applying diffs being in a separate source file from the delta tool as well
Although #132 is marked as closed, the issue is still real. bsdiff can crash or hang when creating diffs on some files. In particular, bsdiff hangs/crashes in its recursive split function.
As you can see from:
http://stackoverflow.com/a/20305493/871119https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=409664
bsdiff 4.3 uses qsufsort for its suffix sorting algorithm, which has a bug causing the hanging/crashing. Our solution is to change the algorithm to use sais for suffix sorting:
https://sites.google.com/site/yuta256/sais
Notes:
*I had to change sais_index_type #define from int to off_t in sais.h/c and in some other places, to eliminate all warnings. Compiles cleanly with clang's -Weverything
*sais is claimed to be more efficient than other algorithms including qsufsort. If a more efficient (and stable) algorithm comes out, we may be able to swap it out in the future.
This can occur in the following case:
--
original_tree:
A/
Current/
B
new_tree:
A/
B
Current -> A/
--
Because symbolic links are not followed, Current/B can be marked as deleted. If A/B is added before the deletion, then A will end up as an empty directory.
Our fix is to remove all subpaths of a file when it changes from a directory to another type of file. This should also decrease the size of the diff even in harmless cases such as when a directory changes into a regular file.
When a filename changes case, make sure we have the file deleted in the old tree before being extracted into the new one.
Note that we don't try creating a diff if a file is renamed with a different case, just like we don't track file names changing in other ways.
See issue #474
« Automatiquement » before the two verbs is a little akward, not incorrect but unusual. And « à l’avenir » (« in the future » is really not necessary, usually they don’t mention it.
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).
Added headless guided installation of pkg and mpkg files. Ported to
using ARC
and inlined documentation. The use of
`AuthorizationExecuteWithPrivileges` should be replaced with an XPC or
assistive external process in a future update. See
https://github.com/sparkle-project/Sparkle/issues/348
2014-07-13 16:53:45 +02:00
422 changed files with 23569 additions and 8201 deletions
* New SUDSAVerifier based on up-to-date OS X APIs (Zachary Waldowski)
* Allow EdDSA for delta updates, too (Kornel)
* Warning fixes (Brian Bergstrand)
* Improvements to release notes view context menu and dark mode (Bi11)
# 1.21.0
* Added support EdDSA (ed25519) signatures (Kornel)
* DSA signatures are considered outdated, and Apple's `Security.framework` only supports weaker SHA-1-based DSA.
* Both old DSA and new EdDSA are still supported (and one app can use both), but new applications should use EdDSA only, and we recommend migrating away from DSA signatures.
* `generate_keys` is now a Swift tool that stores EdDSA private keys in the Keychain
* Existing apps can continue using their old DSA keys, but we've dropped support for generation of old DSA keys
* `sign_update` is now a Swift tool that signs using EdDSA from private keys in the Keychain
* The old DSA-based signing script has been moved to `bin/old_dsa_scripts`
* The old DSA-based signing script has been fixed to work on pre-10.13 systems (Thomas Tempelmann)
* `generate_appcast` has been updated to support EdDSA signatures
* It can sign both DSA (if `dsa_priv.pem` file is specified) and EdDSA (from Keychain)
* The tool now uses Caches directory and doesn't generate unnecessary delta files
* Fixed verification of delta updates on filesystems that change permissions of symlinks
* Fixed `NSURLSession` leak (Michael Ehrmann)
# 1.20.0
* `generate_appcast` option to read private key directly from the keychain (Tamás Lustyik)
* Add delegate callbacks for fininshed download and extraction related events (Csaba Horony)
* Don't check for updates if Do Not Disturb is on (Kornel)
* Expose `CodesigningVerifier`, add codesign info API (sunuslee)
* Threading fixes:
* Fix potential hang with `dispatch_sync` to main thread (Brian Bergstrand)
* Fix closeCheckingWindow called from background thread (Alexey Martemyanov)
* Updated Finnish language resources (Jason Pollack)
* Hungarian localization (Csaba Horony)
* Log more information about authentication requests (Kornel)
* Explicitly specify types to silence "Messaging unqualified id" warning that's new in Xcode 10. Removed __has_feature(objc_generics) check and use generisc to help silence the warnings. (Kent Sutherland)
* Fix binary delta creation on network drives (sagecook)
* Fix compilation issues on Xcode 10 with new build system (Leo Natan)
# 1.19.0
* Refactoring of downloader code to avoid deprecated methods (Deadpikle)
* Changes to which methods run on the main thread.
Note: some delegate methods may be called on non-main thread now. (Kornel)
* Update Japanese localization (1024jp)
* Update Sparkle.strings (Stefan Paychère)
* Fix Sparkle clients polling too frequently (Jonathan Bullard)
* Handle SecTransformExecute errors (Kornel)
* Silence Touch Bar availability warnings on Xcode 9 by using API_AVAILABLE. Disable gnu-zero-variadic-macro-arguments to prevent warnings from use of API_AVAILABLE. (Kent Sutherland)
* 10.11 SDK compatibility (David Fuhrmann)
# 1.18.1
* Add optional updaterDidRelaunchApplication: method on SUUpdaterDelegate (#1115) (App Tyrant)
* Implemented sparkle:os attribute as documented (Memphiz)
* Additional termination detection in case kpoll fails. (fujisoft)
* Included bin files in CocoaPods installation (Keith Smiley)
* Updated Dutch localization (Eitot)
* Updated German localization (Eitot)
* Updated Japanese translation (1024jp)
* Updated Portuguese translation (Victor)
* Updated to Xcode 9/Swift 4
# 1.18.0
* Name of the host app is used in authorization prompt (the `SPARKLE_RELAUNCH_TOOL_NAME` setting is now obsolete)
* More detailed progress bar for package installers (Kornel Lesiński)
* Disabled the keyboard shortcut for the install button for scheduled updates to avoid accidental installs. (George Nachman)
* generate_appcast tool adds release notes if there's an .html file with the same base name as the archive (Brett Walker)
* Added `sparkle:shortVersionString` to the enclosure, #1032 (Brett Walker)
* Fixed Japanese localization (1024jp)
* Fixed escaping of system profile URLs
* Added more logging in various failure cases (Kornel Lesiński)
* Better error message for quarantined apps that can't be updated
# 1.17.0
* Added Touch Bar support (Bi11)
* Upgraded SULog to use logging APIs that Apple provides built-in (Zorg)
* Skip buttons are disabled if the update is marked as critical (Kornel Lesiński)
* Background updates ask OS for lower-priority networking (Kornel Lesiński)
* Refactorings to sync with upcoming 2.0
* Added kqueue based termination listener (Zorg)
* Added AppKit prevention guards to modules that shouldn't import it (Zorg)
* Added Obj-C generics where applicable (Zorg)
* Made SUBundleIcon & SUApplicationInfo take SUHost, not NSBundle (Zorg)
* Detect and fail if any two-way dependencies exist in the project (Zorg)
* generate_appcast:
* fixed handling of multiple directories in an archive
* percent encode the filename used in the delta url (Brett Walker)
* Update Sparkle.strings (BR Lingo)
* Improved handling of non-ASCII names in delta archives (Kornel Lesiński)
* Don't touch Info.plist unless git version changes (Václav Slavík)
# 1.16.0
* Guided package installs are now the default for updating packages (Zorg)
- `pkg` installers won't show any UI. If you require the old behavior of showing a full installer window, rename the `*.pkg` file to `*.sparkle_interactive.pkg`
* Previous version of the app is now deleted instead of staying in the trash (Zorg)
* Updated Mac models list until July 2015 (Gabriel Ulici)
* Updated Polish translation (Kornel Lesiński)
* Updated Xcode project languages for which we have translations (Jake Petroules)
* Updated XIB files (Kornel Lesiński)
* Use NSByteCountFormatter if available (Jake Petroules)
* Declared protocols on SUUpdateAlert for the 10.11 SDK (Daniel Jalkut)
* Silenced warning about casting away const-ness and -Wassign-enum (Daniel Jalkut)
* Added script to generate a report comparing the Sparkle.strings files (Kevin Wojniak)
* Check for empty strings (as well as nil) in SUHost's -name method (Karl Moskowski)
* Don't follow symlinks for checking file existence (Zorg)
* Unit tests in Swift (Zorg, Jake Petroules)
* Fixed framework imports (Felix Schulze)
* Fixed issues with copying files from different mounted drives (Zorg)
* Disallowed automatic updates when user can't write to the bundle (Zorg)
* Set the task working directories instead of changing the process working directory (Kevin Wojniak)
# 1.11.1 (Nov 9, 2015)
* Don't install automatic updates when system is about to shut down
# 1.11.0 (Aug 24, 2015)
* Big improvements to code signing and DSA verification
- Sparkle now checks not only whether an update is correctly signed, but also whether the updated version will be able to verify future updates. Updates now must either use DSA keys correctly, or not try to use them at all. Same goes for Apple Code Signing.
- Rely on code signing and the DSA key in the new app instead of appcast. If the new app has a public DSA key, then the appcast item must have a DSA signature for the app, even if the app is code signed. (Zorg)
* More verbose error message when DSA keys don't match (Kornel Lesiński)
* Added delegate methods for pre-download and immediately post-failed-download (Isaac Greenspan)
* Fix Lucida Grande is always used for release notes (LIU Dongyuan / 柳东原)
* Only remove quarantine with setResourceValue: when it's present. Fixes "Unable to quarantine: 93" messages from showing up in the console. (Zorg)
* Fixed const and nullability warnings (Jake Petroules, Kornel Lesiński)
* 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).
* Dropped support for macOS 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
See [getting started guide](https://sparkle-project.org/documentation/). No code is necessary, but a bit of Xcode configuration is required.
## Development
### Troubleshooting
* Please check **Console.app**. Sparkle prints detailed information there about all problems it encounters. It often also suggests solutions to the problems, so please read Sparkle's log messages carefully.
* Use the `generate_appcast` tool which creates appcast files, correct signatures, and delta updates automatically.
* Make sure the URL specified in [`SUFeedURL`](https://sparkle-project.org/documentation/customization/) is valid (typos/404s are a common error!), and that it uses modern TLS ([test it](https://www.ssllabs.com/ssltest/)).
* Delete your app's preferences (in `~/Library/Preferences/<your bundle id>`) if you've set another feed URL programmatically via Sparkle's Objective-C interface.
### API symbols
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.
### Code of Conduct
We pledge to have an open and welcoming environment. See our [Code of Conduct](CODE_OF_CONDUCT.md).
// This object implements the protocol which we have defined. It provides the actual behavior for the service. It is 'exported' by the service to make it available to the process hosting the service over an NSXPCConnection.
[self.delegatedownloaderDidFailWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUDownloadErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Failed to read temporary downloaded data from %@",self.downloadFilename]}]];
// Okay, something's really broken with this user's file structure.
NSError*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUTemporaryDirectoryErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Can't make a temporary directory for the update download at %@.",tempDir]}];
NSError*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUTemporaryDirectoryErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Can't make a download file name %@ directory inside temporary directory for the update download at %@.",downloadFileName,downloadFileNameDirectory]}];
// We don't want the download system to extract our gzips for persistent downloads
// Note that we use a substring matching here instead of direct comparison because the docs say "application/gzip" but the system *uses* "application/x-gzip". This is a documentation bug.
NSError*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUTemporaryDirectoryErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Can't make a download file name %@ directory inside temporary directory for the update download at %@.",downloadFileName,downloadFileNameDirectory]}];
[selfreportError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUAppcastParseErroruserInfo:@{NSLocalizedDescriptionKey:SULocalizedString(@"An error occurred while parsing the update feed.",nil)}]];
newVersion=[dictobjectForKey:SUAppcastAttributeVersion];// Get version from the item, in case it's a download-less item (i.e. paid upgrade).
}
if(newVersion==nil)// no sparkle:version attribute anywhere?
{
SULog(SULogLevelError,@"warning: <%@> for URL '%@' is missing %@ attribute. Version comparison may be unreliable. Please always specify %@",SURSSElementEnclosure,[enclosureobjectForKey:SURSSAttributeURL],SUAppcastAttributeVersion,SUAppcastAttributeVersion);
// Separate the url by underscores and take the last component, as that'll be closest to the end,
// then we remove the extension. Hopefully, this will be the version.
*error=@"Feed item lacks sparkle:version attribute, and version couldn't be deduced from file name (would have used last component of a file name like AppName_1.3.4.zip)";
if(!newVersion){
if(error){
*error=[NSStringstringWithFormat:@"Feed item lacks %@ attribute, and version couldn't be deduced from file name (would have used last component of a file name like AppName_1.3.4.zip)",SUAppcastAttributeVersion];
elseif([self.itemDescriptionhasPrefix:@"http://"]||[self.itemDescriptionhasPrefix:@"https://"])// if the description starts with http:// or https:// use that.
SULog(SULogLevelError,@"Release notes with file:// URLs are not supported");
}else{
self.releaseNotesURL=url;
}
}elseif([self.itemDescriptionhasPrefix:@"http://"]||[self.itemDescriptionhasPrefix:@"https://"]){// if the description starts with http:// or https:// use that.
// If the user hasn't quit in a week, ask them if they want to relaunch to get the latest bits. It doesn't matter that this measure of "one day" is imprecise.
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SURunningFromDiskImageErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:SULocalizedString(@"%1$@ can't be updated when it's running from a read-only volume like a disk image or an optical drive. Move %1$@ to your Applications folder, relaunch it from there, and try again.",nil),[aHostname]]}]];
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SURunningFromDiskImageErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:SULocalizedString(@"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.",nil),[aHostname]]}]];
// Okay, something's really broken with this user's file structure.
[self.downloadcancel];
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUTemporaryDirectoryErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Can't make a temporary directory for the update download at %@.",self.tempDir]}]];
SULog(@"The appcast item for the update has no DSA signature. The update will be rejected, because both DSA and Apple Code Signing verification failed.");
returnNO;
}
// don't need to do anything here as there's no GUI with this driver (there can be with child classes)
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SURelaunchErroruserInfo:@{NSLocalizedDescriptionKey:SULocalizedString(@"An error occurred while downloading the update. Please try again later.",nil),NSLocalizedFailureReasonErrorKey:[errorlocalizedDescription]}]];
// We don't want the download system to extract our gzips.
// Note that we use a substring matching here instead of direct comparison because the docs say "application/gzip" but the system *uses* "application/x-gzip". This is a documentation bug.
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUUnarchivingErroruserInfo:@{NSLocalizedDescriptionKey:SULocalizedString(@"An error occurred while extracting the archive. Please try again later.",nil)}]];
[selfabortUpdateWithError:err];
}
-(BOOL)shouldInstallSynchronously{returnNO;}
-(void)installWithToolAndRelaunch:(BOOL)relaunch
{
// Perhaps a poor assumption but: if we're not relaunching, we assume we shouldn't be showing any UI either. Because non-relaunching installations are kicked off without any user interaction, we shouldn't be interrupting them.
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SURelaunchErroruserInfo:@{NSLocalizedDescriptionKey:SULocalizedString(@"An error occurred while extracting the archive. Please try again later.",nil),NSLocalizedFailureReasonErrorKey:[NSStringstringWithFormat:@"Couldn't copy relauncher (%@) to temporary path (%@)! %@",relaunchPathToCopy,targetPath,(error?[errorlocalizedDescription]:@"")]}]];
NSLocalizedDescriptionKey:[NSStringstringWithFormat:SULocalizedString(@"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@.",nil),[self.hostname]],
NSLocalizedFailureReasonErrorKey:[NSStringstringWithFormat:@"Couldn't copy relauncher (%@) to temporary path (%@)! %@",
// 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:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:SULocalizedString(@"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@.",nil),[self.hostname]],NSLocalizedFailureReasonErrorKey:[NSStringstringWithFormat:@"Couldn't find the relauncher (expected to find it at %@)",self.relaunchPath]}]];
// We intentionally don't abandon the update here so that the host won't initiate another.
NSLocalizedDescriptionKey:[NSStringstringWithFormat:SULocalizedString(@"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@.",nil),[self.hostname]],
NSLocalizedFailureReasonErrorKey:[NSStringstringWithFormat:@"Couldn't find the relauncher (expected to find it at %@ and %@)",relaunchToolSourcePath,self.relaunchPath],
[[NSFileManagerdefaultManager]removeItemAtPath:self.relaunchPatherror:&dontThrow];// Clean up the copied relauncher
[selfabortUpdateWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUInstallationErroruserInfo:@{NSLocalizedDescriptionKey:SULocalizedString(@"An error occurred while installing the update. Please try again later.",nil),NSLocalizedFailureReasonErrorKey:[errorlocalizedDescription]}]];
Loaded 100 of 422 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.