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 · 19 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
Collaborator

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!

@indutny-signal
Copy link
Contributor

Was the fix for this released already?

@mmaietta
Copy link
Collaborator

@indutny-signal The fix that was implemented was released in 25.0.0-alpha.4

@indutny-signal
Copy link
Contributor

I was hoping for a stable release, but currently fighting my way through upgrading to 25.0.0 😂 Universal builds appear to be a bit hosed.

@mmaietta
Copy link
Collaborator

@indutny-signal yeah, I plan on converting it to stable soon, I was just hoping for more adoption than the ~7% it currently is 😅

Can you open a new GH issue for the universal build issue you mention? That particularly confuses me.

@finnlaymfarmor
Copy link

Hi @mmaietta ,

We're currently running [email protected], and getting the same error. I've tried a number of different fixes across GH Issues, SO, and asking LLM's but nothing seems to be remedying. Any ideas?

@1007912932
Copy link

你好@mmaietta

我们目前正在运行 [email protected],但出现了同样的错误。我尝试了 GH 问题、SO 和咨询 LLM 等多种不同的修复方法,但似乎都无济于事。有什么想法吗?

大神,最后怎么处理的这个问题,可以贴下回复吗,万分感谢!

@beyondkmp
Copy link
Collaborator

@finnlaymfarmor @1007912932 Can you provide a minimal reproducible demo code?

@1007912932
Copy link

electron-builder哪个版本解决了吗,我看8133关闭了

@1007912932
Copy link

能加个微信沟通下吗?
我的微信号:luffy_is_fool

@LWD8
Copy link

LWD8 commented Dec 9, 2024

降回22.14.13就可以了,升级electron-builder@25也不行

@cgarrovillo
Copy link

This issue needs to be reopened as it seems we have not come into a common conclusion that this is fixed @mmaietta

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.

9 participants