修复 win7 无法启动的问题

This commit is contained in:
lyswhut
2026-09-14 20:05:55 +08:00
parent abcbf5fa00
commit 96fd33065a
6 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -33,8 +33,8 @@ const archMap = {
module.exports = async(context) => {
await beforePack()
const { arch } = context
const electronVersion = context.packager?.info?._framework?.version ?? require('../package.json').devDependencies.electron.replace(/^[^\d]*?(\d+)/, '$1')
await copyLib(archMap[arch], parseInt(electronVersion) == 22)
// const electronVersion = context.packager?.info?._framework?.version ?? require('../package.json').devDependencies.electron.replace(/^[^\d]*?(\d+)/, '$1')
await copyLib(archMap[arch])
// const electronNodeAbi = nodeAbi.getAbi(electronVersion, 'electron')
// if (electronPlatformName !== 'linux' || process.env.FORCE) return
// // const bindingFilePath = path.join(__dirname, '../node_modules/better-sqlite3/binding.gyp')
+2 -2
View File
@@ -40,8 +40,8 @@ const replaceSqliteLib = async(arch) => {
await fs.promises.unlink(targetPath).catch(_ => _)
await fs.promises.copyFile(filePath, targetPath)
}
exports.copyLib = async(arch = process.arch, replaceLocal = false) => {
if (process.platform === 'linux' || replaceLocal) {
exports.copyLib = async(arch = process.arch) => {
if (process.platform === 'linux') {
await replaceSqliteLib(arch)
return
}
Binary file not shown.
Binary file not shown.