Skip to content
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

Require an explicit launch path for mod registrations. #19687

Merged
merged 3 commits into from
Nov 6, 2021

Conversation

pchote
Copy link
Member

@pchote pchote commented Sep 25, 2021

Fixes #19518.
Supersedes #19589.

Switching to .NET 5 broke (and is, in general, fundamentally incompatible with) the method we used to guess the launch path for external mod switching. This PR solves the problem by removing the assumption that it is always valid to switch to the currently active mod, and only registers mods that explicitly define a launch path. A new alert dialog is shown instead of the restart prompt if the settings are changed and we don't have a valid path for restarting the game.

We would ideally also update launch-game.cmd to pass Engine.LaunchPath similarly to launch-game.sh, but this goes beyond my level of ability and patience (having now spent well over an hour failing at what should have been a trivial change). We need to cd %~dp0% before the bin\OpenRA.exe lines, and pass Engine.LaunchPath="%~dpf0" to create the correct metadata file. The final issue is that the Game.Mod detection at the top of the script blocks the restart even though a valid argument is already specified.

This also removes a workaround that allowed the current mod to be
registered even if it defined a bogus path. Uses of Game.ExternalMods
should therefore always use TryGetValue and correctly handle it
returning false.
@abcdefg30
Copy link
Member

We would ideally also update launch-game.cmd to pass Engine.LaunchPath similarly to launch-game.sh [...]

launch-game.sh doesn't seem to be updated here?

@pchote
Copy link
Member Author

pchote commented Sep 29, 2021

It was updated in #12600 so nothing needed to change here.

@abcdefg30
Copy link
Member

Pushed a commit that adjusts the launch-game.cmd script.

@teinarss teinarss merged commit 280dd8e into OpenRA:bleed Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when restarting the game after changing between fullscreen and windowed mode
3 participants