sffc
sffc

Reputation: 6414

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

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?

Upvotes: 4

Views: 4032

Answers (1)

sffc
sffc

Reputation: 6414

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

"build": {
  // ...
  "fileAssociations": [{
    "ext": "xyz",
    "name": "XYZ File",
    "role": "Editor"
  }]
}

Upvotes: 7

Related Questions