electron / electron/windows-installer

3.0.4 breaks notification.onclick. Working on 2.7.0, full reproduction

Open
#296 11 comments 12 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.6k
Forks
267
Avg merge
5h 38m
Merged PRs (30d)
1

Description

* **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
```js
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

```bash
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` to `2.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](https://code.google.com/archive/p/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
([full 270 output.pdf](https://github.com/electron/windows-installer/files/2961691/270.pdf))

* **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
([full 304 output.pdf](https://github.com/electron/windows-installer/files/2961693/304.pdf))

* **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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.