Skip to content

Commit

Permalink
Update SUPlainInstaller.m (#1512)
Browse files Browse the repository at this point in the history
Try to preserve Finder tags while updating apps
  • Loading branch information
core-code authored and kornelski committed Dec 11, 2019
1 parent 3a497dd commit 1081dcd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sparkle/SUPlainInstaller.m
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ - (BOOL)performInstallationToURL:(NSURL *)installationURL fromUpdateAtURL:(NSURL
if (progress) {
progress(9/10.0);
}

// Try to preserve Finder tags. Failure can be accepted without complaint as previous Sparkle versions did not do this at all
NSArray *resourceTags;
BOOL success = [oldTempURL getResourceValue:&resourceTags forKey:NSURLTagNamesKey error:NULL];
if (success && resourceTags.count)
{
[destinationAppURL setResourceValue:resourceTags forKey:NSURLTagNamesKey error:NULL];
}

// From here on out, we don't really need to bring up authorization if we haven't done so prior
SUFileManager *constrainedFileManager = [fileManager fileManagerByPreservingAuthorizationRights];
Expand Down

0 comments on commit 1081dcd

Please sign in to comment.