[Backport release-10.x] MSAStep: Tighten isSchemeHandlerRegistered check (#4858)

This commit is contained in:
Alexandru Ionut Tripon 2026-01-25 10:29:57 +02:00 committed by GitHub
commit f85271e5ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,13 +56,14 @@ bool isSchemeHandlerRegistered()
process.waitForFinished();
QString output = process.readAllStandardOutput().trimmed();
return output.contains(BuildConfig.LAUNCHER_APP_BINARY_NAME);
return output.contains(APPLICATION->desktopFileName());
#elif defined(Q_OS_WIN)
QString regPath = QString("HKEY_CURRENT_USER\\Software\\Classes\\%1").arg(BuildConfig.LAUNCHER_APP_BINARY_NAME);
QSettings settings(regPath, QSettings::NativeFormat);
return settings.contains("shell/open/command/.");
const QString registeredRunCommand = settings.value("shell/open/command/.").toString().replace("\\", "/");
return registeredRunCommand.contains(QCoreApplication::applicationFilePath());
#endif
return true;
}