{"record":{"id":"8adda85715f8c555","repo":"huiyadanli/RevokeMsgPatcher","slug":"apppath-app-launcher","errorCode":null,"errorMessage":"在路径{appPath}下，未找到app_launcher文件夹","messagePattern":"在路径(.+?)下，未找到app_launcher文件夹","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"RevokeMsgPatcher/Forms/FormLiteLoaderQQNT.cs","lineNumber":349,"sourceCode":"                        return Path.Combine(versionsPath, latestVersion, \"resources\", \"app\");\n                    }\n                }\n            }\n\n            return Path.Combine(installPath, \"resources\", \"app\");\n        }\n\n        /// <summary>\n        /// 创建 app/app_launcher/liteloader.h.js 文件，写入 require(String.raw*) 其中 * 为 LiteLoaderQQNT 的路径\n        /// </summary>\n        /// <param name=\"appPath\"></param>\n        /// <exception cref=\"Exception\"></exception>\n        private void CreateLauncherFile(string appPath)\n        {\n            string launcherDir = Path.Combine(appPath, \"app_launcher\");\n            if (!Directory.Exists(launcherDir))\n            {\n                throw new Exception($\"在路径{appPath}下，未找到app_launcher文件夹\");\n            }\n\n            string launcherFilePath = Path.Combine(launcherDir, \"liteloader.h.js\");\n            // if (File.Exists(launcherFilePath))\n            // {\n            //     Debug.WriteLine(\"已经创建过liteloader.h.js文件\");\n            //     return;\n            // }\n\n            string liteLoaderPath = Path.Combine(Application.StartupPath, \"LiteLoaderQQNT\");\n            string content = $\"require(String.raw`{liteLoaderPath}`);\";\n\n            File.WriteAllText(launcherFilePath, content, Encoding.UTF8);\n        }\n\n        /// <summary>\n        /// 修改 app/package.json 文件，将 main 后面的路径改为 ./app_launcher/liteloader.h.js\n        /// </summary>","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/huiyadanli/RevokeMsgPatcher/blob/89cbbb3f0cc896d5d092de0199a635c5c39944b6/RevokeMsgPatcher/Forms/FormLiteLoaderQQNT.cs#L331-L367","documentation":"CreateLauncherFile(appPath) writes liteloader.h.js into <appPath>/app_launcher/. It throws a plain Exception if that subfolder is missing, because the expected QQNT application folder layout is either wrong or has changed.","triggerScenarios":"The appPath returned by GetAppPath exists but contains no app_launcher directory. Occurs with an unexpected/older QQNT build, a restructured app folder, or appPath mis-resolution (e.g. versions folder present but empty, falling through to <install>/resources/app).","commonSituations":"New QQNT version restructured its app folder; a non-standard install layout was selected; the versions subfolder was emptied.","solutions":["Confirm the QQNT install path has versions\\<ver>\\resources\\app\\app_launcher.","Reinstall a supported QQNT version to repair the app folder layout.","Re-check that the chosen path is the QQNT root (the one containing QQ.exe)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"string launcherDir = Path.Combine(appPath, \"app_launcher\");\nif (!Directory.Exists(launcherDir))\n{\n    MessageBox.Show($\"{appPath} 下未找到 app_launcher 文件夹，请确认 QQNT 版本/路径。\");\n    return;\n}\nCreateLauncherFile(appPath);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm versions\\<ver>\\resources\\app\\app_launcher exists before installing.","Use a supported QQNT version whose app folder layout matches expectations.","Always select the QQNT root (containing QQ.exe) as the install path."],"tags":["liteloaderqqnt","install","path"],"backgroundTag":null,"analyzedSha":"89cbbb3f0cc896d5d092de0199a635c5c39944b6","analyzedAt":"2026-08-13T10:37:37.073Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}