diff --git a/SUPlainInstallerInternals.m b/SUPlainInstallerInternals.m index 15eb16b40..1eb6b8a89 100644 --- a/SUPlainInstallerInternals.m +++ b/SUPlainInstallerInternals.m @@ -198,17 +198,12 @@ + (BOOL)_copyPathWithForcedAuthentication:(NSString *)src toPath:(NSString *)dst // quarantine to avoid a delay at launch, and to avoid // presenting the user with a confusing trust dialog. // - // This needs to be done after the application is moved to its - // new home with "mv" in case it's moved across filesystems: if - // that happens, "mv" actually performs a copy and may result - // in the application being quarantined. It also needs to be - // done before "chown" changes ownership, because the ownership - // change will almost certainly make it impossible to change - // attributes to release the files from the quarantine. + // This needs to be done before "chown" changes ownership, + // because the ownership change will fail if the file is quarantined. if (res) { SULog(@"releaseFromQuarantine"); - [self performSelectorOnMainThread:@selector(releaseFromQuarantine:) withObject:dst waitUntilDone:YES]; + [self performSelectorOnMainThread:@selector(releaseFromQuarantine:) withObject:src waitUntilDone:YES]; } if( res ) // Set permissions while it's still in source, so we have it with working and correct perms when it arrives at destination. @@ -252,6 +247,21 @@ + (BOOL)_copyPathWithForcedAuthentication:(NSString *)src toPath:(NSString *)dst AuthorizationFree(auth, 0); + // If the currently-running application is trusted, the new + // version should be trusted as well. Remove it from the + // quarantine to avoid a delay at launch, and to avoid + // presenting the user with a confusing trust dialog. + // + // This needs to be done after the application is moved to its + // new home with "mv" in case it's moved across filesystems: if + // that happens, "mv" actually performs a copy and may result + // in the application being quarantined. + if (res) + { + SULog(@"releaseFromQuarantine after installing"); + [self performSelectorOnMainThread:@selector(releaseFromQuarantine:) withObject:dst waitUntilDone:YES]; + } + if (!res) { // Something went wrong somewhere along the way, but we're not sure exactly where.