Skip to content

Commit a853689

Browse files
committed
Stupid mistakes on updating target DLL when updating a compatible DLL with a inferior version number
1 parent 9a9cf17 commit a853689

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Source/WatchDogInstallChecker/Util/SanityLib.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ internal static string UpdateIfNeeded(string name, string sourceFilename, string
6464
System.Reflection.Assembly sourceAsm = System.Reflection.Assembly.LoadFile(sourceFilename);
6565
System.Reflection.Assembly targetAsm = System.Reflection.Assembly.LoadFile(targetFilename);
6666
if (!sourceAsm.GetName().Version.Equals(targetAsm.GetName().Version))
67+
{
68+
Log.info("File {0} is older then {1}. This is going to cause trouble, updating it!", targetFilename, name);
69+
Delete(targetFilename); // Remove the file or the update will not work.
6770
return Update(name, sourceFilename, targetFilename);
71+
}
6872
else
6973
{
7074
Delete(sourceFilename);
@@ -120,7 +124,7 @@ private static string CalcGameData()
120124
path = System.IO.Path.GetDirectoryName(path);
121125
candidate = System.IO.Path.Combine(path, "GameData");
122126
}
123-
Log.dbg("GameData found on {0}", GAMEDATA);
127+
Log.dbg("GameData found on {0}", candidate);
124128
return (GAMEDATA = candidate);
125129
}
126130
catch (Exception e)

0 commit comments

Comments
 (0)