This commit is contained in:
Alexander Aleksandrovič Klimov 2026-02-11 11:43:43 +01:00 committed by GitHub
commit e6073ef78c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -1,12 +1,12 @@
function Get-IcingaAgentInstallation()
{
[string]$architecture = '';
if ([IntPtr]::Size -eq 4) {
$architecture = "x86";
$regPath = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*';
} else {
if (Test-Path 'Env:ProgramFiles(x86)') {
$architecture = "x86_64";
$regPath = @('HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*', 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*');
} else {
$architecture = "x86";
$regPath = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*';
}
$RegistryData = Get-ItemProperty $regPath -ErrorAction SilentlyContinue;

View file

@ -33,7 +33,7 @@ function Get-IcingaRepositoryPackage()
$SourceRepo = $null;
$RepoName = $null;
[bool]$HasRepo = $FALSE;
[bool]$Isx86 = [bool]([IntPtr]::Size -eq 4);
[bool]$Isx86 = [bool](-not (Test-Path 'Env:ProgramFiles(x86)'));
foreach ($entry in $Repositories) {
$RepoContent = Read-IcingaRepositoryFile -Name $entry.Name;