set `requestedExecutionLevel` option on windows will cause application crash
See original GitHub issueI’m building 32bit application on windows using electron-builder 20.19.2, electron-updater 2.23.3 and electron 2.0.3
this is build
section of my package.json:
“build”: { “appId”: “launcher”, “directories”: { “output”: “out” }, “win”: { “publish”: { “provider”: “generic”, “url”: “http://127.0.0.1/update/”, “channel”: “latest” }, “target”: [ { “target”: “portable”, “arch”: “ia32” } ], “asar”: true, “requestedExecutionLevel”: “requireAdministrator”, “files”: [ “dist/", "local_packages/”, “main.js”, “package.json” ] } },
When I set requestedExecutionLevel
option to requireAdministrator
or highestAvailable
, the produced exe file could not be started.It looks like electron-builder generated a wrong format of manifest file.
The error message shows below:
The application has failed to start because the side by side configuration is incorrect please see the application event log or use the command line sxstrace.exe tool for more detail.
the manifest file in generated exe file shows below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"><dependency><dependentAssembly><assemblyIdentity type="Win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity></dependentAssembly></dependency><trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"><security><requestedPrivileges><requestedExecutionLevel level="requireAdministrator" uiAccess="false"></requestedExecutionLevel></requestedPrivileges></security></trustInfo><asmv3:application xmlns:asmv3=“urn:schemas-microsoft-com:asm.v3”><asmv3:windowsSettings xmlns=“http://schemas.microsoft.com/SMI/2005/WindowsSettings”><dpiAware>true/pm</dpiAware><disableWindowFiltering xmlns="http://schemas.microsoft.com/SMI/2011/WindowsSettings">true</disableWindowFiltering></asmv3:windowsSettings></asmv3:application><ms_compatibility:compatibility xmlns:ms_compatibility=“urn:schemas-microsoft-com:compatibility.v1” xmlns=“urn:schemas-microsoft-com:compatibility.v1”><ms_compatibility:application xmlns:ms_compatibility=“urn:schemas-microsoft-com:compatibility.v1”><ms_compatibility:supportedOS xmlns:ms_compatibility=“urn:schemas-microsoft-com:compatibility.v1” Id=“{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}”></ms_compatibility:supportedOS><ms_compatibility:supportedOS xmlns:ms_compatibility=“urn:schemas-microsoft-com:compatibility.v1” Id=“{1f676c76-80e1-4239-95bb-83d0f6d0da78}”></ms_compatibility:supportedOS><ms_compatibility:supportedOS xmlns:ms_compatibility=“urn:schemas-microsoft-com:compatibility.v1” Id=“{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}”></ms_compatibility:supportedOS><ms_compatibility:supportedOS xmlns:ms_compatibility=“urn:schemas-microsoft-com:compatibility.v1” Id=“{35138b9a-5d96-4fbd-8e2d-a2440225f93a}”></ms_compatibility:supportedOS><ms_compatibility:supportedOS xmlns:ms_compatibility=“urn:schemas-microsoft-com:compatibility.v1” Id=“{e2011457-1546-43c5-a5fe-008deee3d3f0}”></ms_compatibility:supportedOS></ms_compatibility:application></ms_compatibility:compatibility></assembly>
some unreadable character 
is in the beginning of this manifest file, so I guess maybe these character causes application crash
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top GitHub Comments
I have the same issue when set option
"requestedExecutionLevel": "requireAdministrator"
. Without this option, my app build success and working.It’s been 2 years since I was opened this issue. So I think it’s okay to close it. If anyone has any questions, please feel free to reopen it.