2026-11-12 09:32:23 +01:00
|
|
|
# Builds the dashboard exe.
|
|
|
|
|
#
|
|
|
|
|
# powershell -ExecutionPolicy Bypass -File build.ps1 -> ProjectDashboard.exe next to server.js
|
|
|
|
|
# small, for this folder: uses the installed Node.js and .NET 8 Desktop Runtime.
|
|
|
|
|
#
|
|
|
|
|
# powershell -ExecutionPolicy Bypass -File build.ps1 -Release -> release\ProjectDashboard.exe
|
|
|
|
|
# ONE exe to pass on: .NET runtime, node.exe and all dashboard files are inside.
|
|
|
|
|
# On another PC it unpacks itself to %LOCALAPPDATA%\ProjectDashboard on first start
|
|
|
|
|
# and asks for the projects folder and the backup target.
|
|
|
|
|
#
|
|
|
|
|
# Needs the .NET 8+ SDK (and Node.js on this PC, which is copied into the release exe).
|
demo-version: höchstens 6 projekte
- edition.json (nur im Demo-Build) bzw. DASHBOARD_DEMO=1 schaltet die Demo
ein. projectList() gibt dann fest nach Name die ersten 6 Projekte aus;
Board, Galerie, Liste, Kennzahlen, Speicher, Aktivität, Details,
Aktionen, Löschen und Aufräumen kennen damit nur diese 6.
- Backup: robocopy schließt in der Demo alle übrigen Projektordner per
/XD aus (auch die automatische Sicherung).
- Neu/Klonen: Server lehnt ab Grenze ab, Oberfläche zeigt einen Kauf-Hinweis.
- Demo-Banner "Demo – 6 von N Projekten sichtbar" + "Vollversion holen",
Demo-Badge und Kauf-Button unter Einstellungen → Über. EN/DE.
- build.ps1 -Demo → release\ProjectDashboard-Demo.exe und
ProjectDashboard-Demo-Setup.exe; der Installer nutzt dieselbe AppId wie
die Vollversion, die ihn später am selben Ort ersetzt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:29:59 +01:00
|
|
|
#
|
|
|
|
|
# powershell -ExecutionPolicy Bypass -File build.ps1 -Demo -> release\ProjectDashboard-Demo.exe (+ -Demo-Setup.exe)
|
2026-11-25 09:47:17 +01:00
|
|
|
# the free demo: at most 6 projects (edition marker in server.js). The full build is not touched.
|
demo-version: höchstens 6 projekte
- edition.json (nur im Demo-Build) bzw. DASHBOARD_DEMO=1 schaltet die Demo
ein. projectList() gibt dann fest nach Name die ersten 6 Projekte aus;
Board, Galerie, Liste, Kennzahlen, Speicher, Aktivität, Details,
Aktionen, Löschen und Aufräumen kennen damit nur diese 6.
- Backup: robocopy schließt in der Demo alle übrigen Projektordner per
/XD aus (auch die automatische Sicherung).
- Neu/Klonen: Server lehnt ab Grenze ab, Oberfläche zeigt einen Kauf-Hinweis.
- Demo-Banner "Demo – 6 von N Projekten sichtbar" + "Vollversion holen",
Demo-Badge und Kauf-Button unter Einstellungen → Über. EN/DE.
- build.ps1 -Demo → release\ProjectDashboard-Demo.exe und
ProjectDashboard-Demo-Setup.exe; der Installer nutzt dieselbe AppId wie
die Vollversion, die ihn später am selben Ort ersetzt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:29:59 +01:00
|
|
|
param([switch]$Release, [switch]$Demo)
|
2026-11-12 09:32:23 +01:00
|
|
|
$ErrorActionPreference = 'Stop'
|
demo-version: höchstens 6 projekte
- edition.json (nur im Demo-Build) bzw. DASHBOARD_DEMO=1 schaltet die Demo
ein. projectList() gibt dann fest nach Name die ersten 6 Projekte aus;
Board, Galerie, Liste, Kennzahlen, Speicher, Aktivität, Details,
Aktionen, Löschen und Aufräumen kennen damit nur diese 6.
- Backup: robocopy schließt in der Demo alle übrigen Projektordner per
/XD aus (auch die automatische Sicherung).
- Neu/Klonen: Server lehnt ab Grenze ab, Oberfläche zeigt einen Kauf-Hinweis.
- Demo-Banner "Demo – 6 von N Projekten sichtbar" + "Vollversion holen",
Demo-Badge und Kauf-Button unter Einstellungen → Über. EN/DE.
- build.ps1 -Demo → release\ProjectDashboard-Demo.exe und
ProjectDashboard-Demo-Setup.exe; der Installer nutzt dieselbe AppId wie
die Vollversion, die ihn später am selben Ort ersetzt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:29:59 +01:00
|
|
|
if ($Demo) { $Release = [switch]$true }
|
2026-11-12 09:32:23 +01:00
|
|
|
$here = $PSScriptRoot
|
|
|
|
|
$launcher = Join-Path $here 'launcher'
|
|
|
|
|
$csproj = Join-Path $launcher 'ProjectDashboard.csproj'
|
|
|
|
|
|
|
|
|
|
if (-not (Test-Path (Join-Path $launcher 'app.ico'))) { & (Join-Path $launcher 'make-icon.ps1') }
|
|
|
|
|
|
|
|
|
|
if (-not $Release) {
|
|
|
|
|
$stage = Join-Path $launcher 'publish'
|
|
|
|
|
dotnet publish $csproj -c Release -o $stage --nologo -v q
|
|
|
|
|
if ($LASTEXITCODE -ne 0) { throw "dotnet publish failed ($LASTEXITCODE)" }
|
|
|
|
|
Copy-Item (Join-Path $stage 'ProjectDashboard.exe') (Join-Path $here 'ProjectDashboard.exe') -Force
|
|
|
|
|
Remove-Item $stage -Recurse -Force
|
|
|
|
|
Write-Host "-> $(Join-Path $here 'ProjectDashboard.exe')"
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# ── release: assemble the payload ────────────────────────────────────────────
|
|
|
|
|
$payload = Join-Path $launcher 'payload-stage'
|
|
|
|
|
$zip = Join-Path $launcher 'payload.zip'
|
|
|
|
|
if (Test-Path $payload) { Remove-Item $payload -Recurse -Force }
|
|
|
|
|
New-Item -ItemType Directory $payload | Out-Null
|
|
|
|
|
|
|
|
|
|
Write-Host '1/3 Paket zusammenstellen ...'
|
|
|
|
|
foreach ($f in 'server.js', 'package.json') { Copy-Item (Join-Path $here $f) $payload }
|
|
|
|
|
foreach ($d in 'lib', 'public') { Copy-Item (Join-Path $here $d) (Join-Path $payload $d) -Recurse }
|
|
|
|
|
|
|
|
|
|
# node_modules: everything the server needs, but from lucide-static only the icon sprite
|
|
|
|
|
$nm = Join-Path $payload 'node_modules'
|
|
|
|
|
New-Item -ItemType Directory $nm | Out-Null
|
|
|
|
|
Get-ChildItem (Join-Path $here 'node_modules') -Directory -Force | Where-Object { $_.Name -ne 'lucide-static' -and $_.Name -ne '.bin' } |
|
|
|
|
|
ForEach-Object { Copy-Item $_.FullName (Join-Path $nm $_.Name) -Recurse }
|
|
|
|
|
$lucide = Join-Path $nm 'lucide-static'
|
|
|
|
|
New-Item -ItemType Directory $lucide | Out-Null
|
|
|
|
|
foreach ($f in 'sprite.svg', 'LICENSE', 'package.json') { Copy-Item (Join-Path $here "node_modules\lucide-static\$f") $lucide }
|
|
|
|
|
|
|
|
|
|
# cleanup.ps1 (shipped copy, used when the projects folder has no _Tools\Cleanup)
|
2026-11-12 14:03:53 +01:00
|
|
|
# dashboard inside _Tools (..\Cleanup) or next to it (..\_Tools\Cleanup); without it the
|
|
|
|
|
# shipped exe measures sizes but offers nothing to delete
|
|
|
|
|
$parent = Split-Path $here -Parent
|
|
|
|
|
$cleanup = @((Join-Path $parent 'Cleanup\cleanup.ps1'), (Join-Path $parent '_Tools\Cleanup\cleanup.ps1')) | Where-Object { Test-Path $_ } | Select-Object -First 1
|
|
|
|
|
if ($cleanup) {
|
|
|
|
|
New-Item -ItemType Directory (Join-Path $payload 'tools') | Out-Null
|
|
|
|
|
Copy-Item $cleanup (Join-Path $payload 'tools\cleanup.ps1')
|
|
|
|
|
} else { Write-Warning 'cleanup.ps1 nicht gefunden - die exe misst Groessen, bietet aber nichts zum Aufraeumen an.' }
|
2026-11-12 09:32:23 +01:00
|
|
|
|
|
|
|
|
# node.exe of this PC (MIT license, copied alongside)
|
|
|
|
|
$nodeExe = (Get-Command node -ErrorAction Stop).Source
|
|
|
|
|
New-Item -ItemType Directory (Join-Path $payload 'node') | Out-Null
|
|
|
|
|
Copy-Item $nodeExe (Join-Path $payload 'node\node.exe')
|
|
|
|
|
$nodeLicense = Join-Path (Split-Path $nodeExe -Parent) 'LICENSE'
|
|
|
|
|
if (Test-Path $nodeLicense) { Copy-Item $nodeLicense (Join-Path $payload 'node\LICENSE') }
|
|
|
|
|
Set-Content -Encoding UTF8 (Join-Path $payload 'THIRD-PARTY.txt') @"
|
|
|
|
|
Enthaltene Software:
|
|
|
|
|
- Node.js $(& $nodeExe --version) (MIT) - node\LICENSE
|
|
|
|
|
- Express (MIT) - node_modules\express
|
|
|
|
|
- Lucide Icons (ISC) - node_modules\lucide-static\LICENSE
|
|
|
|
|
"@
|
|
|
|
|
|
2026-11-25 09:47:17 +01:00
|
|
|
# demo edition: flip the marker in the STAGED server.js only (the source stays 'full')
|
demo-version: höchstens 6 projekte
- edition.json (nur im Demo-Build) bzw. DASHBOARD_DEMO=1 schaltet die Demo
ein. projectList() gibt dann fest nach Name die ersten 6 Projekte aus;
Board, Galerie, Liste, Kennzahlen, Speicher, Aktivität, Details,
Aktionen, Löschen und Aufräumen kennen damit nur diese 6.
- Backup: robocopy schließt in der Demo alle übrigen Projektordner per
/XD aus (auch die automatische Sicherung).
- Neu/Klonen: Server lehnt ab Grenze ab, Oberfläche zeigt einen Kauf-Hinweis.
- Demo-Banner "Demo – 6 von N Projekten sichtbar" + "Vollversion holen",
Demo-Badge und Kauf-Button unter Einstellungen → Über. EN/DE.
- build.ps1 -Demo → release\ProjectDashboard-Demo.exe und
ProjectDashboard-Demo-Setup.exe; der Installer nutzt dieselbe AppId wie
die Vollversion, die ihn später am selben Ort ersetzt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:29:59 +01:00
|
|
|
if ($Demo) {
|
2026-11-25 09:47:17 +01:00
|
|
|
$sf = Join-Path $payload 'server.js'
|
|
|
|
|
$txt = [IO.File]::ReadAllText($sf)
|
|
|
|
|
$flip = $txt.Replace("const BUILD_EDITION = 'full'", "const BUILD_EDITION = 'demo'")
|
|
|
|
|
if ($flip -eq $txt) { throw "Demo-Marker nicht gefunden in server.js (const BUILD_EDITION = 'full')" }
|
|
|
|
|
[IO.File]::WriteAllText($sf, $flip, (New-Object Text.UTF8Encoding $false))
|
|
|
|
|
Write-Host ' edition: demo'
|
demo-version: höchstens 6 projekte
- edition.json (nur im Demo-Build) bzw. DASHBOARD_DEMO=1 schaltet die Demo
ein. projectList() gibt dann fest nach Name die ersten 6 Projekte aus;
Board, Galerie, Liste, Kennzahlen, Speicher, Aktivität, Details,
Aktionen, Löschen und Aufräumen kennen damit nur diese 6.
- Backup: robocopy schließt in der Demo alle übrigen Projektordner per
/XD aus (auch die automatische Sicherung).
- Neu/Klonen: Server lehnt ab Grenze ab, Oberfläche zeigt einen Kauf-Hinweis.
- Demo-Banner "Demo – 6 von N Projekten sichtbar" + "Vollversion holen",
Demo-Badge und Kauf-Button unter Einstellungen → Über. EN/DE.
- build.ps1 -Demo → release\ProjectDashboard-Demo.exe und
ProjectDashboard-Demo-Setup.exe; der Installer nutzt dieselbe AppId wie
die Vollversion, die ihn später am selben Ort ersetzt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:29:59 +01:00
|
|
|
}
|
|
|
|
|
|
2026-11-12 09:32:23 +01:00
|
|
|
Write-Host '2/3 Packen ...'
|
|
|
|
|
if (Test-Path $zip) { Remove-Item $zip -Force }
|
|
|
|
|
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
|
|
|
|
[IO.Compression.ZipFile]::CreateFromDirectory($payload, $zip, [IO.Compression.CompressionLevel]::Optimal, $false)
|
|
|
|
|
|
|
|
|
|
# ── release: one self-contained exe with the payload inside ─────────────────
|
|
|
|
|
Write-Host '3/3 exe bauen ...'
|
|
|
|
|
$stage = Join-Path $launcher 'publish-portable'
|
|
|
|
|
dotnet publish $csproj -c Release -p:Portable=true -o $stage --nologo -v q
|
|
|
|
|
if ($LASTEXITCODE -ne 0) { throw "dotnet publish failed ($LASTEXITCODE)" }
|
|
|
|
|
$outDir = Join-Path $here 'release'
|
|
|
|
|
New-Item -ItemType Directory -Force $outDir | Out-Null
|
demo-version: höchstens 6 projekte
- edition.json (nur im Demo-Build) bzw. DASHBOARD_DEMO=1 schaltet die Demo
ein. projectList() gibt dann fest nach Name die ersten 6 Projekte aus;
Board, Galerie, Liste, Kennzahlen, Speicher, Aktivität, Details,
Aktionen, Löschen und Aufräumen kennen damit nur diese 6.
- Backup: robocopy schließt in der Demo alle übrigen Projektordner per
/XD aus (auch die automatische Sicherung).
- Neu/Klonen: Server lehnt ab Grenze ab, Oberfläche zeigt einen Kauf-Hinweis.
- Demo-Banner "Demo – 6 von N Projekten sichtbar" + "Vollversion holen",
Demo-Badge und Kauf-Button unter Einstellungen → Über. EN/DE.
- build.ps1 -Demo → release\ProjectDashboard-Demo.exe und
ProjectDashboard-Demo-Setup.exe; der Installer nutzt dieselbe AppId wie
die Vollversion, die ihn später am selben Ort ersetzt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:29:59 +01:00
|
|
|
$out = Join-Path $outDir $(if ($Demo) { 'ProjectDashboard-Demo.exe' } else { 'ProjectDashboard.exe' })
|
2026-11-12 09:32:23 +01:00
|
|
|
Copy-Item (Join-Path $stage 'ProjectDashboard.exe') $out -Force
|
|
|
|
|
|
|
|
|
|
Remove-Item $stage, $payload, $zip -Recurse -Force
|
|
|
|
|
# the normal build must not pick up the self-contained restore state
|
|
|
|
|
Remove-Item (Join-Path $launcher 'obj') -Recurse -Force -ErrorAction SilentlyContinue
|
|
|
|
|
Write-Host ("-> {0} ({1:N0} MB)" -f $out, ((Get-Item $out).Length / 1MB))
|
2026-11-24 21:54:46 +01:00
|
|
|
|
|
|
|
|
# ── installer: release\ProjectDashboard-Setup.exe wraps the exe (Inno Setup 6, optional) ──
|
|
|
|
|
$iscc = @("$env:LOCALAPPDATA\Programs\Inno Setup 6\ISCC.exe", "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe", "$env:ProgramFiles\Inno Setup 6\ISCC.exe") |
|
|
|
|
|
Where-Object { Test-Path $_ } | Select-Object -First 1
|
|
|
|
|
if ($iscc) {
|
|
|
|
|
Write-Host 'Setup bauen ...'
|
|
|
|
|
$ver = (Get-Content (Join-Path $here 'package.json') -Raw | ConvertFrom-Json).version
|
demo-version: höchstens 6 projekte
- edition.json (nur im Demo-Build) bzw. DASHBOARD_DEMO=1 schaltet die Demo
ein. projectList() gibt dann fest nach Name die ersten 6 Projekte aus;
Board, Galerie, Liste, Kennzahlen, Speicher, Aktivität, Details,
Aktionen, Löschen und Aufräumen kennen damit nur diese 6.
- Backup: robocopy schließt in der Demo alle übrigen Projektordner per
/XD aus (auch die automatische Sicherung).
- Neu/Klonen: Server lehnt ab Grenze ab, Oberfläche zeigt einen Kauf-Hinweis.
- Demo-Banner "Demo – 6 von N Projekten sichtbar" + "Vollversion holen",
Demo-Badge und Kauf-Button unter Einstellungen → Über. EN/DE.
- build.ps1 -Demo → release\ProjectDashboard-Demo.exe und
ProjectDashboard-Demo-Setup.exe; der Installer nutzt dieselbe AppId wie
die Vollversion, die ihn später am selben Ort ersetzt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:29:59 +01:00
|
|
|
$isccArgs = @('/Q', "/DAppVer=$ver")
|
|
|
|
|
if ($Demo) { $isccArgs += '/DDemo' }
|
|
|
|
|
& $iscc @isccArgs (Join-Path $here 'installer\ProjectDashboard.iss')
|
2026-11-24 21:54:46 +01:00
|
|
|
if ($LASTEXITCODE -ne 0) { throw "Inno Setup failed ($LASTEXITCODE)" }
|
demo-version: höchstens 6 projekte
- edition.json (nur im Demo-Build) bzw. DASHBOARD_DEMO=1 schaltet die Demo
ein. projectList() gibt dann fest nach Name die ersten 6 Projekte aus;
Board, Galerie, Liste, Kennzahlen, Speicher, Aktivität, Details,
Aktionen, Löschen und Aufräumen kennen damit nur diese 6.
- Backup: robocopy schließt in der Demo alle übrigen Projektordner per
/XD aus (auch die automatische Sicherung).
- Neu/Klonen: Server lehnt ab Grenze ab, Oberfläche zeigt einen Kauf-Hinweis.
- Demo-Banner "Demo – 6 von N Projekten sichtbar" + "Vollversion holen",
Demo-Badge und Kauf-Button unter Einstellungen → Über. EN/DE.
- build.ps1 -Demo → release\ProjectDashboard-Demo.exe und
ProjectDashboard-Demo-Setup.exe; der Installer nutzt dieselbe AppId wie
die Vollversion, die ihn später am selben Ort ersetzt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:29:59 +01:00
|
|
|
$setup = Join-Path $outDir $(if ($Demo) { 'ProjectDashboard-Demo-Setup.exe' } else { 'ProjectDashboard-Setup.exe' })
|
2026-11-24 21:54:46 +01:00
|
|
|
Write-Host ("-> {0} ({1:N0} MB)" -f $setup, ((Get-Item $setup).Length / 1MB))
|
|
|
|
|
} else {
|
|
|
|
|
Write-Host 'Setup übersprungen: Inno Setup 6 nicht gefunden (winget install JRSoftware.InnoSetup).'
|
|
|
|
|
}
|