reavertm Jul 15, 2015 @ 2:28pm
2
Launch Options: allow setting environment variables
Currently Steam UI allows to append custom launch options to application executable.
Please extend "Launch Options" with additional input box to add environment variables and set them for the game.

Rationale:
Certain OpenGL applications or games might have broken OpenGL detection and require setting stuff like LD_PRELOAD=/usr/lib64/libGL.so to work. Others simply have broken AA support and might require driver-level override like __GL_FSAA_MODE=8.
And the point is still to have Steam game tracking (which is lost when game is launched externally).

Of course it can be worked-around by creating wrapper script but in such case game update will overwrite it.

It might be tricky to do that on Windows and it depends on how Steam actually launches the game (fork+exec?), but for Linux/SteamMachines and MacOSX it should be fairly simple, so pretty please :)
Last edited by reavertm; Jul 15, 2015 @ 2:30pm
< >
Showing 1-9 of 9 comments
Pew pew pew! Sep 16, 2018 @ 5:35am 
That superuser comment only applies if you're launching games from the commandline. Half the point of Steam is that you're *not* launching from commandline, you're launching from Steam.
豆花米线 Sep 16, 2018 @ 6:37am 
Originally posted by Cyan:
That superuser comment only applies if you're launching games from the commandline. Half the point of Steam is that you're *not* launching from commandline, you're launching from Steam.

You mean this doen't work?

From https://support.steampowered.com/kb_article.php?ref=1040-JWMT-2947:
Right-click on the game title under the Library in Steam and select Properties.
Under the General tab click the Set launch options... button.
Enter the launch options you wish to apply (be sure to separate each code with a space) and click OK.
Close the game's Properties window and launch the game.
reavertm Sep 28, 2018 @ 3:32am 
Of course it's doesn't work, I wouldn't be posting suggestion if it did.

Steam launcher args are passed to game launcher as command line arguments, so command needs to understand and handle them explicitly. This is what Steam API provides, any Steam app will have that argument parsing code embedded.
But enviroment variables are something different. They are less explicit. Some library that either game or Steam API uses, can read some of them. It can be audio library, nvidia driver etc. Environment variables, in order to be effective need to be:

a) either prepended before command (shell invocation method or running processes)
<VARIABLES_WITH_VALUES> %command <LAUNCHER_ARGS>

b) or exported in parent process (fork+exec method for running processes)
Last edited by reavertm; Sep 28, 2018 @ 3:38am
Modewarp Dec 27, 2021 @ 6:18am 
Here's a recent game which needs environment variables set to play on modern processors:
https://steamcommunity.com/app/692850/discussions/0/3202619099968902082/

I would also like this feature. I just spent a good amount of time trying to see if I could get the current launch options to do it.
zaphodikus Feb 9, 2022 @ 12:40pm 
Wow, this thread is pretty old, keep finding reasons myself to have this kind of feature, gets my vote for sure! Specially a issue for folk with those 10th generation i processors.
Terr Jun 29, 2022 @ 11:04pm 
I needed this feature today. A game (State of Mind) that was crashing at the main menu, due to a bug with OpenSSL libraries that was exhibited by my newer Intel CPU.

The only really practical workaround I found was to restart Steam itself with the necessary environment variables, but the problem with this approach is:

  • I need to always remember to do it again in the future
  • Any settings will affect all games in my library, I can't be selective

For reference:

C:\Users\Terr>setx OPENSSL_ia32cap ~0x200000200000000 SUCCESS: Specified value was saved. C:\Users\Terr>"c:\Program Files (x86)\Steam\steam.exe"
Originally posted by Terr:
I needed this feature today. A game (State of Mind) that was crashing at the main menu, due to a bug with OpenSSL libraries that was exhibited by my newer Intel CPU.

The only really practical workaround I found was to restart Steam itself with the necessary environment variables, but the problem with this approach is:

  • I need to always remember to do it again in the future
  • Any settings will affect all games in my library, I can't be selective

For reference:

C:\Users\Terr>setx OPENSSL_ia32cap ~0x200000200000000 SUCCESS: Specified value was saved. C:\Users\Terr>"c:\Program Files (x86)\Steam\steam.exe"
Is it possible to launch that game directly from the executable, without going through Steam?
demaniak Jan 28, 2023 @ 12:57pm 
Originally posted by 赛博赛狗:
Originally posted by Cyan:
That superuser comment only applies if you're launching games from the commandline. Half the point of Steam is that you're *not* launching from commandline, you're launching from Steam.

You mean this doen't work?

From https://support.steampowered.com/kb_article.php?ref=1040-JWMT-2947:
Right-click on the game title under the Library in Steam and select Properties.
Under the General tab click the Set launch options... button.
Enter the launch options you wish to apply (be sure to separate each code with a space) and click OK.
Close the game's Properties window and launch the game.

That most certainly worked for me.
Context - some env vars that need to be set, to convince the Nvidia drivers (linux) to actually use the discrete graphics and leave the integrated chip alone.
See https://gist.github.com/abenson/a5264836c4e6bf22c8c8415bb616204a for what I'm talking about.

Verified with FPS in GS:GO - launched with and without the changes.
Although I could tell it was working just by how much the laptop fans revved up....
< >
Showing 1-9 of 9 comments
Per page: 1530 50

Date Posted: Jul 15, 2015 @ 2:28pm
Posts: 9