-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Detect invalid TShock installations #2882
Detect invalid TShock installations #2882
Conversation
d1ebbd6
to
a86f18c
Compare
Thanks! You've saved @CEO-Chair's bacon! |
a86f18c
to
7eccd72
Compare
There are two common mistakes made by those installing/updating TShock: - Extracting TShock into the Terraria client directory - Extracting TShock 5 or newer into a legacy (TShock 4 or older) install By checking for the existence of a file named `TerrariaServer.exe`, we can potentially detect these invalid installations, and prompt the user with a more useful diagnostic, rather than (likely) crashing moments later.
7eccd72
to
3776baa
Compare
// On occasion, users have been seen extracting TShock into their client installation directory -- this is of course incorrect, and is known | ||
// to cause issues. Let's attempt to catch this before anything happens (specifically, before Terraria assemblies are resolved) and prevent | ||
// TShock from launching. | ||
if (File.Exists("TerrariaServer.exe")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅 I forgot to mention the .exe part is windows-specific. should it take into account other OSes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the exe
part is not windows-specific, it also exists on Linux... and I'd assume Mac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least vanilla and TShock 4 are both using Mono - and they are just regular assembly and extension doesn't matters much. This doesn't work for tModLoader, but who would do that tho?
I think I would check for Content instead of a platform-specific binary, personally. But I'd check for something inside Content too? |
The grammar introduced in this PR is meant to be nit-picked! Please suggest what sounds most natural and understandable to an end-user.
Additionally, because we are in TShockLauncher and not in TShock yet, we cannot translate strings... and an error like this would benefit greatly from such. It may be worthwhile to hardcode some translations?