{"record":{"id":"f10718e9b8937750","repo":"huiyadanli/RevokeMsgPatcher","slug":"apppath-package-json-h-bak","errorCode":null,"errorMessage":"在路径{appPath}下，未找到package.json.h.bak备份文件，请确认是否通过本软件安装过 LiteLoaderQQNT","messagePattern":"在路径(.+?)下，未找到package\\.json\\.h\\.bak备份文件，请确认是否通过本软件安装过 LiteLoaderQQNT","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"RevokeMsgPatcher/Forms/FormLiteLoaderQQNT.cs","lineNumber":240,"sourceCode":"        {\n            string destPath = Path.Combine(installPath, \"dbghelp.dll\");\n            if (File.Exists(destPath))\n            {\n                File.Delete(destPath);\n            }\n        }\n\n        private void RestorePackageJson(string appPath)\n        {\n            string packageJsonPath = Path.Combine(appPath, \"package.json\");\n            string backupPath = Path.Combine(appPath, \"package.json.h.bak\");\n            if (File.Exists(backupPath))\n            {\n                File.Copy(backupPath, packageJsonPath, true);\n            }\n            else\n            {\n                throw new Exception($\"在路径{appPath}下，未找到package.json.h.bak备份文件，请确认是否通过本软件安装过 LiteLoaderQQNT\");\n            }\n        }\n\n        /// <summary>\n        /// 打补丁\n        /// </summary>\n        /// <param name=\"sender\"></param>\n        /// <param name=\"e\"></param>\n        private void btnPath_Click(object sender, EventArgs e)\n        {\n            string installPath = txtQQNTPath.Text;\n            if (!IsAllFilesExist(installPath))\n            {\n                MessageBox.Show(\"请选择正确的QQNT安装路径!\");\n                return;\n            }\n\n            try","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/huiyadanli/RevokeMsgPatcher/blob/89cbbb3f0cc896d5d092de0199a635c5c39944b6/RevokeMsgPatcher/Forms/FormLiteLoaderQQNT.cs#L222-L258","documentation":"RestorePackageJson(appPath) restores QQNT's package.json by copying package.json.h.bak over package.json. That backup is only written by ModifyPackageJson during a successful LiteLoaderQQNT install; if it is absent, restore cannot proceed and a plain Exception is thrown.","triggerScenarios":"Clicking Restore (btnRestore_Click -> RestorePackageJson) when package.json.h.bak does not exist in the resolved appPath. Happens when LiteLoaderQQNT was never installed via this tool, when the backup was deleted, or when QQNT was reinstalled (wiping the app folder).","commonSituations":"User runs Restore before ever installing; QQNT got reinstalled so the .bak is gone; wrong QQNT install path so appPath resolves to a folder that never had the backup.","solutions":["Install LiteLoaderQQNT via this tool first (install creates package.json.h.bak).","If you modified package.json by other means, restore it manually from QQNT's original or reinstall QQNT.","Verify GetAppPath resolved to the correct versions\\<ver>\\resources\\app directory."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"string backupPath = Path.Combine(appPath, \"package.json.h.bak\");\nif (!File.Exists(backupPath))\n{\n    MessageBox.Show(\"未找到备份文件，请先通过本软件安装 LiteLoaderQQNT。\");\n    return;\n}\nRestorePackageJson(appPath);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install LiteLoaderQQNT via this tool before attempting Restore.","Keep package.json.h.bak intact; don't manually clean QQNT's app folder.","Verify the QQNT path (QQ.exe present) before Restore so appPath resolves correctly."],"tags":["restore","liteloaderqqnt","file-missing"],"backgroundTag":null,"analyzedSha":"89cbbb3f0cc896d5d092de0199a635c5c39944b6","analyzedAt":"2026-08-13T10:37:37.073Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}