Electron Fuses support
See original GitHub issueI’m flipping fuses in my afterPack script. Is there a better way to get the path to the final packaged Electron executable?
const path = require('path')
const { flipFuses, FuseVersion, FuseV1Options } = require('@electron/fuses')
module.exports = async function afterPack(context) {
const ext = {
darwin: '.app',
win32: '.exe',
}[context.electronPlatformName]
const electronBinaryPath = path.join(context.appOutDir, context.packager.appInfo.productFilename + ext) // is there a better way?
await flipFuses(
electronBinaryPath,
{
version: FuseVersion.V1,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
},
)
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:9
Top Results From Across the Web
@electron/fuses - npm
Start using @electron/fuses in your project by running `npm i @electron/fuses`. There are no other projects in the npm registry using ...
Read more >Electron Fuses
Fuses are the solution to this problem, at a high level they are "magic bits" in the Electron binary that can be flipped...
Read more >Fuses, Relays - Circuit protection - Electron.com
Fuses, Relays,Car Fuses (Blade Type),Fuse holders,PCB Mount Fuses,Relays,Thermal Cutoff,Glass Fuses,PTC Resettable Fuses.
Read more >Catching The Electron Flow: Multimeters And Fuse Box ...
Any battery with an OCV under 12.4 volts won't produce enough amperage to support extended ignition-on, engine-off electrical testing. In that regard, never ......
Read more >Electron 15 Adds String Encoding API - I Programmer
Electron 15 has been released with updates to Chromium and Node.js, ... were made in this release to the support and use of...
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
Hey guys, I investigated further to see if I could integrate Fuses package directly into electron-builder. Got the logic flow but the schema validator fails due to having to use
FuseConfig
from @electron/fuses https://github.com/electron/fuses/blob/d69eb9cc92b13e77b08bdf3b594635fc0a2c83b8/src/config.ts#L17-L22This theoretically would allow version overrides since electron-builder schema wouldn’t need to have a breaking change when a FuseV2Config eventually comes out. Instead, it’d just be a simple package update and the schema would automatically accept the new version.
Due to the way the package’s
FuseOptions
was written, the schema comes out all weird because it can’t handle enums. This is what is generated in the schemaWhich translates to:
version
andEnableCookieEncryption
overlap values and aren’t rendered in the schema validator.This was the configuration property
The documentation site won’t even generate either. 😢
I don’t see a way for this to be able to be published. Thoughts are welcome. For now, I’m closing this ticket and suggesting this approach https://github.com/electron-userland/electron-builder/issues/6365#issuecomment-1191747089. Sorry folks
Adding on to ☝️ , when building for MacOS Universal distributable and want to flip fuses, you’ll need to run
flipFuses
only on theafterPack
of theuniversal
callback stage (added in https://github.com/electron-userland/electron-builder/releases/tag/v23.1.0) asafterPack
is called for x64, arm64, and universal stages You’ll need to wrap the code above with: (note: I use electron-builder.js as a config file to achieve typesafety. More info: https://www.electron.build/api/programmatic-usage)