Skip to content

Commit f56c949

Browse files
committed
Skip antivirus warning when running under Wine
1 parent 701b0dd commit f56c949

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Client/loader/Main.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,17 @@ MTAEXPORT int DoWinMain(HINSTANCE hLauncherInstance, MAYBE_UNUSED HINSTANCE hPre
259259
// Make sure GTA is not running
260260
HandleIfGTAIsAlreadyRunning();
261261

262-
// Maybe warn user if no anti-virus running
263-
CheckAntiVirusStatus();
262+
// Maybe warn user if no anti-virus running (skip under Wine)
263+
HKEY hKey = nullptr;
264+
if (RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Wine", 0, KEY_READ, &hKey) != ERROR_SUCCESS &&
265+
RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine", 0, KEY_READ, &hKey) != ERROR_SUCCESS)
266+
{
267+
CheckAntiVirusStatus();
268+
}
269+
else
270+
{
271+
RegCloseKey(hKey);
272+
}
264273

265274
// Ensure logo is showing
266275
ShowSplash(hInstanceToUse);

0 commit comments

Comments
 (0)