You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(is.windows()){// Depends on SnoreToast version https://github.com/KDE/snoretoast/blob/master/CMakeLists.txt#L5consttoastActivatorClsid="eb1fdd5b-8f70-4b5a-b230-998a2dc19303";// v0.7.0constappID="com.github.th-ch.youtube-music";app.setAppUserModelId(appID);constappLocation=process.execPath;constappData=app.getPath("appData");// continue if not in dev mode / running portable appif(!is.dev()&&!appLocation.startsWith(path.join(appData,"..","Local","Temp"))){// shortcutPath can be anywhere inside AppData\Roaming\Microsoft\Windows\Start Menu\Programs\constshortcutPath=path.join(appData,"Microsoft","Windows","Start Menu","Programs","YouTube Music.lnk");// check if shortcut doesn't exist -> create it, if it exist and invalid -> update ittry{constshortcutDetails=electron.shell.readShortcutLink(shortcutPath);// throws error if it doesn't exist yet// validate shortcutDetailsif(shortcutDetails.target!==appLocation||shortcutDetails.appUserModelId!==appID||shortcutDetails.toastActivatorClsid!==toastActivatorClsid){throw"needUpdate";}// if the execution got to this line, the shortcut exists and is valid}catch(error){// if not valid -> Register shortcutelectron.shell.writeShortcutLink(shortcutPath,error==="needUpdate" ? "update" : "create",{target: appLocation,cwd: path.dirname(appLocation),description: "YouTube Music Desktop App - including custom plugins",appUserModelId: appID,
toastActivatorClsid
});}}}
this method currently requires Electron but you could get packages from npm / make similar functions yourself
The text was updated successfully, but these errors were encountered:
Thanks for the guide 🙌 ! Added link to this post here 027f0d6.
If you have any suggestion how to have an official way to know the version, I'm happy to hear it!
You need to create a shortcut to your app in the start menu, and it needs to include the following:
appUserModelId
Application User Model IDtoastActivatorClsid
Value depends on the SnoreToast version!https://github.com/KDE/snoretoast/blob/v0.9.0/CMakeLists.txt#L5
https://github.com/KDE/snoretoast/blob/v0.7.0/CMakeLists.txt#L5
You need to do
app.setAppUserModelId(appID)
Here is an example from youtube-music :
The text was updated successfully, but these errors were encountered: