chore: 修改windows打包报错

This commit is contained in:
电摇小子
2026-08-11 02:59:43 +08:00
parent 8a0d3b02d9
commit d1a090bb6b
2 changed files with 27 additions and 1 deletions
+3 -1
View File
@@ -88,7 +88,9 @@ function validateAsarRuntimeDependencies(runtimeResources) {
const asarPath = path.join(runtimeResources, 'app.asar')
if (!existsSync(asarPath)) throw new Error(`Missing packaged application archive: ${asarPath}`)
const entries = new Set(asar.listPackage(asarPath))
// @electron/asar returns platform-native separators. Normalize to POSIX
// paths so validation behaves consistently on Windows and macOS/Linux.
const entries = new Set(asar.listPackage(asarPath).map((entry) => entry.replaceAll('\\', '/')))
const missingPackages = REQUIRED_RUNTIME_PACKAGES.filter(
(packageName) => !entries.has(`/node_modules/${packageName}/package.json`)
)