diff --git a/config.forge.js b/config.forge.js index 896b900..212b559 100644 --- a/config.forge.js +++ b/config.forge.js @@ -4,7 +4,7 @@ module.exports = { packageName: "Launcher", name: "Launcher", productName: "Launcher", - icon: path.resolve(__dirname, 'app.ico') + icon: path.resolve(__dirname, 'icon.png') }, makers: [ { diff --git a/main.js b/main.js index ae27d37..f3cc79f 100644 --- a/main.js +++ b/main.js @@ -1,6 +1,9 @@ const { app, BrowserWindow, Menu, ipcMain, Notification } = require('electron') const path = require('path') -if (handleSquirrelEvent()) return; +if (require('electron-squirrel-startup')) { + handleSquirrelEvent() + app.quit() +} const { Client, Authenticator } = require('minecraft-launcher-core') const appdata = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + '/Library/Preferences' : process.env.HOME + "/.local/share") diff --git a/package-lock.json b/package-lock.json index e01c303..28fea4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1735,6 +1735,29 @@ } } }, + "electron-squirrel-startup": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/electron-squirrel-startup/-/electron-squirrel-startup-1.0.0.tgz", + "integrity": "sha1-GbTlWTP6Dvj1VnhLnGYPdyVGoLg=", + "requires": { + "debug": "^2.2.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, "electron-winstaller": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/electron-winstaller/-/electron-winstaller-4.0.1.tgz", diff --git a/package.json b/package.json index 2cc3d2c..5cb8f96 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "electron": "^11.1.1" }, "dependencies": { + "electron-squirrel-startup": "^1.0.0", "minecraft-launcher-core": "^3.16.1" }, "config": {