Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkForUpdatesAndNotify updates but does not notify on Windows 10 #2700

Closed
forman opened this issue Mar 15, 2018 · 8 comments
Closed

checkForUpdatesAndNotify updates but does not notify on Windows 10 #2700

forman opened this issue Mar 15, 2018 · 8 comments

Comments

@forman
Copy link

forman commented Mar 15, 2018

electron-builder: 19.56.0
electron-updater: 2.20.1
electron: 1.8.2
node: 8.9.4
npm: 5.6.0

Target: Windows 10

First of all, thanks so much for this great tool! It is helping us a lot.

My problem is that autoUpdater.checkForUpdatesAndNotify() updates perfectly but does not notify on Windows 10. On Mac I get the expected toast when the update is available.

The project is cate-desktop which uses a two-package.json structure.

@forman
Copy link
Author

forman commented Mar 21, 2018

Could be related to electron/electron#10864

@marceloavf
Copy link
Contributor

Me neither, try all solutions in electron/electron#10864 but doesn't work, seems to be windows problem.

@marceloavf
Copy link
Contributor

marceloavf commented Apr 12, 2018

@forman I get it working again by setting Notification on import, setting model ID and default protocol:

import { app, Notification } from "electron"

app.setAppUserModelId("com.xxxx.xxxx");
app.setAsDefaultProtocolClient('xxxxx');

@forman
Copy link
Author

forman commented Apr 13, 2018

@marceloavf Great, thanks!

However, even after reading the electron API docs, I have no clue what arguments to pass to that API.

Where does the ID passed to setAppUserModelId come from? Am I free to choose? Or is it generated and must be registered in the OS or with Microsoft, e.g. by the installer of the app?

Also, could you given me a hint what protocol to pass to setAsDefaultProtocolClient that would enable the update notifications.

Thanks again!

@marceloavf
Copy link
Contributor

@forman According to Microsoft, AppUserModelId is defined with this base form CompanyName.ProductName.SubProduct.VersionInformation while the SubProduct and VersionInformation portions are optional.

Seems that if two apps set the same AppUserModelId it change some internal ID and if also sets the same ProtocolClient it opens a select menu.

I used to write it like this: com.companyName.softwareName, the ProtocolClient is just a shortcut to open your software with a command, I constantly use my company name summarized with the software name, for example: ps-softwarename.

@forman
Copy link
Author

forman commented Apr 19, 2018

@marceloavf Thanks, again. I will try it now.

@tzachshabtay
Copy link

Important to note here, that just calling setAppUserModelId is not enough, the string that you set there needs to match build.appId in your package.json (at least that's how I got it to work).

@Praveer1981
Copy link

Important to note here, that just calling setAppUserModelId is not enough, the string that you set there needs to match build.appId in your package.json (at least that's how I got it to work).
@tzachshabtay :
https://docs.microsoft.com/en-us/windows/win32/shell/appids?redirectedfrom=MSDN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants