From 1081dcdda187a9be5635594d388090f78de940f9 Mon Sep 17 00:00:00 2001 From: CoreCode Date: Wed, 11 Dec 2019 20:11:28 +0100 Subject: [PATCH] Update SUPlainInstaller.m (#1512) Try to preserve Finder tags while updating apps --- Sparkle/SUPlainInstaller.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sparkle/SUPlainInstaller.m b/Sparkle/SUPlainInstaller.m index 1c781634..63e2b71b 100644 --- a/Sparkle/SUPlainInstaller.m +++ b/Sparkle/SUPlainInstaller.m @@ -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];