Skip to content

Latest commit

 

History

History
167 lines (122 loc) · 6.6 KB

File metadata and controls

167 lines (122 loc) · 6.6 KB

Architecture

Docs site: mrumid2oo4.github.io/windows-setup-shell · FAQ: docs/FAQ.md

TL;DR: Identity in config.ps1 → UI BMPs from generate-ui.ps1 → Inno script setup.iss packages examples/win-unpacked into release/*.exe. The wizard chrome is custom; Inno only does file copy, shortcuts, registry, and silent upgrade.


Key takeaways

  1. One identity file. Everything user-visible that names a product flows from config.ps1.
  2. Two runtimes. PowerShell draws pixels; Inno Setup runs the installer process.
  3. Three wizard pages. Options → Installing → Finished. Stock Inno pages are hidden.
  4. Neutral by default. No logos, no product photography — safe to reuse across projects.
  5. Payload is yours. This repo never ships an application binary; you drop win-unpacked.

System map

┌────────────────────┐     ┌─────────────────────┐
│  config.ps1        │────▶│  product.inc        │
│  (identity)        │     │  (Inno #defines)    │
└─────────┬──────────┘     └──────────┬──────────┘
          │                           │
          ▼                           ▼
┌────────────────────┐     ┌─────────────────────┐
│  generate-ui.ps1   │     │  setup.iss          │
│  → ui/generated/*  │────▶│  custom [Code] UI   │
└────────────────────┘     └──────────┬──────────┘
                                      │
┌────────────────────┐                ▼
│  examples/         │     ┌─────────────────────┐
│  win-unpacked/*    │────▶│  ISCC.exe           │
└────────────────────┘     │  → release/*.exe    │
                           └─────────────────────┘

Layers

1. Identity layer — config.ps1

Field Used by
AppName, AppPublisher, AppUrl Window title, finish copy, Help link
AppShortName Large text on left hero BMPs
AppExeName Shortcuts, launch-after-install
AppId / AppGuid Uninstall / AppId
ProtocolScheme Optional HKCU\Software\Classes\…
AccentR/G/B Buttons + glow in generated art
OutputName, Version Setup.exe filename and version info

Rule: if a string mentions your product, it should come from here — not from hard-coded Pascal.

2. Presentation layer — scripts/generate-ui.ps1

Produces 24-bit BMPs Inno can load without alpha headaches:

Asset Role
hero-*-{ru,en}.bmp Left panel (800×1280 @2×)
btn-*-{ru,en}.bmp Primary actions
progress-track.bmp / progress-fill.bmp Install bar

Hero composition (top → bottom):

  1. Neutral SETUP wordmark + localized “Installer / Установщик”
  2. Abstract gradient + soft grid (no logo art)
  3. Product short name + status line + version
  4. Three-step indicator (Parameters / Installing / Finished)

Swap branding later by editing the backdrop / wordmark functions — the Inno script does not care what the BMPs depict.

3. Installer runtime — installer/setup.iss

Stock chrome is suppressed (HideStockChrome). The script builds:

Region Contents
Left 400px TBitmapImage hero
Right 624px Options / progress / done panels
Bottom 52px Help · Cancel · action button

Page flow:

InitializeWizard
    └─ ShowWelcome (Page1: folder, language, shortcuts)
         └─ Next → Inno file copy (Page2 progress hooks)
              └─ ShowFinished (Page3: launch checkbox)

Silent / /VERYSILENT path skips custom chrome so auto-updaters that relaunch Setup keep working.

4. Payload layer — examples/win-unpacked

Any folder layout Inno can recurse. Typical Electron portable:

examples/win-unpacked/
  Your App.exe
  resources/
  ...

[Files] copies the tree into {localappdata}\Programs\{AppName} (per-user, no admin).

5. Build orchestration — scripts/build.ps1

  1. Validate payload exe + assets/app.ico
  2. Emit installer/product.inc from config
  3. Run generate-ui.ps1
  4. Locate or install Inno Setup ≥ 6.6
  5. Compile with UTF-8 BOM (required for non-ASCII captions)
  6. Optionally signtool when CSC_LINK is set

Window geometry

┌──────────────┬────────────────────────────────┐
│              │  Installation options          │
│   HERO       │  ────────────────────────────  │
│   400 × 640  │  Folder  [..............] […]  │
│              │  Language [ Русский      ▾ ]   │
│              │  ☐ Desktop  ☑ Start Menu       │
│              ├────────────────────────────────┤
│              │  ? Help          Cancel  [ ▶ ] │
└──────────────┴────────────────────────────────┘
                 1024 × 640 total

Logical sizes are scaled with Inno ScaleX / ScaleY for DPI.


Extension points

Goal Where to change
Brand colors config.ps1 accent + optionally generate-ui.ps1 palette
Real logo / splash Replace New-NeutralBackdrop / Draw-Wordmark
Extra wizard fields BuildPage1 in setup.iss
Protocol / deep links ProtocolScheme in config
Admin install PrivilegesRequired in [Setup]
Different payload root [Files] Source: path in setup.iss
Auto-update silent apply Call Setup with /VERYSILENT /NORESTART

What this is not

  • Not an Electron app and not a web installer UI.
  • Not a code-signing service — it only invokes signtool if you provide a cert.
  • Not a store of brand assets — intentionally empty so you can reuse it cold.

Mental model

Inno owns the install. PowerShell owns the look. Config owns the name.

Keep those three responsibilities separate and the shell stays reusable across products without a rewrite.