We have an electron app that uses Imagemagick on OSX, we have pre-installed that with brew install. It works fine in development, but when we package the app - it cant find imagemagick.
Can we brew install imagemagick before setting up the app? How would we go about doing this?
If using electron-builder (which I recommend) you can simply add a postinstall
script to your package.json to install Imagemagick
In package.json
"scripts": {
"postinstall": "brew install imagemagick"
}
Alternatively if you don't want to install it, or brew might not already be available on target machines, you can install imagemagick into a folder within the app then add that to the extraResources
key of package.json
"extraResources": ["imagemagick/"]
This will tell electron-builder to bundle this folder into the archive. Then just reference imagmagick from that folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With