Skip to content

Commit

Permalink
Additional GOG log message
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidPack committed Jun 13, 2019
1 parent b72013e commit ad12f0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion installer2/Installer.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class Installer
{
private static final String TERRARIA_VERSION = "v1.3.5.3";
private static final int TERRARIA_SIZE = 10786816; // Windows only: We only want to make a backup of the official release
private static final int TERRARIA_SIZE_GOG = 10786816; // Could potentially differ in a later release. Coincidence?

public static void tryInstall(String[] files, String[] filesToDelete, File directory, boolean WindowsInstall)
{
Expand Down Expand Up @@ -38,7 +39,7 @@ private static void install(String[] files, String[] filesToDelete, File directo
{
File terrariaBackup = new File(directory, "Terraria_" + TERRARIA_VERSION + ".exe");
File terrariaUnknown = new File(directory, "Terraria_Unknown.exe");
if (!terrariaBackup.exists() && terraria.length() == TERRARIA_SIZE)
if (!terrariaBackup.exists() && (terraria.length() == TERRARIA_SIZE || terraria.length() == TERRARIA_SIZE_GOG))
{
copy(terraria, terrariaBackup);
}
Expand Down
4 changes: 3 additions & 1 deletion patches/tModLoader/Terraria.ModLoader.Engine/GoGVerifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ private static bool GoGCheck() {
}

var vanillaPath = Path.GetFileName(Assembly.GetExecutingAssembly().Location) != "Terraria.exe" ? "Terraria.exe" : "Terraria_v1.3.5.3.exe";
if (!File.Exists(vanillaPath))
if (!File.Exists(vanillaPath)) {
Logging.tML.Info("Vanilla Terraria.exe not found.");
return false;
}

if (!HashMatchesFile(GoGHash, vanillaPath))
return false;
Expand Down

0 comments on commit ad12f0e

Please sign in to comment.