From 0f833e5848563f66b790fc0bcb32e2a21ef0ddcb Mon Sep 17 00:00:00 2001 From: Coding for fun Date: Mon, 22 Jan 2024 06:41:36 +0100 Subject: [PATCH] Only enable maxmind enrichment if the directory exists --- setup/wscommon.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup/wscommon.ps1 b/setup/wscommon.ps1 index 8044cb2..75251a8 100644 --- a/setup/wscommon.ps1 +++ b/setup/wscommon.ps1 @@ -262,7 +262,9 @@ function Install-Wireshark { Copy-Item "$SETUP_PATH\wireshark.exe" "$TEMP\wireshark.exe" Start-Process -Wait "$TEMP\wireshark.exe" -ArgumentList "/S /desktopicon=yes /quicklaunchicon=yes" New-Item -Path "$env:USERPROFILE\AppData\Roaming\Wireshark" -Force -Type Directory | Out-Null - Set-Content '"C:/enrichment/maxmind_current"' -Encoding Ascii -Path "$env:USERPROFILE\AppData\Roaming\Wireshark\maxmind_db_paths" + if (Test-Path "C:\enrichment\maxmind_current") { + Set-Content '"C:/enrichment/maxmind_current"' -Encoding Ascii -Path "$env:USERPROFILE\AppData\Roaming\Wireshark\maxmind_db_paths" + } Add-ToUserPath "$env:ProgramFiles\Wireshark" }