diff --git a/.gitea/workflows/build-installer.yaml b/.gitea/workflows/build-installer.yaml index e252b38..97b9b19 100644 --- a/.gitea/workflows/build-installer.yaml +++ b/.gitea/workflows/build-installer.yaml @@ -115,6 +115,8 @@ jobs: Copy-Item "$base\server\scripts\firmware\KL520\*.bin" "$base\installer\payload\scripts\firmware\KL520\" Copy-Item "$base\server\scripts\firmware\KL720\*.bin" "$base\installer\payload\scripts\firmware\KL720\" Copy-Item "local_service_win\third_party\Kneron_DFUT\bin\libusb-1.0.dll" "$base\installer\payload\scripts\" + $kpWheel = Get-ChildItem "local_service_win" -Filter "KneronPLUS*.whl" -ErrorAction SilentlyContinue | Select-Object -First 1 + if ($kpWheel) { Copy-Item $kpWheel.FullName "$base\installer\payload\scripts\" } - name: Build Windows installer run: | diff --git a/.github/workflows/build-installer.yaml b/.github/workflows/build-installer.yaml index e252b38..97b9b19 100644 --- a/.github/workflows/build-installer.yaml +++ b/.github/workflows/build-installer.yaml @@ -115,6 +115,8 @@ jobs: Copy-Item "$base\server\scripts\firmware\KL520\*.bin" "$base\installer\payload\scripts\firmware\KL520\" Copy-Item "$base\server\scripts\firmware\KL720\*.bin" "$base\installer\payload\scripts\firmware\KL720\" Copy-Item "local_service_win\third_party\Kneron_DFUT\bin\libusb-1.0.dll" "$base\installer\payload\scripts\" + $kpWheel = Get-ChildItem "local_service_win" -Filter "KneronPLUS*.whl" -ErrorAction SilentlyContinue | Select-Object -First 1 + if ($kpWheel) { Copy-Item $kpWheel.FullName "$base\installer\payload\scripts\" } - name: Build Windows installer run: | diff --git a/edge-ai-platform/Makefile b/edge-ai-platform/Makefile index 992d257..c2f60f6 100644 --- a/edge-ai-platform/Makefile +++ b/edge-ai-platform/Makefile @@ -130,6 +130,11 @@ installer-payload: build-server-tray ## Stage payload files for GUI installer cp scripts/kneron_detect.py installer/payload/scripts/ cp server/scripts/firmware/KL520/*.bin installer/payload/scripts/firmware/KL520/ cp server/scripts/firmware/KL720/*.bin installer/payload/scripts/firmware/KL720/ + @# Copy KneronPLUS wheel if available (for Windows installer) + @if ls ../local_service_win/KneronPLUS*.whl 1>/dev/null 2>&1; then \ + cp ../local_service_win/KneronPLUS*.whl installer/payload/scripts/; \ + echo " KneronPLUS wheel bundled."; \ + fi @echo "Payload staged in installer/payload/" installer: installer-payload ## Build GUI installer app diff --git a/edge-ai-platform/installer/app.go b/edge-ai-platform/installer/app.go index 4ad9c8f..00dd023 100644 --- a/edge-ai-platform/installer/app.go +++ b/edge-ai-platform/installer/app.go @@ -494,6 +494,22 @@ func (inst *Installer) setupPythonVenv(installDir string) error { return fmt.Errorf("pip install failed: %s — %w", string(out), err) } + // Install KneronPLUS SDK wheel if bundled in payload + scriptsDir := filepath.Join(installDir, "scripts") + matches, _ := filepath.Glob(filepath.Join(scriptsDir, "KneronPLUS*.whl")) + if len(matches) > 0 { + inst.emitProgress(ProgressEvent{ + Step: "python", + Message: "Installing Kneron SDK...", + Percent: 84, + }) + cmd = exec.Command(pipPath, "install", matches[0]) + if out, err := cmd.CombinedOutput(); err != nil { + // Non-fatal: device detection may still work via pyusb + _ = out + } + } + inst.emitProgress(ProgressEvent{ Step: "python", Message: "Python environment ready.", diff --git a/edge-ai-platform/scripts/build-installer.ps1 b/edge-ai-platform/scripts/build-installer.ps1 index 79bf382..0754910 100644 --- a/edge-ai-platform/scripts/build-installer.ps1 +++ b/edge-ai-platform/scripts/build-installer.ps1 @@ -85,6 +85,15 @@ if (Test-Path $libusbSrc) { Write-Host " libusb-1.0.dll not found, skipping." -ForegroundColor Yellow } +# Copy KneronPLUS wheel if available +$kpWheel = Get-ChildItem (Join-Path $repoRoot "local_service_win") -Filter "KneronPLUS*.whl" -ErrorAction SilentlyContinue | Select-Object -First 1 +if ($kpWheel) { + Copy-Item $kpWheel.FullName installer\payload\scripts\ + Write-Host " $($kpWheel.Name) bundled." -ForegroundColor Green +} else { + Write-Host " KneronPLUS wheel not found, skipping." -ForegroundColor Yellow +} + $fileCount = (Get-ChildItem -Recurse installer\payload -File).Count Write-Host " Payload staged: $fileCount files." -ForegroundColor Green Write-Host ""