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 electron-updater uninstalls old version, but does not install new version #6329

Closed
delewis13 opened this issue Oct 11, 2021 · 14 comments
Closed
Labels

Comments

@delewis13
Copy link

delewis13 commented Oct 11, 2021

UPDATE - NAMING COLLISION BETWEEN INSTALLER & PRODUCT

I will note that there are a number of other threads / bugs that exhibit similar behaviour [i.e. uninstalls and doesn't reinstall], but all with seemingly different root causes. I have fixed this in my case, for my specific root cause [detailed below]. If this helps you, awesome - please post in the thread that it helped to let maintainers know.

If not, then your root cause is probably different - in this case, probably better you post on one of the other threads around this issue / create your own, rather than adding here.

THE FIX

Minimal reproduction: https://github.com/delewis13/electron-builder-minimal/tree/electron-updater-nsis-bug
Issue can be reproduced across multiple version combinations of electron-builder / electron / electron-updater

It seems there is some naming collision when the productName in your electron-builder config (which is used to name the installed .exe) and the artifactName (which is the installer) are the same (case-insensitive).

For example, previously I had productName: 'myapp' and artifactName: 'myApp.exe' which caused the issue as described below. Simply changing artifaceName: 'myApp Setup.exe resolved the issue.

ORIGINAL POST

electron: 11.1
electron-builder: 22.13.1
electron-updater: 4.3.9
node: 15.0.1

Pretty much as title says.

Tried with various build configs & electron-updater methods. The most simple of which was:

  },
  nsis: {
    oneClick: true,
    installerIcon: `./builder/images/ico/${pkg.productName}/recording.ico`,
    uninstallerIcon: `./builder/images/ico/${pkg.productName}/recording.ico`,
    installerHeaderIcon: `./builder/images/ico/${pkg.productName}/recording.ico`,
  },

with
autoUpdater.checkForUpdatesAndNotify()

Tested with & without code-signing cert

@Echo4F
Copy link

Echo4F commented Oct 14, 2021

Install new version

@delewis13
Copy link
Author

Install new version

New version of what? My electron-builder + electron-updater are both latest published on NPM :S

@Echo4F
Copy link

Echo4F commented Oct 14, 2021

Uninstall old version

@Echo4F
Copy link

Echo4F commented Oct 14, 2021 via email

@Echo4F
Copy link

Echo4F commented Oct 14, 2021

I have done it
Please what next

@ragauskl
Copy link

This worked for me: #2363 (comment)

@delewis13
Copy link
Author

Afraid none of those fixes helped @ragauskl :( Thanks for the suggestion though

@github-actions github-actions bot added the bug label Nov 2, 2021
@delewis13
Copy link
Author

delewis13 commented Nov 2, 2021

@mmaietta noticed you are quite active here - thought i'd tag you.

I've made a minimal reproduction of this error forked from electron-webpack-quick-start, though i've also reproduced it on other electron / electron builder versions.

See the initial post above for more info, i've updated it with link to minimal reproduction of bug + description

@robertpatrick
Copy link
Contributor

@mmaietta I am seeing the same behavior with our app. autoInstallOnAppQuit=true works when the NSIS app is installed "only for you". When installed for "All users" and exiting the app, the Windows UAC prompt is displayed asking for permissions for the "old-installer". Upon granting permission, the app is uninstalled but the installer never starts (and no Windows UAC Prompt is ever displayed).

@ejwilburn
Copy link

We're seeing the same issue. This used to happen with just the advanced installer (not the one-click installer) and switching to the one-click installer fixed it for us but now auto-update is broken completely on Windows.

Windows 10 x64 in my test environment.

@delewis13
Copy link
Author

delewis13 commented Nov 20, 2021

@robertpatrick @ejwilburn

Looks like a similar symptom with a different root causes? I was observing the issue across all installer configs [regardless of one-click vs advanced, or all users vs single user].

You've probably already looked, but perhaps #2363?

@robertpatrick
Copy link
Contributor

@delewis13 I didn't realize that #2363 existed. That, and #6425, have me concerned that this feature isn't being properly tested on Windows. What can I do to help get auto-update working correctly on Windows?

@stale
Copy link

stale bot commented Apr 16, 2022

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the backlog label Apr 16, 2022
@robertpatrick
Copy link
Contributor

@mmaietta i think this is resolved already, probably should close this.

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

No branches or pull requests

6 participants