From 61a492236493c7c0db851a3e143c82021b8e3adc Mon Sep 17 00:00:00 2001 From: gxalpha Date: Thu, 28 Sep 2023 10:39:46 +0200 Subject: [PATCH] mac-virtualcam: Always replace camera extension when requested Current code assumes that a newer version of the extension is always better. However that's not true - when the user installs an old version of OBS, we should also install the old version of the camera extension to have a version compatible with the installed OBS. For normal users this method is only called when the versions in the Info.plist do not match. In system extensions developer mode it's called every time an installation is requested (meaning on every start), which is probably desired as well; and by never returning "ReplacementActionCancel" we can now always treat "ErrorRequestCanceled" as an error and not something that we requested to happen. --- plugins/mac-virtualcam/src/obs-plugin/plugin-main.mm | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/plugins/mac-virtualcam/src/obs-plugin/plugin-main.mm b/plugins/mac-virtualcam/src/obs-plugin/plugin-main.mm index fd87e0ba5..62e9550f4 100644 --- a/plugins/mac-virtualcam/src/obs-plugin/plugin-main.mm +++ b/plugins/mac-virtualcam/src/obs-plugin/plugin-main.mm @@ -68,15 +68,7 @@ struct virtualcam_data { actionForReplacingExtension:(nonnull OSSystemExtensionProperties *)existing withExtension:(nonnull OSSystemExtensionProperties *)ext { - NSString *extVersion = [NSString stringWithFormat:@"%@.%@", [ext bundleShortVersion], [ext bundleVersion]]; - NSString *existingVersion = - [NSString stringWithFormat:@"%@.%@", [existing bundleShortVersion], [existing bundleVersion]]; - - if ([extVersion compare:existingVersion options:NSNumericSearch] == NSOrderedDescending) { - return OSSystemExtensionReplacementActionReplace; - } else { - return OSSystemExtensionReplacementActionCancel; - } + return OSSystemExtensionReplacementActionReplace; } - (void)request:(nonnull OSSystemExtensionRequest *)request didFailWithError:(nonnull NSError *)error