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

After upgrading to 24.13.2, Windows NSIS installer Failed to uninstall old application files when there is an app running #8131

Closed
zaichaopan-alianza opened this issue Mar 12, 2024 · 8 comments · Fixed by #8133

Comments

@zaichaopan-alianza
Copy link

  • Electron-Builder Version: 24.13.2
  • Node Version: 18.14.0
  • Electron Version: 29.1.1
  • Electron Type (current, beta, nightly): current
  • Target: Windows

After upgrading to 24.13.2, when installing nsis installer when app is running, it shows below error "xxxx cannot be closed. Please close it manually and click Retry to continue"

electron-quick-start-is-running

Click Retry will keep showing the dialog again. When click Cancel, it shows "old application files cannot be uninstalled"
electron-quick-start-is-cannot-uninstall-old-app

Versions before 24.13.2 do not have this issue

When try previous version 24.13.1, It shows dialog xxx is running, click OK to close. After click OK, running app will close and install will continue.

electron-quick-start-13 1

Step to reproduce

  • upgrade electron-builder to 24.13.2 and create a NSIS installer
  • install the installer and have the app running
  • click the installer again to install or make another new installer to install

Seems like the fix in #8059 introduce this issue. Have anyone run into the same issue?

Thx a million !

@zaichaopan-alianza zaichaopan-alianza changed the title After upgrading to 24.13.2, Windows NSIS installer Failed to uninstall old application files when there is an app instancer After upgrading to 24.13.2, Windows NSIS installer Failed to uninstall old application files when there is an app running Mar 12, 2024
@mmaietta
Copy link
Collaborator

What's your nsis electron-builder config? I'll try and repro this locally

@zaichaopan-alianza
Copy link
Author

thank you so much @mmaietta I have the repo https://github.com/zaichaopan-alianza/electron-builder-24.13.2-nsis-installer you can try. It is from electron-quick-start. My config is very simple. It just

{
  "name": "electron-quick-start",
  "version": "1.0.0",
  "description": "A minimal Electron application",
  "main": "main.js",
  "build": {
    "appId": "com.example.electron-quick-start"
  },
  "scripts": {
    "start": "electron .",
    "pack": "electron-builder --dir",
    "dist": "electron-builder"
  },
  "repository": "https://github.com/electron/electron-quick-start",
  "keywords": [
    "Electron",
    "quick",
    "start",
    "tutorial",
    "demo"
  ],
  "author": "GitHub",
  "license": "CC0-1.0",
  "devDependencies": {
    "electron": "^29.1.1",
    "electron-builder": "24.13.2"
  }
}

@mmaietta
Copy link
Collaborator

Thanks for the repo! Really appreciate it.

Will take a look this week when I find some solid time outside of work

@beyondkmp
Copy link
Contributor

SYSTEMROOT = "c:\windows", The path c:\windows contains special characters, so it needs to be enclosed in double quotes to work properly.

!define SYSTEMROOT "$%SYSTEMROOT%"
nsExec::Exec '"${SYSTEMROOT}\System32\cmd.exe" /c tasklist /FI "USERNAME eq %USERNAME%" /FI "IMAGENAME eq ${_FILE}" /FO csv | "${SYSTEMROOT}\System32\find.exe" "${_FILE}"'

@zaichaopan-alianza
Copy link
Author

@beyondkmp I tried the fix #8133. The issue is no longer reproduced. Thanks a lot!

@mmaietta
Copy link
Collaborator

Releasing in 25.0.0-alpha.4

@sumeet-singh04
Copy link

Would this fix be backported to 24.13.3 ?

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 3, 2024

Unfortunately, AFAIK it's not possible to backport fixes to previous versions due to the @changesets CI/CD approach. It's only able to roll forward AFAICT. Happy to be disproved otherwise though!

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

Successfully merging a pull request may close this issue.

4 participants