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

Windows NSIS uninstall fails when built from MacOS Catalina #4875

Closed
fkoehler42 opened this issue Apr 14, 2020 · 31 comments
Closed

Windows NSIS uninstall fails when built from MacOS Catalina #4875

fkoehler42 opened this issue Apr 14, 2020 · 31 comments
Labels

Comments

@fkoehler42
Copy link

fkoehler42 commented Apr 14, 2020

  • Version: 22.4.1

  • Electron Version: 7.2.1

  • Electron Type (current, beta, nightly): current

  • Electron Updater Version: 4.2.5

  • Target: Windows NSIS (tested on Windows 7 and 10)

I recently switched to Mac OS 10.15 (Catalina) which doesn't support 32 bit executables anymore. Doing so, I also upgraded electron-builder to the latest version so Wine isn't used.

Since then, my Windows NSIS uninstaller seems broken. The build process works as expected, no error/warning raised. However, after the first install of my app which works well, I face a NSIS error when I try to uninstall. This is the common "Installer integrity check has failed" error. When I try to either manually reinstall the app or update it using electron-updater, the installer progress bar stays stuck at around 40%.

My build config is the default one. I tried some tweaks suggested on similar issues but none of them helped. If I build my app from a previous MacOS version the issue disappears.

@shrinidhi111
Copy link

I had to downgrade to 21.2.0 to fix my issue #4878

@fkoehler42
Copy link
Author

Unfortunately this issue seems different: I got no warning from Windows Defender. I tried to downgrade electron-builder to 21.x, as well as turning off the "Windows Defender real-time protection". (Issue appears also on Windows 7 BTW)

@Snake231088
Copy link

Same issue!
Any solution or workaround?

@BusinessDuck
Copy link
Contributor

BusinessDuck commented Apr 18, 2020

Same for me!
image
Affected by this reg key. Clean it and problem is gone. I think something wrong with nsis templates.

@BusinessDuck
Copy link
Contributor

BusinessDuck commented Apr 18, 2020

Hack solution (good once for oneClick):

"nsis": {
      "guid": "MyAppName",
      "include": "build/installer.nsh",
    },

build/installer.nsh listing

!macro customInit
    DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\MyAppName"
!macroend

@fkoehler42
Copy link
Author

fkoehler42 commented Apr 20, 2020

@BusinessDuck I tried to remove the UninstallString key but doing so makes Windows think my app has already been uninstalled so the program is removed from the control panel without being actually uninstalled

@BusinessDuck
Copy link
Contributor

use !macro customUnInstall instead

@pafa7a
Copy link

pafa7a commented May 3, 2020

Building with MacOS Catalina 10.15.4 and experiencing the same issues on Windows.
Custom removal in nsis scripts didn't worked at all (was not triggered).
When building the installer from Windows machine everything works well...

@matt-cree-instil
Copy link

matt-cree-instil commented May 4, 2020

I'm also experiencing the same issues -- building on Windows for Windows works fine.

@andywang646691
Copy link

andywang646691 commented May 12, 2020

This problem exists in many electron-builder versions, and has not been fixed until now. just try a hack, and modify electron-builder source code:
image
comment code and throw error so that electron-builer can builds installer by parallels vm.
The source code maybe from node_modules/app-builder-lib/out/targets/nsis/NsisTarget.js or node_modules/electron-builder/node_modules/app-builder-lib/out/targets/nsis/NsisTarget.js

The hint come from here

@ouzhou
Copy link

ouzhou commented Jun 29, 2020

same issue

@simple-YoungBadBoy
Copy link

Same issue!
Any solution or workaround?

@matt-cree-instil
Copy link

matt-cree-instil commented Aug 9, 2020 via email

@stale
Copy link

stale bot commented Oct 10, 2020

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 Oct 10, 2020
@stale stale bot closed this as completed Oct 17, 2020
@aschmid
Copy link

aschmid commented Oct 19, 2020

same issue here. :(

@Ali-Albaker
Copy link

same issue

@gentlecoder
Copy link

gentlecoder commented Nov 17, 2020

Same here. I use /NCRC to uninstall it, works fine for me.

@lauritzen
Copy link

Same here. I worked around it by building "on Windows" with the electronuserland/builder:wine Docker image on MacOS, more info here: https://www.electron.build/multi-platform-build#build-electron-app-using-docker-on-a-local-machine. The script I'm using:

docker run --rm \
       --env-file <(env | grep -vE '\r|\n' | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') \
       --env ELECTRON_CACHE="/root/.cache/electron" \
       --env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
       -v ${PWD}:/project \
       -v ${PWD}/docker-node-modules:/project/node_modules \
       -v ~/.cache/electron:/root/.cache/electron \
       -v ~/.cache/electron-builder:/root/.cache/electron-builder \
       electronuserland/builder:wine \
       /bin/bash -c "yarn --link-duplicates --pure-lockfile && yarn electron:publish"

@olegdolenchuk
Copy link

same issue

1 similar comment
@takuyabz
Copy link

same issue

@takuyabz
Copy link

This issue cause is building on mac.
You should build on a windows environment.
I installed the parallels desktop on Mac, and build it for windows.
Then I succeeded uninstall on windows.
please try this solution, thank you.

@LukeXF
Copy link

LukeXF commented Jul 3, 2021

Same issue, can't understand why this is such a big issue

@tjx666
Copy link

tjx666 commented Aug 9, 2021

Still exits....

@mmaietta
Copy link
Collaborator

mmaietta commented Aug 24, 2021

This is the recommended solution: https://www.electron.build/multi-platform-build#build-electron-app-using-docker-on-a-local-machine

Happy to review a PR if anyone would like to open one. Setting up a local dev environment is fairly simple: https://github.com/electron-userland/electron-builder/blob/master/CONTRIBUTING.md#to-setup-a-local-dev-environment

@Ali-Albaker
Copy link

Still exists. It's best to use Windows OS, VM or docker to make the build

@adamcjm
Copy link

adamcjm commented Jan 29, 2023

I find a way to solve this problem:

  1. You can try to add a line code with the content CRCCheck off to bottom of the file node_modules/app-builder-lib/templates/nsis/common.nsh.

  2. And then rebuild and install the application to windows, and try to uninstall or update.

these two step fixed my problem.

@adamcjm
Copy link

adamcjm commented Jan 29, 2023

Still exists. It's best to use Windows OS, VM or docker to make the build

I find a way to solve this problem:

  1. You can try to add a line code with the content CRCCheck off to bottom of the file node_modules/app-builder-lib/templates/nsis/common.nsh.

  2. And then rebuild and install the application to windows, and try to uninstall or update.

these two step fixed my problem.

@adamcjm
Copy link

adamcjm commented Jan 29, 2023

Still exits....

I find a way to solve this problem:

  1. You can try to add a line code with the content CRCCheck off to bottom of the file node_modules/app-builder-lib/templates/nsis/common.nsh.

  2. And then rebuild and install the application to windows, and try to uninstall or update.

these two step fixed my problem.

@adamcjm
Copy link

adamcjm commented Jan 29, 2023

Same issue, can't understand why this is such a big issue

I find a way to solve this problem:

  1. You can try to add a line code with the content CRCCheck off to bottom of the file node_modules/app-builder-lib/templates/nsis/common.nsh.

  2. And then rebuild and install the application to windows, and try to uninstall or update.

these two step fixed my problem.

@ErnestLeung52
Copy link

I find a way to solve this problem:

  1. You can try to add a line code with the content CRCCheck off to bottom of the file node_modules/app-builder-lib/templates/nsis/common.nsh.
  2. And then rebuild and install the application to windows, and try to uninstall or update.

these two step fixed my problem.

This works for me!!! Thank you!

@itsdouges
Copy link

When you turn CRCCheck off is there any unintended consequences of that? Does code signing become at risk?

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