mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
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
This commit is contained in:
parent
619758c0c2
commit
4d7d1ba822
@ -81,14 +81,14 @@
|
||||
</Property>
|
||||
<Property Id="MSIUSEREALADMINDETECTION" Value="1" />
|
||||
<Condition Message="This setup requires IIS 6.0, 7.0 or 8.0 is installed."><![CDATA[(IIS="#7") OR (IIS="#6") OR (IIS="#8")]]></Condition>
|
||||
<!-- Version 2.7.6 had an uninstall issue that leaves some files behind. Asking the user to manually hash this out. -->
|
||||
<!-- Version 2.7.5 had an uninstall issue that leaves some files behind. Asking the user to manually hash this out. -->
|
||||
<Condition Message="A older version of ModSecurityIIS was found in your computer. Please complete uninstall by removing the following file: [FILEEXISTS]. You may have to remove ModSecurity module from IIS, use the IIS Manager to do so."><![CDATA[(NOT FILEEXISTS) OR (Installed)]]></Condition>
|
||||
<Condition Message="64-bit operating system was detected, please use the 64-bit installer.">
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
VersionNT64
|
||||
<?else ?>
|
||||
NOT VersionNT64
|
||||
<?endif ?></Condition>
|
||||
VersionNT64
|
||||
<?else ?>
|
||||
NOT VersionNT64
|
||||
<?endif ?></Condition>
|
||||
<Media Id="1" Cabinet="simple.cab" EmbedCab="yes" />
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
@ -296,6 +296,11 @@
|
||||
<Shortcut Id="UninstallProduct" Name="Uninstall" Description="Uninstalls the ModSecurity IIS" Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]" />
|
||||
<Shortcut Id="EULA" Name="EULA" Description="EULA" Target="[INSTALLFOLDER]EULA.rtf" WorkingDirectory="INSTALLFOLDER" />
|
||||
<Shortcut Id="Readme" Name="EULA" Description="EULA" Target="[INSTALLFOLDER]README.TXT" WorkingDirectory="INSTALLFOLDER" />
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
<Shortcut Id="List_Dependencies" Name="List Dependencies (Debug)" Description="Check for missing dependencies" Target="[INSTALLFOLDER]list_dependencies.bat" Arguments=""[inetsrv64]libapr-1.dll" "[inetsrv64]libapriconv-1.dll" "[inetsrv64]libaprutil-1.dll" "[inetsrv64]libcurl.dll" "[inetsrv64]libxml2.dll" "[inetsrv64]lua5.1.dll" "[inetsrv64]mlogc.exe" "[inetsrv64]ModSecurityIIS.dll" "[inetsrv64]pcre.dll" "[inetsrv64]zlib1.dll" "[inetsrv32]libapr-1.dll" "[inetsrv32]libapriconv-1.dll" "[inetsrv32]libaprutil-1.dll" "[inetsrv32]libcurl.dll" "[inetsrv32]libxml2.dll" "[inetsrv32]lua5.1.dll" "[inetsrv32]mlogc.exe" "[inetsrv32]ModSecurityIIS.dll" "[inetsrv32]pcre.dll" "[inetsrv32]zlib1.dll"" WorkingDirectory="INSTALLFOLDER" />
|
||||
<?else ?>
|
||||
<Shortcut Id="List_Dependencies" Name="List Dependencies (Debug)" Description="Check for missing dependencies" Target="[INSTALLFOLDER]list_dependencies.bat" Arguments=""[inetsrv32]libapr-1.dll" "[inetsrv32]libapriconv-1.dll" "[inetsrv32]libaprutil-1.dll" "[inetsrv32]libcurl.dll" "[inetsrv32]libxml2.dll" "[inetsrv32]lua5.1.dll" "[inetsrv32]mlogc.exe" "[inetsrv32]ModSecurityIIS.dll" "[inetsrv32]pcre.dll" "[inetsrv32]zlib1.dll"" WorkingDirectory="INSTALLFOLDER" />
|
||||
<?endif ?>
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
@ -307,6 +312,7 @@
|
||||
<File Id="modsecurity.conf" Name="modsecurity.conf" Source="wix\modsecurity.conf" />
|
||||
<File Id="modsecurity_iis.conf" Name="modsecurity_iis.conf" Source="wix\modsecurity_iis.conf" />
|
||||
<File Id="modsecurity_crs_10_setup.conf" Name="modsecurity_crs_10_setup.conf" Source="wix\modsecurity_crs_10_setup.conf" />
|
||||
<File Id="LIST_DEPENDENCIES.BAT" Name="list_dependencies.bat" Source="wix\list_dependencies.bat" />
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
@ -402,8 +408,13 @@
|
||||
<UI Id="WixUI_FeatureTreeCustom">
|
||||
<Dialog Id="CustomizeDlgModSec" Width="370" Height="270" Title="!(loc.CustomizeDlg_Title)" TrackDiskSpace="yes">
|
||||
<Control Id="Tree" Type="SelectionTree" X="25" Y="85" Width="175" Height="115" Property="_BrowseProperty" Sunken="yes" TabSkip="no" Text="!(loc.CustomizeDlgTree)">
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
<Publish Property="DisableButton" Value="1">(NOT &ModSec64=3) AND (NOT &ModSec32=3)</Publish>
|
||||
<Publish Property="DisableButton" Value="0">&ModSec64=3 OR &ModSec32=3</Publish>
|
||||
<?else ?>
|
||||
<Publish Property="DisableButton" Value="1">(NOT &ModSec32=3)</Publish>
|
||||
<Publish Property="DisableButton" Value="0">&ModSec32=3</Publish>
|
||||
<?endif ?>
|
||||
</Control>
|
||||
<Control Id="Browse" Type="PushButton" X="294" Y="210" Width="66" Height="17" Text="!(loc.CustomizeDlgBrowse)">
|
||||
<Publish Event="SelectionBrowse" Value="BrowseDlg">1</Publish>
|
||||
@ -450,8 +461,8 @@
|
||||
<Condition Action="hide">Installed</Condition>
|
||||
</Control>
|
||||
</Dialog>
|
||||
<Property Id="CONFIGURE_IIS" Secure="yes" Value="1">
|
||||
<RegistrySearch Id="ConfigureIISRegistrySearch" Type="raw" Root="HKLM" Key="SOFTWARE\ModSecurity\ModSecurity" Name="ConfigureIIS" />
|
||||
<Property Id="CONFIGURE_MODSECURITY_IIS">
|
||||
<RegistrySearch Id="ConfigureIISRegistrySearch" Type="raw" Root="HKLM" Key="SOFTWARE\ModSecurity\ModSecurityConfigureIIS" Name="ModSecurityConfigureIIS" />
|
||||
</Property>
|
||||
<Dialog Id="RegisterDlg" Width="370" Height="270" Title="!(loc.VerifyReadyDlg_Title)" TrackDiskSpace="yes">
|
||||
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
|
||||
@ -469,7 +480,7 @@
|
||||
<Control Id="Title" Type="Text" X="15" Y="6" Width="210" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}IIS Setup" />
|
||||
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="Choose to configure ModSecurity on IIS or not." />
|
||||
<Control Id="Text" Type="Text" X="25" Y="55" Width="320" Height="50" Text="ModSecurityIIS needs to be configured under IIS as a module. It is recommended to perform this configuration during the installation. However, if you are facing problems in the installation, the recomendation is to disable this step. This will facilitate the debugging process since the files will be installed in place. Note that some scripts will be installed along with ModSecurity common files that can be later used to help this configuration/debugging process." />
|
||||
<Control Type="CheckBox" Id="ConfigureIIS" Width="200" Height="14" X="25" Y="124" CheckBoxValue="1" Property="CONFIGURE_IIS" Text="Perform ModSecurityIIS configuration." />
|
||||
<Control Type="CheckBox" Id="ConfigureIIS" Width="200" Height="14" X="25" Y="124" CheckBoxValue="1" Property="CONFIGURE_MODSECURITY_IIS" Text="Perform ModSecurityIIS configuration." />
|
||||
<Control Type="Text" Id="troubleshooting" Width="314" Height="37" X="26" Y="161" Text="For further information about problems during the installation, have a look at ModSecurityIIS Troubleshooting guide. Available at: https://github.com/SpiderLabs/ModSecurity/wiki/IIS-Troubleshooting" />
|
||||
</Dialog>
|
||||
<Binary Id="bannrbmp" SourceFile="wix\banner.jpg" />
|
||||
@ -502,7 +513,7 @@
|
||||
<Publish Dialog="RegisterDlg" Control="Back" Event="NewDialog" Value="CustomizeDlgModSec" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
|
||||
<Publish Dialog="RegisterDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="2">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
|
||||
<Publish Dialog="RegisterDlg" Control="Next" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish>
|
||||
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlgModSec" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
|
||||
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="RegisterDlg" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
|
||||
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
|
||||
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish>
|
||||
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
|
||||
@ -516,32 +527,41 @@
|
||||
<WixVariable Id="WixUIBannerBmp" Value="wix\banner.jpg" />
|
||||
<WixVariable Id="WixUIDialogBmp" Value="wix\dialog.jpg" />
|
||||
<InstallUISequence>
|
||||
<Custom Action="SetCONFIGURE_IIS" Before="AppSearch">NOT Installed AND NOT OLDERVERSIONDETECTED</Custom>
|
||||
<Custom Action="SetCONFIGURE_MODSECURITY_IIS" Before="AppSearch">NOT Installed AND NOT OLDERVERSIONDETECTED</Custom>
|
||||
</InstallUISequence>
|
||||
<InstallExecuteSequence>
|
||||
<Custom Action="SetCONFIGURE_IIS" Before="AppSearch">NOT Installed AND NOT OLDERVERSIONDETECTED</Custom>
|
||||
<Custom Action="SetCONFIGURE_MODSECURITY_IIS" Before="AppSearch">NOT Installed AND NOT OLDERVERSIONDETECTED</Custom>
|
||||
</InstallExecuteSequence>
|
||||
<CustomAction Id="SetCONFIGURE_IIS" Property="CONFIGURE_IIS" Value="1" Execute="firstSequence" />
|
||||
<CustomAction Id="SetCONFIGURE_MODSECURITY_IIS" Property="CONFIGURE_MODSECURITY_IIS" Value="1" Execute="firstSequence" />
|
||||
<InstallExecuteSequence>
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
<Custom Action="InstallModule64" Before="InstallFinalize"><![CDATA[NOT Installed AND CONFIGURE_IIS]]></Custom>
|
||||
<Custom Action="InstallModule32" After="InstallModule64"><![CDATA[NOT Installed AND CONFIGURE_IIS]]></Custom>
|
||||
<Custom Action="InstallConf" After="InstallModule32"><![CDATA[NOT Installed AND CONFIGURE_IIS]]></Custom>
|
||||
<Custom Action="UninstallConf" Before="RemoveFiles"><![CDATA[Installed AND CONFIGURE_IIS]]></Custom>
|
||||
<Custom Action="UninstallModule32" After="UninstallConf"><![CDATA[Installed AND CONFIGURE_IIS]]></Custom>
|
||||
<Custom Action="UninstallModule64" After="UninstallModule32"><![CDATA[Installed AND CONFIGURE_IIS]]></Custom>
|
||||
<Custom Action="InstallModule64" Before="InstallFinalize"><![CDATA[NOT Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
|
||||
<Custom Action="InstallModule32" After="InstallModule64"><![CDATA[NOT Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
|
||||
<Custom Action="InstallConf" After="InstallModule32"><![CDATA[NOT Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
|
||||
<Custom Action="UninstallConf" Before="RemoveFiles"><![CDATA[Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
|
||||
<Custom Action="UninstallModule32" After="UninstallConf"><![CDATA[Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
|
||||
<Custom Action="UninstallModule64" After="UninstallModule32"><![CDATA[Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
|
||||
<?else ?>
|
||||
<Custom Action="InstallModule32" Before="InstallFinalize"><![CDATA[NOT Installed AND CONFIGURE_IIS]]></Custom>
|
||||
<Custom Action="InstallConf" After="InstallModule32"><![CDATA[NOT Installed AND CONFIGURE_IIS]]></Custom>
|
||||
<Custom Action="UninstallConf" Before="RemoveFiles"><![CDATA[Installed AND CONFIGURE_IIS]]></Custom>
|
||||
<Custom Action="UninstallModule32" After="UninstallConf"><![CDATA[Installed AND CONFIGURE_IIS]]></Custom>
|
||||
<Custom Action="InstallModule32" Before="InstallFinalize"><![CDATA[NOT Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
|
||||
<Custom Action="InstallConf" After="InstallModule32"><![CDATA[NOT Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
|
||||
<Custom Action="UninstallConf" Before="RemoveFiles"><![CDATA[Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
|
||||
<Custom Action="UninstallModule32" After="UninstallConf"><![CDATA[Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
|
||||
<?endif ?>
|
||||
</InstallExecuteSequence>
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
<CustomAction Id="InstallModule32" Execute="deferred" Impersonate="no" Return="check" Directory="INSTALLFOLDER" ExeCommand=""[System64Folder]inetsrv\appcmd.exe" install module /name:"ModSecurity IIS (32bits)" /image:"%SystemRoot%\System32\inetsrv\ModSecurityIIS.dll"" />
|
||||
<CustomAction Id="InstallModule64" Execute="deferred" Impersonate="no" Return="check" Directory="INSTALLFOLDER" ExeCommand=""[System64Folder]inetsrv\appcmd.exe" install module /name:"ModSecurity IIS (64bits)" /image:"%SystemRoot%\SysWOW64\inetsrv\ModSecurityIIS.dll"" />
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
<CustomAction Id="InstallModule32" Execute="deferred" Impersonate="no" Return="check" Directory="INSTALLFOLDER" ExeCommand=""[System64Folder]inetsrv\appcmd.exe" install module /name:"ModSecurity IIS (64bits)" /image:"%SystemRoot%\System32\inetsrv\ModSecurityIIS.dll" /preCondition:"bitness64"" />
|
||||
<?else ?>
|
||||
<CustomAction Id="InstallModule32" Execute="deferred" Impersonate="no" Return="check" Directory="INSTALLFOLDER" ExeCommand=""[SystemFolder]inetsrv\appcmd.exe" install module /name:"ModSecurity IIS (32bits)" /image:"%SystemRoot%\System32\inetsrv\ModSecurityIIS.dll"" />
|
||||
<?endif ?>
|
||||
<CustomAction Id="InstallModule64" Execute="deferred" Impersonate="no" Return="check" Directory="INSTALLFOLDER" ExeCommand=""[System64Folder]inetsrv\appcmd.exe" install module /name:"ModSecurity IIS (32bits)" /image:"%SystemRoot%\SysWOW64\inetsrv\ModSecurityIIS.dll" /preCondition:"bitness32"" />
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
<CustomAction Id="UninstallModule32" Execute="deferred" Impersonate="no" Return="check" Directory="INSTALLFOLDER" ExeCommand=""[System64Folder]inetsrv\appcmd.exe" uninstall module /module.name:"ModSecurity IIS (32bits)"" />
|
||||
<CustomAction Id="UninstallModule64" Execute="deferred" Impersonate="no" Return="check" Directory="INSTALLFOLDER" ExeCommand=""[System64Folder]inetsrv\appcmd.exe" uninstall module /module.name:"ModSecurity IIS (64bits)"" />
|
||||
<?else ?>
|
||||
<CustomAction Id="UninstallModule32" Execute="deferred" Impersonate="no" Return="check" Directory="INSTALLFOLDER" ExeCommand=""[SystemFolder]inetsrv\appcmd.exe" uninstall module /module.name:"ModSecurity IIS (32bits)"" />
|
||||
<CustomAction Id="UninstallModule64" Execute="deferred" Impersonate="no" Return="check" Directory="INSTALLFOLDER" ExeCommand=""[System64Folder]inetsrv\appcmd.exe" uninstall module /module.name:"ModSecurity IIS (64bits)"" />
|
||||
<?endif ?>
|
||||
<CustomAction Id="InstallConf" Execute="deferred" Impersonate="no" Return="check" Directory="INSTALLFOLDER" ExeCommand=""[System64Folder]inetsrv\appcmd.exe" set config /section:"system.webServer/ModSecurity" /"enabled:true" /"configFile:[INSTALLFOLDER]modsecurity_iis.conf"" />
|
||||
<CustomAction Id="UninstallConf" Execute="deferred" Impersonate="no" Return="check" Directory="INSTALLFOLDER" ExeCommand=""[System64Folder]inetsrv\appcmd.exe" clear config -section:"system.webServer/ModSecurity"" />
|
||||
<?else ?>
|
||||
|
79
iis/wix/list_dependencies.bat
Normal file
79
iis/wix/list_dependencies.bat
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user