From 3abc6d8804afeacfcf62521a1216b3ee22b542e6 Mon Sep 17 00:00:00 2001 From: "almost.m4" Date: Fri, 12 Jul 2024 13:06:06 +0200 Subject: [PATCH] Lookup - Improve prerequisite validation --- tools/navigation_lookup_generator.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/navigation_lookup_generator.ps1 b/tools/navigation_lookup_generator.ps1 index 8a032ff..9008d91 100644 --- a/tools/navigation_lookup_generator.ps1 +++ b/tools/navigation_lookup_generator.ps1 @@ -13,7 +13,8 @@ $ARCHIVE_FILE = "" function Install-Prerequisites { Write-Host "Checking for prerequisites..." # Check for 7-Zip installation - if (-not (Get-Command "7z" -ErrorAction SilentlyContinue)) { + $sevenZipInstalled = Get-Command "7z" -ErrorAction SilentlyContinue + if (-not $sevenZipInstalled) { Write-Host "7-Zip not found. Installing 7-Zip..." Invoke-WebRequest -Uri "https://www.7-zip.org/a/7z1900-x64.msi" -OutFile "$env:TEMP\7z1900-x64.msi" Start-Process -FilePath "msiexec.exe" -ArgumentList "/i $env:TEMP\7z1900-x64.msi /quiet" -Wait @@ -24,7 +25,8 @@ function Install-Prerequisites { } # Check for hexdump installation - if (-not (Get-Command "hexdump" -ErrorAction SilentlyContinue)) { + $hexdumpInstalled = Get-Command "hexdump" -ErrorAction SilentlyContinue + if (-not $hexdumpInstalled) { Write-Host "Hexdump not found. Installing hexdump..." $hexdumpZipUrl = "https://www.di-mgt.com.au/src/hexdump-2.1.0.zip" $hexdumpZipPath = "$env:TEMP\hexdump-2.1.0.zip"