When attempting to open a file by double-clicking, I encounter an issue while using electron-packager to build the application for the Mac App Store.
Although I have set up the electron app to launch when a file is double-clicked, it appears that the filename of the opened file is not sent as a command line parameter to the app.
Instead of receiving the requested file path in argv[1], I am getting -psn_0_857362. I had anticipated argv[1] would contain the file path, but this does not seem to be the case.
Below is a simplified version of the code snippet used in main.js:
ipcMain.on(
'getOpenFile',
function( e ) {
let data = null;
if ( process.argv.length >= 2 ) {
data = process.argv[1];
}
e.returnValue = data;
}
);
I am puzzled as to why the file path is not being displayed. Is there a limitation imposed by the Mac App Store or is there another step required to enable the expected functionality?