Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you specify a custom file extension in an Electron app?

Tags:

electron

I want to create a custom file type for my Electron app. I want custom file icons and for the app to open when you double-click on the file. How do I do this?

like image 564
sffc Avatar asked Nov 14 '25 16:11

sffc


1 Answers

Use the fileAssociations option in electron-builder. For example, in your package.json:

"build": {
  // ...
  "fileAssociations": [{
    "ext": "xyz",
    "name": "XYZ File",
    "role": "Editor"
  }]
}
like image 160
sffc Avatar answered Nov 17 '25 09:11

sffc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!