-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreload.js
27 lines (22 loc) · 872 Bytes
/
preload.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'use strict';
const remote = require('@electron/remote');
//const process = remote.process;
const path = require('path');
global.mypaths = remote.getGlobal("mypaths");
const install = window.process.argv.find((f) => f.includes("install=")).split('=')[1];
async function pregame() {
var greenworks = require(path.join(global.mypaths.game.libs,'greenworks.js'));
}
//polyfill mainModule, direct to game dir instead of app dir
window.process.mainModule = {};
window.process.mainModule.filename = global.mypaths.app.game+'/index.html';
console.log("mainModule");
//console.log(process.mainModule.filename);
//polyfill steamkey
window.nw = {};
window.nw.App = {};
window.nw.App.argv = [];
//console.log(window.process.argv);
let steamkey = window.process.argv.find((f) => f.includes("steamkey="));
steamkey = steamkey.split('=')[1];
window.nw.App.argv.push(steamkey);