sonic2kk / steamtinkerlaunch

Linux wrapper tool for use with the Steam client for custom launch options and 3rd party programs
GNU General Public License v3.0
2.03k stars 69 forks source link

ReShade: Use `ALTEXEPATH` to install ReShade DLLs for Custom Commands with `ONLY_CUSTOMCMD=1` #1092

Closed sonic2kk closed 2 months ago

sonic2kk commented 2 months ago

Fixes #1089.

This PR adds an extra check to setFullGameExePath, where if an alternative EXE path is defined, this should be used in place of the custom command EXE directory. This makes sense to me, as the order of priority should be to use ALTEXEPATH above all other paths when deciding where to put things, and otherwise either the custom command folder (if custom commands are enabled) or the game EXE folder should be used.

This should address an issue where when installing ReShade with ONLY_CUSTOMCMD enabled, ReShade would install shaders to the ALTEXEPATH (as this is handled by setShadDest) but it would not do this for the ReShade DLLs - handled by a call in installReshade to setShadDestDir, which in turn calls setFullGameExePath to get the path where the DLLs should be installed.

This will need some testing to ensure this doesn't cause any regressions. The following cases should be testing:

zany130 commented 2 months ago

sorry for the late test. I got sidetracked with other things, but....

it seems its still installing into the custom command dir steamtinkerlaunch.log

sonic2kk commented 2 months ago

Oops, that's because I'm an idiot and removed a line that is supposed to be there... DEFINEDALTEXEPATH is never set so it never uses it. Really sorry about that...

sonic2kk commented 2 months ago

Should work now with 3b6ffb0.

zany130 commented 2 months ago

Works as expected for my case of using persona 3 reload with the reloaded mod manager.

Ill also test to see if everything works as expected when there is no custom command.

Unfortunately, I don't think I have any games that have launchers in a different directory than the main executable (Star Wars, maybe?).

sonic2kk commented 2 months ago

I'll do some testing tomorrow of that case as well then keeping an extra eye on it, but sounds like this is in a good position! Thanks!

sonic2kk commented 2 months ago

Didn't get a chance to test this again today, but once I have time I will and will merge this hopefully soon into the week.

zany130 commented 2 months ago

no worries I haven't been able to test extensively but I did fire up a few different games and mad sure it installs Reshade games no regressions there

sonic2kk commented 2 months ago

Seems safe in my tests as well. Pending CI this will be merged :-)