feat(client): 迁移Hub更新客户端实现
This commit is contained in:
+28
-35
@@ -3,7 +3,6 @@ param(
|
||||
[string]$OutputDir = "",
|
||||
[string]$ZipFile = "",
|
||||
[string]$SdkVersion = "0.1.0",
|
||||
[string]$ExampleConfig = "",
|
||||
[switch]$IncludeDemoMainApp,
|
||||
[switch]$IncludeQtRuntime
|
||||
)
|
||||
@@ -15,38 +14,24 @@ if ([string]::IsNullOrWhiteSpace($SourceDir)) {
|
||||
$SourceDir = Join-Path $RepoRoot "out/bin/Release"
|
||||
}
|
||||
if ([string]::IsNullOrWhiteSpace($OutputDir)) {
|
||||
$OutputDir = Join-Path $RepoRoot "dist/UpdateClientSDK"
|
||||
$OutputDir = Join-Path $RepoRoot "dist/SimCAEHubUpdateClientSDK"
|
||||
}
|
||||
if ([string]::IsNullOrWhiteSpace($ZipFile)) {
|
||||
$ZipFile = Join-Path $RepoRoot "dist/UpdateClientSDK.zip"
|
||||
}
|
||||
if ([string]::IsNullOrWhiteSpace($ExampleConfig)) {
|
||||
$ExampleConfig = Join-Path $RepoRoot "config/app_config.example.json"
|
||||
$ZipFile = Join-Path $RepoRoot "dist/SimCAEHubUpdateClientSDK.zip"
|
||||
}
|
||||
|
||||
$source = (Resolve-Path $SourceDir).Path
|
||||
$exampleConfigPath = (Resolve-Path $ExampleConfig).Path
|
||||
|
||||
$requiredFiles = @("Launcher.exe", "Updater.exe", "Bootstrap.exe")
|
||||
foreach ($name in $requiredFiles) {
|
||||
|
||||
$requiredFiles = @("Launcher.exe", "Updater.exe", "Bootstrap.exe")
|
||||
foreach ($name in $requiredFiles) {
|
||||
$path = Join-Path $source $name
|
||||
if (-not (Test-Path $path)) {
|
||||
throw "SDK source directory is missing required file: $path"
|
||||
}
|
||||
}
|
||||
|
||||
$publicKeyCandidates = @(
|
||||
(Join-Path $source "config/manifest_public_key.pem"),
|
||||
(Join-Path $source "manifest_public_key.pem"),
|
||||
(Join-Path $RepoRoot "config/manifest_public_key.pem")
|
||||
)
|
||||
$publicKey = $publicKeyCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1
|
||||
if (-not $publicKey) {
|
||||
throw "manifest_public_key.pem is missing. Prepare the public key that matches the server signing private key."
|
||||
}
|
||||
|
||||
$debugArtifacts = Get-ChildItem $source -Recurse -File | Where-Object {
|
||||
$_.Name -match '^(Qt5.*d|qwindowsd|libEGLd|libGLESv2d|msvcp.*d|vcruntime.*d)\.dll$' -or
|
||||
}
|
||||
}
|
||||
|
||||
$debugArtifacts = Get-ChildItem $source -Recurse -File | Where-Object {
|
||||
$_.Name -match '^(Qt5.*d|qwindowsd|libEGLd|libGLESv2d|msvcp.*d|vcruntime.*d)\.dll$' -or
|
||||
$_.Extension -in @('.pdb', '.ilk')
|
||||
}
|
||||
if ($debugArtifacts) {
|
||||
@@ -85,9 +70,14 @@ function Test-IsQtRuntimeFile {
|
||||
}
|
||||
|
||||
return (
|
||||
$Item.Name -match '^Qt5.*\.dll$' -or
|
||||
$Item.Name -in @(
|
||||
"libEGL.dll",
|
||||
$Item.Name -match '^Qt5.*\.dll$' -or
|
||||
$Item.Name -match '^vc_redist.*\.exe$' -or
|
||||
$Item.Name -match '^vcredist.*\.exe$' -or
|
||||
$Item.Name -match '^vcruntime.*\.dll$' -or
|
||||
$Item.Name -match '^msvcp.*\.dll$' -or
|
||||
$Item.Name -match '^concrt.*\.dll$' -or
|
||||
$Item.Name -in @(
|
||||
"libEGL.dll",
|
||||
"libGLESv2.dll",
|
||||
"opengl32sw.dll",
|
||||
"d3dcompiler_47.dll"
|
||||
@@ -95,19 +85,20 @@ function Test-IsQtRuntimeFile {
|
||||
)
|
||||
}
|
||||
|
||||
Get-ChildItem $source -Force | Where-Object {
|
||||
$_.Name -notin $excludedTopLevel -and -not (Test-IsQtRuntimeFile $_)
|
||||
} | Copy-Item -Destination $binDir -Recurse -Force
|
||||
|
||||
Copy-Item $exampleConfigPath (Join-Path $configDir "app_config.json") -Force
|
||||
Copy-Item $publicKey (Join-Path $configDir "manifest_public_key.pem") -Force
|
||||
Get-ChildItem $source -Force | Where-Object {
|
||||
$_.Name -notin $excludedTopLevel -and -not (Test-IsQtRuntimeFile $_)
|
||||
} | Copy-Item -Destination $binDir -Recurse -Force
|
||||
|
||||
$commonSourceDir = Join-Path $RepoRoot "Common"
|
||||
$commonSourceFiles = @(
|
||||
"ConfigHelper.h",
|
||||
"ConfigHelper.cpp",
|
||||
"IntegrityHelper.h",
|
||||
"IntegrityHelper.cpp",
|
||||
"TicketHelper.h",
|
||||
"TicketHelper.cpp"
|
||||
"TicketHelper.cpp",
|
||||
"UpdatePathPolicy.h",
|
||||
"UpdatePathPolicy.cpp"
|
||||
)
|
||||
foreach ($commonFile in $commonSourceFiles) {
|
||||
$commonPath = Join-Path $commonSourceDir $commonFile
|
||||
@@ -144,6 +135,8 @@ Copy-Item (Join-Path $PSScriptRoot "install-sdk.ps1") (Join-Path $scriptsDir "in
|
||||
sdk_type = "external-updater-runtime"
|
||||
required_entry = "Launcher.exe"
|
||||
contains_demo_main_app = [bool]$IncludeDemoMainApp
|
||||
contains_qt_runtime = [bool]$IncludeQtRuntime
|
||||
contains_final_config = $false
|
||||
docs_entry = "Docs/01-客户端接入打包部署指南.md"
|
||||
word_guide_included = [bool]$wordGuideSource
|
||||
integration_sources = $commonSourceFiles
|
||||
|
||||
Reference in New Issue
Block a user