3.0.4 breaks notification.onclick. Working on 2.7.0, full reproduction
See original GitHub issue- Electron Version:
- 4.0.8
- windows-installer Version:
- 3.0.4
- Last Known Working windows-installer version:
- 2.7.0
Expected Behavior
The following code should produce a notification and when clicked present an alert
const n = new Notification(1)
n.onclick = function () { alert('click') }
Actual Behavior
Works as expected when using 2.7.0, in 3.0.4 the notification presents, but the click event is never fired
To Reproduce
The following repo has a Notification example and takes care of creating a installer, start menu shortcuts etc. It basically a merge of electron-quick-start and the Handling Squirrel Events section in README
git clone https://github.com/wavebox/electron-quick-start.git -b winstaller-304-shortcut
cd electron-quick-start
npm install
npm run installer
Run the generated installer under electron-quick-start-installer
. The app will present a notification and when clicked does nothing.
The same example works with 2.7.0
. To try this…
- Manually uninstall
electron-quick-start
(this is important) - Downgrade
electron-winstaller
to2.7.0
npm run installer
- Install and try again
Additional Information
I’ve been digging around what’s going on here, and it’s definately down to the start menu shortcut that gets generated in 3.0.4. Install with 3.0.4 and replace the shortcut with the 2.7.0 version and it works!
Using lnk-parser the only discernable difference that I can find is the value type is different for System.AppUserModel.ID
. Here’s the entry for both…
2.7.0
- Property set GUID 9f4c2855-9f79-4b39-a8d0-e1d42de1d5f3
- ID 26
- Value 0x001f (VT_LPWSTR)
- b2b6457d-4173-5767-b785-be9d6904b546
- ID System.AppUserModel.ID
- Value 0x001f (VT_LPWSTR)
- com.squirrel.electron-quick-start.electron-quick-start
3.0.4
- Property set GUID 9f4c2855-9f79-4b39-a8d0-e1d42de1d5f3
- ID 26
- Value 0x0048 (VT_CLSID)
- CLSID:b2b6457d-4173-5767-b785-be9d6904b546
- ID System.AppUserModel.ID
Value 0x001f (VT_LPWSTR)
- com.squirrel.electron-quick-start.electron-quick-start
I could be off the mark here, it could be something different. If you need any more info let me know!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:10
Top GitHub Comments
i’m able to make a workaround : create shortcuts and setAppUserModelId manually
This issue is still not resolved? This is a pretty critical issue for any modern desktop application.