I'm creating an Electron App using React. It successfully plays flash on the dev environment but fails to do so in production. In my electron.js file (main file) I've added an if-else to locate the dll to a different folder when electron produces a build.
In the electron.js, I use this line to have the dll included when playing flash.
switch (process.platform) {
case 'win32':
pluginName = 'plugins/pepperflashplugin.dll'
break
case 'darwin':
pluginName = 'plugins/PepperFlashPlayer.plugin'
break
case 'linux':
pluginName = 'plugins/libpepflashplayer.so'
break
default:
break
}
isDev ? app.commandLine.appendSwitch('ppapi-flash-path', path.join(__dirname, pluginName)) :
app.commandLine.appendSwitch('ppapi-flash-path', 'resources/extraResources', pluginName);
Here's the build field of my package.json
"build": {
"appId": "com.fp.uav",
"files": [
"build/",
"node_modules/**/*"
],
"extraResources": [
{
"from": "public/plugins/",
"to": "extraResources",
"filter": [
"**/*"
]
}
],
"win": {
"icon": "public/assets/UAV.ico"
}
}
What happens is I build the project then electron-builder use the files in my build folder then it will put the production build in the dist.
Here's my Folder structure if it helps.
Any help is appreciated. Thanks!