Commit graph

2 commits

Author SHA1 Message Date
Lukas Brübach
0403ac9354 [Installer] Make the Inno Setup installer the default, with its failure hook.
COCKATRICE_WIN_INSTALLER now defaults to InnoSetup. NSIS stays selectable for
one release as the legacy fallback, and the two can still be built from one
tree and compared on a real upgrade.

The switches question from the previous commit is settled from Inno Setup's
source: the setup command line is an if/else-if chain over the switches it
knows, with no fallback that rejects the rest, so /R, /PID= and /D= are
ignored rather than refused. The client therefore sends one command line that
drives either installer:

- /R and /PID= for NSIS, which also needs /D= last and unquoted;
- /VERYSILENT and the CloseApplications set for Setup, which releases the
  mapped runtime DLLs through Restart Manager instead of waiting for a pid;
- /UPDATER as the client's own mark, read only by the Inno Setup script.

An older client that passes only the NSIS switches still installs; it walks
the wizard once instead of running silently.

The Sentry offer that AbortInstall carried is ported: a silent run the updater
launched, which began replacing files and never reached the end, offers to
send its log through the same helper. The helper is embedded with a [Files]
dontcopy entry and extracted at send time; a repeated [Files] section merges
with the generated one instead of being a compile error. Setup prefixes every
log line with a timestamp, so the helper's ABORT scan now allows that prefix.

CI installs Inno Setup next to NSIS, dumps ISCCOutput.log and the generated
script when the installer fails to compile, and --package NSIS|InnoSetup
selects the installer through the CMake option instead of adding a second
CPack generator to the run.
2026-10-26 08:29:22 +01:00
Lukas Brübach
2c8e47a0a4 [Installer] Add an Inno Setup generator next to NSIS.
COCKATRICE_WIN_INSTALLER chooses which tool writes the Windows installer.
NSIS stays the default, so nothing on the existing path changes; InnoSetup
selects CPack's own INNOSETUP generator (CMake >= 3.27) and builds from the
same install() rules. Both can be built from one tree and the resulting
installers compared on an upgrade from 3.1.x.

What the Inno path does differently:

- Installs over the previous version instead of running the old uninstaller
  first, which is what the backup/restore pair in the NSIS template exists
  to survive.
- Closes and restarts a running application through Windows Restart Manager
  (CloseApplications/RestartApplications) instead of the two PowerShell
  process guards the template needed.
- Removes stale runtime with one [InstallDelete] of *.dll and Plugins,
  instead of RetryDllPurge and its diagnostics.
- Writes a log on every run through SetupLogging, instead of CockLog.
- Resolves the install directory from the legacy NSIS registration, and
  deletes that registration after a successful install so the old
  uninstaller (whose blanket directory removal caused the 3.1.x data loss)
  cannot be run after the upgrade.
- Keeps the portable mode the client detects, the C++ runtime bootstrap and
  the /PORTABLE switch.

The in-app updater still passes the NSIS switches (/R, /PID=); the installer
logs them so the first Windows run settles whether Inno Setup accepts them or
the switch-over needs a client version gate.

The installer content check in .ci/compile.sh learns to strip Inno Setup's
{app} prefix from the paths 7-Zip lists, so the required-runtime comparison
works for either archive format.
2026-10-26 07:52:44 +01:00