Packaging for OpenGL

I’m using a third party library called Spout, which has been made into an Unreal Plugin. It requires Unreal to be running in OpenGL mode, which the Unreal Editor can be forced to open in using the command line with an -opengl flag.

I’m having issues when trying to package the game though. During the packaging process an error dialogue opens, which is generated from the Spout library code, actually within the dll, the error is due to there being no OpenGl device context.

Could someone shed some light on why the code is being run at all, not just compiled, during the packaging process.

The same error dialogue can be produced by playing as a standalone game from the editor, this can be solved by adding -opengl to the ‘Additional Launch Parameters’ in the ‘Level Editor - Play’ settings.

I’ve tried changing the windows platform settings to only target the OpenGL RHI. Perhaps there’s a way of packaging via the command line and targeting just OpenGL? or packaging without the plugin code being run?

Any help would be appreciated.