Skip to content

Smart Inno Setup: graceful in-place ArSonMix update, safe user data, automatic launch - #443

Merged
masarray merged 52 commits into
mainfrom
fix/inno-smart-upgrade-graceful-launch-20261108
Nov 7, 2026
Merged

masarray merged 52 commits into
mainfrom
fix/inno-smart-upgrade-graceful-launch-20261108

Conversation

@masarray

@masarray masarray commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Problem

The existing official Inno Setup RC had CloseApplications=no and no [Run]: an already-running mixer could block replacement, and successful installation did not launch ArSonMix.

Fix

  • Preserve stable per-user AppId/folder and upgrade in place without uninstalling Studio data or overriding .smix user state.
  • Inno PrepareToInstall signals the native per-session shutdown event for compatible builds; JUCE executes normal session save/quit and Inno waits for the running mutex to release. For legacy versions without this event, an embedded temporary-only PowerShell helper finds ONLY the exact installed ArSonMix.exe process path, requests normal GUI WM_CLOSE (main HWND or PID-filtered top-level HWND), and waits for all matched processes to exit. It then requires an exclusive writable Win32 handle to the original EXE. No force kill or arbitrary process-name shutdown; a hung/locked EXE stops before [Files] without modifying the installed program or private Studio data. CloseApplications=no deliberately disables the competing Windows Restart Manager shutdown; RestartApplications=no prevents duplicate relaunch.
  • Inno Setup wizard eliminates unnecessary screens; one [Run] launches the installed GUI once after successful interactive install/update using original (non-elevated) user. skipifsilent prevents Session 0 audio activation during enterprise installs / CI.
  • Inno version comes from project(ARMixConsole VERSION ...) rather than stale 0.1.0-rc.1 hardcode. Distribute builds as ArSonMix Windows Preview, not UNQUALIFIED; preserve separate exact-source-SHA integrity verification and distinct owner physical listening evidence (not a fabricated all-hardware certificate).
  • Exact FAT powershell installer test now performs two real installs: starts with verified PE; then replaces test-installed PE with a harmless real WinForms window, leaves private Studio + custom install sentinel, runs same Inno setup as a silent in-place update, requires observed INSTALLER_HANDSHAKE_SAVED graceful shutdown, source SHA-256 EXE restored, user files retained, followed by real uninstall preserving Studio. Never ships the test fixture.

CI

PR quick Windows-native contract gate first. Then one owner-authorized exact-commit /arsonmix-ci fat HEAD_SHA milestone (Windows compiler + Inno real installer/update/uninstall), no redundant Windows jobs on every PR commit. This is software/installer FAT, not physical ASIO certification.

Product behavior

A normal user double-clicks the installer, the in-use mixer is requested to save and close normally, new version is placed in the same location, and the new mixer opens once automatically. If Windows cannot close the old mixer safely, setup must stop rather than silently discard live edits.

Cross-thread reconciliation

PR #445 restores retained mixer channels/WIRE/FX on verified device Apply; its safety regression requires NEEDS_REMAP instead of silently migrating MAIN physical 3/4 to 1/2. #443 installer changes ConsoleApp shutdown; #445 device changes ConsoleWindow and binding policy. Both must be integrated without reverting either, followed by exact-head Windows native + Inno qualification. See the latest cross-thread checkpoint in PR comments.

Exact Windows failure regression

Isolated Windows Inno run #42421982731 PASS: (1) handshake-enabled running mixer saves/quits and updates, (2) legacy old GUI without handshake receives WM_CLOSE_SAVED and updates in place, (3) unresponsive EXE without a responsive window remains running; Setup exits 7 before file replacement, preserving installed EXE SHA and Studio user sentinel. Exact-source Windows MSVC + Inno FAT in progress. Real user reported DeleteFile failed; code 5 on %LOCALAPPDATA%\\Programs\\ArSonMix\\ArSonMix.exe; existing released installer did not own the legacy-close path.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T19:58:54.881420Z c03f3d2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c03f3d210c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread installer/ArSonMix.iss Outdated
; one new executable only after a successful interactive install/update.
; Silent enterprise/FAT installs deliberately do not launch desktop audio.
[Run]
Filename: "{app}\\ArSonMix.exe"; WorkingDir: "{app}"; Flags: nowait runasoriginaluser skipifsilent

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use a single path separator in the installer launch entry

This entry contains two literal backslashes after {app}, whereas the new launch contract expects one. Running node --test tests/windows_installer_contract_test.mjs fails the “successful interactive install or update launches exactly one new mixer” test at line 41 (0 !== 1). That test is required by both the fast Linux contracts and Windows validation in .github/workflows/p1-windows.yml, so this commit blocks those checks before installer qualification. Use the same single-backslash path spelling as the other Inno entries.

Useful? React with 👍 / 👎.

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat 1782151

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat 76a8b06

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

2026-11-08 Smart Installer native handshake qualification checkpoint

Inno CloseApplications=yes alone proved insufficient on the Windows fixture: the previous smoke showed the installed application exited, but no durable save marker. Do not claim safe updater on a mere 0 installer exit code.

Implemented in this PR on exact head 76a8b068707e6c896ad5a86c5af95d4f665114a1:

  • New JUCE GUI-thread-only Local\\ArSonMix.InstallShutdown.v1 signal + process lifetime Local\\ArSonMix.MixerRunning.v1 mutex. The existing ConsoleApp event poll calls systemRequestedQuit() so its normal shutdown goes through ConsoleWindow::~ConsoleWindow(), mixerSessionWorker_.finishForShutdown(), saveMixerSession(resumeMain), then releases the running mutex. No audio callback / force kill.
  • Inno PrepareToInstall requests this safe shutdown, waits for mutex release before replacing the PE and fails with an actionable message if the verified native process doesn't stop. Prior installs without the new signal still fall back to Windows Restart Manager. Keep RestartApplications=no; interactive installer [Run] launches one updated mixer, silent/FAT never auto-launches.
  • Test-only WinForms fixture simulates the same signal/mutex plus Windows Restart Manager messages; C# code is never packaged. Independent Windows Inno smoke run #42412638174 PASS: INSTALLER_HANDSHAKE_SAVED, old process exit, in-place installer exit 0, exact upgraded file hash, private Studio preserved, real uninstall.
  • Fast native contracts PASS on this head. Exact-head full Windows C++ build/CTest and real Inno FAT installer are being checked in run #42412752861 (do not claim PASS before complete). No physical ASIO test or signed/public release is claimed.
  • Duplicated narrower P0 Smart Inno Setup: graceful in-place upgrade, protect Studio and launch mixer #444 is closed without merging. Smart Inno Setup: graceful in-place ArSonMix update, safe user data, automatic launch #443 is sole implementation authority; block merge if any native build / real updater or full FAT step fails.

This checkpoint describes implemented behavior, not a release announcement.

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat 0a48518

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Cross-thread reconciled release checkpoint — 2026-11-08

Source of truth: main remains 857b362f90d00b07e82180ef6e4a26a3d65ff14d (#418 merged). The active change streams are this PR #443 (installer + Windows Preview package) at 0a48518dd7e92897572ff02c84c3b34a607beb7f and PR #445 (device-session mixer rebind) at cddf25b8c82a2d417d73bd09dc2d1c15b78cbf75. Older duplicate installer #444 is closed without merge. No public GitHub Release exists.

Installer #443: in-place same-AppId Inno update, safe signal-based native quit, retained user Studio/.smix, a single post-setup interactive launch, no forced kill, exact-SHA provenance; UNQUALIFIED product/artifact filenames were replaced with honest Preview branding without inventing a per-build physical audio certificate. Native quick contracts and independent Windows running-app INSTALLER_HANDSHAKE_SAVED smoke PASS on this head; current full exact-head MSVC/61 CTest + Inno FAT run #42415878943 is in progress.

Device #445: retains channel graph/WIRE/FX and device-independent session after verified Audio I/O Apply; keeps MAIN muted. Critical P1 Codex review issue silently falling back from physical MAIN pins 3/4 to 1/2 has been fixed on the current head: missing pins / changed ASIO inventory -> NEEDS_REMAP, no session mutation; explicit multi-pair selection required on replacement playback. Added native regression. PR quick native and Chromium PASS; exact-head MSVC/native CTest run #42415881519 is in progress.

Both branches edit src/Main.cpp in distinct regions (#443 ConsoleApp setup/shutdown handshake, #445 ConsoleWindow device rebind), so preserve both changes on merge. Do not conflate Windows CI proof with the owner's real audio listening tests; neither should be denied or upgraded to an unstated all-device certification.

Merge gate: finish full CI for both heads, then reconcile both branches into main without wiping their independent changes; check main Windows/Chromium, final installer artifact build, provenance, and distribution separately. No blind merges or redundant fat runs.

….ps1; strict preflight is the only shutdown authority
…1; strict preflight is the only shutdown authority

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

P0 field failure: Inno DeleteFile failed code 5 on installed ArSonMix.exe (8 Nov 2026)

User screenshot: C:\Users\me\AppData\Local\Programs\ArSonMix\ArSonMix.exe; Inno file replacement reports DeleteFile failed; code 5. Access is denied and offers Retry/Skip/Cancel. This is a real end-user failure, not a cosmetic error. Previously green fixture only exercised the newly installed version with a shutdown event, not upgrade from a legacy GUI with no handshake or an executable held by a hung process.

Current dedicated installer branch 2fa18fe47109ba3d99a06324d71ce8a943aefe60:

  • PrepareToInstall sends the native JUCE event when present.
  • Embedded temporary-only installer/ArSonMixUpdateShutdown.ps1 targets the exact installed EXE path, enumerates same-path process IDs, requests ordinary WM_CLOSE via main HWND or PID-filtered top-level HWND, and waits up to 25s. Never taskkill/TerminateProcess, never close a different ArSonMix installed elsewhere.
  • If an old process refuses to exit or file is still locked, the installer returns an actionable preflight error before [Files]; CreateFileW exclusive writable access is verified on {app}\ArSonMix.exe to catch other handle/ACL/AV conflicts.
  • CloseApplications=no intentionally removes the competing Windows Restart Manager shutdown path, which previously allowed a blocked process to exit unpredictably even when a helper was supposed to own the lifecycle. Existing RestartApplications=no and one interactive [Run] are preserved, and AppId and private Studio/.smix are unchanged.
  • Isolated Windows Inno smoke now tests 1) update-handshake GUI, 2) old GUI with no handshake (assert WM_CLOSE_SAVED), 3) locked nonresponsive EXE (must fail before copy), plus SHA-256/install/uninstall/Studio sentinel.

Previous test #42421873294 verified the first two paths but the negative test was not deterministic with a cancellable WinForms window; current #42421982731 uses a truly nonresponsive no-window executable as a hard-lock fixture. Do not mark installer release complete until all three cases pass on current exact head.

Coordination: #445 head 8af626a2f14b1463ed014870fbef85ac1563c195 owns device-change mixer retention and MAIN port safety; it must remain intact when #443 changes ConsoleApp startup/shutdown and installer packaging. #444 duplicate remains closed. Main has not been rewritten; don't ship a stale old installer.

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat 2fa18fe

masarray commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

P0 code-5 installer upgrade fix — verified Windows acceptance

Exact PR head: 2fa18fe47109ba3d99a06324d71ce8a943aefe60.

Inno Windows smoke #42421982731 PASS with three independent executable-level cases:

  1. Native-style Local\ArSonMix.InstallShutdown.v1 handshake: INSTALLER_HANDSHAKE_SAVED, old process exits, EXE SHA unchanged after same-path update.
  2. True legacy WinForms ArSonMix.exe with NO handshake event/mutex: installer sends WM_CLOSE, marker WM_CLOSE_SAVED, old process exits, update succeeds, Studio data retained.
  3. Truly nonresponsive existing ArSonMix.exe with NO usable window: installer helper returns 21 after bounded wait, Inno PrepareToInstall exits with code 7 BEFORE [Files], old process remains running, old installed EXE SHA unchanged and Studio/user files survive. Logged INNO_BLOCKED_FAIL_CLOSED_PASS.

Root fix: Restart Manager and the old conditional-only handshake were insufficient. One strict pre-copy lifecycle now sends native event if available, otherwise matches legacy process by exact installed path and requests safe GUI close, waits for process exit, checks exclusive writable EXE handle; CloseApplications=no prevents a competing RM path. Never skips a locked file and never force-kills ArSonMix.

Packaging: exact-SHA Windows MSVC, native CTest and full Inno FAT run #42422158099 is running. Do not advertise a final installable artifact until that run publishes it. Prior installer artifacts are immutable and still lack the new preflight logic.

Cross-thread #445: the latest device-change and retained WIRE/FX/MAIN routing work is separate, overlapping only in src/Main.cpp but in different class sections. Keep both changes on merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant