Electron-builder: NSIS: Auto-updating leaves a bad shortcut when a user attaches the icon to the Windows Taskbar

Created on 19 Nov 2016  路  12Comments  路  Source: electron-userland/electron-builder

  • Version: Electron-builder: 8.6.0

  • Target: Windows NSIS

User Story

As a Electron-App user, I would like my pinned Taskbar icon to still work after updating, so I can quickly use my app after updates and reduce time spent pinning the icon to my Taskbar after every update.

Current situation:

When you do auto-update, it installs it in a new folder, deletes the old folder, and leaves the pinned Taskbar icon referencing a folder that doesn't exist.

Example workflow:

### User side: 
1. user has electron app on Windows Taskbar.
2. User runs electron app on 2.0.21. It is installed in C:\Program Files\electron-app\2.0.21\electron-app.exe 
3. User boots up the app. 
4. User gets install prompt. Accepts it.
5. The app downloads. 
### Electron-App: 
* Creates a new folder 2.0.22. 
* Installs Electron-app in the  2.0.22. 
* Deletes folder 2.0.21.
* leaves the dock icon referencing a folder and .exe that doesn't exist.

Ideal situation:

When you do an auto-update, the pinned Taskbar icon continues to work.

Assumptions:

Currently Electron-App structure is: Program_Files\Electron-App-NameVersion\Electron-App.exe
Uninstalling is easy because it uninstalls the entire Version folder.

Potential Proposal:

Move the .exe outside of the version folder?
Electron-App Structure:

  • Program_files\Electron-App-Name\Electron-App.exe
  • Program_files\Electron-App-NameVersion\Electron-App files (including uninstall)

Note: The above proposal is just a suggestion, I am open to whatever the best technical implementation is (I trust you know better than me).

References: #884

feature nsis

Most helpful comment

Fixed (If allowToChangeInstallationDirectory is not set to true). Thanks to @MariaDima

All 12 comments

Solution: Since you should use asar, it is ok to not create folder per version.

@develar: I upgraded to v10.2.0, but my application is still being unpinned during upgrade.

@bontibon Were both versions (old and new) built by 10.2.0?

@develar: Yes; I just re-ran the same installer.

I can confirm on Windows 10 I am also experiencing this issue. Upon closing my application when a update will be installed the pin is removed (cleaned up by the NSIS installer?). When manually executing the installer I get the same behavior.

UninstShortcut calls IStartMenuPinnedList::RemoveFromList which removes the shortcut from being pinned in both the start menu and the taskbar.

Since the updater effectively runs the old uninstall and the new installer this is being called. If the paths are no longer being changed upon update (and the updater should check that, since the new installer could use a different directory) the portion of the uninstall where shortcuts are removed and reinstalled could be skipped when updating.

Hi! Is there any workaround for this issue?

Can confirm this problem.

Fixed (If allowToChangeInstallationDirectory is not set to true). Thanks to @MariaDima

We are still experiencing this issue in Windows
"devDependencies": {
"electron": "2.0.14",
"electron-builder": "20.31.2"
},
"nsis": {
"oneClick": true,
"perMachine": false,
"include": "build/nsis-scripts/installer.nsh"
},
"msi": {
"oneClick": true,
"perMachine": true,
"runAfterFinish": false
}
Is it broken again?

Actually it's a diff issue. It does not keep old short cut but it deletes old pinned icon on every upgrade. so looks like a diff issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JohnWeisz picture JohnWeisz  路  3Comments

jhg picture jhg  路  3Comments

iklemm picture iklemm  路  3Comments

alexstrat picture alexstrat  路  3Comments

leo picture leo  路  3Comments