From bd355af936fae51378e4bb0405527ea14153bf98 Mon Sep 17 00:00:00 2001 From: Zorg Date: Fri, 23 Oct 2026 20:35:28 -0700 Subject: [PATCH] Fix update being installed before app terminates if it's located in NFC unicode encoded path (#2943) Normalize the path on both sides (NSRunningApplication and path on disk) consistently using URLByResolvingSymlinksInPath. --- Sparkle/InstallerProgress/InstallerProgressAppController.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Sparkle/InstallerProgress/InstallerProgressAppController.m b/Sparkle/InstallerProgress/InstallerProgressAppController.m index fc56a979..ce8dbf8f 100644 --- a/Sparkle/InstallerProgress/InstallerProgressAppController.m +++ b/Sparkle/InstallerProgress/InstallerProgressAppController.m @@ -195,8 +195,11 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3; - (NSArray *)runningApplicationsWithBundle:(NSBundle *)bundle SPU_OBJC_DIRECT { - // Resolve symlinks otherwise when we compare file paths, we may not realize two paths that are represented differently are the same - NSArray *bundlePathComponents = bundle.bundlePath.stringByResolvingSymlinksInPath.pathComponents; + // Resolve symlinks otherwise when we compare file paths, we may not realize two paths that are represented differently are the same. + // Make sure to use -[NSURL URLByResolvingSymlinksInPath] rather than -[NSString stringByResolvingSymlinksInPath] + // because the former will normalize it to proper file system representation. + // This is also done when retrieving NSRunningApplication path further below + NSArray *bundlePathComponents = bundle.bundleURL.URLByResolvingSymlinksInPath.pathComponents; NSString *bundleIdentifier = bundle.bundleIdentifier; NSMutableArray *matchedRunningApplications = [[NSMutableArray alloc] init];