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.
This commit is contained in:
Zorg committed 2026-10-24 19:43:52 -07:00
1 parent 6cf88c720d
commit bd355af936
1 file changed
+5 -2
+5 -2
View File
@@ -195,8 +195,11 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3;
- (NSArray<NSRunningApplication *> *)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<NSString *> *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<NSString *> *bundlePathComponents = bundle.bundleURL.URLByResolvingSymlinksInPath.pathComponents;
NSString *bundleIdentifier = bundle.bundleIdentifier;
NSMutableArray<NSRunningApplication *> *matchedRunningApplications = [[NSMutableArray alloc] init];