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>
This commit is contained in:
2026-11-24 22:29:59 +01:00
parent 76aad18646
commit d9c20fa076
7 changed files with 131 additions and 19 deletions

View File

@@ -9,8 +9,12 @@
# 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).
param([switch]$Release)
#
# powershell -ExecutionPolicy Bypass -File build.ps1 -Demo -> release\ProjectDashboard-Demo.exe (+ -Demo-Setup.exe)
# the free demo: at most 6 projects (edition.json in the payload). The full build is not touched.
param([switch]$Release, [switch]$Demo)
$ErrorActionPreference = 'Stop'
if ($Demo) { $Release = [switch]$true }
$here = $PSScriptRoot
$launcher = Join-Path $here 'launcher'
$csproj = Join-Path $launcher 'ProjectDashboard.csproj'
@@ -69,6 +73,11 @@ Enthaltene Software:
- Lucide Icons (ISC) - node_modules\lucide-static\LICENSE
"@
# demo edition: server.js reads edition.json (WriteAllText = UTF-8 without BOM)
if ($Demo) {
[IO.File]::WriteAllText((Join-Path $payload 'edition.json'), '{ "demo": true, "limit": 6, "buyUrl": "https://sn09.itch.io/project-dashboard" }')
}
Write-Host '2/3 Packen ...'
if (Test-Path $zip) { Remove-Item $zip -Force }
Add-Type -AssemblyName System.IO.Compression.FileSystem
@@ -81,7 +90,7 @@ 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
$out = Join-Path $outDir 'ProjectDashboard.exe'
$out = Join-Path $outDir $(if ($Demo) { 'ProjectDashboard-Demo.exe' } else { 'ProjectDashboard.exe' })
Copy-Item (Join-Path $stage 'ProjectDashboard.exe') $out -Force
Remove-Item $stage, $payload, $zip -Recurse -Force
@@ -95,9 +104,11 @@ $iscc = @("$env:LOCALAPPDATA\Programs\Inno Setup 6\ISCC.exe", "${env:ProgramFile
if ($iscc) {
Write-Host 'Setup bauen ...'
$ver = (Get-Content (Join-Path $here 'package.json') -Raw | ConvertFrom-Json).version
& $iscc /Q "/DAppVer=$ver" (Join-Path $here 'installer\ProjectDashboard.iss')
$isccArgs = @('/Q', "/DAppVer=$ver")
if ($Demo) { $isccArgs += '/DDemo' }
& $iscc @isccArgs (Join-Path $here 'installer\ProjectDashboard.iss')
if ($LASTEXITCODE -ne 0) { throw "Inno Setup failed ($LASTEXITCODE)" }
$setup = Join-Path $outDir 'ProjectDashboard-Setup.exe'
$setup = Join-Path $outDir $(if ($Demo) { 'ProjectDashboard-Demo-Setup.exe' } else { 'ProjectDashboard-Setup.exe' })
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).'