From 4d7d1ba822b2dfa6c3b1e98e05dda4fc174cb0f7 Mon Sep 17 00:00:00 2001 From: "Felipe \"Zimmerle\" Costa" Date: Wed, 19 Feb 2014 22:09:57 -0300 Subject: [PATCH] iis: Adds listing dependencies script This script could be used in order to verify all ModSecurity run time dependencies. It is now part of ModSecurity folder in Program menu. Cosmetics changes in the installer --- iis/installer.wxs | 68 +++++++++++++++++++----------- iis/wix/list_dependencies.bat | 79 +++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 24 deletions(-) create mode 100644 iis/wix/list_dependencies.bat diff --git a/iis/installer.wxs b/iis/installer.wxs index 314410fd..64d1610d 100644 --- a/iis/installer.wxs +++ b/iis/installer.wxs @@ -81,14 +81,14 @@ - + - VersionNT64 - - NOT VersionNT64 - + VersionNT64 + + NOT VersionNT64 + @@ -296,6 +296,11 @@ + + + + + @@ -307,6 +312,7 @@ + @@ -402,8 +408,13 @@ + (NOT &ModSec64=3) AND (NOT &ModSec32=3) &ModSec64=3 OR &ModSec32=3 + + (NOT &ModSec32=3) + &ModSec32=3 + 1 @@ -450,8 +461,8 @@ Installed - - + + @@ -469,7 +480,7 @@ - + @@ -502,7 +513,7 @@ NOT Installed OR WixUI_InstallMode = "Change" NOT Installed OR WixUI_InstallMode = "Change" Installed AND PATCH - NOT Installed OR WixUI_InstallMode = "Change" + NOT Installed OR WixUI_InstallMode = "Change" Installed AND NOT PATCH Installed AND PATCH 1 @@ -516,32 +527,41 @@ - NOT Installed AND NOT OLDERVERSIONDETECTED + NOT Installed AND NOT OLDERVERSIONDETECTED - NOT Installed AND NOT OLDERVERSIONDETECTED + NOT Installed AND NOT OLDERVERSIONDETECTED - + - - - - - - + + + + + + - - - - + + + + - - + + + + + + + + + + + diff --git a/iis/wix/list_dependencies.bat b/iis/wix/list_dependencies.bat new file mode 100644 index 00000000..276b4f33 --- /dev/null +++ b/iis/wix/list_dependencies.bat @@ -0,0 +1,79 @@ + +@echo off + +echo * +echo * +echo * ModSecurityIIS - list dependencies +echo * +echo * +echo * This script is likely to be used as part as a debugging process. +echo * +echo * +echo * The main function of this script is to list all ModSecurityIIS runtime +echo * dependencies, including system dependencies, to check if there is a +echo * missing library or a version mismatch. This can be very usefull in case +echo * ModSecurityIIS refuses to register as IIS module or if IIS refuses to +echo * start. +echo * +echo * +echo * + +pause + +:LOOP_FILE +SET /a log_file=%RANDOM%+100000 +SET log_file=%TEMP%\ModSecurityIIS-depedencies-%log_file:~-5%.TXT +IF EXIST %log_file% GOTO LOOP_FILE + +echo Saving logs at: %log_file% + +set POSSIBLE_PATHS_X86="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\dumpbin.exe" "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\dumpbin.exe" +set POSSIBLE_PATHS_X64="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\dumpbin.exe" + +for %%i in (%POSSIBLE_PATHS_X86%) do ( + echo Checking for dumpbin x86... %%i + echo Checking for dumpbin x86... %%i >> %log_file% + if exist %%i ( + SET DUMPBIN_X86=%%i + goto found_x86 + ) +) +:found_x86 + +for %%i in (%POSSIBLE_PATHS_X64%) do ( + echo Checking for dumpbin x64... %%i + echo Checking for dumpbin x64... %%i >> %log_file% + if exist %%i ( + SET DUMPBIN_X64=%%i + goto found_x64 + ) +) +:found_x64 + +if "%DUMPBIN_X86:~1,-1%" == "" ( + echo Dumpbin x86 not found. + echo Dumpbin x86 not found. >> %log_file% +) else ( + echo Using dumpbin x86: %DUMPBIN_X86% + echo Using dumpbin x86: %DUMPBIN_X86% >> %log_file% + %DUMPBIN_X86% /imports /dependents %* >> %log_file% + ) +) + +if "%DUMPBIN_X64:~1,-1%" == "" ( + echo Dumpbin x64 not found. + echo Dumpbin x64 not found. >> %log_file% +) else ( + echo Using dumpbin x64: %DUMPBIN_X64% + echo Using dumpbin x64: %DUMPBIN_X64% >> %log_file% + %DUMPBIN_X64% /imports /dependents %* >> %log_file% +) + +goto exit + +:exit +echo Logs were saved at: %log_file%. +echo Trying to open it with explorer... +explorer %log_file% +echo Done. +pause