2023-02-09 10:39:21 +00:00
|
|
|
const fs = require('fs');
|
2023-09-03 09:56:24 +00:00
|
|
|
const defaultDir = './dist/win-ia32-unpacked/resources/default_app'
|
|
|
|
const exeFile = './dist/win-ia32-unpacked/OpenFusionClient.exe'
|
2023-02-09 10:39:21 +00:00
|
|
|
|
|
|
|
exports.default = function() {
|
|
|
|
// remove leftover files from default electron app
|
2023-09-03 09:56:24 +00:00
|
|
|
fs.rm(defaultDir, { recursive: true }, (err) => {
|
2023-02-09 10:39:21 +00:00
|
|
|
if (err) {
|
|
|
|
throw err;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
// patch executable for large address awareness
|
2023-09-03 09:56:24 +00:00
|
|
|
fs.open(exeFile, "r+", (err, fd) => {
|
2023-02-09 10:39:21 +00:00
|
|
|
if(!err) {
|
|
|
|
fs.write(
|
|
|
|
fd, new Uint8Array([0x22]), 0, 1, 0x166,
|
|
|
|
(err) => {
|
|
|
|
if(err) {
|
|
|
|
throw err;
|
|
|
|
}
|
|
|
|
fs.closeSync(fd);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
throw err;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|