Browse Source

Delay scan of IPA.exe until just before it would be run

pull/72/head
Anairkoen Schno 3 years ago
parent
commit
f93bdad9af
Signed by: DaNike GPG Key ID: BEFB74D5F3FC4387
1 changed files with 12 additions and 12 deletions
  1. +12
    -12
      IPA.Injector/Updates.cs

+ 12
- 12
IPA.Injector/Updates.cs View File

@ -34,23 +34,23 @@ namespace IPA.Injector
var path = Path.Combine(UnityGame.InstallPath, "IPA.exe");
if (!File.Exists(path)) return;
var scanResult = AntiMalwareEngine.Engine.ScanFile(new FileInfo(path));
if (scanResult == ScanResult.Detected)
{
updater.Error("Scan of BSIPA installer found malware; not updating");
return;
}
if (!SelfConfig.AntiMalware_.RunPartialThreatCode_ && scanResult is not ScanResult.KnownSafe and not ScanResult.NotDetected)
{
updater.Error("Scan of BSIPA installer returned partial threat; not updating. To allow this, enable AntiMalware.RunPartialThreatCode in the config.");
return;
}
var ipaVersion = new Version(FileVersionInfo.GetVersionInfo(path).FileVersion);
var selfVersion = Assembly.GetExecutingAssembly().GetName().Version;
if (ipaVersion > selfVersion)
{
var scanResult = AntiMalwareEngine.Engine.ScanFile(new FileInfo(path));
if (scanResult == ScanResult.Detected)
{
updater.Error("Scan of BSIPA installer found malware; not updating");
return;
}
if (!SelfConfig.AntiMalware_.RunPartialThreatCode_ && scanResult is not ScanResult.KnownSafe and not ScanResult.NotDetected)
{
updater.Error("Scan of BSIPA installer returned partial threat; not updating. To allow this, enable AntiMalware.RunPartialThreatCode in the config.");
return;
}
_ = Process.Start(new ProcessStartInfo
{
FileName = path,


Loading…
Cancel
Save