Sync desktop with public relay and add verified device connection management
This commit is contained in:
1 parent
87e888af69
commit
51c4f86918
17 files changed
+1289
-118
No files matched your search
@@ -0,0 +1,25 @@
|
||||
param(
|
||||
[string]$Runtime = 'win-x64',
|
||||
[switch]$FrameworkDependent
|
||||
)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$projectRoot = Split-Path $PSScriptRoot -Parent
|
||||
$outputDirectory = Join-Path $projectRoot "bin/desktop-$Runtime"
|
||||
$selfContained = if ($FrameworkDependent) { 'false' } else { 'true' }
|
||||
Push-Location (Join-Path $projectRoot 'desktop')
|
||||
try {
|
||||
dotnet publish Ads.Desktop -c Release -r $Runtime --self-contained $selfContained -o $outputDirectory --nologo
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Desktop publish failed' }
|
||||
} finally { Pop-Location }
|
||||
$suffix = if ($Runtime.StartsWith('win-')) { '.exe' } else { '' }
|
||||
$client = Join-Path $projectRoot ('bin/ads-client' + $suffix)
|
||||
if (Test-Path -LiteralPath $client) {
|
||||
Copy-Item -LiteralPath $client -Destination (Join-Path $outputDirectory ('ads-client' + $suffix)) -Force
|
||||
}
|
||||
if ($Runtime.StartsWith('win-') -and (Test-Path -LiteralPath (Join-Path $projectRoot 'bin/tools/scrcpy/scrcpy.exe'))) {
|
||||
$tools = Join-Path $outputDirectory 'tools/scrcpy'
|
||||
New-Item -ItemType Directory -Force -Path $tools | Out-Null
|
||||
Copy-Item -Path (Join-Path $projectRoot 'bin/tools/scrcpy/*') -Destination $tools -Recurse -Force
|
||||
}
|
||||
# Do not copy client.env or any other credential into a distributable directory.
|
||||
Write-Host "Desktop published to $outputDirectory (credentials excluded)"
|
||||
Reference in new issue
Block a user