Skip to content

Commit

Permalink
Add diagnostic info if polish build of me1 is detected. Fix blank MD5…
Browse files Browse the repository at this point in the history
… being passed as hash result for ME1 targets.
  • Loading branch information
Mgamerz committed Jan 5, 2021
1 parent db6b063 commit b6756f8
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 107 deletions.
130 changes: 67 additions & 63 deletions ALOTInstallerCore/ModManager/ME3Tweaks/LogCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ void addDiagLine(string message = "", Severity sev = Severity.INFO)
#else
addDiagLine($@"Version information cannot be read on non-windows platforms");
#endif

if (selectedDiagnosticTarget.Game == MEGame.ME1 && selectedDiagnosticTarget.IsPolishME1)
{
Log.Warning(@"Detected this is Polish build of ME1. This version is a different build of ME1 than the rest of the localizations");
addDiagLine(@"POLISH BUILD OF ME1", Severity.WARN);
}
// Disk type
#if WINDOWS
string pathroot = Path.GetPathRoot(gamePath);
Expand Down Expand Up @@ -719,12 +723,12 @@ void memExceptionOccured(string operation, string line)
},
applicationExited: x => exitcode = x);

if (exitcode != 0)
{
addDiagLine(
$@"MassEffectModderNoGui exited exited incompatible mod detection check with code {exitcode}",
Severity.ERROR);
}
if (exitcode != 0)
{
addDiagLine(
$@"MassEffectModderNoGui exited exited incompatible mod detection check with code {exitcode}",
Severity.ERROR);
}

if (blacklistedMods.Any())
{
Expand Down Expand Up @@ -882,45 +886,45 @@ void memExceptionOccured(string operation, string line)
addDiagLine(@"Files added or removed after texture mods were installed",
Severity.DIAGSECTION);

if (textureMapFileExists)
{
// check for replaced files (file size changes)
updateStatusCallback?.Invoke(
"Checking texture map consistency");
List<string> removedFiles = new List<string>();
List<string> addedFiles = new List<string>();
List<string> replacedFiles = new List<string>();
MEMIPCHandler.RunMEMIPCUntilExit(args, ipcCallback: (string command, string param) =>
{
switch (command)
if (textureMapFileExists)
{
// check for replaced files (file size changes)
updateStatusCallback?.Invoke(
"Checking texture map consistency");
List<string> removedFiles = new List<string>();
List<string> addedFiles = new List<string>();
List<string> replacedFiles = new List<string>();
MEMIPCHandler.RunMEMIPCUntilExit(args, ipcCallback: (string command, string param) =>
{
case @"ERROR_REMOVED_FILE":
//.Add($" - File removed after textures were installed: {param}");
removedFiles.Add(param);
break;
case @"ERROR_ADDED_FILE":
//addedFiles.Add($"File was added after textures were installed" + param + " " + File.GetCreationTimeUtc(Path.Combine(gamePath, param));
addedFiles.Add(param);
break;
case @"ERROR_VANILLA_MOD_FILE":
if (!addedFiles.Contains(param))
{
replacedFiles.Add(param);
}
switch (command)
{
case @"ERROR_REMOVED_FILE":
//.Add($" - File removed after textures were installed: {param}");
removedFiles.Add(param);
break;
case @"ERROR_ADDED_FILE":
//addedFiles.Add($"File was added after textures were installed" + param + " " + File.GetCreationTimeUtc(Path.Combine(gamePath, param));
addedFiles.Add(param);
break;
case @"ERROR_VANILLA_MOD_FILE":
if (!addedFiles.Contains(param))
{
replacedFiles.Add(param);
}

break;
default:
Debug.WriteLine(@"oof?");
break;
}
},
applicationExited: i => exitcode = i);
if (exitcode != 0)
{
addDiagLine(
$@"MassEffectModderNoGuiexited exited texture map consistency check with code {exitcode}",
Severity.ERROR);
}
break;
default:
Debug.WriteLine(@"oof?");
break;
}
},
applicationExited: i => exitcode = i);
if (exitcode != 0)
{
addDiagLine(
$@"MassEffectModderNoGuiexited exited texture map consistency check with code {exitcode}",
Severity.ERROR);
}

if (removedFiles.Any())
{
Expand Down Expand Up @@ -1058,10 +1062,10 @@ void handleIPC(string command, string param)
setMEMCrashLog: x => memCrashText = x
);

if (exitcode != 0)
{
addDiagLine($@"MassEffectModderNoGui exited full textures check with code {exitcode}", Severity.ERROR);
};
if (exitcode != 0)
{
addDiagLine($@"MassEffectModderNoGui exited full textures check with code {exitcode}", Severity.ERROR);
};

if (emptyMipsNotRemoved.Any() || badTFCReferences.Any() || scanErrors.Any())
{
Expand All @@ -1086,26 +1090,26 @@ void handleIPC(string command, string param)
}
}

if (scanErrors.Any())
{
addDiagLine();
addDiagLine(@"The following textures failed to scan:", Severity.ERROR);
foreach (var fts in scanErrors)
if (scanErrors.Any())
{
addDiagLine(@" - " + fts, Severity.ERROR);
addDiagLine();
addDiagLine(@"The following textures failed to scan:", Severity.ERROR);
foreach (var fts in scanErrors)
{
addDiagLine(@" - " + fts, Severity.ERROR);
}
}
}
}
else if (exitcode != 0)
{
addDiagLine(@"Texture check failed");
if (memCrashText != null)
else if (exitcode != 0)
{
addDiagLine(@"MassEffectModder crashed with info:");
addDiagLines(memCrashText.Split("\n"), Severity.ERROR); //do not localize
}
addDiagLine(@"Texture check failed");
if (memCrashText != null)
{
addDiagLine(@"MassEffectModder crashed with info:");
addDiagLines(memCrashText.Split("\n"), Severity.ERROR); //do not localize
}
}
else
else

{
// Is this right?? We skipped check. We can't just print this
Expand Down
2 changes: 1 addition & 1 deletion ALOTInstallerCore/ModManager/Objects/GameTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public string TargetBootIcon
}
}

public bool Supported => GameSource != null;
public bool Supported => !string.IsNullOrEmpty(GameSource);
public bool IsPolishME1 { get; private set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ internal static (string hash, string result) GetGameSource(GameTarget target)
case MEGame.ME1:
var me1Info = ME1ExecutableInfo.GetExecutableInfo(exePath, true);
SUPPORTED_HASHES_ME1.TryGetValue(me1Info.OriginalExecutableHash, out var me1result);
return (md5, me1result);
return (me1Info.OriginalExecutableHash, me1result);
case MEGame.ME2:
SUPPORTED_HASHES_ME2.TryGetValue(md5, out var me2result);
return (md5, me2result);
Expand Down
40 changes: 1 addition & 39 deletions ALOTInstallerCore/Steps/Precheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,45 +51,7 @@ public static string PerformPreStagingCheck(InstallOptionsPackage package,
package = package
};

#if WINDOWS
// Check for PhysX legacy. Require it to be installed at this point in time

// Obsolete due to PhysXLoader.dll patch
//if (package.InstallTarget.Game == MEGame.ME1)
//{
// if (!LegacyPhysXInstaller.IsPhysxKeyWritable() && !LegacyPhysXInstaller.IsLegacyPhysXInstalled())
// {
// Log.Information("[AICORE] Precheck: Legacy PhysX is not detected. Prompting for install");
// if (ShowConfirmationDialog("Legacy PhysX is not installed",
// "Legacy PhysX must be installed to correct issues with poor programming practices in Mass Effect that can cause other older games (such as Mirror's Edge) to not work, due to how PhyX was designed back in 2007.\n\nALOT Installer will install Legacy PhysX and implement changes that prevent Mass Effect from interfering with other games. The next page has important information about this fix.",
// "Continue", "Abort install"))
// {
// void setProgressCallback(long done, long total)
// {
// SetPreinstallCheckText($"Downloading Legacy PhysX {Math.Round(done * 100.0 / total)}%");
// }

// var physxInstallResult = LegacyPhysXInstaller.InstallLegacyPhysX(setProgressCallback,
// SetPreinstallCheckText,
// ShowConfirmationDialog,
// ShowNormalDialog, null).Result;
// if (physxInstallResult != null)
// {
// return physxInstallResult;
// }
// }
// else
// {
// return
// "Legacy PhysX is not installed. Legacy PhysX must be installed to fix issues with Mass Effect when the game is texture modded."; //Technically it's exe modded but still
// }
// }
// else
// {
// Log.Information("[AICORE] Precheck: Legacy PhysX is installed");
// }
//}
#endif

SetPreinstallCheckText("Performing precheck");
if (!pc.checkOneOptionSelected(out var noOptionsSelectedReason))
{
Expand Down
6 changes: 3 additions & 3 deletions SharedAssemblyInfo.proj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<Copyright>2017-2021 ME3Tweaks</Copyright>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<!-- THESE SHOULD ALL BE THE SAME -->
<Version>4.0.722.2337</Version>
<AssemblyVersion>4.0.722.2337</AssemblyVersion>
<FileVersion>4.0.722.2337</FileVersion>
<Version>4.0.723.2344</Version>
<AssemblyVersion>4.0.723.2344</AssemblyVersion>
<FileVersion>4.0.723.2344</FileVersion>
</PropertyGroup>
</Project>

0 comments on commit b6756f8

Please sign in to comment.