-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite file operations for updating an app #575
Merged
Merged
Commits on Jul 23, 2015
-
Rewrote file operations for updating an app
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
Configuration menu - View commit details
-
Copy full SHA for 984c3dc - Browse repository at this point
Copy the full SHA 984c3dcView commit details
Commits on Jul 24, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 9c8fb99 - Browse repository at this point
Copy the full SHA 9c8fb99View commit details
Commits on Jul 25, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 19876c5 - Browse repository at this point
Copy the full SHA 19876c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for d4b7a69 - Browse repository at this point
Copy the full SHA d4b7a69View commit details -
Make errors/directory names more user friendly
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.
Configuration menu - View commit details
-
Copy full SHA for dbae37b - Browse repository at this point
Copy the full SHA dbae37bView commit details
Commits on Jul 27, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 62f7b7a - Browse repository at this point
Copy the full SHA 62f7b7aView commit details
Commits on Jul 29, 2015
-
Configuration menu - View commit details
-
Copy full SHA for a746219 - Browse repository at this point
Copy the full SHA a746219View commit details
Commits on Aug 15, 2015
-
Configuration menu - View commit details
-
Copy full SHA for fd7628e - Browse repository at this point
Copy the full SHA fd7628eView commit details -
Release quarantine for Autoupdate.app
I don't think this is actually needed, but better be safe than sorry.
Configuration menu - View commit details
-
Copy full SHA for ea959cb - Browse repository at this point
Copy the full SHA ea959cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d53d72 - Browse repository at this point
Copy the full SHA 5d53d72View commit details
Commits on Aug 16, 2015
-
Remove installation URL != old URL case
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.
Configuration menu - View commit details
-
Copy full SHA for 758ed1d - Browse repository at this point
Copy the full SHA 758ed1dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5b469d7 - Browse repository at this point
Copy the full SHA 5b469d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for ba73e52 - Browse repository at this point
Copy the full SHA ba73e52View commit details -
Configuration menu - View commit details
-
Copy full SHA for 182652a - Browse repository at this point
Copy the full SHA 182652aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2782b42 - Browse repository at this point
Copy the full SHA 2782b42View commit details
Commits on Sep 18, 2015
-
Configuration menu - View commit details
-
Copy full SHA for d1a5aae - Browse repository at this point
Copy the full SHA d1a5aaeView commit details
Commits on Sep 19, 2015
-
Configuration menu - View commit details
-
Copy full SHA for bd3be28 - Browse repository at this point
Copy the full SHA bd3be28View commit details
Commits on Sep 24, 2015
-
Configuration menu - View commit details
-
Copy full SHA for a9743f0 - Browse repository at this point
Copy the full SHA a9743f0View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.