Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marffinn/0caa7f89efe883ab978fe0de821d49ec to your computer and use it in GitHub Desktop.
Save marffinn/0caa7f89efe883ab978fe0de821d49ec 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