-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
53 lines (46 loc) · 1.18 KB
/
index.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const electron = require('electron')
const {app, BrowserWindow, ipcMain} = electron
const {autoUpdater} = require("electron-updater");
var win;
function createWindow () {
win = new BrowserWindow({
width: 1000,
height: 1000,
frame: false,
transparent: true,
alwaysOnTop: true,
resizable: false,
webPreferences: {
enableRemoteModule: true,
nodeIntegration: true
}
})
win.show()
win.loadFile('index.html')
win.maximize()
}
app.whenReady().then(createWindow)
//auto-updates
app.on('ready', function() {
autoUpdater.checkForUpdatesAndNotify();
});
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
//ignore boxes while running app
ipcMain.on('set-ignore-mouse-events', (event, nothin) => {
BrowserWindow.fromWebContents(event.sender).setIgnoreMouseEvents(nothin)
})
//launch on startup
var AutoLaunch = require('auto-launch');
var autoLauncher = new AutoLaunch({
name: "Windows-mods"
});
autoLauncher.isEnabled().then(function(isEnabled) {
if (isEnabled) return;
autoLauncher.enable();
}).catch(function (err) {
console.log(err);
});