1

I have a Mac electron app that calls a compiled binary that I wrote when a button is pressed. The way I have it set up is:

  1. The binary (let's call it test) is placed in a bin folder, which sits in the root directory of the application.

  2. From a Javascript file, I run

var appRootDir = require('app-root-path');
var path = appRootDir + '/bin/test';
const spawn = require( 'child_process' ).spawn;
var child = spawn( path, []); 

whenever I want to start the binary This works great when I run the app locally via npm start. But, when I package it by running electron-builder, the binary fails to get called. I don't have this problem on Windows because electron-builder creates a folder containing the app and its files, but on Mac, everything seems to be condensed into one application. I've tried following this example but it seems specific to ffmpeg/I couldn't get it to work.

Clearly I must be missing something--does anyone have any ideas? Thank you!

philippemnoel
  • 21
  • 1
  • 3

0 Answers0