{"record":{"id":"fe08a7b030aea2bb","repo":"ramensoftware/windhawk","slug":"missing-libraryfilename-value","errorCode":null,"errorMessage":"Missing LibraryFileName value","messagePattern":"Missing LibraryFileName value","errorType":"exception","errorClass":"std::runtime_error","httpStatus":null,"severity":"error","filePath":"src/windhawk/engine/mod.cpp","lineNumber":256,"sourceCode":"            }\n        }\n\n        return false;\n    };\n\n    return (!patterns.includeExcludeCustomOnly &&\n            listTakesEveryProcess(patterns.include)) ||\n           listTakesEveryProcess(patterns.includeCustom);\n}\n\n// The library named by the mod's settings. It must be a file in the mods\n// folder, so only a bare file name is accepted: a separator, a root name or a\n// \"..\" would make the joined path escape the folder. A ':' is rejected on its\n// own, since a root name is a single drive letter and \"foo:bar\", a stream on\n// the folder, is its own filename().\nstd::filesystem::path GetModLibraryPath(std::wstring_view libraryFileName) {\n    if (libraryFileName.empty()) {\n        throw std::runtime_error(\"Missing LibraryFileName value\");\n    }\n\n    std::filesystem::path fileName(libraryFileName);\n    if (fileName != fileName.filename() ||\n        libraryFileName.find(L':') != libraryFileName.npos ||\n        libraryFileName == L\".\" || libraryFileName == L\"..\") {\n        throw std::runtime_error(\"Invalid LibraryFileName value\");\n    }\n\n    return StorageManager::GetInstance().GetModsPath() / fileName;\n}\n\nMod::ChangeMarker MakeChangeMarker(PortableSettings& settings) {\n    return {\n        .libraryFileName = settings.GetString(L\"LibraryFileName\").value_or(L\"\"),\n        .settingsChangeTime =\n            settings.GetInt(L\"SettingsChangeTime\").value_or(0),\n    };","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/ramensoftware/windhawk/blob/61d99ed8e182e1af1b60109612b6763ad1b4b74e/src/windhawk/engine/mod.cpp#L238-L274","documentation":"GetModLibraryPath builds the absolute path of a mod's DLL from the LibraryFileName declared in mod metadata. If that value is absent or empty, it throws runtime_error because a mod without a library file name cannot be loaded. This is a validation guard before any path is constructed.","triggerScenarios":"Mod::Load (or DoesModExportToolModMarker) reading a mod whose metadata section has no LibraryFileName key, or where it resolves to an empty string.","commonSituations":"Hand-edited or corrupted mod.ini/metadata files; mods downloaded with missing or stripped metadata; tooling that generates mod packages without the required key.","solutions":["Add a LibraryFileName entry to the mod's metadata file matching the compiled DLL name (e.g. LibraryFileName=my_mod.dll).","Re-download or reinstall the mod from a trusted source — the installed package is incomplete.","If you author mods, validate your package metadata before distribution (all required keys present)."],"exampleFix":"// before ([Mod] section)\nName=MyMod\nAuthor=Me\n// after ([Mod] section)\nName=MyMod\nAuthor=Me\nLibraryFileName=MyMod.dll","handlingStrategy":"validation","validationCode":"// C++ caller-side pre-check before Mod::Load\nstd::wstring libFile = ReadModSetting(modDir, L\"LibraryFileName\").value_or(L\"\");\nif (libFile.empty()) {\n    LOG(L\"Mod %s is missing LibraryFileName; skipping\", modName.c_str());\n    return false;\n}","typeGuard":null,"tryCatchPattern":"try {\n    mod->Load();\n} catch (const std::runtime_error& e) {\n    if (std::string_view(e.what()) == \"Missing LibraryFileName value\") {\n        LOG(L\"Skipping mod with incomplete metadata\");\n    }\n}","preventionTips":["Validate mod metadata (required keys present) before installing a mod package.","Never hand-edit mod.ini without verifying against the official schema.","Reinstall mods from official sources rather than copying folders manually.","For mod authors, include LibraryFileName in your packaging template."],"tags":["windhawk","mod-metadata","config","validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"61d99ed8e182e1af1b60109612b6763ad1b4b74e","analyzedAt":"2026-09-12T14:02:41.115Z","contentChangedAt":"2026-09-12T14:02:41.115Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}