Skip to content

Commit 360691b

Browse files
committed
fix: use powershell for custom cmd
Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>
1 parent 4c52436 commit 360691b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

iis/installer.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@
412412
<CustomAction Id="Cleanup5" Execute="deferred" Impersonate="no" Return="ignore" Directory="INSTALLFOLDER" ExeCommand="&quot;[SystemFolder]inetsrv\appcmd.exe&quot; uninstall module /module.name:&quot;ModSecurityIIS&quot;" />
413413
<?endif?>
414414
<!-- Create required directories for ModSecurity with proper permissions for IIS -->
415-
<CustomAction Id="CreateModSecurityDirs" Execute="deferred" Impersonate="no" Return="ignore" Directory="INSTALLFOLDER" ExeCommand="cmd.exe /c &quot;if not exist c:\inetpub\temp mkdir c:\inetpub\temp &amp; if not exist c:\inetpub\logs mkdir c:\inetpub\logs &amp; icacls c:\inetpub\temp /grant IIS_IUSRS:(OI)(CI)M /T &amp; icacls c:\inetpub\logs /grant IIS_IUSRS:(OI)(CI)M /T&quot;" />
415+
<CustomAction Id="CreateModSecurityDirs" Execute="deferred" Impersonate="no" Return="ignore" Directory="INSTALLFOLDER" ExeCommand="powershell.exe -NoProfile -ExecutionPolicy Bypass -Command &quot;New-Item -ItemType Directory -Path 'c:\inetpub\temp', 'c:\inetpub\logs' -Force | Out-Null; icacls 'c:\inetpub\temp' /grant 'IIS_IUSRS:(OI)(CI)M' /T /Q | Out-Null; icacls 'c:\inetpub\logs' /grant 'IIS_IUSRS:(OI)(CI)M' /T /Q | Out-Null&quot;" />
416416
<?if $(var.Win64) = "yes" ?>
417417
<CustomAction Id="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;" />
418418
<CustomAction Id="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;" />

0 commit comments

Comments
 (0)