- Fixes & string clarifications related to anti-virus false positives
This commit is contained in:
pointfeev 2023-03-28 00:30:47 -04:00
parent 2cf940ef25
commit c74d597a7a
3 changed files with 8 additions and 12 deletions

View file

@ -4,7 +4,7 @@
<TargetFramework>net7.0-windows</TargetFramework>
<UseWindowsForms>True</UseWindowsForms>
<ApplicationIcon>Resources\ini.ico</ApplicationIcon>
<Version>4.7.1.1</Version>
<Version>4.7.1.2</Version>
<Copyright>2021, pointfeev (https://github.com/pointfeev)</Copyright>
<Company>CreamInstaller</Company>
<Product>Automatic DLC Unlocker Installer &amp; Configuration Generator</Product>

View file

@ -58,8 +58,9 @@ internal static class Program
{
using DialogForm dialogForm = new(form);
if (dialogForm.Show(SystemIcons.Error,
$"ERROR: {selection.Name} is currently running!" + "\n\nPlease close the program/game to continue . . . ", "Retry", "Cancel")
== DialogResult.OK)
$"ERROR: One or more DLLs crucial to unlocker installation are locked for {selection.Name}!"
+ "\n\nThis is commonly caused by the program/game being active or an anti-virus blocking access."
+ "\n\nPlease close the program/game or resolve your anti-virus to continue . . . ", "Retry", "Cancel") == DialogResult.OK)
continue;
}
else

View file

@ -595,17 +595,12 @@ internal static class Resources
config = directory + @"\cream_api.ini";
}
private static string ComputeMD5(this string filePath)
{
if (!filePath.FileExists())
return null;
#pragma warning disable CA5351
using MD5 md5 = MD5.Create();
private static string ComputeMD5(this string filePath)
=> filePath.FileExists() && filePath.ReadFileBytes() is { } bytes
? BitConverter.ToString(MD5.HashData(bytes)).Replace("-", "").ToUpperInvariant()
: null;
#pragma warning restore CA5351
using FileStream stream = File.OpenRead(filePath);
byte[] hash = md5.ComputeHash(stream);
return BitConverter.ToString(hash).Replace("-", "").ToUpperInvariant();
}
internal static bool IsResourceFile(this string filePath, ResourceIdentifier identifier)
=> filePath.ComputeMD5() is { } hash && ResourceMD5s[identifier].Contains(hash);