feat: add Flutter USB mirroring and single-instance desktop clients
This commit is contained in:
1 parent
3a7bb071f0
commit
a339465392
30 files changed
+1688
-104
No files matched your search
@@ -3,12 +3,12 @@ $projectRoot = Split-Path $PSScriptRoot -Parent
|
||||
$output = Join-Path $projectRoot 'bin/flutter-win-x64'
|
||||
Push-Location (Join-Path $projectRoot 'flutter_manager')
|
||||
try {
|
||||
flutter build windows --release
|
||||
flutter build windows --release -t lib/main.dart
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Flutter publish failed' }
|
||||
} finally { Pop-Location }
|
||||
New-Item -ItemType Directory -Force -Path $output | Out-Null
|
||||
Copy-Item -Path (Join-Path $projectRoot 'flutter_manager/build/windows/x64/runner/Release/*') -Destination $output -Recurse -Force
|
||||
foreach ($name in @('ads-client','ads-agent','adsctl')) {
|
||||
foreach ($name in @('ads-client','ads-agent','adsctl','ads-usb')) {
|
||||
$tool = Join-Path $projectRoot "bin/$name.exe"
|
||||
if (-not (Test-Path -LiteralPath $tool)) { throw "先运行 scripts/build.ps1:缺少 $name" }
|
||||
Copy-Item -LiteralPath $tool -Destination $output -Force
|
||||
@@ -16,5 +16,6 @@ foreach ($name in @('ads-client','ads-agent','adsctl')) {
|
||||
$tools = Join-Path $output 'tools/scrcpy'
|
||||
New-Item -ItemType Directory -Force -Path $tools | Out-Null
|
||||
Copy-Item -Path (Join-Path $projectRoot 'bin/tools/scrcpy/*') -Destination $tools -Recurse -Force
|
||||
& (Join-Path $PSScriptRoot 'copy-windows-usb-driver.ps1') -Destination $output
|
||||
# Private credentials are deliberately excluded from distributable artifacts.
|
||||
Write-Host "Flutter published to $output (credentials excluded)"
|
||||
@@ -31,6 +31,8 @@ foreach ($name in @('Avalonia','Flutter')) {
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $source $runtime))) { throw "Missing redistributable C++ runtime: $runtime" }
|
||||
}
|
||||
}
|
||||
& (Join-Path $PSScriptRoot 'copy-windows-usb-driver.ps1') -Destination $source
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $source 'ads-usb.exe'))) { Copy-Item -LiteralPath (Join-Path $root 'bin/ads-usb.exe') -Destination $source }
|
||||
foreach ($file in @($exe,'adsctl.exe','ads-agent.exe','ads-client.exe','tools/scrcpy/adb.exe','tools/scrcpy/scrcpy.exe')) {
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $source $file))) { throw "Missing payload: $folder/$file" }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
param([Parameter(Mandatory)][string]$Destination)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$root = Split-Path $PSScriptRoot -Parent
|
||||
# Reuse the pinned upstream SHA-256 and publisher signature checks. This does
|
||||
# not install the driver and never requests elevation during packaging.
|
||||
& (Join-Path $PSScriptRoot 'install-windows-usb.ps1')
|
||||
if (-not $?) { throw 'USBip installer verification failed' }
|
||||
$drivers = Join-Path $Destination 'drivers'
|
||||
New-Item -ItemType Directory -Path $drivers -Force | Out-Null
|
||||
Copy-Item -LiteralPath (Join-Path $root 'work/USBip-0.9.8.1-x64.exe') -Destination $drivers -Force
|
||||
@(
|
||||
'USBip 0.9.8.1 x64, upstream usbip-win2 by Cloudyne Systems (Scheibling Consulting AB).',
|
||||
'Source: https://github.com/vadimgrn/usbip-win2/releases/tag/v.0.9.8.1',
|
||||
'This is an unmodified, signed optional installer. It is not installed by the ADS installer.',
|
||||
'Select USB mode in ADS, then confirm driver installation and the Windows UAC prompt.',
|
||||
'Driver installation can briefly restart USB hubs and may require a Windows reboot.'
|
||||
) | Set-Content -LiteralPath (Join-Path $drivers 'README.txt') -Encoding utf8
|
||||
Reference in new issue
Block a user