Hi,
i'm using the electron-packager to create a setup of my electron application.
Now i have a question:
In the development im using "npm start" to test an run my application and this command looks like
"start": "..\\node_modules\\electron-prebuilt\\dist\\electron.exe . --disable-gpu --force-cpu-draw".
But after building the setup using the packager the arguments --disable-gpu and --force-cpu-draw will be ignored. Where to put this arguments in the build process to archive the function of it?
Thanks in advance!
Which version of electron-packager are you using?
5.2.1What CLI arguments are you passing? Alternatively, if you are using the API, what parameters are
you passing to thepackager()function?
electron-packager . APPNAME --out=../Staging/setup/win --platform=win32 --arch=all --version=1.2.5 --icon=icons/favicon.ico --version-string.ProductName=APPNAME --disable-gpu --force-cpu-drawWhat version of Electron are you building with?
1.2.5
What is the host platform are you running electron-packager on?
Windows 7 - 64bit
What target platform(s)/architecture(s) are you building for?
win32-ia32 and win32-x64Is there a stack trace in the error message you're seeing?
Please provide either a failing testcase or detailed steps to reproduce your problem.
Another title could be "passing command line arguments to Electron app after packaging"
Have you tried http://electron.atom.io/docs/api/chrome-command-line-switches/ ?
--disable-gpu and --force-cpu-draw are not listed - but i will take a look
I installed electron version 1.2.6 and tested the command line switches but without any effect
I don't know what to tell you, there's a bunch of projects that seem to use it: https://github.com/search?q=electron+disable-gpu&type=Code&utf8=%E2%9C%93
Thanks for your answers! I will check out the found code results and maybe test it on osx instead of windows
I can confirm that app.commandLine.appendSwitch('disable-gpu') doesn't work for me either. In addition, neither does app.commandLine.appendArgument('disable-gpu')
It appears I'm out of luck at this point because --disable-gpu is necessary for my deployment.
@jptillman app.disableHardwareAcceleration() https://github.com/electron/electron/blob/master/docs/api/app.md#appdisablehardwareacceleration
@develar Yep, that works. I missed that in my scan of the docs. Thanks!
That doesn't seem to force the CPU to become the renderer.
Most helpful comment
@jptillman
app.disableHardwareAcceleration()https://github.com/electron/electron/blob/master/docs/api/app.md#appdisablehardwareacceleration