diff --git a/scripts/windows/InstallWindowsAgent.ps1 b/scripts/windows/InstallWindowsAgent.ps1 index bcc5a7b1b..269dab93c 100644 --- a/scripts/windows/InstallWindowsAgent.ps1 +++ b/scripts/windows/InstallWindowsAgent.ps1 @@ -47,7 +47,15 @@ Function CheckProgramInstalled($programName) } else { - return $false + $installed = (Get-ItemProperty HKLM:SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object { $_.DisplayName -match $programName }) + if (-not [System.String]::IsNullOrEmpty($installed)) + { + return $true + } + else + { + return $false + } } } @@ -123,4 +131,4 @@ ipconfig /FlushDNS # JumpCloud Agent Installation Logic -DownloadAndInstallAgent -msvc2013x64link:($msvc2013x64Link) -TempPath:($TempPath) -msvc2013x64file:($msvc2013x64File) -msvc2013x64install:($msvc2013x64Install) -msvc2013x86link:($msvc2013x86Link) -msvc2013x86file:($msvc2013x86File) -msvc2013x86install:($msvc2013x86Install) \ No newline at end of file +DownloadAndInstallAgent -msvc2013x64link:($msvc2013x64Link) -TempPath:($TempPath) -msvc2013x64file:($msvc2013x64File) -msvc2013x64install:($msvc2013x64Install) -msvc2013x86link:($msvc2013x86Link) -msvc2013x86file:($msvc2013x86File) -msvc2013x86install:($msvc2013x86Install)