Skip to content

Commit

Permalink
WIP: fixed opencv archiveName
Browse files Browse the repository at this point in the history
  • Loading branch information
Fixstars-momoko committed Jul 17, 2024
1 parent b5d7bf2 commit d4fc424
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 4 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/develop-Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
path: |
${{ github.workspace }}/build/config_Windows.json
${{ github.workspace }}/installer/tools/installer.ps1
${{ github.workspace }}/installer/test/cpp
test_installation:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -108,3 +109,47 @@ jobs:
exit 1
}
- name: Check if version_info.json exists
run: |
$SENSING_DEV_ROOT= [Environment]::GetEnvironmentVariable("SENSING_DEV_ROOT", "User")
$target_file = Join-Path -Path "$SENSING_DEV_ROOT" -ChildPath "version_info.json"
if (Test-Path $target_file){
echo "version_info.json exists."
} else{
echo "version_info.json does not exist."
exit 1
}
- name: Test Aravis installation and Path
run: |
$PATH = [Environment]::GetEnvironmentVariable("PATH", "User")
$SENSING_DEV_ROOT= [Environment]::GetEnvironmentVariable("SENSING_DEV_ROOT", "User")
$env:PATH="$env:PATH;$PATH"
$env:SENSING_DEV_ROOT=${SENSING_DEV_ROOT}
cd ${{ github.workspace }}/download/installer/testcases/cpp/aravis_test && cmake ./
cmake --build . --config Release
cd Release && ls && ./aravis_test
echo "aravis test passed"
- name: Test ion-kit
run: |
$PATH = [Environment]::GetEnvironmentVariable("PATH", "User")
$SENSING_DEV_ROOT= [Environment]::GetEnvironmentVariable("SENSING_DEV_ROOT", "User")
$env:PATH="$env:PATH;$PATH"
$env:SENSING_DEV_ROOT=${SENSING_DEV_ROOT}
cd ${{ github.workspace }}/download/installer/testcases/cpp/ionkit_test && cmake ./
cmake --build . --config Release
cd Release && ls && ./ionkit_test
echo "ion-kit test passed"
- name: Test opencv
if: ${{ (matrix.with_openCV == '-InstallOpenCV') }}
run: |
$PATH = [Environment]::GetEnvironmentVariable("PATH", "User")
$SENSING_DEV_ROOT= [Environment]::GetEnvironmentVariable("SENSING_DEV_ROOT", "User")
$env:SENSING_DEV_ROOT=${SENSING_DEV_ROOT}
$env:PATH="$env:PATH;$PATH"
cd ${{ github.workspace }}/download/installer/testcases/cpp/opencv_test && cmake ./
cmake --build . --config Release
cd Release && ./opencv_test
echo "opencv test passed"
30 changes: 26 additions & 4 deletions installer/tools/installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ Installs the Sensing SDK.
.DESCRIPTION
This script downloads and installs the Sensing SDK components. You can specify a particular version or the latest version will be installed by default.
.PARAMETER Verbose
Display verbose
.PARAMETER version
Specifies the version of the Sensing SDK to be installed. Default is 'latest'.
Expand Down Expand Up @@ -40,18 +37,41 @@ https://sensing-dev.github.io/doc/startup-guide/windows/index.html

[cmdletbinding()]
param(
[Parameter(Mandatory=$false)]
[string]$version,

[Parameter(Mandatory=$false)]
[string]$user,

[Parameter(Mandatory=$false)]
[string]$installPath,

[Parameter(Mandatory=$false)]
[switch]$InstallOpenCV = $false,

# for debug purporse
[Parameter(Mandatory=$false)]
[switch]$debugScript = $false,

[Parameter(Mandatory=$false)]
[string]$configPath,

[Parameter(Mandatory=$false)]
[string]$archiveAravis,

[Parameter(Mandatory=$false)]
[string]$archiveAravisDep,

[Parameter(Mandatory=$false)]
[string]$archiveIonKit,

[Parameter(Mandatory=$false)]
[string]$archiveGenDCSeparator,

[Parameter(Mandatory=$false)]
[string]$archiveOpenCV,

[Parameter(Mandatory=$false)]
[string]$uninstallerPath
)

Expand Down Expand Up @@ -443,9 +463,11 @@ function Invoke-Script {
$compoURL = $content.$key.pkg_url

Write-Host "$compName $compVersion will be installed"
if (-not $archiveName){
if (-not $archiveOpenCV){
$archiveName = "$tempWorkDir/$compName.exe"
Invoke-WebRequest -Uri $compoURL -OutFile $archiveName
}else{
$archiveName = $archiveOpenCV
}

CheckComponentHash -compName $compName -archivePath $archiveName -expectedHash $compHash
Expand Down

0 comments on commit d4fc424

Please sign in to comment.