electron-builder: Cannot build the app with "requestedExecutionLevel": "requireAdministrator"

  • Version: 20.13.4
  • Target: windows
  • Problem: cannot build app with “requestedExecutionLevel”: “requireAdministrator” | “highestAvailable” but working as “asInvoker”

So everything is working fine on electron-builder 20.5.1 then I decide to upgrade to version 20.13.4. Build the app and running as development is fine but when I build the app and open it is display the dialog message below. I’m also checking in Event Viewer and got this line. Activation context generation failed for "pathToApp\app.exe".Error in manifest or policy file "pathToApp\app.exe" on line 0. Invalid Xml syntax. Does this also relate to #2934?

image

[UPDATE]: I try to lower the version, but it is not working since version 20.6.0.

package.json

{
  "resolutions": {
    "webpack-sources": "1.1.0"
  },
  "electronWebpack": {
    "renderer": {
      "webpackConfig": "webpack.renderer.additions.js"
    }
  },
  "dependencies": {      
    "electron-store": "^1.3.0",    
    "material-ui": "^0.20.0",    
    "react": "^16.3.2",
    "react-dom": "^16.3.2",
    "react-router-dom": "^4.2.2",
    "source-map-support": "^0.5.6",
    "typeface-roboto": "^0.0.54"  
  },
  "devDependencies": {   
    "electron": "^2.0.1",
    "electron-builder": "^20.13.4",
    "electron-webpack": "^2.1.1",
    "electron-webpack-ts": "^2.0.2",    
    "tslint": "^5.9.1",
    "tslint-react": "^3.5.1",
    "typescript": "^2.8.3",
    "webpack": "^4.8.3"
  },
  "build": {
    "productName": "MyApp",
    "compression": "maximum",
    "forceCodeSigning": false,
    "asar": true,
    "win": {
      "icon": "resources/icon/icon.ico",
      "requestedExecutionLevel": "highestAvailable"    
    }   
  }
}

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 6
  • Comments: 35 (9 by maintainers)

Most upvoted comments

I had to downgrade to 20.4.1, the issue appears to be in 20.5.1 onward

Where is 20.31.0 coming from?

https://github.com/electron-userland/electron-builder/releases/tag/v20.31.0

Great, so, I will close issue, thanks for confirmation.

@develar that is correct. Everything is default except the “requireAdministrator” setting.

Why is this issue being ignored? Somebody set the label “reply needed”, but then ignores all replies?