Skip to content

Commit 67cab1c

Browse files
committed
should?
1 parent 2563b1c commit 67cab1c

File tree

2 files changed

+11
-43
lines changed

2 files changed

+11
-43
lines changed

.github/workflows/test-ci-windows.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,13 @@ jobs:
136136
name: iis-module-x86
137137
path: iis/release/x86/
138138

139-
- name: Generate wxs files
139+
- name: Generate MSI files
140140
shell: pwsh
141141
run: |
142142
heat dir "iis\release\amd64" -cg ModSec64Components -dr inetsrv64 -gg -sreg -srd -var var.ModSecurityIISRelease64 -out "iis\ModSec64.wxs"
143143
heat dir "iis\release\x86" -cg ModSec32Components -dr inetsrv32 -gg -sreg -srd -var var.ModSecurityIISRelease32 -out "iis\ModSec32.wxs"
144-
145-
- name: Compile wxs files
146-
shell: pwsh
147-
run: |
148144
candle.exe -ext WixUtilExtension -ext WixUIExtension "iis\installer.wxs" "iis\ModSec64.wxs" -arch x64 -dModSecurityIISRelease64="iis\release\amd64\" -out iis\
149145
candle.exe -ext WixUtilExtension -ext WixUIExtension "iis\ModSec32.wxs" -arch x86 -dModSecurityIISRelease32="iis\release\x86\" -out iis\
150-
151-
- name: Link wixobj files into MSI
152-
shell: pwsh
153-
run: |
154146
light.exe -ext WixUtilExtension -ext WixUIExtension "iis\installer.wixobj" "iis\ModSec32.wixobj" "iis\ModSec64.wixobj" -out "iis\modsecurityiis.msi"
155147
156148
- name: Upload artifacts
@@ -163,20 +155,13 @@ jobs:
163155
needs: package
164156
runs-on: windows-latest
165157
steps:
166-
- name: Download MSI
158+
- name: Install MSI
167159
uses: actions/download-artifact@v4
168160
with:
169161
name: modsecurityiis-installers
170162
path: ${{ github.workspace }}\
171-
172-
- name: Install MSI
173-
shell: pwsh
174163
run: |
175164
msiexec /i modsecurityiis.msi /qn /norestart
176-
177-
- name: ReStart IIS Feature
178-
shell: pwsh
179-
run: |
180165
Restart-Service W3SVC
181166
182167
- name: Test IIS Module

iis/CMakeLists.txt

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,6 @@ set(IIS_STANDALONE_SOURCES
5757
../standalone/server.c
5858
)
5959

60-
# Source files for IIS-specific components
61-
set(IIS_MODULE_SOURCES
62-
main.cpp
63-
moduleconfig.cpp
64-
mymodule.cpp
65-
mymodule.def
66-
)
67-
68-
6960
# Determine architecture
7061
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
7162
set(ARCHITECTURE "x64")
@@ -91,27 +82,25 @@ add_custom_command(
9182
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
9283
)
9384

94-
set(MC_GENERATED_RES "${CMAKE_CURRENT_BINARY_DIR}/ModSecurityIISMessage.res")
95-
add_custom_command(
96-
OUTPUT ${MC_GENERATED_RES}
97-
COMMAND rc.exe
98-
ARGS /fo "${MC_GENERATED_RES}" "${MC_GENERATED_RC}"
99-
DEPENDS ${MC_GENERATED_RC}
100-
COMMENT "Building resource file: ${MC_GENERATED_RES}"
85+
# Source files for IIS-specific components
86+
set(IIS_MODULE_SOURCES
87+
main.cpp
88+
moduleconfig.cpp
89+
mymodule.cpp
90+
mymodule.def
91+
${MC_GENERATED_RC}
10192
)
10293

10394
set_source_files_properties(
10495
${MC_GENERATED_RC}
10596
${MC_GENERATED_H}
106-
${MC_GENERATED_RES}
10797
PROPERTIES GENERATED TRUE
10898
)
10999

110100
add_library(${IIS_MODULE_NAME} SHARED
111101
${IIS_APACHE_SOURCES}
112102
${IIS_STANDALONE_SOURCES}
113103
${IIS_MODULE_SOURCES}
114-
${MC_GENERATED_RES}
115104
)
116105

117106
# Set the output name and extension
@@ -209,11 +198,11 @@ option(WITH_YAJL "Enable YAJL support" OFF)
209198
if(WITH_YAJL)
210199
# Manually find YAJL if config.cmake is not available (e.g., from vcpkg)
211200
find_path(YAJL_INCLUDE_DIR yajl/yajl_common.h
212-
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/build-${ARCHITECTURE}/vcpkg_installed/${ARCHITECTURE}-windows/include"
201+
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/build/vcpkg_installed/${ARCHITECTURE}-windows/include"
213202
NO_DEFAULT_PATH
214203
)
215204
find_library(YAJL_LIBRARY NAMES yajl
216-
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/build-${ARCHITECTURE}/vcpkg_installed/${ARCHITECTURE}-windows/lib"
205+
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/build/vcpkg_installed/${ARCHITECTURE}-windows/lib"
217206
NO_DEFAULT_PATH
218207
)
219208

@@ -241,7 +230,6 @@ if(WITH_SSDEEP)
241230

242231
message(STATUS "SSDEEP_ROOT: ${SSDEEP_ROOT}")
243232

244-
# 查找头文件
245233
find_path(SSDEEP_INCLUDE_DIR fuzzy.h
246234
PATHS "${SSDEEP_ROOT}/include"
247235
NO_DEFAULT_PATH
@@ -252,7 +240,6 @@ if(WITH_SSDEEP)
252240
target_compile_definitions(${IIS_MODULE_NAME} PRIVATE WITH_SSDEEP)
253241
target_include_directories(${IIS_MODULE_NAME} PRIVATE ${SSDEEP_INCLUDE_DIR})
254242

255-
# 检查 fuzzy.def 文件是否存在
256243
set(SSDEEP_DEF_FILE "${SSDEEP_ROOT}/fuzzy.def")
257244
if(NOT EXISTS "${SSDEEP_DEF_FILE}")
258245
message(WARNING "fuzzy.def not found at ${SSDEEP_DEF_FILE}. Disabling SSDEEP support.")
@@ -261,7 +248,6 @@ if(WITH_SSDEEP)
261248
set(SSDEEP_GENERATED_LIB "${CMAKE_CURRENT_BINARY_DIR}/fuzzy.lib")
262249
set(SSDEEP_GENERATED_dll "${CMAKE_CURRENT_BINARY_DIR}/bin/fuzzy.dll")
263250

264-
# 添加自定义命令生成 fuzzy.lib
265251
add_custom_command(
266252
OUTPUT ${SSDEEP_GENERATED_LIB}
267253
COMMAND lib.exe /machine:${ARCHITECTURE} /def:${SSDEEP_DEF_FILE} /out:${SSDEEP_GENERATED_LIB}
@@ -270,16 +256,13 @@ if(WITH_SSDEEP)
270256
VERBATIM
271257
)
272258

273-
# 确保自定义命令的输出被标记为生成文件
274259
set_source_files_properties(${SSDEEP_GENERATED_LIB} PROPERTIES GENERATED TRUE)
275260

276-
# 添加自定义目标确保生成 fuzzy.lib
277261
add_custom_target(generate_ssdeep_lib ALL
278262
DEPENDS ${SSDEEP_GENERATED_LIB}
279263
COMMENT "Ensuring ssdeep lib is generated"
280264
)
281265

282-
# 使主目标依赖于 fuzzy.lib 的生成
283266
add_dependencies(${IIS_MODULE_NAME} generate_ssdeep_lib)
284267

285268
add_library(SSDEEP::fuzzy SHARED IMPORTED)

0 commit comments

Comments
 (0)