diff --git a/gstreamer/tools/chocolateyBeforeModify.ps1 b/gstreamer/tools/chocolateyBeforeModify.ps1 index d6ca9c8..5115b06 100644 --- a/gstreamer/tools/chocolateyBeforeModify.ps1 +++ b/gstreamer/tools/chocolateyBeforeModify.ps1 @@ -22,17 +22,17 @@ if (${ENV:OS_IS64BIT} -Eq $true -And -Not (${ENV:ChocolateyForceX86} -Eq $true)) $pathForUninstall = "%GSTREAMER_1_0_ROOT_$(${toolchain}.ToUpper())_X86%\bin" } -if (-not (Get-Command 'Uninstall-ChocolateyPath' -errorAction SilentlyContinue)) { +if (-Not (Get-Command 'Uninstall-ChocolateyPath' -errorAction SilentlyContinue)) { Write-Output "Using Uninstall-ChocolateyPath-GH1663 function"; $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" $modulePath = Join-Path "${toolsDir}" 'Uninstall-ChocolateyPath-GH1663.ps1' Import-Module "${modulePath}" - Uninstall-ChocolateyPath-GH1663 "${pathForUninstall}" "User" + Uninstall-ChocolateyPath-GH1663 "${pathForUninstall}" "Machine" } else { Write-Debug "Using native Uninstall-ChocolateyPath function"; - Uninstall-ChocolateyPath "${pathForUninstall}" "User" + Uninstall-ChocolateyPath "${pathForUninstall}" "Machine" } diff --git a/gstreamer/tools/chocolateyInstall.ps1 b/gstreamer/tools/chocolateyInstall.ps1 index 8d2c3ba..397da9d 100644 --- a/gstreamer/tools/chocolateyInstall.ps1 +++ b/gstreamer/tools/chocolateyInstall.ps1 @@ -41,6 +41,7 @@ $packageArgs = @{ } Install-ChocolateyPackage @packageArgs +Update-SessionEnvironment if (${ENV:OS_IS64BIT} -Eq $true -And -Not (${ENV:ChocolateyForceX86} -Eq $true)) { $locationVarName = "GSTREAMER_1_0_ROOT_$(${toolchain}.ToUpper())_X86_64" @@ -48,7 +49,7 @@ if (${ENV:OS_IS64BIT} -Eq $true -And -Not (${ENV:ChocolateyForceX86} -Eq $true)) $locationVarName = "GSTREAMER_1_0_ROOT_$(${toolchain}.ToUpper())_X86" } -$installLocation = (Get-EnvironmentVariable -Name "${locationVarName}" -Scope "User") +$installLocation = (Get-EnvironmentVariable -Name "${locationVarName}" -Scope "Machine") Write-Output "" Write-Output "GStreamer installed to ${installLocation}" Write-Output "" @@ -59,8 +60,7 @@ $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" $modulePath = Join-Path "${toolsDir}" 'Install-ChocolateyPath-GH1663.ps1' Import-Module "${modulePath}" -# Must install to User path since we need to expand a User environment variable -Install-ChocolateyPath-GH1663 -PathToInstall "%${locationVarName}%\bin" -PathType "User" +Install-ChocolateyPath-GH1663 -PathToInstall "%${locationVarName}%\bin" -PathType "Machine" Update-SessionEnvironment $locationOnPath = (Get-Command gst-launch-1.0.exe -errorAction SilentlyContinue)