修复 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
+1
View File
@@ -133,6 +133,7 @@ jobs:
- name: Prepare win7 electron env - name: Prepare win7 electron env
run: | run: |
npm install electron@22 npm install electron@22
npm install better-sqlite3@12
pip.exe install setuptools pip.exe install setuptools
- name: Build Package win7 Setup x64 - name: Build Package win7 Setup x64
+1
View File
@@ -113,6 +113,7 @@ jobs:
- name: Prepare win7 electron env - name: Prepare win7 electron env
run: | run: |
npm install electron@22 npm install electron@22
npm install better-sqlite3@12
pip.exe install setuptools pip.exe install setuptools
- name: Release win7 package - name: Release win7 package
+2 -2
View File
@@ -33,8 +33,8 @@ const archMap = {
module.exports = async(context) => { module.exports = async(context) => {
await beforePack() await beforePack()
const { arch } = context const { arch } = context
const electronVersion = context.packager?.info?._framework?.version ?? require('../package.json').devDependencies.electron.replace(/^[^\d]*?(\d+)/, '$1') // const electronVersion = context.packager?.info?._framework?.version ?? require('../package.json').devDependencies.electron.replace(/^[^\d]*?(\d+)/, '$1')
await copyLib(archMap[arch], parseInt(electronVersion) == 22) await copyLib(archMap[arch])
// const electronNodeAbi = nodeAbi.getAbi(electronVersion, 'electron') // const electronNodeAbi = nodeAbi.getAbi(electronVersion, 'electron')
// if (electronPlatformName !== 'linux' || process.env.FORCE) return // if (electronPlatformName !== 'linux' || process.env.FORCE) return
// // const bindingFilePath = path.join(__dirname, '../node_modules/better-sqlite3/binding.gyp') // // 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.unlink(targetPath).catch(_ => _)
await fs.promises.copyFile(filePath, targetPath) await fs.promises.copyFile(filePath, targetPath)
} }
exports.copyLib = async(arch = process.arch, replaceLocal = false) => { exports.copyLib = async(arch = process.arch) => {
if (process.platform === 'linux' || replaceLocal) { if (process.platform === 'linux') {
await replaceSqliteLib(arch) await replaceSqliteLib(arch)
return return
} }
Binary file not shown.
Binary file not shown.