mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
lint
This commit is contained in:
7
index.js
7
index.js
@ -257,12 +257,13 @@ app.on("ready", () => {
|
||||
|
||||
// Register appID on windows
|
||||
if (is.windows()) {
|
||||
const appLocation = process.execPath;
|
||||
const appID = "com.github.th-ch.youtube-music";
|
||||
app.setAppUserModelId(appID);
|
||||
const appLocation = process.execPath;
|
||||
const appData = app.getPath("appData");
|
||||
// check shortcut validity if not in dev mode / running portable app
|
||||
if (!is.dev() && !appLocation.startsWith(path.join(app.getPath("appData"), "..", "Local", "Temp"))) {
|
||||
const shortcutPath = path.join(app.getPath("appData"), "Microsoft", "Windows", "Start Menu", "Programs", "YouTube Music.lnk");
|
||||
if (!is.dev() && !appLocation.startsWith(path.join(appData, "..", "Local", "Temp"))) {
|
||||
const shortcutPath = path.join(appData, "Microsoft", "Windows", "Start Menu", "Programs", "YouTube Music.lnk");
|
||||
try { // check if shortcut is registered and valid
|
||||
const shortcutDetails = electron.shell.readShortcutLink(shortcutPath); // throw error if doesn't exist yet
|
||||
if (shortcutDetails.target !== appLocation || shortcutDetails.appUserModelId !== appID) {
|
||||
|
||||
Reference in New Issue
Block a user