Add standalone OCSentinel setup executable builder
Some checks failed
OfficeCom Sentinel Client / build-client (push) Has been cancelled
Some checks failed
OfficeCom Sentinel Client / build-client (push) Has been cancelled
This commit is contained in:
50
build/build-client-installer.ps1
Normal file
50
build/build-client-installer.ps1
Normal file
@@ -0,0 +1,50 @@
|
||||
param(
|
||||
[string]$Configuration = "Release"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$repoRoot = Split-Path -Parent $PSScriptRoot
|
||||
$artifactsRoot = Join-Path $repoRoot "artifacts"
|
||||
$zipPath = Join-Path $artifactsRoot "OCSentinelClient-win-x64.zip"
|
||||
$bootstrapperRoot = Join-Path $repoRoot "installer\OCSentinelBootstrapper"
|
||||
$payloadPath = Join-Path $bootstrapperRoot "payload.zip"
|
||||
$projectPath = Join-Path $bootstrapperRoot "OCSentinelBootstrapper.csproj"
|
||||
$publishRoot = Join-Path $artifactsRoot "bootstrapper-publish\win-x64"
|
||||
$outputExe = Join-Path $artifactsRoot "OCSentinelSetup.exe"
|
||||
|
||||
if (-not (Test-Path $zipPath)) {
|
||||
& powershell.exe -ExecutionPolicy Bypass -File (Join-Path $repoRoot "build\build-client-package.ps1") -Configuration $Configuration
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "build-client-package.ps1 failed"
|
||||
}
|
||||
}
|
||||
|
||||
Copy-Item -Path $zipPath -Destination $payloadPath -Force
|
||||
|
||||
if (Test-Path $publishRoot) {
|
||||
Remove-Item -LiteralPath $publishRoot -Recurse -Force
|
||||
}
|
||||
|
||||
if (Test-Path $outputExe) {
|
||||
Remove-Item -LiteralPath $outputExe -Force
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $publishRoot | Out-Null
|
||||
|
||||
& dotnet publish $projectPath `
|
||||
-c $Configuration `
|
||||
-r win-x64 `
|
||||
--self-contained true `
|
||||
-p:PublishSingleFile=true `
|
||||
-p:EnableCompressionInSingleFile=true `
|
||||
-p:IncludeNativeLibrariesForSelfExtract=true `
|
||||
-o $publishRoot
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "dotnet publish failed for bootstrapper"
|
||||
}
|
||||
|
||||
Copy-Item -Path (Join-Path $publishRoot "OCSentinelBootstrapper.exe") -Destination $outputExe -Force
|
||||
|
||||
Write-Host "OfficeCom Sentinel setup executable created at $outputExe"
|
||||
Reference in New Issue
Block a user