Skip to content

Commit

Permalink
Merge branch 'main' into feature/add-ion-contrib-python-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Fixstars-momoko committed Oct 25, 2024
2 parents ae51526 + 890682c commit e00a3c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion installer/tools/installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ function Set-EnvironmentVariables {
[Environment]::SetEnvironmentVariable("SENSING_DEV_ROOT", $SensingDevRoot, "User")
Write-Host "Updated SENSING_DEV_ROOT: $SensingDevRoot"

$gstLibPath = "$SensingDevRoot\lib\girepository-1.0"
$gstLibPath = "$SensingDevRoot\lib\gstreamer-1.0"
[Environment]::SetEnvironmentVariable("GST_PLUGIN_PATH", $gstLibPath, "User")
Write-Host "Updated GST_PLUGIN_PATH: $gstLibPath"
}
Expand Down
13 changes: 9 additions & 4 deletions installer/tools/pygobject_installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ if (Test-Path $defaultCacheDIR) {
if (-not $CacheDIR) {
Write-Output "Using default cache path: $defaultCacheDIR"
$CacheDIR = $defaultCacheDIR
New-Item -Path "$env:TEMP" -Name "PyGObjectCache" -ItemType "directory"
}

# Define the application ID for pkg-config-lite
$pkgConfigLiteAppId = "bloodrock.pkg-config-lite"

$pkgConfigURL = "https://sourceforge.net/projects/pkgconfiglite/files/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip/download"

# Check if pkg-config-lite is already installed using winget
try {
$installedPackage = winget show --id $pkgConfigLiteAppId -e --accept-source-agreements
Expand All @@ -42,11 +45,12 @@ try {
}

# Install pkg-config-lite using winget
Write-Output "Installing $pkgConfigLiteAppId..."
Write-Output "Installing pkgConfig..."
try {
# Define the directory you want to remove from PATH
Invoke-WebRequest -UserAgent "Wget" -Uri $pkgConfigURL -OutFile "$CacheDIR\pkg-config-lite-0.28-1_bin-win32.zip"
Expand-Archive -Path "$CacheDIR\pkg-config-lite-0.28-1_bin-win32.zip" -DestinationPath $CacheDIR
$pkgconfigDirectory = "$CacheDIR\pkg-config-lite-0.28-1\bin"
winget install --accept-source-agreements --accept-package-agreements --id $pkgConfigLiteAppId --location $CacheDIR
} catch {
Write-Error "Failed to install pkg-config-lite: $_"
exit 1
Expand All @@ -60,6 +64,8 @@ Write-Output "Added $pkgconfigDirectory to PATH for the current session"
Write-Output "Installing gobject-introspection..."

try {
Write-Output $CacheDIR
Get-ChildItem -Force -LiteralPath $CacheDIR
Invoke-WebRequest -Uri https://github.com/Sensing-Dev/aravis/releases/download/v0.8.31/PyGObject-1.72.0-dependencies.zip -OutFile $CacheDIR\dependency.zip
Expand-Archive -Path $CacheDIR\dependency.zip -DestinationPath $CacheDIR\dependency
Remove-Item -Force $CacheDIR\dependency.zip
Expand All @@ -85,6 +91,7 @@ try {
# Delete the vcpkg directory recursively
Write-Output "Deleting cache directory: "$CacheDIR" ..."
try {
Write-Output "Uninstalling $pkgConfigLiteAppId..."
Remove-Item -Path "$CacheDIR" -Recurse -Force
} catch {
Write-Error "Failed to remove vcpkg directory: $_"
Expand All @@ -96,8 +103,6 @@ Write-Output "Removing PKG_CONFIG_PATH environment variable"
Remove-Item Env:\PKG_CONFIG_PATH

try{
Write-Output "Uninstalling $pkgConfigLiteAppId..."
winget uninstall --id $pkgConfigLiteAppId --accept-source-agreements
Write-Output "Clean up environment variable PATH..."
[Environment]::SetEnvironmentVariable("Path", $currentPath, "User")
} catch {
Expand Down

0 comments on commit e00a3c6

Please sign in to comment.