From 93d4d3c976ec5b945cc0d122c506805c0502423c Mon Sep 17 00:00:00 2001 From: Araxeus Date: Mon, 10 May 2021 22:13:45 +0300 Subject: [PATCH] writeShortcut on windows --- index.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 1e1af391..278d51c4 100644 --- a/index.js +++ b/index.js @@ -255,8 +255,18 @@ app.on("ready", () => { }, 20000); } - if (is.windows()) { - app.setAppUserModelId("com.github.th-ch.youtube-music"); + if (!is.dev() && is.windows()) { + const appID = "com.github.th-ch.youtube-music"; + electron.shell.writeShortcutLink( + path.join(app.getPath("appData"), 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'YouTube Music.lnk'), + 'update', + { + target: process.execPath, + description: "YouTube Music Desktop App - including custom plugins", + appUserModelId: appID + } + ); + app.setAppUserModelId(appID); } mainWindow = createMainWindow();