|
@ -34,23 +34,23 @@ namespace IPA.Injector |
|
|
var path = Path.Combine(UnityGame.InstallPath, "IPA.exe"); |
|
|
var path = Path.Combine(UnityGame.InstallPath, "IPA.exe"); |
|
|
if (!File.Exists(path)) return; |
|
|
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 ipaVersion = new Version(FileVersionInfo.GetVersionInfo(path).FileVersion); |
|
|
var selfVersion = Assembly.GetExecutingAssembly().GetName().Version; |
|
|
var selfVersion = Assembly.GetExecutingAssembly().GetName().Version; |
|
|
|
|
|
|
|
|
if (ipaVersion > selfVersion) |
|
|
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 |
|
|
_ = Process.Start(new ProcessStartInfo |
|
|
{ |
|
|
{ |
|
|
FileName = path, |
|
|
FileName = path, |
|
|