Skip to content

Commit

Permalink
Switch to system-wide path for GStreamer
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcker committed Mar 18, 2023
1 parent 13f758a commit 9dfaaf4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions gstreamer/tools/chocolateyBeforeModify.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
6 changes: 3 additions & 3 deletions gstreamer/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ $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"
} else {
$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 ""
Expand All @@ -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)
Expand Down

0 comments on commit 9dfaaf4

Please sign in to comment.