From 56b86205795d62838ebd3535bb6c60d1fc95582c Mon Sep 17 00:00:00 2001 From: Jack McKernan Date: Fri, 17 Mar 2023 21:40:17 -0500 Subject: [PATCH] Fix check for 32-bit installs. Force a boolean comparison of the $ENV:XXX values, which are actually strings. The boolean rules are very strange in PowerShell. Closes #6. Co-authored-by: lebarsfa --- cfssl/tools/chocolateyInstall.ps1 | 2 +- gstreamer/tools/chocolateyBeforeModify.ps1 | 2 +- gstreamer/tools/chocolateyInstall.ps1 | 2 +- libsndfile/tools/chocolateyInstall.ps1 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cfssl/tools/chocolateyInstall.ps1 b/cfssl/tools/chocolateyInstall.ps1 index 33a1b29..7523cd7 100644 --- a/cfssl/tools/chocolateyInstall.ps1 +++ b/cfssl/tools/chocolateyInstall.ps1 @@ -25,7 +25,7 @@ $targets = [Ordered]@{ if (Test-ProcessAdminRights) { $parentFolder = "${ENV:PROGRAMFILES}" $pathType = "Machine" - if (${ENV:OS_IS64BIT} -And ${ENV:ChocolateyForceX86}) { + if (${ENV:OS_IS64BIT} -Eq $true -And -Not (${ENV:ChocolateyForceX86} -Eq $true)) { $parentFolder = "${ENV:PROGRAMFILES(x86)}" } } diff --git a/gstreamer/tools/chocolateyBeforeModify.ps1 b/gstreamer/tools/chocolateyBeforeModify.ps1 index 82aa7f9..d6ca9c8 100644 --- a/gstreamer/tools/chocolateyBeforeModify.ps1 +++ b/gstreamer/tools/chocolateyBeforeModify.ps1 @@ -16,7 +16,7 @@ if (${nameSplit}.Length -gt 1 -and ${nameSplit}[1] -ne "devel") { # ENV:ChocolateyForceX86 appears to never be set for uninstall # No --x86 flag exists on the command -if (${ENV:OS_IS64BIT} -And -Not ${ENV:ChocolateyForceX86}) { +if (${ENV:OS_IS64BIT} -Eq $true -And -Not (${ENV:ChocolateyForceX86} -Eq $true)) { $pathForUninstall = "%GSTREAMER_1_0_ROOT_$(${toolchain}.ToUpper())_X86_64%\bin" } else { $pathForUninstall = "%GSTREAMER_1_0_ROOT_$(${toolchain}.ToUpper())_X86%\bin" diff --git a/gstreamer/tools/chocolateyInstall.ps1 b/gstreamer/tools/chocolateyInstall.ps1 index 4f5c913..8d2c3ba 100644 --- a/gstreamer/tools/chocolateyInstall.ps1 +++ b/gstreamer/tools/chocolateyInstall.ps1 @@ -42,7 +42,7 @@ $packageArgs = @{ Install-ChocolateyPackage @packageArgs -if (${ENV:OS_IS64BIT} -And -Not ${ENV:ChocolateyForceX86}) { +if (${ENV:OS_IS64BIT} -Eq $true -And -Not (${ENV:ChocolateyForceX86} -Eq $true)) { $locationVarName = "GSTREAMER_1_0_ROOT_$(${toolchain}.ToUpper())_X86_64" } else { $locationVarName = "GSTREAMER_1_0_ROOT_$(${toolchain}.ToUpper())_X86" diff --git a/libsndfile/tools/chocolateyInstall.ps1 b/libsndfile/tools/chocolateyInstall.ps1 index 34ecd67..a28088f 100644 --- a/libsndfile/tools/chocolateyInstall.ps1 +++ b/libsndfile/tools/chocolateyInstall.ps1 @@ -15,7 +15,7 @@ $url64 = "https://github.com/libsndfile/libsndfile/releases/download/${ if (Test-ProcessAdminRights) { $parentFolder = "${ENV:PROGRAMFILES}" $pathType = "Machine" - if (${ENV:OS_IS64BIT} -And ${ENV:ChocolateyForceX86}) { + if (${ENV:OS_IS64BIT} -Eq $true -And -Not (${ENV:ChocolateyForceX86} -Eq $true)) { $parentFolder = "${ENV:PROGRAMFILES(x86)}" } }