nsis can't install the app for all users on some PC
See original GitHub issue- Version: 20.44.4
- Target: windows
I have created an installer using electron-builder settings below:
"build": {
"productName": "MyApp",
"appId": "com.MyApp",
"extraResources": [
{
"from": "./someApp/someApp.exe",
"to": "someApp.exe"
},
{
"from": "./someApp/someApp.config.yaml",
"to": "someApp.config.yaml"
}
],
"directories": {
"output": "build"
},
"files": [
"dist/electron/**/*"
],
"win": {
"icon": "build/icons/icon.ico",
"requestedExecutionLevel": "requireAdministrator"
},
"nsis": {
"oneClick": false,
"perMachine": true,
"allowToChangeInstallationDirectory": true
}
},
I have installed the app on few machines and there were two PC where I couldn’t install it. Here is what I get:
it says: Installation Aborted. Setup was not completed successfully.
I have no idea why this happens, and how to fix it. Does anybody know why it might happen? This problem appears on two machines out of 7 I have tested so far. Both run windows 10.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:30 (5 by maintainers)
Top Results From Across the Web
AllUsers/CurrentUser install without elevation - NSIS Forums
AllUsers /CurrentUser install without elevation. I've got a game application that I'm trying to write an installer for.
Read more >Complete Guide: How to Fix NSIS Error Windows 10
The NSIS error is an issue that commonly comes up when you're installing a program. How to deal with this error? This post...
Read more >NSIS Error - STILL not working. - Microsoft Community
If the NSIS cannot install something, the error which occurs could be due to several reasons. For example, improper configuration settings, ...
Read more >Why do I get NSIS Error?
The installer has failed a self-check. This means that for some actions, the installer file has been altered from its original form. If...
Read more >Installed NSIS application is not shown in start menu/system ...
Use SetShellVarContext to switch constants to "all users"/machine mode: RequestExecutionLevel Admin Function .onInit SetShellVarContext All ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm the issue. Upgrading electron-builder and changing the nsis configuration results in problems with installing the new package over an existing installation:
The new installer might work on a second try, which will also result in a non-updated + broken installation entry in the Windows programs list.
@Zver64 IMO this should be reopened
Ok, seems like the above is not the complete story, there seems to be an issue with the installation directory depending if a one-click unattended installer or an attended installer is created.
I recently added this section to my package.json build config:
Without the above section, an unattended one-click installer is created which on a clean installation installs the app into:
\AppData\Local\Programs\<packagejson.name>\
so unless you use the “build.extraMetadata” option to change the “name” property, multiple apps with different “productName” values overwrite each other despite creating separate registry entries and desktop shortcuts (which seem to be based on the productName.When adding the above config which creates the attended installer, on a clean install the app is installed into:
\AppData\Local\Programs\<packagejson.build.productName>
allowing separate app installations to be created without having to change the "name " property.If the app is installed first using the one-click installer and then installed over the top using the attended installer, the attended installer detects an existing installation at
\AppData\Local\Programs\<packagejson.name>\
, then removes the contents of the directory and installs the app at:\AppData\Local\Programs\<packagejson.name>\<packagejson.build.productName>
instead of\AppData\Local\Programs\<packagejson.build.productName>
uninstalling the app then leaves behind an empty\AppData\Local\Programs\<packagejson.name>\
directory but does correctly remove the registry entries.I was not able to reproduce the issue by performing the above steps, so likely it was caused by the changes i had made over time.