fix(integrity): exclude installer-managed metadata

This commit is contained in:
Comely
2026-07-12 18:44:11 -07:00
parent b098792001
commit b736472b55
2 changed files with 20 additions and 14 deletions
+17 -3
View File
@@ -11,7 +11,21 @@ inline bool isRuntimeProtectedPath(const QString& path,
{
const QString normalizedPath =
QDir::cleanPath(QDir::fromNativeSeparators(path)).toCaseFolded();
static const QSet<QString> protectedPaths{
static const QSet<QString> installerManagedRootFiles{
QStringLiteral("components.xml"),
QStringLiteral("installationlog.txt"),
QStringLiteral("installer.dat"),
QStringLiteral("maintenancetool.dat"),
QStringLiteral("maintenancetool.exe"),
QStringLiteral("maintenancetool.ini"),
QStringLiteral("network.xml")
};
if (installerManagedRootFiles.contains(normalizedPath)
|| normalizedPath.startsWith(QStringLiteral("installerresources/"))
|| normalizedPath.startsWith(QStringLiteral("licenses/")))
return true;
static const QSet<QString> runtimeProtectedPaths{
QStringLiteral("bootstrap.exe"),
QStringLiteral("client.ini"),
QStringLiteral("config/app_config.json"),
@@ -19,7 +33,7 @@ inline bool isRuntimeProtectedPath(const QString& path,
QStringLiteral("config/client_identity.dat"),
QStringLiteral("config/version_policy.dat")
};
if (protectedPaths.contains(normalizedPath))
if (runtimeProtectedPaths.contains(normalizedPath))
return true;
QString runtimePrefix = QDir::cleanPath(
@@ -29,7 +43,7 @@ inline bool isRuntimeProtectedPath(const QString& path,
while (runtimePrefix.startsWith(QStringLiteral("./")))
runtimePrefix.remove(0, 2);
for (const QString& protectedPath : protectedPaths) {
for (const QString& protectedPath : runtimeProtectedPaths) {
if (normalizedPath == runtimePrefix + QLatin1Char('/') + protectedPath)
return true;
}