diff --git a/IPA.Injector/Updates.cs b/IPA.Injector/Updates.cs index 754b13f9..ee9ec1de 100644 --- a/IPA.Injector/Updates.cs +++ b/IPA.Injector/Updates.cs @@ -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,