diff --git a/build.ps1 b/build.ps1 index 3caa80e..2329267 100644 --- a/build.ps1 +++ b/build.ps1 @@ -88,3 +88,17 @@ 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)) + +# ── 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 + & $iscc /Q "/DAppVer=$ver" (Join-Path $here 'installer\ProjectDashboard.iss') + if ($LASTEXITCODE -ne 0) { throw "Inno Setup failed ($LASTEXITCODE)" } + $setup = Join-Path $outDir '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).' +} diff --git a/installer/ProjectDashboard.iss b/installer/ProjectDashboard.iss new file mode 100644 index 0000000..42b524e --- /dev/null +++ b/installer/ProjectDashboard.iss @@ -0,0 +1,87 @@ +; Installer for Project Dashboard (Inno Setup 6). Built by build.ps1 -Release: +; ISCC.exe /DAppVer= installer\ProjectDashboard.iss +; -> release\ProjectDashboard-Setup.exe +; +; Wraps the one-file release exe: per-user install (no admin / UAC), Start menu entry, +; optional desktop icon, uninstall entry in Windows "Apps". The app itself unpacks to +; %LOCALAPPDATA%\ProjectDashboard on first start, exactly like the portable exe. + +#ifndef AppVer + #define AppVer "1.0.0" +#endif +#define AppName "Project Dashboard" +#define AppExe "ProjectDashboard.exe" + +[Setup] +AppId={{6F3C2E9A-4B1D-4E7A-9C55-2D8B0F1A7E31} +AppName={#AppName} +AppVersion={#AppVer} +AppVerName={#AppName} {#AppVer} +AppPublisher=Michael Media +AppPublisherURL=https://sn09.itch.io/project-dashboard +AppSupportURL=https://discord.gg/Ej4JPmCZva +AppCopyright=© 2026 Michael Media +; per-user: installs to %LOCALAPPDATA%\Programs, no admin rights needed +PrivilegesRequired=lowest +PrivilegesRequiredOverridesAllowed=dialog +DefaultDirName={autopf}\{#AppName} +DefaultGroupName={#AppName} +DisableProgramGroupPage=yes +DisableDirPage=auto +OutputDir=..\release +OutputBaseFilename=ProjectDashboard-Setup +SetupIconFile=..\launcher\app.ico +UninstallDisplayIcon={app}\{#AppExe} +UninstallDisplayName={#AppName} +WizardStyle=modern +Compression=lzma2/max +SolidCompression=yes +ArchitecturesAllowed=x64compatible +ArchitecturesInstallIn64BitMode=x64compatible +MinVersion=10.0 +; an update replaces the running exe: close it first +CloseApplications=force +RestartApplications=no + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" +Name: "german"; MessagesFile: "compiler:Languages\German.isl" + +[CustomMessages] +english.DeleteData=Also delete your settings and data (project folders list, backup state, window position)?%n%nYour project folders and backups are NOT touched either way. +german.DeleteData=Auch deine Einstellungen und Daten löschen (Liste der Projektordner, Backup-Stand, Fensterposition)?%n%nDeine Projektordner und Backups werden in keinem Fall angefasst. + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}" + +[Files] +Source: "..\release\{#AppExe}"; DestDir: "{app}"; Flags: ignoreversion + +[Icons] +Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExe}" +Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}" +Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#AppExe}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#AppExe}"; Description: "{cm:LaunchProgram,{#AppName}}"; Flags: nowait postinstall skipifsilent + +[UninstallRun] +; the app may run in the tray: stop it (and its server) before removing files +Filename: "{sys}\taskkill.exe"; Parameters: "/f /t /im {#AppExe}"; Flags: runhidden; RunOnceId: "StopApp" + +[UninstallDelete] +; the unpacked app copy is rebuilt on every start anyway +Type: filesandordirs; Name: "{localappdata}\ProjectDashboard\app" + +[Code] +procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); +begin + if CurUninstallStep = usPostUninstall then + begin + // "Start with Windows" pointed at the installed exe + RegDeleteValue(HKEY_CURRENT_USER, 'Software\Microsoft\Windows\CurrentVersion\Run', 'ProjectDashboard'); + if not UninstallSilent then + if MsgBox(CustomMessage('DeleteData'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then + DelTree(ExpandConstant('{localappdata}\ProjectDashboard'), True, True, True); + end; +end;