fix: enhance logic to check and download the correct version of ekDNSHelper
This commit is contained in:
@@ -1,9 +1,27 @@
|
|||||||
$DNSHelper = $Global:ToolsDirectory + '\ekdns.exe'
|
$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'
|
$DNSHelperURL = 'https://www.emberkom.com/tools/ekdns-x64.exe'
|
||||||
If (!(Test-Path ${Env:ProgramFiles(x86)})) {
|
If (!(Test-Path ${Env:ProgramFiles(x86)})) {
|
||||||
$DNSHelperURL = 'https://www.emberkom.com/tools/ekdns-x86.exe'
|
$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
|
Download-File -URL $DNSHelperURL -File $DNSHelper
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user