summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xantivirusDetection.vbs19
-rw-r--r--configure.ac15
2 files changed, 34 insertions, 0 deletions
diff --git a/antivirusDetection.vbs b/antivirusDetection.vbs
new file mode 100755
index 000000000000..a4e76731f0b6
--- /dev/null
+++ b/antivirusDetection.vbs
@@ -0,0 +1,19 @@
+Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\SecurityCenter2")
+Set installedAntiviruses = objWMIService.ExecQuery("Select * from AntivirusProduct")
+'Iterates through all the antivirus software,retrieved by the WMI query,present on the system and prints only the ones that are active
+'this is done by checking the 12th bit of the productState property of the antivirus
+'if 12th bit is on then it means that the antivirus is in active state
+'if 12th bit is off then it is inactive.
+'see http://neophob.com/2010/03/wmi-query-windows-securitycenter2/
+count=0
+list=""
+For Each antivirus in installedAntiviruses
+ If antivirus.productState And &h01000 Then 'checking the state of the 12th bit of productState property of the antivirus
+ count=count+1
+ list=list & VBNewLine & VBtab & "*" & antivirus.displayName
+ End if
+Next
+If count = 0 Then
+ Wscript.StdOut.Write "NOT_FOUND"
+Else Wscript.Echo list
+End if
diff --git a/configure.ac b/configure.ac
index d4a737aeaeb1..1bccce3578c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12974,6 +12974,21 @@ fi
AC_SUBST(ENABLE_FORMULA_LOGGER)
dnl ===================================================================
+dnl Checking for active Antivirus software.
+dnl ===================================================================
+
+if test $_os = WINNT ; then
+ AC_MSG_CHECKING([for active Antivirus software])
+ ANTIVIRUS_LIST=`cscript.exe //Nologo $SRC_ROOT/antivirusDetection.vbs`
+ if [ [ "$ANTIVIRUS_LIST" != "NOT_FOUND" ] ]; then
+ AC_MSG_RESULT([found])
+ add_warning "To speed up builds and avoid failures in unit tests, it is highly recommended that you exclude the build directories associated with LibreOffice in the following Antivirus software: $ANTIVIRUS_LIST"
+ else
+ AC_MSG_RESULT([not found])
+ fi
+fi
+
+dnl ===================================================================
dnl Setting up the environment.
dnl ===================================================================
AC_MSG_NOTICE([setting up the build environment variables...])