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

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

Closed
SxMShaDoW opened this issue Nov 19, 2016 · 12 comments · May be fixed by qcif/data-curator#563

Comments

@SxMShaDoW
Copy link

SxMShaDoW commented Nov 19, 2016

  • 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-Name\Version\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-Name\Version\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

@develar
Copy link
Member

develar commented Nov 29, 2016

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

@ghost
Copy link

ghost commented Nov 29, 2016

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

@develar
Copy link
Member

develar commented Nov 29, 2016

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

@ghost
Copy link

ghost commented Nov 29, 2016

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

@mattlyons0
Copy link

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.

@mattlyons0
Copy link

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.

@clusterberries
Copy link
Contributor

Hi! Is there any workaround for this issue?

@jonas-zipprick
Copy link

Can confirm this problem.

MariaDima added a commit to MariaDima/electron-builder that referenced this issue Jun 12, 2017
MariaDima added a commit to MariaDima/electron-builder that referenced this issue Jun 12, 2017
@develar develar closed this as completed Jun 13, 2017
@develar
Copy link
Member

develar commented Jun 13, 2017

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

@pashvin
Copy link

pashvin commented Dec 4, 2018

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?

@pashvin
Copy link

pashvin commented Dec 4, 2018

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.

@Stanzilla
Copy link

@pashvin #2514

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

Successfully merging a pull request may close this issue.

7 participants