fix: enhance logic to check and download the correct version of ekDNSHelper

This commit is contained in:
2026-03-04 22:49:05 -05:00
parent 79290125f4
commit 7a74d6d2a9
+19 -1
View File
@@ -1,9 +1,27 @@
$DNSHelper = $Global:ToolsDirectory + '\ekdns.exe'
If ( !(Test-Path $DNSHelper) ) {
$DNSHelperRequiredVersion = '2.1.0'
$DownloadRequired = $false
If (Test-Path $DNSHelper) {
$versionOutput = (& $DNSHelper | Select-Object -First 1)
If ($versionOutput -match 'v(\d+\.\d+\.\d+)') {
If ($Matches[1] -ne $DNSHelperRequiredVersion) {
$DownloadRequired = $true
}
}
} Else {
$DownloadRequired = $true
}
# Download the latest version of ekDNSHelper
If ($DownloadRequired) {
$DNSHelperURL = 'https://www.emberkom.com/tools/ekdns-x64.exe'
If (!(Test-Path ${Env:ProgramFiles(x86)})) {
$DNSHelperURL = 'https://www.emberkom.com/tools/ekdns-x86.exe'
}
If (Test-Path $DNSHelper) { Remove-Item -Path $DNSHelper -Force -ErrorAction SilentlyContinue }
Write-Output "Downloading latest version of ekDNSHelper"
Download-File -URL $DNSHelperURL -File $DNSHelper
}