Add large address aware patch to build process

This commit is contained in:
CakeLancelot 2023-02-09 03:14:09 +00:00
parent 4726a50be7
commit d0f947c4a5
3 changed files with 26 additions and 4 deletions

19
build/4gb-patch.js Normal file
View File

@ -0,0 +1,19 @@
const fs = require('fs');
const file = './dist/win-ia32-unpacked/OpenFusionClient.exe'
exports.default = async function() {
fs.open(file, "r+", (err, fd) => {
if(!err) {
fs.write(
fd, new Uint8Array([0x22]), 0, 1, 0x166,
(err) => {
if(err) {
throw err;
}
}
);
} else {
throw err;
}
});
}

View File

@ -1,10 +1,10 @@
const fs = require('fs'); const fs = require('fs');
const dir = './dist/win-ia32-unpacked/resources/default_app' const dir = './dist/win-ia32-unpacked/resources/default_app'
exports.default = async function(context) { exports.default = async function() {
fs.rmdir(dir, { recursive: true }, (err) => { fs.rm(dir, { recursive: true }, (err) => {
if (err) { if (err) {
throw err; throw err;
} }
}); });
} }

View File

@ -67,7 +67,10 @@
"to": "utils" "to": "utils"
} }
], ],
"afterPack": "./build/delete-default-app.js" "afterPack": [
"./build/4gb-patch.js",
"./build/delete-default-app.js"
]
}, },
"dependencies": { "dependencies": {
"fs-extra": "^0.30.0" "fs-extra": "^0.30.0"