-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_installers.ps1
More file actions
41 lines (29 loc) · 1.98 KB
/
build_installers.ps1
File metadata and controls
41 lines (29 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Build script for System Monitor Installers
$ErrorActionPreference = "Stop"
Write-Host "--- 1. Cleaning old publish folders ---" -ForegroundColor Cyan
if (Test-Path "publish_collector") { Remove-Item -Recurse -Force "publish_collector" }
if (Test-Path "publish_monitor") { Remove-Item -Recurse -Force "publish_monitor" }
Write-Host "--- 2. Publishing SystemCollectorService (Server) ---" -ForegroundColor Cyan
dotnet publish SystemCollectorService/SystemCollectorService.csproj -c Release -o publish_collector -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
Write-Host "--- 3. Publishing SystemMonitorService (Client) ---" -ForegroundColor Cyan
dotnet publish SystemMonitorService/SystemMonitorService.csproj -c Release -o publish_monitor -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
Write-Host "--- 4. Locating Inno Setup Compiler (ISCC.exe) ---" -ForegroundColor Cyan
$iscc = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
if (-not (Test-Path $iscc)) {
# Try to find in PATH if not in default location
$iscc = Get-Command iscc -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Source
}
if (-not $iscc) {
Write-Error "Inno Setup Compiler (ISCC.exe) not found! Please install it from https://jrsoftware.org/isdl.php"
exit
}
Write-Host "Using ISCC from: $iscc" -ForegroundColor Gray
Write-Host "--- 5. Compiling Combined Installer ---" -ForegroundColor Green
& $iscc "CombinedInstaller.iss"
Write-Host "--- 6. Compiling Server Installer ---" -ForegroundColor Green
& $iscc "ServerInstaller.iss"
Write-Host "--- 7. Compiling Client Installer ---" -ForegroundColor Green
& $iscc "ClientInstaller.iss"
Write-Host "`nSuccessfully generated installers:" -ForegroundColor Cyan
Get-ChildItem *.exe | Where-Object { $_.Name -like "SystemMonitor*Setup.exe" } | Select-Object Name, @{Name="Size(MB)";Expression={"{0:N2}" -f ($_.Length / 1MB)}}
Write-Host "`nDone!" -ForegroundColor Cyan