[0.16.51-0.17.6][Minor]Steam version launches factorio from steam folder regardless where it was actually launched.

Bugs that are actually features.
DeltaKilo
Burner Inserter
Burner Inserter
Posts: 14
Joined: Wed May 02, 2018 9:18 pm
Contact:

[0.16.51-0.17.6][Minor]Steam version launches factorio from steam folder regardless where it was actually launched.

Post by DeltaKilo »

For example: I run steam version of factorio.exe from: d:\Games\Factorio-Seablock\bin\x64\ but instead of actually launching factorio from this folder D:\Games\Steam\steamapps\common\Factorio\bin\x64\factorio.exe is launched.

I think it's more convenient just to check if user owns the game with steam api and launch the executable user want to launch because there can be different configs, versions, saves, mods and you can force the game to look at local mods,saves, etc folders instead of %AppData%
tehfreek
Filter Inserter
Filter Inserter
Posts: 391
Joined: Thu Mar 17, 2016 7:34 am
Contact:

Re: [0.16.51-0.17.6][Minor]Steam version launches factorio from steam folder regardless where it was actually launched.

Post by tehfreek »

The portable version downloadable from the Factorio website does not hook into the Steam API, and both versions offer command line options for setting the config file and mod directory in use.
DeltaKilo
Burner Inserter
Burner Inserter
Posts: 14
Joined: Wed May 02, 2018 9:18 pm
Contact:

Re: [0.16.51-0.17.6][Minor]Steam version launches factorio from steam folder regardless where it was actually launched.

Post by DeltaKilo »

tehfreek wrote: Tue Mar 05, 2019 7:02 pm The portable version downloadable from the Factorio website does not hook into the Steam API, and both versions offer command line options for setting the config file and mod directory in use.
What about different game versions?
tehfreek
Filter Inserter
Filter Inserter
Posts: 391
Joined: Thu Mar 17, 2016 7:34 am
Contact:

Re: [0.16.51-0.17.6][Minor]Steam version launches factorio from steam folder regardless where it was actually launched.

Post by tehfreek »

DeltaKilo wrote: Tue Mar 05, 2019 7:04 pm What about different game versions?
The executable itself is keyed to the version, so you'll need multiple installs for that.
DeltaKilo
Burner Inserter
Burner Inserter
Posts: 14
Joined: Wed May 02, 2018 9:18 pm
Contact:

Re: [0.16.51-0.17.6][Minor]Steam version launches factorio from steam folder regardless where it was actually launched.

Post by DeltaKilo »

tehfreek wrote: Tue Mar 05, 2019 7:05 pm
DeltaKilo wrote: Tue Mar 05, 2019 7:04 pm What about different game versions?
The executable itself is keyed to the version, so you'll need multiple installs for that.
That's what i'm trying to say. If you launch any Steam version of factorio(for time tracking for example) from outside of Steam folder instead of actually launch it it launches latest and greatest factorio.exe from Steam\steamapps\common\Factorio\bin\x64\
User avatar
MasterBuilder
Filter Inserter
Filter Inserter
Posts: 353
Joined: Sun Nov 23, 2014 1:22 am
Contact:

Re: [0.16.51-0.17.6][Minor]Steam version launches factorio from steam folder regardless where it was actually launched.

Post by MasterBuilder »

Two possibilities:
1: For most Steam games, when you launch the game (even by running the game exe directly) what happens is the game exe tells steam.exe to start X game and then terminates.
Launching the Steam version from anywhere on your PC will tell steam to start D:\Games\Steam\steamapps\common\Factorio\bin\x64\factorio.exe since that is where Steam considers it to be installed.
Even if you copy that folder somewhere else to preserve a different version, steam will only launch the one it installed. Both Factorio & Steam are doing exactly what they are supposed to do.

2: Factorio bypasses this and you can start it directly in which case you need to update "config-path.cfg" to make your copy standalone.
Example config:

Code: Select all

config-path=__PATH__executable__/../../config
use-system-read-write-data-directories=false
The config will need to be altered even if Steam controls execution of the game.

If you want to run Factorio directly, separate from Steam (to say have 0.16 & 0.17 installed at the same time) one MUST NOT be the Steam version.

Disclaimer: I have never run Factorio through Steam, but I do monitor/control process execution on this system. 90% of steam games work like this:
game.exe -> steam.exe (with arguments to launch the right game) -> game.exe (launch from steam, where steam expects the game to be. No different that double-clicking the game from your steam list without touching the exe.)
Give a man fire and he'll be warm for a day. Set a man on fire and he'll be warm for the rest of his life.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14894
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51-0.17.6][Minor]Steam version launches factorio from steam folder regardless where it was actually launched.

Post by Rseding91 »

Thanks for the report however there's nothing we can do about this. Steam does this automatically when the steam version of a game is launched outside of steam.
If you want to get ahold of me I'm almost always on Discord.
DeltaKilo
Burner Inserter
Burner Inserter
Posts: 14
Joined: Wed May 02, 2018 9:18 pm
Contact:

Re: [0.16.51-0.17.6][Minor]Steam version launches factorio from steam folder regardless where it was actually launched.

Post by DeltaKilo »

MasterBuilder wrote: Tue Mar 05, 2019 7:20 pm
2: Factorio bypasses this and you can start it directly in which case you need to update "config-path.cfg" to make your copy standalone.
Example config:

Code: Select all

config-path=__PATH__executable__/../../config
use-system-read-write-data-directories=false
The config will need to be altered even if Steam controls execution of the game.

If you want to run Factorio directly, separate from Steam (to say have 0.16 & 0.17 installed at the same time) one MUST NOT be the Steam version.

Disclaimer: I have never run Factorio through Steam, but I do monitor/control process execution on this system. 90% of steam games work like this:
game.exe -> steam.exe (with arguments to launch the right game) -> game.exe (launch from steam, where steam expects the game to be. No different that double-clicking the game from your steam list without touching the exe.)
It's my point, I have 3 different folders of Steam versions of Europa Universalis 4 for example with different versions and sets of mods for MP. If you launch eu4.exe from d:\whateverer\eu4.exe the actual d:\whateverer\eu4.exe is launched. Not the case with factorio which always launch steam/steamapps/common...etc.

I don't expect the change to be backported to 0.16 but still.
DeltaKilo
Burner Inserter
Burner Inserter
Posts: 14
Joined: Wed May 02, 2018 9:18 pm
Contact:

Re: [0.16.51-0.17.6][Minor]Steam version launches factorio from steam folder regardless where it was actually launched.

Post by DeltaKilo »

Rseding91 wrote: Tue Mar 05, 2019 7:54 pm Thanks for the report however there's nothing we can do about this. Steam does this automatically when the steam version of a game is launched outside of steam.
I will dig into it, but my educated guess that if you hook Steam API with if(LoadLibrary(...)==NULL) it not only not increase code, but actually reduce it because you get rid of #ifdefs, also you can have 1 build for steam and non steam version.
User avatar
MasterBuilder
Filter Inserter
Filter Inserter
Posts: 353
Joined: Sun Nov 23, 2014 1:22 am
Contact:

Re: [0.16.51-0.17.6][Minor]Steam version launches factorio from steam folder regardless where it was actually launched.

Post by MasterBuilder »

DeltaKilo wrote: Tue Mar 05, 2019 8:00 pm It's my point, I have 3 different folders of Steam versions of Europa Universalis 4 for example with different versions and sets of mods for MP. If you launch eu4.exe from d:\whateverer\eu4.exe the actual d:\whateverer\eu4.exe is launched. Not the case with factorio which always launch steam/steamapps/common...etc.

I don't expect the change to be backported to 0.16 but still.
Then EU4 is the exception to the rule. I said 90% work this way and I meant it. Some games don't bother with Steamworks protection and can be launched directly from their exe without steam even running.
Factorio is not one of those games.
Give a man fire and he'll be warm for a day. Set a man on fire and he'll be warm for the rest of his life.
posila
Factorio Staff
Factorio Staff
Posts: 5440
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.16.51-0.17.6][Minor]Steam version launches factorio from steam folder regardless where it was actually launched.

Post by posila »

I was not sure if I can share this publicly (still not sure, but it seem to be pretty known, if I try to google it) ... if you put steam_appid.txt that contains Factorio's SteamID next to factorio.exe, Steam won't relaunch factorio.exe from the client.
DeltaKilo
Burner Inserter
Burner Inserter
Posts: 14
Joined: Wed May 02, 2018 9:18 pm
Contact:

Re: [0.16.51-0.17.6][Minor]Steam version launches factorio from steam folder regardless where it was actually launched.

Post by DeltaKilo »

posila wrote: Tue Mar 12, 2019 10:28 pm I was not sure if I can share this publicly (still not sure, but it seem to be pretty known, if I try to google it) ... if you put steam_appid.txt that contains Factorio's SteamID next to factorio.exe, Steam won't relaunch factorio.exe from the client.
I found it separately after my last message but before yours :) look at album dates: https://imgur.com/a/eOd3qIq

I still thinking that inclusion of appid file should be default. Also linking steam_api at runtime will save a lot of time.
Post Reply

Return to “Not a bug”