Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4d7d1ba

Browse files
author
Felipe "Zimmerle" Costa
committed
iis: Adds listing dependencies script
This script could be used in order to verify all ModSecurity run timedependencies. It is now part of ModSecurity folder in Program menu.Cosmetics changes in the installer
1 parent619758c commit4d7d1ba

File tree

2 files changed

+123
-24
lines changed

2 files changed

+123
-24
lines changed

‎iis/installer.wxs‎

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@
8181
</Property>
8282
<PropertyId="MSIUSEREALADMINDETECTION"Value="1" />
8383
<ConditionMessage="This setup requires IIS 6.0, 7.0 or 8.0 is installed."><![CDATA[(IIS="#7") OR (IIS="#6") OR (IIS="#8")]]></Condition>
84-
<!-- Version 2.7.6 had an uninstall issue that leaves some files behind. Asking the user to manually hash this out.-->
84+
<!-- Version 2.7.5 had an uninstall issue that leaves some files behind. Asking the user to manually hash this out.-->
8585
<ConditionMessage="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>
8686
<ConditionMessage="64-bit operating system was detected, please use the 64-bit installer.">
8787
<?if $(var.Win64) ="yes" ?>
88-
VersionNT64
89-
<?else ?>
90-
NOT VersionNT64
91-
<?endif ?></Condition>
88+
VersionNT64
89+
<?else ?>
90+
NOT VersionNT64
91+
<?endif ?></Condition>
9292
<MediaId="1"Cabinet="simple.cab"EmbedCab="yes" />
9393
<DirectoryId="TARGETDIR"Name="SourceDir">
9494
<?if $(var.Win64) ="yes" ?>
@@ -296,6 +296,11 @@
296296
<ShortcutId="UninstallProduct"Name="Uninstall"Description="Uninstalls the ModSecurity IIS"Target="[System64Folder]msiexec.exe"Arguments="/x [ProductCode]" />
297297
<ShortcutId="EULA"Name="EULA"Description="EULA"Target="[INSTALLFOLDER]EULA.rtf"WorkingDirectory="INSTALLFOLDER" />
298298
<ShortcutId="Readme"Name="EULA"Description="EULA"Target="[INSTALLFOLDER]README.TXT"WorkingDirectory="INSTALLFOLDER" />
299+
<?if $(var.Win64) ="yes" ?>
300+
<ShortcutId="List_Dependencies"Name="List Dependencies (Debug)"Description="Check for missing dependencies"Target="[INSTALLFOLDER]list_dependencies.bat"Arguments="&quot;[inetsrv64]libapr-1.dll&quot;&quot;[inetsrv64]libapriconv-1.dll&quot;&quot;[inetsrv64]libaprutil-1.dll&quot;&quot;[inetsrv64]libcurl.dll&quot;&quot;[inetsrv64]libxml2.dll&quot;&quot;[inetsrv64]lua5.1.dll&quot;&quot;[inetsrv64]mlogc.exe&quot;&quot;[inetsrv64]ModSecurityIIS.dll&quot;&quot;[inetsrv64]pcre.dll&quot;&quot;[inetsrv64]zlib1.dll&quot;&quot;[inetsrv32]libapr-1.dll&quot;&quot;[inetsrv32]libapriconv-1.dll&quot;&quot;[inetsrv32]libaprutil-1.dll&quot;&quot;[inetsrv32]libcurl.dll&quot;&quot;[inetsrv32]libxml2.dll&quot;&quot;[inetsrv32]lua5.1.dll&quot;&quot;[inetsrv32]mlogc.exe&quot;&quot;[inetsrv32]ModSecurityIIS.dll&quot;&quot;[inetsrv32]pcre.dll&quot;&quot;[inetsrv32]zlib1.dll&quot;"WorkingDirectory="INSTALLFOLDER" />
301+
<?else ?>
302+
<ShortcutId="List_Dependencies"Name="List Dependencies (Debug)"Description="Check for missing dependencies"Target="[INSTALLFOLDER]list_dependencies.bat"Arguments="&quot;[inetsrv32]libapr-1.dll&quot;&quot;[inetsrv32]libapriconv-1.dll&quot;&quot;[inetsrv32]libaprutil-1.dll&quot;&quot;[inetsrv32]libcurl.dll&quot;&quot;[inetsrv32]libxml2.dll&quot;&quot;[inetsrv32]lua5.1.dll&quot;&quot;[inetsrv32]mlogc.exe&quot;&quot;[inetsrv32]ModSecurityIIS.dll&quot;&quot;[inetsrv32]pcre.dll&quot;&quot;[inetsrv32]zlib1.dll&quot;"WorkingDirectory="INSTALLFOLDER" />
303+
<?endif ?>
299304
</Component>
300305
</Directory>
301306
</Directory>
@@ -307,6 +312,7 @@
307312
<FileId="modsecurity.conf"Name="modsecurity.conf"Source="wix\modsecurity.conf" />
308313
<FileId="modsecurity_iis.conf"Name="modsecurity_iis.conf"Source="wix\modsecurity_iis.conf" />
309314
<FileId="modsecurity_crs_10_setup.conf"Name="modsecurity_crs_10_setup.conf"Source="wix\modsecurity_crs_10_setup.conf" />
315+
<FileId="LIST_DEPENDENCIES.BAT"Name="list_dependencies.bat"Source="wix\list_dependencies.bat" />
310316
</Component>
311317
</DirectoryRef>
312318
<?if $(var.Win64) ="yes" ?>
@@ -402,8 +408,13 @@
402408
<UIId="WixUI_FeatureTreeCustom">
403409
<DialogId="CustomizeDlgModSec"Width="370"Height="270"Title="!(loc.CustomizeDlg_Title)"TrackDiskSpace="yes">
404410
<ControlId="Tree"Type="SelectionTree"X="25"Y="85"Width="175"Height="115"Property="_BrowseProperty"Sunken="yes"TabSkip="no"Text="!(loc.CustomizeDlgTree)">
411+
<?if $(var.Win64) ="yes" ?>
405412
<PublishProperty="DisableButton"Value="1">(NOT&amp;ModSec64=3) AND (NOT&amp;ModSec32=3)</Publish>
406413
<PublishProperty="DisableButton"Value="0">&amp;ModSec64=3 OR&amp;ModSec32=3</Publish>
414+
<?else ?>
415+
<PublishProperty="DisableButton"Value="1">(NOT&amp;ModSec32=3)</Publish>
416+
<PublishProperty="DisableButton"Value="0">&amp;ModSec32=3</Publish>
417+
<?endif ?>
407418
</Control>
408419
<ControlId="Browse"Type="PushButton"X="294"Y="210"Width="66"Height="17"Text="!(loc.CustomizeDlgBrowse)">
409420
<PublishEvent="SelectionBrowse"Value="BrowseDlg">1</Publish>
@@ -450,8 +461,8 @@
450461
<ConditionAction="hide">Installed</Condition>
451462
</Control>
452463
</Dialog>
453-
<PropertyId="CONFIGURE_IIS"Secure="yes"Value="1">
454-
<RegistrySearchId="ConfigureIISRegistrySearch"Type="raw"Root="HKLM"Key="SOFTWARE\ModSecurity\ModSecurity"Name="ConfigureIIS" />
464+
<PropertyId="CONFIGURE_MODSECURITY_IIS">
465+
<RegistrySearchId="ConfigureIISRegistrySearch"Type="raw"Root="HKLM"Key="SOFTWARE\ModSecurity\ModSecurityConfigureIIS"Name="ModSecurityConfigureIIS" />
455466
</Property>
456467
<DialogId="RegisterDlg"Width="370"Height="270"Title="!(loc.VerifyReadyDlg_Title)"TrackDiskSpace="yes">
457468
<ControlId="Cancel"Type="PushButton"X="304"Y="243"Width="56"Height="17"Cancel="yes"Text="!(loc.WixUICancel)">
@@ -469,7 +480,7 @@
469480
<ControlId="Title"Type="Text"X="15"Y="6"Width="210"Height="15"Transparent="yes"NoPrefix="yes"Text="{\WixUI_Font_Title}IIS Setup" />
470481
<ControlId="Description"Type="Text"X="25"Y="23"Width="280"Height="15"Transparent="yes"NoPrefix="yes"Text="Choose to configure ModSecurity on IIS or not." />
471482
<ControlId="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." />
472-
<ControlType="CheckBox"Id="ConfigureIIS"Width="200"Height="14"X="25"Y="124"CheckBoxValue="1"Property="CONFIGURE_IIS"Text="Perform ModSecurityIIS configuration." />
483+
<ControlType="CheckBox"Id="ConfigureIIS"Width="200"Height="14"X="25"Y="124"CheckBoxValue="1"Property="CONFIGURE_MODSECURITY_IIS"Text="Perform ModSecurityIIS configuration." />
473484
<ControlType="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" />
474485
</Dialog>
475486
<BinaryId="bannrbmp"SourceFile="wix\banner.jpg" />
@@ -502,7 +513,7 @@
502513
<PublishDialog="RegisterDlg"Control="Back"Event="NewDialog"Value="CustomizeDlgModSec"Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
503514
<PublishDialog="RegisterDlg"Control="Next"Event="NewDialog"Value="VerifyReadyDlg"Order="2">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
504515
<PublishDialog="RegisterDlg"Control="Next"Event="NewDialog"Value="WelcomeDlg"Order="3">Installed AND PATCH</Publish>
505-
<PublishDialog="VerifyReadyDlg"Control="Back"Event="NewDialog"Value="CustomizeDlgModSec"Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
516+
<PublishDialog="VerifyReadyDlg"Control="Back"Event="NewDialog"Value="RegisterDlg"Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
506517
<PublishDialog="VerifyReadyDlg"Control="Back"Event="NewDialog"Value="MaintenanceTypeDlg"Order="2">Installed AND NOT PATCH</Publish>
507518
<PublishDialog="VerifyReadyDlg"Control="Back"Event="NewDialog"Value="WelcomeDlg"Order="3">Installed AND PATCH</Publish>
508519
<PublishDialog="MaintenanceWelcomeDlg"Control="Next"Event="NewDialog"Value="MaintenanceTypeDlg">1</Publish>
@@ -516,32 +527,41 @@
516527
<WixVariableId="WixUIBannerBmp"Value="wix\banner.jpg" />
517528
<WixVariableId="WixUIDialogBmp"Value="wix\dialog.jpg" />
518529
<InstallUISequence>
519-
<CustomAction="SetCONFIGURE_IIS"Before="AppSearch">NOT Installed AND NOT OLDERVERSIONDETECTED</Custom>
530+
<CustomAction="SetCONFIGURE_MODSECURITY_IIS"Before="AppSearch">NOT Installed AND NOT OLDERVERSIONDETECTED</Custom>
520531
</InstallUISequence>
521532
<InstallExecuteSequence>
522-
<CustomAction="SetCONFIGURE_IIS"Before="AppSearch">NOT Installed AND NOT OLDERVERSIONDETECTED</Custom>
533+
<CustomAction="SetCONFIGURE_MODSECURITY_IIS"Before="AppSearch">NOT Installed AND NOT OLDERVERSIONDETECTED</Custom>
523534
</InstallExecuteSequence>
524-
<CustomActionId="SetCONFIGURE_IIS"Property="CONFIGURE_IIS"Value="1"Execute="firstSequence" />
535+
<CustomActionId="SetCONFIGURE_MODSECURITY_IIS"Property="CONFIGURE_MODSECURITY_IIS"Value="1"Execute="firstSequence" />
525536
<InstallExecuteSequence>
526537
<?if $(var.Win64) ="yes" ?>
527-
<CustomAction="InstallModule64"Before="InstallFinalize"><![CDATA[NOT Installed ANDCONFIGURE_IIS]]></Custom>
528-
<CustomAction="InstallModule32"After="InstallModule64"><![CDATA[NOT Installed ANDCONFIGURE_IIS]]></Custom>
529-
<CustomAction="InstallConf"After="InstallModule32"><![CDATA[NOT Installed ANDCONFIGURE_IIS]]></Custom>
530-
<CustomAction="UninstallConf"Before="RemoveFiles"><![CDATA[Installed ANDCONFIGURE_IIS]]></Custom>
531-
<CustomAction="UninstallModule32"After="UninstallConf"><![CDATA[Installed ANDCONFIGURE_IIS]]></Custom>
532-
<CustomAction="UninstallModule64"After="UninstallModule32"><![CDATA[Installed ANDCONFIGURE_IIS]]></Custom>
538+
<CustomAction="InstallModule64"Before="InstallFinalize"><![CDATA[NOT Installed ANDCONFIGURE_MODSECURITY_IIS]]></Custom>
539+
<CustomAction="InstallModule32"After="InstallModule64"><![CDATA[NOT Installed ANDCONFIGURE_MODSECURITY_IIS]]></Custom>
540+
<CustomAction="InstallConf"After="InstallModule32"><![CDATA[NOT Installed ANDCONFIGURE_MODSECURITY_IIS]]></Custom>
541+
<CustomAction="UninstallConf"Before="RemoveFiles"><![CDATA[Installed ANDCONFIGURE_MODSECURITY_IIS]]></Custom>
542+
<CustomAction="UninstallModule32"After="UninstallConf"><![CDATA[Installed ANDCONFIGURE_MODSECURITY_IIS]]></Custom>
543+
<CustomAction="UninstallModule64"After="UninstallModule32"><![CDATA[Installed ANDCONFIGURE_MODSECURITY_IIS]]></Custom>
533544
<?else ?>
534-
<CustomAction="InstallModule32"Before="InstallFinalize"><![CDATA[NOT Installed ANDCONFIGURE_IIS]]></Custom>
535-
<CustomAction="InstallConf"After="InstallModule32"><![CDATA[NOT Installed ANDCONFIGURE_IIS]]></Custom>
536-
<CustomAction="UninstallConf"Before="RemoveFiles"><![CDATA[Installed ANDCONFIGURE_IIS]]></Custom>
537-
<CustomAction="UninstallModule32"After="UninstallConf"><![CDATA[Installed ANDCONFIGURE_IIS]]></Custom>
545+
<CustomAction="InstallModule32"Before="InstallFinalize"><![CDATA[NOT Installed ANDCONFIGURE_MODSECURITY_IIS]]></Custom>
546+
<CustomAction="InstallConf"After="InstallModule32"><![CDATA[NOT Installed ANDCONFIGURE_MODSECURITY_IIS]]></Custom>
547+
<CustomAction="UninstallConf"Before="RemoveFiles"><![CDATA[Installed ANDCONFIGURE_MODSECURITY_IIS]]></Custom>
548+
<CustomAction="UninstallModule32"After="UninstallConf"><![CDATA[Installed ANDCONFIGURE_MODSECURITY_IIS]]></Custom>
538549
<?endif ?>
539550
</InstallExecuteSequence>
540551
<?if $(var.Win64) ="yes" ?>
541-
<CustomActionId="InstallModule32"Execute="deferred"Impersonate="no"Return="check"Directory="INSTALLFOLDER"ExeCommand="&quot;[System64Folder]inetsrv\appcmd.exe&quot; install module /name:&quot;ModSecurity IIS (32bits)&quot; /image:&quot;%SystemRoot%\System32\inetsrv\ModSecurityIIS.dll&quot;" />
542-
<CustomActionId="InstallModule64"Execute="deferred"Impersonate="no"Return="check"Directory="INSTALLFOLDER"ExeCommand="&quot;[System64Folder]inetsrv\appcmd.exe&quot; install module /name:&quot;ModSecurity IIS (64bits)&quot; /image:&quot;%SystemRoot%\SysWOW64\inetsrv\ModSecurityIIS.dll&quot;" />
552+
<?if $(var.Win64) ="yes" ?>
553+
<CustomActionId="InstallModule32"Execute="deferred"Impersonate="no"Return="check"Directory="INSTALLFOLDER"ExeCommand="&quot;[System64Folder]inetsrv\appcmd.exe&quot; install module /name:&quot;ModSecurity IIS (64bits)&quot; /image:&quot;%SystemRoot%\System32\inetsrv\ModSecurityIIS.dll&quot; /preCondition:&quot;bitness64&quot;" />
554+
<?else ?>
555+
<CustomActionId="InstallModule32"Execute="deferred"Impersonate="no"Return="check"Directory="INSTALLFOLDER"ExeCommand="&quot;[SystemFolder]inetsrv\appcmd.exe&quot; install module /name:&quot;ModSecurity IIS (32bits)&quot; /image:&quot;%SystemRoot%\System32\inetsrv\ModSecurityIIS.dll&quot;" />
556+
<?endif ?>
557+
<CustomActionId="InstallModule64"Execute="deferred"Impersonate="no"Return="check"Directory="INSTALLFOLDER"ExeCommand="&quot;[System64Folder]inetsrv\appcmd.exe&quot; install module /name:&quot;ModSecurity IIS (32bits)&quot; /image:&quot;%SystemRoot%\SysWOW64\inetsrv\ModSecurityIIS.dll&quot; /preCondition:&quot;bitness32&quot;" />
558+
<?if $(var.Win64) ="yes" ?>
543559
<CustomActionId="UninstallModule32"Execute="deferred"Impersonate="no"Return="check"Directory="INSTALLFOLDER"ExeCommand="&quot;[System64Folder]inetsrv\appcmd.exe&quot; uninstall module /module.name:&quot;ModSecurity IIS (32bits)&quot;" />
544560
<CustomActionId="UninstallModule64"Execute="deferred"Impersonate="no"Return="check"Directory="INSTALLFOLDER"ExeCommand="&quot;[System64Folder]inetsrv\appcmd.exe&quot; uninstall module /module.name:&quot;ModSecurity IIS (64bits)&quot;" />
561+
<?else ?>
562+
<CustomActionId="UninstallModule32"Execute="deferred"Impersonate="no"Return="check"Directory="INSTALLFOLDER"ExeCommand="&quot;[SystemFolder]inetsrv\appcmd.exe&quot; uninstall module /module.name:&quot;ModSecurity IIS (32bits)&quot;" />
563+
<CustomActionId="UninstallModule64"Execute="deferred"Impersonate="no"Return="check"Directory="INSTALLFOLDER"ExeCommand="&quot;[System64Folder]inetsrv\appcmd.exe&quot; uninstall module /module.name:&quot;ModSecurity IIS (64bits)&quot;" />
564+
<?endif ?>
545565
<CustomActionId="InstallConf"Execute="deferred"Impersonate="no"Return="check"Directory="INSTALLFOLDER"ExeCommand="&quot;[System64Folder]inetsrv\appcmd.exe&quot; set config /section:&quot;system.webServer/ModSecurity&quot; /&quot;enabled:true&quot; /&quot;configFile:[INSTALLFOLDER]modsecurity_iis.conf&quot;" />
546566
<CustomActionId="UninstallConf"Execute="deferred"Impersonate="no"Return="check"Directory="INSTALLFOLDER"ExeCommand="&quot;[System64Folder]inetsrv\appcmd.exe&quot; clear config -section:&quot;system.webServer/ModSecurity&quot;" />
547567
<?else ?>

‎iis/wix/list_dependencies.bat‎

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
2+
@echooff
3+
4+
echo *
5+
echo *
6+
echo * ModSecurityIIS - list dependencies
7+
echo *
8+
echo *
9+
echo * This script is likely to be used as part as a debugging process.
10+
echo *
11+
echo *
12+
echo * The main function of this script is to list all ModSecurityIIS runtime
13+
echo * dependencies, including system dependencies, to check if there is a
14+
echo * missing library or a version mismatch. This can be very usefull in case
15+
echo * ModSecurityIIS refuses to register as IIS module or if IIS refuses to
16+
echo * start.
17+
echo *
18+
echo *
19+
echo *
20+
21+
pause
22+
23+
:LOOP_FILE
24+
SET /alog_file=%RANDOM%+100000
25+
SETlog_file=%TEMP%\ModSecurityIIS-depedencies-%log_file:~-5%.TXT
26+
IFEXIST%log_file%GOTO LOOP_FILE
27+
28+
echo Saving logs at:%log_file%
29+
30+
setPOSSIBLE_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"
31+
setPOSSIBLE_PATHS_X64="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\dumpbin.exe"
32+
33+
for%%iin (%POSSIBLE_PATHS_X86%)do (
34+
echo Checking for dumpbin x86...%%i
35+
echo Checking for dumpbin x86...%%i>>%log_file%
36+
ifexist%%i (
37+
SETDUMPBIN_X86=%%i
38+
goto found_x86
39+
)
40+
)
41+
:found_x86
42+
43+
for%%iin (%POSSIBLE_PATHS_X64%)do (
44+
echo Checking for dumpbin x64...%%i
45+
echo Checking for dumpbin x64...%%i>>%log_file%
46+
ifexist%%i (
47+
SETDUMPBIN_X64=%%i
48+
goto found_x64
49+
)
50+
)
51+
:found_x64
52+
53+
if"%DUMPBIN_X86:~1,-1%"=="" (
54+
echo Dumpbin x86 not found.
55+
echo Dumpbin x86 not found.>>%log_file%
56+
)else (
57+
echo Using dumpbin x86:%DUMPBIN_X86%
58+
echo Using dumpbin x86:%DUMPBIN_X86%>>%log_file%
59+
%DUMPBIN_X86% /imports /dependents%*>>%log_file%
60+
)
61+
)
62+
63+
if"%DUMPBIN_X64:~1,-1%"=="" (
64+
echo Dumpbin x64 not found.
65+
echo Dumpbin x64 not found.>>%log_file%
66+
)else (
67+
echo Using dumpbin x64:%DUMPBIN_X64%
68+
echo Using dumpbin x64:%DUMPBIN_X64%>>%log_file%
69+
%DUMPBIN_X64% /imports /dependents%*>>%log_file%
70+
)
71+
72+
gotoexit
73+
74+
:exit
75+
echo Logs were saved at:%log_file%.
76+
echo Trying to open it with explorer...
77+
explorer%log_file%
78+
echo Done.
79+
pause

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp