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

Commitf8f06f7

Browse files
author
Felipe "Zimmerle" Costa
committed
IIS: Updates build_msi.bat to fit the new WiX install options
Instead of -dPlatform a recent update in the WiX files are demandingthe parameter -arch, although this parameter is not valid nor neededwhile running "light".
1 parent4d7d1ba commitf8f06f7

File tree

2 files changed

+77
-31
lines changed

2 files changed

+77
-31
lines changed

‎iis/build_msi.bat‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ del installer.wix*
88
"candle.exe" -ext WixUtilExtension -ext WixUIExtension"%CURRENT_DIR%\installer.wxs" -out"%CURRENT_DIR%\installer.wixobj" -arch x64
99
@ifNOT (%ERRORLEVEL%)== (0)goto build_failed
1010

11-
"light.exe" -ext WixUtilExtension -ext WixUIExtension"%CURRENT_DIR%\installer.wixobj" -out"%CURRENT_DIR%\installer-64.msi"-arch x64
11+
"light.exe" -ext WixUtilExtension -ext WixUIExtension"%CURRENT_DIR%\installer.wixobj" -out"%CURRENT_DIR%\installer-64.msi"
1212
@ifNOT (%ERRORLEVEL%)== (0)goto build_failed
1313

1414
"candle.exe" -ext WixUtilExtension -ext WixUIExtension"%CURRENT_DIR%\installer.wxs" -out"%CURRENT_DIR%\installer.wixobj" -arch x86
1515
@ifNOT (%ERRORLEVEL%)== (0)goto build_failed
1616

17-
"light.exe" -ext WixUtilExtension -ext WixUIExtension"%CURRENT_DIR%\installer.wixobj" -out"%CURRENT_DIR%\installer-32.msi"-arch x86
17+
"light.exe" -ext WixUtilExtension -ext WixUIExtension"%CURRENT_DIR%\installer.wixobj" -out"%CURRENT_DIR%\installer-32.msi"
1818
@ifNOT (%ERRORLEVEL%)== (0)goto build_failed
1919

2020
exit /B0

‎iis/installer.wxs‎

Lines changed: 75 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,17 @@
1313
<?if $(sys.BUILDARCH) = x64 ?>
1414
<?define Win64 ="yes" ?>
1515
<?define PlatformProgramFilesFolder ="ProgramFiles64Folder" ?>
16+
<?define ConfigFile ="[inetsrv64]Config\applicationHost.config" ?>
17+
<PropertyId="IIS_SETUP">
18+
<RegistrySearchId="ConfigureIISRegistrySearch"Type="raw"Root="HKLM"Key="SOFTWARE\ModSecurity\ModSecurity"Name="ModSecurityConfigureIIS"Win64="yes" />
19+
</Property>
1620
<?else ?>
1721
<?define Win64 ="no" ?>
1822
<?define PlatformProgramFilesFolder ="ProgramFilesFolder" ?>
23+
<?define ConfigFile ="[inetsrv32]Config\applicationHost.config" ?>
24+
<PropertyId="IIS_SETUP">
25+
<RegistrySearchId="ConfigureIISRegistrySearch"Type="raw"Root="HKLM"Key="SOFTWARE\ModSecurity\ModSecurity"Name="ModSecurityConfigureIIS"Win64="no" />
26+
</Property>
1927
<?endif ?>
2028
<PropertyId="IIS">
2129
<RegistrySearchId="IISInstalledVersion"Root="HKLM"Key="SOFTWARE\Microsoft\InetStp"Type="raw"Name="MajorVersion" />
@@ -93,14 +101,26 @@
93101
<DirectoryId="TARGETDIR"Name="SourceDir">
94102
<?if $(var.Win64) ="yes" ?>
95103
<DirectoryId="SystemFolder"Name="SystemFolder">
96-
<DirectoryId="inetsrv32"Name="inetsrv" />
104+
<DirectoryId="inetsrv32"Name="inetsrv">
105+
<DirectoryId="SystemFolderConfig32"Name="config">
106+
<DirectoryId="SystemFolderConfigSchema32"Name="schema" />
107+
</Directory>
108+
</Directory>
97109
</Directory>
98110
<DirectoryId="System64Folder"Name="SystemFolder">
99-
<DirectoryId="inetsrv64"Name="inetsrv" />
111+
<DirectoryId="inetsrv64"Name="inetsrv">
112+
<DirectoryId="SystemFolderConfig64"Name="config">
113+
<DirectoryId="SystemFolderConfigSchema64"Name="schema" />
114+
</Directory>
115+
</Directory>
100116
</Directory>
101117
<?else ?>
102118
<DirectoryId="SystemFolder"Name="SystemFolder">
103-
<DirectoryId="inetsrv32"Name="inetsrv" />
119+
<DirectoryId="inetsrv32"Name="inetsrv">
120+
<DirectoryId="SystemFolderConfig32"Name="config">
121+
<DirectoryId="SystemFolderConfigSchema32"Name="schema" />
122+
</Directory>
123+
</Directory>
104124
</Directory>
105125
<?endif ?>
106126
<DirectoryId="$(var.PlatformProgramFilesFolder)">
@@ -313,6 +333,17 @@
313333
<FileId="modsecurity_iis.conf"Name="modsecurity_iis.conf"Source="wix\modsecurity_iis.conf" />
314334
<FileId="modsecurity_crs_10_setup.conf"Name="modsecurity_crs_10_setup.conf"Source="wix\modsecurity_crs_10_setup.conf" />
315335
<FileId="LIST_DEPENDENCIES.BAT"Name="list_dependencies.bat"Source="wix\list_dependencies.bat" />
336+
<FileId="ModSecurity.xml"Name="ModSecurity.xml"Source="ModSecurity.xml" />
337+
<!-- Modify ApplicationHost.config-->
338+
<util:XmlConfigId="appHostEntry"File="$(var.ConfigFile)"Action="create"ElementPath="//configuration/configSections/sectionGroup[\[]@name='system.webServer'[\]]"VerifyPath="section[\[]@name='ModSecurity'[\]]"Name="section"Node="element"Sequence="1"On="install" />
339+
<util:XmlConfigId="appHostEntryName"File="$(var.ConfigFile)"ElementPath="appHostEntry"Name="name"Value="ModSecurity"Sequence="2" />
340+
<util:XmlConfigId="appHostEntryOverrideMode"File="$(var.ConfigFile)"ElementPath="appHostEntry"Name="overrideModeDefault"Value="Deny"Sequence="3" />
341+
<util:XmlConfigId="appHostEntryAllowDefinition"File="$(var.ConfigFile)"ElementPath="appHostEntry"Name="allowDefinition"Value="Everywhere"Sequence="4" />
342+
<util:XmlConfigId="removeAppHostEntry"File="$(var.ConfigFile)"Action="delete"ElementPath="/configuration/configSections/sectionGroup[\[]@name='system.webServer'[\]]"Node="element"VerifyPath="section[\[]@name='ModSecurity'[\]]"On="uninstall"Sequence="1" />
343+
<util:XmlConfigId="removeAppHostEntry2"File="$(var.ConfigFile)"Action="delete"ElementPath="/configuration/system.webServer"Node="element"VerifyPath="/configuration/system.webServer/ModSecurity"Name="section"On="uninstall"Sequence="2" />
344+
<RegistryKeyRoot="HKLM"Key="SOFTWARE\ModSecurity\ModSecurity"Action="createAndRemoveOnUninstall">
345+
<RegistryValueType="string"Name="ModSecurityConfigureIIS"Value="[IIS_SETUP]"KeyPath="yes" />
346+
</RegistryKey>
316347
</Component>
317348
</DirectoryRef>
318349
<?if $(var.Win64) ="yes" ?>
@@ -346,6 +377,16 @@
346377
<FileId="_32_ZLIB1"Name="zlib1.dll"Source="Release\x86\zlib1.dll" />
347378
</Component>
348379
</DirectoryRef>
380+
<DirectoryRefId="SystemFolderConfigSchema32">
381+
<ComponentId="ConfigSchema32"Guid="514A81F0-2413-42EF-B19F-E2613125EC11"Location="local"Win64="no">
382+
<FileId="_32_ConfigSchema"Name="ModSecurity.xml"Source="ModSecurity.xml" />
383+
</Component>
384+
</DirectoryRef>
385+
<DirectoryRefId="SystemFolderConfigSchema64">
386+
<ComponentId="ConfigSchema64"Guid="514A81F0-2413-42EF-B19F-E2613125EC22"Location="local"Win64="yes">
387+
<FileId="_64_ConfigSchema"Name="ModSecurity.xml"Source="ModSecurity.xml" />
388+
</Component>
389+
</DirectoryRef>
349390
<?else ?>
350391
<DirectoryRefId="inetsrv32">
351392
<ComponentId="ModSec32"DiskId="1"Guid="514A81F0-2413-42EF-B19F-E2613125ECE1"Win64="no"Location="local">
@@ -362,9 +403,18 @@
362403
<FileId="_32_ZLIB1"Name="zlib1.dll"Source="Release\x86\zlib1.dll" />
363404
</Component>
364405
</DirectoryRef>
365-
<?endif ?>
406+
<DirectoryRefId="SystemFolderConfigSchema32">
407+
<ComponentId="ConfigSchema32"Guid="514A81F0-2413-42EF-B19F-E2613125EC11"Location="local"Win64="no">
408+
<FileId="_32_ConfigSchema"Name="ModSecurity.xml"Source="ModSecurity.xml" />
409+
</Component>
410+
</DirectoryRef>
411+
<?endif ?>
366412
<FeatureId="DefaultFeature"Title="ModSecurity IIS Common files"Level="1"InstallDefault="local"Absent="disallow"Display="expand"AllowAdvertise="no"Description="Configuration and common files">
367413
<ComponentRefId="ModSecCommon" />
414+
<ComponentRefId="ConfigSchema32" />
415+
<?if $(var.Win64) ="yes" ?>
416+
<ComponentRefId="ConfigSchema64" />
417+
<?endif ?>
368418
<ComponentRefId="StartMenuShortcuts" />
369419
<FeatureId="OWASP_ModSecurity_CRS_v2.2.8"Level="1"Title="OWASP ModSecurity CRS v2.2.8"InstallDefault="local"Display="expand"AllowAdvertise="no"Description="Install OWASP CRS v2.2.8">
370420
<ComponentRefId="OWASP_CRS_V_2_2_8" />
@@ -461,9 +511,6 @@
461511
<ConditionAction="hide">Installed</Condition>
462512
</Control>
463513
</Dialog>
464-
<PropertyId="CONFIGURE_MODSECURITY_IIS">
465-
<RegistrySearchId="ConfigureIISRegistrySearch"Type="raw"Root="HKLM"Key="SOFTWARE\ModSecurity\ModSecurityConfigureIIS"Name="ModSecurityConfigureIIS" />
466-
</Property>
467514
<DialogId="RegisterDlg"Width="370"Height="270"Title="!(loc.VerifyReadyDlg_Title)"TrackDiskSpace="yes">
468515
<ControlId="Cancel"Type="PushButton"X="304"Y="243"Width="56"Height="17"Cancel="yes"Text="!(loc.WixUICancel)">
469516
<PublishEvent="SpawnDialog"Value="CancelDlg">1</Publish>
@@ -480,7 +527,7 @@
480527
<ControlId="Title"Type="Text"X="15"Y="6"Width="210"Height="15"Transparent="yes"NoPrefix="yes"Text="{\WixUI_Font_Title}IIS Setup" />
481528
<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." />
482529
<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." />
483-
<ControlType="CheckBox"Id="ConfigureIIS"Width="200"Height="14"X="25"Y="124"CheckBoxValue="1"Property="CONFIGURE_MODSECURITY_IIS"Text="Perform ModSecurityIIS configuration." />
530+
<ControlType="CheckBox"Id="ConfigureIIS"Width="200"Height="14"X="25"Y="124"CheckBoxValue="1"Property="IIS_SETUP"Text="Perform ModSecurityIIS configuration." />
484531
<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" />
485532
</Dialog>
486533
<BinaryId="bannrbmp"SourceFile="wix\banner.jpg" />
@@ -526,48 +573,47 @@
526573
<WixVariableId="WixUILicenseRtf"Value="wix\EULA.rtf" />
527574
<WixVariableId="WixUIBannerBmp"Value="wix\banner.jpg" />
528575
<WixVariableId="WixUIDialogBmp"Value="wix\dialog.jpg" />
576+
<CustomActionId="SetIISConfigure"Property="IIS_SETUP"Value="1"Execute="firstSequence" />
529577
<InstallUISequence>
530-
<CustomAction="SetCONFIGURE_MODSECURITY_IIS"Before="AppSearch">NOT Installed AND NOT OLDERVERSIONDETECTED</Custom>
578+
<CustomAction="SetIISConfigure"Before="AppSearch">NOT Installed</Custom>
531579
</InstallUISequence>
532-
<InstallExecuteSequence>
533-
<CustomAction="SetCONFIGURE_MODSECURITY_IIS"Before="AppSearch">NOT Installed AND NOT OLDERVERSIONDETECTED</Custom>
534-
</InstallExecuteSequence>
535-
<CustomActionId="SetCONFIGURE_MODSECURITY_IIS"Property="CONFIGURE_MODSECURITY_IIS"Value="1"Execute="firstSequence" />
536580
<InstallExecuteSequence>
537581
<?if $(var.Win64) ="yes" ?>
538-
<CustomAction="InstallModule64"Before="InstallFinalize"><![CDATA[NOT Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
539-
<CustomAction="InstallModule32"After="InstallModule64"><![CDATA[NOT Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
540-
<CustomAction="InstallConf"After="InstallModule32"><![CDATA[NOT Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
541-
<CustomAction="UninstallConf"Before="RemoveFiles"><![CDATA[Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
542-
<CustomAction="UninstallModule32"After="UninstallConf"><![CDATA[Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
543-
<CustomAction="UninstallModule64"After="UninstallModule32"><![CDATA[Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
582+
<CustomAction="SetIISConfigure"Before="AppSearch">NOT Installed</Custom>
583+
<CustomAction="InstallModule64"Before="InstallFinalize"><![CDATA[NOT Installed AND IIS_SETUP]]></Custom>
584+
<CustomAction="InstallModule32"After="InstallModule64"><![CDATA[NOT Installed AND IIS_SETUP]]></Custom>
585+
<CustomAction="InstallConf"After="InstallModule32"><![CDATA[NOT Installed AND IIS_SETUP]]></Custom>
586+
<CustomAction="UninstallConf"Before="RemoveFiles"><![CDATA[Installed AND IIS_SETUP]]></Custom>
587+
<CustomAction="UninstallModule32"Before="UninstallConf"><![CDATA[Installed AND IIS_SETUP]]></Custom>
588+
<CustomAction="UninstallModule64"Before="UninstallModule32"><![CDATA[Installed AND IIS_SETUP]]></Custom>
544589
<?else ?>
545-
<CustomAction="InstallModule32"Before="InstallFinalize"><![CDATA[NOT Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
546-
<CustomAction="InstallConf"After="InstallModule32"><![CDATA[NOT Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
547-
<CustomAction="UninstallConf"Before="RemoveFiles"><![CDATA[Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
548-
<CustomAction="UninstallModule32"After="UninstallConf"><![CDATA[Installed AND CONFIGURE_MODSECURITY_IIS]]></Custom>
590+
<CustomAction="SetIISConfigure"Before="AppSearch">NOT Installed</Custom>
591+
<CustomAction="InstallModule32"Before="InstallFinalize"><![CDATA[NOT Installed AND IIS_SETUP]]></Custom>
592+
<CustomAction="InstallConf"After="InstallModule32"><![CDATA[NOT Installed AND IIS_SETUP]]></Custom>
593+
<CustomAction="UninstallConf"Before="RemoveFiles"><![CDATA[Installed AND IIS_SETUP]]></Custom>
594+
<CustomAction="UninstallModule32"After="UninstallConf"><![CDATA[Installed AND IIS_SETUP]]></Custom>
549595
<?endif ?>
550596
</InstallExecuteSequence>
551597
<?if $(var.Win64) ="yes" ?>
552-
<?if $(var.Win64) ="yes" ?>
553598
<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;" />
599+
<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;" />
554600
<?else ?>
555601
<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;" />
556602
<?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;" />
558603
<?if $(var.Win64) ="yes" ?>
559604
<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;" />
560605
<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;" />
561606
<?else ?>
562607
<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;" />
564608
<?endif ?>
609+
<?if $(var.Win64) ="yes" ?>
565610
<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;" />
566-
<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;" />
567611
<?else ?>
568-
<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;" />
569-
<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;" />
570612
<CustomActionId="InstallConf"Execute="deferred"Impersonate="no"Return="check"Directory="INSTALLFOLDER"ExeCommand="&quot;[SystemFolder]inetsrv\appcmd.exe&quot; set config /section:&quot;system.webServer/ModSecurity&quot; /&quot;enabled:true&quot; /&quot;configFile:[INSTALLFOLDER]modsecurity_iis.conf&quot;" />
613+
<?endif ?>
614+
<?if $(var.Win64) ="yes" ?>
615+
<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;" />
616+
<?else ?>
571617
<CustomActionId="UninstallConf"Execute="deferred"Impersonate="no"Return="check"Directory="INSTALLFOLDER"ExeCommand="&quot;[SystemFolder]inetsrv\appcmd.exe&quot; clear config -section:&quot;system.webServer/ModSecurity&quot;" />
572618
<?endif ?>
573619
<DirectoryRefId="TARGETDIR">

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp