electron-builder icon indicating copy to clipboard operation
electron-builder copied to clipboard

app that build with requireAdministrator flag could not be update

Open Fndroid opened this issue 3 years ago • 2 comments

  • Electron-Builder Version: ^22.14.13
  • Node Version: v14.17.6
  • Electron Version: ^17.1.0
  • Electron Type (current, beta, nightly): current
  • Target: nsis

here is a part of the package.json file:

{
    "win": {
      "requestedExecutionLevel": "requireAdministrator",
      "icon": "build/icons/icon.ico",
      "extraResources": [],
      "target": [
        "nsis"
      ],
    },
    "nsis": {
      "oneClick": false,
      "allowToChangeInstallationDirectory": true,
      "deleteAppDataOnUninstall": true
    }
}

oneClick is set to false and perMachine is false by default, so users can install it only for their own account(not all users).

requestedExecutionLevel is set to requireAdministrator then the app will be run with admin privilege.

Here is the problem, if this user want to update the app while it is running. The nsis installer could not kill the app because it is not run under admin privilege. Then some file of the app could not be overwritten because the app locks them.

Maybe an option name forceElevation might help?

Fndroid avatar Mar 14 '22 15:03 Fndroid

I also encountered this problem

Xqrrrr avatar May 23 '22 01:05 Xqrrrr

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment, or this will be closed in 30 days.

github-actions[bot] avatar Jun 15 '25 00:06 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity.

github-actions[bot] avatar Jul 16 '25 00:07 github-actions[bot]