Class WindowsDefenderUtil

java.lang.Object
net.mcreator.io.WindowsDefenderUtil

public class WindowsDefenderUtil extends Object
  • Constructor Details

    • WindowsDefenderUtil

      public WindowsDefenderUtil()
  • Method Details

    • isRealTimeProtectionEnabled

      public static boolean isRealTimeProtectionEnabled()
      Checks if Windows Defender real-time protection is enabled. This does not require elevation.
      Returns:
      true if real-time protection is enabled, false if it is disabled, if another antivirus is active, if the status cannot be determined or if not running on Windows
    • addFolderExclusions

      public static WindowsDefenderUtil.ExclusionResult addFolderExclusions(List<File> folders)
      Adds the given folders to Windows Defender exclusions. This shows the UAC prompt to the user. The exclusions are verified in the same elevated session, so ADDED is only returned if the folders are really excluded. Folders that are already excluded are left as they are.
      Parameters:
      folders - Folders to exclude from Windows Defender scanning
      Returns:
      Result of the operation, DECLINED if the user declined the UAC prompt