electron-builder: NSIS install fails on terminal servers with multiple users already running the program
22.11.7
Which version of node are you using? 14.17.1
Which version of electron are you using? 8.5.5
Which version of electron-updater are you using (if applicable)? 4.3.9
For which target are you building for?
"win": {
"icon": "resources/icons/win/icon.ico",
"target": {
"target": "nsis-web",
"arch": [
"ia32",
"x64"
]
},
"artifactName": "${name}_setup_${version}.${ext}"
},
"nsisWeb": {
"createDesktopShortcut": false,
"createStartMenuShortcut": true,
"menuCategory": true,
"guid": "com.update-test",
"perMachine": false,
"allowElevation": true,
"differentialPackage": true,
"uninstallDisplayName": "${productName}",
"runAfterFinish": true,
"oneClick": true,
"allowToChangeInstallationDirectory": false
},
The issue I am having is the NSIS installer incorrectly determines the application is still running on terminal servers if any user has it open, even when using per user. This blocks the install most of the time, or worse yet, auto kills all instances on the terminal server for all users when one user wants to update their individual install. Both of these are serious bugs. The installer should not check processes for other users when it is installed to one user folder. And it absolutely should not be able to kill the process for other users.
To reproduce. Build an NSIS-web installer.
Connect to a terminal server with 2 different users. Install and run the application one one user. Then try to install on the other, it will fail.
On the right is the application running on a terminal server user. On the left is the installer trying to run on the same server but a different user
Is there a way to disable to is running check with a custom nsis script or anything? We encountered this bug during a large deployment which we have now paused.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 23 (8 by maintainers)
Commits related to this issue
- fix(nsis): ignore process owned by other users Only check for processes owned by current user when the app is installed per-user. On per-user installation, other users are running their own copy of t... — committed to I-Otsuki/electron-builder by I-Otsuki 3 years ago
- fix(nsis): ignore process owned by other users Only find and kill processes owned by current user on install. On per-user installation, other users run their own copy of the app. These instances will... — committed to I-Otsuki/electron-builder by I-Otsuki 3 years ago
- fix(nsis): Ignore other users processes during per-user installation (#6472) * fix(NSIS): ignore process owned by other users Only find and kill processes owned by the current user on install. On... — committed to electron-userland/electron-builder by I-Otsuki 3 years ago
Hope this works. https://github.com/I-Otsuki/electron-builder/blob/c4691563b6dfd98125265b71bdd2f921a2706012/packages/app-builder-lib/templates/nsis/include/allowOnlyOneInstallerInstance.nsh
Found that said behaviour has been there from before I made changes.
Anyway, this could be a cause of what @TDola reported, I mean, random closing of processes. I fixed this and opened a PR #6472
Um, no, this isn’t enough. If current user have the app running, this will kill other users instances too. On per-user install, I have to add
/FI "USERNAME eq %USERNAME%"to taskkill too. So it won’t kill everyone’s app. I’ll add some lines tomorrow.@Simolation Sort of yeah. As long as in app you still run the quit and update function it still works fine.
It’s working for me now. I have tested what happens if you leave it open, and it just errors trying to install. Not a great solution but if your head is under the gun too, it might be the best solution for now until the electron-builder team fixes the issue.
Should be possible to check if the app is running and what user is running it. Only close the current users versions.
Something like this powershell command gives the user ID with the app
Well it change made everyone happy again so I guess that worked. Should I leave this issue open because the solution was just bypassing electron-builders nsis script and it should still be fixed?