Integrate trying to preserve Finder tags in 2.x

https://github.com/sparkle-project/Sparkle/commit/1081dcdda187a9be5635594d388090f78de940f9
This commit is contained in:
Zorg committed 2021-01-16 18:27:41 -08:00
1 parent 3c0e02f333
commit 6e326f3cea
1 file changed
+8
+8
View File
@@ -133,6 +133,14 @@
return NO;
}
// Try to preserve Finder Tags
// TODO: If we ever migrate to -[NSFileManager replaceItemAtURL:..] method, which we should at some point, we wouldn't have to do this step
NSArray *resourceTags = nil;
BOOL retrievedResourceTags = [oldURL getResourceValue:&resourceTags forKey:NSURLTagNamesKey error:NULL];
if (retrievedResourceTags && resourceTags.count > 0) {
[newTempURL setResourceValue:resourceTags forKey:NSURLTagNamesKey error:NULL];
}
// We must leave moving the app to its destination as the final step in installing it, so that
// it's not possible our new app can be left in an incomplete state at the final destination
if (![fileManager changeOwnerAndGroupOfItemAtRootURL:newTempURL toMatchURL:oldURL error:error]) {