-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Launching a game which executable is in a subdirectory of the main directory #63
Comments
Alright I got it, it works when launched with a relative path to the current working directory:
Notice that the ulwgl-run command can't contain the full path in this case or it won't work. |
What's your specific use case? Personally, I've never used it when launching my games so I never saw the point of changing to a specific directory before launching a game. I can give you this feature if it's not too niche, but it'd be via the configuration file usage. For example:
|
For some games I need to give ulwgl-run the .exe path relative to the cwd (current working directory). When the game has its executable in a directory below the main game directory, it won't work without a relative path to the cwd. However, I have also found a bug with ulwgl-run that is not present in vanilla wine. Consider a game directory with the main executable called frontend.exe, and a secondary executable called start.exe.
I guess the bug is caused because of a Proton specific feature that I am not aware of. P.S.: I don't need the feature personally, I am fine giving it relative paths. However, I appreciate it. Thanks. |
FWIW, this is unusual but not niche in any way. Even recent triple-A games sometimes require such handling. IMO ULWGL should explore avenues to facilitate this for compatibility reasons. I do not know how steam handles this though, if we are to emulate it, it is possible that the client itself switches to the working directory before executing the proton command. |
It has to be something else, because in Steam you can pass the absolute path to the executable contained in a subfolder and it works. In wine and ulwgl you have to pass the relative path. In Lutris you can also pass the absolute path. Maybe we can ask @strycore about this. |
Indeed Steam changes into the working directory of the game, as evident by printing the environment when a game is launched through Proton. to test set the following command as the launch options for any Steam game |
Maybe after changing to the working directory of the game, it does something like this: Compare the two strings:
If $Target contains $StartIn, then remove the contents of $StartIn from $Target, leaving it as a relative path:
Now we can just execute $Target relative to $StartIn, and it will work. |
I have tried it, and in a case like the one I mentioned, it only works using a relative path to the cwd. I don't know why, but it is the reality on my system. |
I re-read the issue and noticed that you tried that. So I deleted my reply since there is obviously some interaction that I am missing here. This might be related to anything, needs more investigation. |
you don't have to imagine this structure if you have Grim Dawn in your steam/gog library; it keeps all of the x64 binaries - including dependencies and apis - in a subdirectory, and you will not be able to get to the main menu using the x64 executable if you don't step the working directory out of the subdirectory with said executable. steam (not sure if it's a thing on gog) handles switching between x32 and x64 through a launch argument but it's rather dubious either way |
As discussed with loathingKernel on discord, I think this is related to my use case, one addon of the game Elder Scrolls Online, TamrielTradeCenter, has a client that should be run, if I run it before the game with either runinprefix or run, and after that I launcher the game, it launches normally, but when I do the opposite it doesn't:
Here is an example: If I run the game first:
then the Client.exe which is in another partition:
It won't work. The inverse works though (running the Client.exe first and after that running the game):
Also as discussed there, if I want to run the Client.exe I can also do this, which will work doesn't matter what working directory I'm in:
|
Can you explain what "runinprefix" does and why you call start.exe ? |
To understand what these verbs do better, look at proton's
|
For what it's worth, you can do this still
|
The pressure-vessel docs also mention this constraint (first two points), linking it here for discoverability. |
The first point in the documentation can easily be implemented, but the current working directory in a subdirectory mess should be addressed in a protonfix unless there's a reliable way to handle it. For instance, does the Steam client reference a whitelist or have a configuration file for the correct directory to change to? For each game on Steam, there's a manifest file that contains an @Aqa-Ib for Grim Dawn, does the appmanifest_219990.acf file have an |
As far as other stores are concerned, they should provide the working directory in their metadata in one way or another. I know for example that legendary does have that information and sets that as the working directory before launching. It is safe to assume that other clients do that too, and that's why we haven't had a big influx of comments on this issue. This information is also required on windows, as the working directory is part of the desktop and menu shortcut specification. This is mostly relevant when using umu as a stand-alone application from the terminal. Thus, a likely solution would be to allow users to arbitrarily set a working directory from the command line, for example. |
I own Grim Dawn from GOG, unfortunately, it does not have a manifest file. |
SteamDB shows the installdir config info. https://steamdb.info/app/219990/config/
|
Hmm, I believe it may be possible solve this problem for Steam and GOG's case. Steam provides an installscript.vdf that contains metadata that is defined by the developer which may include its subdirectory. For example:
As for GOG, they should include an
@Aqa-Ib What's the value of |
Steamdb even shows a launch option that's the relative execution path of the 64-bit executable -- |
Correct. The file is named |
@Aqa-Ib Just made a PR to address the problem for GOG games. If you can make time to test it, that'd' be great. Parsing Steam's .vdf files will need to be addressed later -- I have to find some real examples. Also, do you mind sharing the contents of the *.info file for Grim Dawn? GOG doesn't seem to make those files easily available, but I believe there should be a |
Actually, for Steam's case, I believe umu would need to get the subdirectory information via a game's launch options but unfortunately it doesn't appear it will be simple to retrieve. |
Imagine the following folder structure for a game:
In this case, the main game directory is different than the executable directory.
This game won't work when launched like this:
cd /home/user/game/
ulwgl-run /home/user/game/x64/launcher.exe
Using vanilla wine, a solution is to run it like this:
cd /home/user/game/x64/
wine start /d "/home/user/game" launcher.exe
Using Steam, we have the "Start in" field available:
Using Lutris we have a "Working directory" field.
How do we achieve this using
ulwgl-run
?The text was updated successfully, but these errors were encountered: