Electron-packager: Where to place --disable-gpu --force-cpu-draw arguments in the build process

Created on 7 Jul 2016  路  10Comments  路  Source: electron/electron-packager

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.1

What CLI arguments are you passing? Alternatively, if you are using the API, what parameters are
you passing to the packager() 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-draw

What 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-x64

Is there a stack trace in the error message you're seeing?

Please provide either a failing testcase or detailed steps to reproduce your problem.

question

Most helpful comment

All 10 comments

Another title could be "passing command line arguments to Electron app after packaging"

--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.

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dland512 picture dland512  路  5Comments

29e7e280-0d1c-4bba-98fe-f7cd3ca7500a picture 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a  路  4Comments

Bharwcb picture Bharwcb  路  5Comments

Write-Guy picture Write-Guy  路  3Comments

Orrison picture Orrison  路  3Comments