Update SUPlainInstaller.m (#1512)

Try to preserve Finder tags while updating apps
This commit is contained in:
CoreCode authored and Kornel committed 2019-12-11 19:11:28 +00:00
1 parent 3a497ddcbd
commit 1081dcdda1
1 file changed
+8
+8
View File
@@ -207,6 +207,14 @@
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];