Electron-builder: Update is downloaded but not installed, if application was installed for all users (in Program Files) on Windows

Created on 27 Nov 2019  ·  13Comments  ·  Source: electron-userland/electron-builder


  • electron-builder:
    22.1.0
  • electron-updater:
    4.2.0
  • Target:
    nsis


    Settings:
    "nsis": {
      "oneClick": false,
      "allowToChangeInstallationDirectory": true,
      "allowElevation": true,
      ...
     }

Steps to reproduce:

  1. Build electron app, and put the version to lets say 1.0.0;
  2. Build nsis target and artifacts for auto-update (latest.yml);
  3. Build the app again, put the version to lets say 1.0.1, also build artifacts (latest.yml);
  4. Upload the 1.0.1 version to your server, or wherever, just so 1.0.0 can see it;
  5. Launch the 1.0.0 app. Wait for the update to download, app relaunches to update. So far so good.
  6. Now, if the app was installed for single user (to C:/Users/User/AppData/Local/Programs/...) everything is fine, the app is uninstalled, then the 1.0.1 version is installed, all good.
    But if the app was installed for all users (to C:/Program Files/...) the UAC dialog launches, asking for permission (as expected), the app is uninstalled (as expected), but then it is not installed again (totally unexpected). No errors, no warning, no nothing.

I will be happy to provide any other info if needed.

backlog

Most helpful comment

Probably worth mentioning, the app-updater folder (in C:/Users/User/AppData/Local/app-updater/pending/update-info.json) has the property "isAdminRightsRequired": false, shouldn't it be set to true, actually, if the app is installed in the Program Files for all users?

All 13 comments

Indeed very strange. Can you try to start your exe from command line and see what happen in the console? Did you already try on another PC?

@kzimny What exe and when exactly? The main app exe? Or the app installer exe? It installs totally fine to any location, when installed manually.

Probably worth mentioning, the app-updater folder (in C:/Users/User/AppData/Local/app-updater/pending/update-info.json) has the property "isAdminRightsRequired": false, shouldn't it be set to true, actually, if the app is installed in the Program Files for all users?

The exe file launch in step 5 from C:/Program Files/MyApp/myapp.exe.
Look at https://github.com/electron-userland/electron-builder/issues/4312. Maybe similar issue?

Okay, running it as Administrator allows it to install properly. I think it is the same as #1129
@develar Can you look into this?

@DominikLevitsky did you solve this?

Not sure is related but my NSIS installer just dies in the middle of installation progress, no matter if I run it as administrator. NB: it starts installing.
This is breaking my users auto-update (and causing an infinite loop of installations...).

How can I debug the NSIS installer created by electron-builder?

"nsis": {
    "oneClick": false,
    "perMachine": true,
    "allowElevation": true,
    "deleteAppDataOnUninstall": true,
}
...
"electron": "^7.1.3",
"electron-builder": "21.2.0",

@damianobarbati We solved the install issue using this:

    "win": {
     ...
      "requestedExecutionLevel": "highestAvailable"
    }

But it seems like a temporary solution only, because now, it always asks for admin permission on every app opening, which is not acceptable. I wish someone could help to fix this.

@DominikLevitsky thanks for helping. Unfortunately that's not working for me, the installer keep just dying.

解决了吗?

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.

We also have this problem.

some infos @adambailey- ? @damianobarbati

Same issue here. Anyone willing to work on this? Any useful pointers?

PS: I'm using "electron-builder": "^22.8.0" and "electron-updater": "^4.3.4"

Was this page helpful?
0 / 5 - 0 ratings