mirror of
https://github.com/felixrieseberg/windows95.git
synced 2026-05-14 10:31:58 +00:00
Deal with resedit segfaults
This commit is contained in:
832
package-lock.json
generated
832
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,8 @@
|
||||
"lint": "prettier --write src/**/*.{ts,tsx} && npm run check-links",
|
||||
"less": "node ./tools/lessc.js",
|
||||
"tsc": "tsc -p tsconfig.json --noEmit",
|
||||
"check-links": "node tools/check-links.js"
|
||||
"check-links": "node tools/check-links.js",
|
||||
"postinstall": "patch-package"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Felix Rieseberg, felix@felixrieseberg.com",
|
||||
@@ -41,6 +42,7 @@
|
||||
"electron": "34.2.0",
|
||||
"less": "^3.13.0",
|
||||
"parcel-bundler": "^1.12.5",
|
||||
"patch-package": "^8.0.0",
|
||||
"prettier": "^3.5.1",
|
||||
"rimraf": "^6.0.1",
|
||||
"typescript": "^5.7.3"
|
||||
|
||||
32
patches/@electron+packager+18.3.6.patch
Normal file
32
patches/@electron+packager+18.3.6.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
diff --git a/node_modules/@electron/packager/dist/win32.js b/node_modules/@electron/packager/dist/win32.js
|
||||
index 5399b3e..f3b6e88 100644
|
||||
--- a/node_modules/@electron/packager/dist/win32.js
|
||||
+++ b/node_modules/@electron/packager/dist/win32.js
|
||||
@@ -57,7 +57,26 @@ class WindowsApp extends platform_1.App {
|
||||
resOpts.iconPath = icon;
|
||||
}
|
||||
(0, common_1.debug)(`Running resedit with the options ${JSON.stringify(resOpts)}`);
|
||||
- await (0, resedit_1.resedit)(this.electronBinaryPath, resOpts);
|
||||
+
|
||||
+ // This causes segmentation faults for me on multiple machines
|
||||
+ // It's unclear why exactly but this spawn hack fixes it
|
||||
+ // await (0, resedit_1.resedit)(this.electronBinaryPath, resOpts);
|
||||
+
|
||||
+ const { spawnSync } = require('child_process');
|
||||
+ const resEditProcess = spawnSync('node', [
|
||||
+ 'C:\\Users\\FelixRieseberg\\Code\\windows95\\tools\\resedit.js',
|
||||
+ this.electronBinaryPath
|
||||
+ ], {
|
||||
+ stdio: 'inherit'
|
||||
+ });
|
||||
+
|
||||
+ if (resEditProcess.error) {
|
||||
+ throw resEditProcess.error;
|
||||
+ }
|
||||
+
|
||||
+ if (resEditProcess.status !== 0) {
|
||||
+ throw new Error(`Resedit process exited with code ${resEditProcess.status}`);
|
||||
+ }
|
||||
}
|
||||
async signAppIfSpecified() {
|
||||
const windowsSignOpt = this.opts.windowsSign;
|
||||
24
tools/resedit.js
Normal file
24
tools/resedit.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const resedit = require('../node_modules/@electron/packager/dist/resedit.js')
|
||||
const package = require('../package.json');
|
||||
|
||||
const exePath = process.argv[process.argv.length - 1]
|
||||
|
||||
console.log(exePath)
|
||||
|
||||
async function main() {
|
||||
|
||||
await resedit.resedit(exePath, {
|
||||
"productVersion": package.version,
|
||||
"fileVersion": package.version,
|
||||
"productName": package.productName,
|
||||
"win32Metadata": {
|
||||
"FileDescription": package.productName,
|
||||
"InternalName": package.name,
|
||||
"OriginalFilename": `${package.name}.exe`,
|
||||
"ProductName": package.productName,
|
||||
"CompanyName": package.author
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user