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