Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save santiblanko/ec6bdb426eb6847affd96cf4de335e5e to your computer and use it in GitHub Desktop.
Save santiblanko/ec6bdb426eb6847affd96cf4de335e5e to your computer and use it in GitHub Desktop.
Command to add extra resources in your electron app

This is the example usage of electron-packager that I never found online anywhere else.

To add resource.exe and resource2.dll in the resource folder when you create an installer, this is how you do it with the --extra-resource commandline switch.

--extra-resource

electron-packager . --overwrite --asar --extra-resource="resource1.exe" --extra-resource="resource2.dll" --platform=win32 --arch=ia32 --icon=./frontend/dist/assets/icon.ico --prune=true --out=./build --version-string.ProductName='Hot Pan de sal'

within the backend code you can refer to the files as:

"./resources/resource1.exe"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment