Fix Optima service architecture for x86 COM

This commit is contained in:
2026-09-08 12:35:50 +00:00
parent 6c4e50f7a6
commit cd02e6af5f
123 changed files with 32 additions and 21 deletions

View File

@@ -1,7 +1,9 @@
param(
[string]$OutputPath = (Join-Path $PSScriptRoot "release-optima"),
[ValidateSet("Debug", "Release")]
[string]$Configuration = "Release"
[string]$Configuration = "Release",
[ValidateSet("x86", "x64")]
[string]$Architecture = "x86"
)
$ErrorActionPreference = "Stop"
@@ -18,6 +20,7 @@ $winSwSource = Resolve-Path (Join-Path $daemonSource "smartb2bsync-optima.exe")
$output = [System.IO.Path]::GetFullPath($OutputPath)
$workspace = [System.IO.Path]::GetFullPath($PSScriptRoot)
$daemonOutput = Join-Path $output "daemon"
$runtimeIdentifier = "win-$Architecture"
if (-not $output.StartsWith($workspace, [StringComparison]::OrdinalIgnoreCase) -or
$output -eq $workspace -or
@@ -32,7 +35,7 @@ if (Test-Path -LiteralPath $output) {
New-Item -ItemType Directory -Force -Path $output | Out-Null
New-Item -ItemType Directory -Force -Path $daemonOutput | Out-Null
& $dotnet publish $project -c $Configuration -r win-x64 --self-contained true -o $output
& $dotnet publish $project -c $Configuration -r $runtimeIdentifier --self-contained true -p:PlatformTarget=$Architecture -o $output
if ($LASTEXITCODE -ne 0) {
throw "Publikowanie usługi Optimy nie powiodło się."
}
@@ -76,4 +79,4 @@ try {
$writer.Dispose()
}
Write-Host "Gotowa usługa Optimy (self-contained win-x64): $output"
Write-Host "Gotowa usługa Optimy (self-contained $runtimeIdentifier): $output"