Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
578de8f
Inno Setup: gracefully close running mixer, upgrade in-place and auto…
masarray Nov 7, 2026
5e74950
Add real Windows WM_CLOSE fixture to validate in-place installer update
masarray Nov 7, 2026
ee6463b
Windows FAT: exercise running-app graceful WM_CLOSE and verified in-p…
masarray Nov 7, 2026
926b723
Normalize WinForms compiler and fixture paths for Windows CI
masarray Nov 7, 2026
11cdf02
Test Inno smart upgrade, graceful close, single auto-launch and data …
masarray Nov 7, 2026
2380c83
Read installer version from verified CMake source rather than stale 0…
masarray Nov 7, 2026
2be519b
Pass authoritative native CMake 0.5.0 version into the Inno Setup com…
masarray Nov 7, 2026
35b11d1
Assert installer displays CMake-authoritative release candidate version
masarray Nov 7, 2026
c03f3d2
Watch installer WM_CLOSE fixture changes in native CI path selection
masarray Nov 7, 2026
1782151
Use canonical one-separator installed executable path for Inno auto-l…
masarray Nov 7, 2026
5dd2fbe
Introduce small real-Windows Inno update diagnostics without 15-minut…
masarray Nov 7, 2026
7992c76
Run fast targeted Inno Restart Manager upgrade smoke on Windows witho…
masarray Nov 7, 2026
7d6d138
Expose exact Restart Manager failure evidence during real FAT update …
masarray Nov 7, 2026
e451d79
FAT: capture genuine Restart Manager session-close notifications, not…
masarray Nov 7, 2026
0adbeb6
FAT: gate upgrade on cooperative WM_QUERYENDSESSION or WM_ENDSESSION …
masarray Nov 7, 2026
6e9ccb6
FAT: gate upgrade on cooperative WM_QUERYENDSESSION or WM_ENDSESSION …
masarray Nov 7, 2026
37f85d4
FAT: gate upgrade on cooperative WM_QUERYENDSESSION or WM_ENDSESSION …
masarray Nov 7, 2026
fd51f46
Native: message-thread installer shutdown signal saves accepted mixer…
masarray Nov 7, 2026
bf2fdc5
Inno: cooperative saved-session shutdown handshake before in-place up…
masarray Nov 7, 2026
0b1c52e
Windows fixture: simulate native installer event/mutex and assert dur…
masarray Nov 7, 2026
3ac3927
Qualify cooperative installer shutdown marker and exact event/mutex c…
masarray Nov 7, 2026
f90da49
Qualify cooperative installer shutdown marker and exact event/mutex c…
masarray Nov 7, 2026
76a8b06
Qualify cooperative installer shutdown marker and exact event/mutex c…
masarray Nov 7, 2026
f5dbb27
Preview distribution naming: ArSonMix.iss (preserve field-test honesty)
masarray Nov 7, 2026
8bd929f
Preview distribution naming: p1-windows.yml (preserve field-test hone…
masarray Nov 7, 2026
04d8260
Preview distribution naming: package_native_windows.ps1 (preserve fie…
masarray Nov 7, 2026
8dd9a95
Preview distribution naming: build_verify_windows_installer.ps1 (pres…
masarray Nov 7, 2026
c1f556d
Preview distribution naming: collect_hardware_fat_windows.ps1 (preser…
masarray Nov 7, 2026
66a8ebc
Preview distribution naming: m3e_fat_evidence_gate.mjs (preserve fiel…
masarray Nov 7, 2026
68fc486
Preview distribution naming: windows_installer_contract_test.mjs (pre…
masarray Nov 7, 2026
223fe9b
Preview distribution naming: native_artifact_packaging_contract_test.…
masarray Nov 7, 2026
15ed641
Update exact-SHA FAT synthetic fixtures for Preview artifact status w…
masarray Nov 7, 2026
b8f2dc6
Inno running-process Windows smoke resolves newly named Preview setup
masarray Nov 7, 2026
0a48518
Update native packaging regression contract for user-tested Preview d…
masarray Nov 7, 2026
ee223c8
P0 installer legacy-upgrade helper: close only the exact installed Ar…
masarray Nov 7, 2026
ea6d29c
P0 Inno: preflight legacy GUI shutdown and exclusive EXE lock check b…
masarray Nov 7, 2026
d83922a
Use correct single Windows separators in Inno Pascal shutdown path an…
masarray Nov 7, 2026
7f5a22b
Avoid duplicate WM_CLOSE when legacy ArSonMix main window already acc…
masarray Nov 7, 2026
765886f
Windows installer fixture supports legacy GUI without update handshak…
masarray Nov 7, 2026
68f6d8f
Windows fixture simulates legacy busy mixer refusing close to prove f…
masarray Nov 7, 2026
d93686f
Windows Inno acceptance covers actual legacy no-handshake upgrade and…
masarray Nov 7, 2026
5662c7c
Contract-test legacy running mixer close, exact-path PID matching and…
masarray Nov 7, 2026
554fa30
Run isolated Inno Windows smoke when legacy shutdown helper changes
masarray Nov 7, 2026
59ba69a
Installer contract rejects executable force-close commands without mi…
masarray Nov 7, 2026
f9b8964
Point regression assertions to isolated Windows Inno smoke that actua…
masarray Nov 7, 2026
4cc4bc2
Make negative test fixture explicitly report blocked mode and refuse …
masarray Nov 7, 2026
f2223e0
Assert legacy/blocked fixture modes and expose Inno refusal logs for …
masarray Nov 7, 2026
55b8588
Avoid competing Restart Manager auto-close after strict legacy/native…
masarray Nov 7, 2026
964bbb2
Disable Restart Manager override in test_inno_graceful_update_windows…
masarray Nov 7, 2026
4dee1c2
Disable Restart Manager override in build_verify_windows_installer.ps…
masarray Nov 7, 2026
f8ae96d
Require one deterministic graceful shutdown authority; never let RM o…
masarray Nov 7, 2026
2fa18fe
Use deterministic no-window locked EXE to prove installer aborts befo…
masarray Nov 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/inno-upgrade-smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Inno Setup graceful update smoke
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths:
- 'installer/ArSonMix.iss'
- 'installer/ArSonMixUpdateShutdown.ps1'
- 'scripts/build_verify_windows_installer.ps1'
- 'scripts/test_inno_graceful_update_windows.ps1'
- 'tests/fixtures/installer_graceful_close.cs'
- 'tests/windows_installer_contract_test.mjs'
push:
branches: [main]
paths:
- 'installer/ArSonMix.iss'
- 'installer/ArSonMixUpdateShutdown.ps1'
- 'scripts/build_verify_windows_installer.ps1'
- 'scripts/test_inno_graceful_update_windows.ps1'
- 'tests/fixtures/installer_graceful_close.cs'
- 'tests/windows_installer_contract_test.mjs'
permissions:
contents: read
concurrency:
group: inno-upgrade-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
inno-smoke:
runs-on: windows-2022
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Check installer safety and single-launch contracts
run: node --test tests/windows_installer_contract_test.mjs
- name: Prepare Inno Setup 6
shell: pwsh
run: |
if (-not (Get-Command ISCC.exe -ErrorAction SilentlyContinue) -and
-not (Test-Path -LiteralPath 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe')) {
choco install innosetup --yes --no-progress --limit-output
if ($LASTEXITCODE -ne 0) { throw 'Inno Setup compiler installation failed' }
}
- name: Real silent Inno upgrade of running WinForms fixture and Studio retention
shell: pwsh
run: ./scripts/test_inno_graceful_update_windows.ps1
9 changes: 6 additions & 3 deletions .github/workflows/p1-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ on:
- 'scripts/build_verify_windows_installer.ps1'
- 'installer/**'
- 'tests/windows_installer_contract_test.mjs'
- 'tests/fixtures/installer_graceful_close.cs'
- 'scripts/verify_native_windows_artifact.ps1'
- 'scripts/collect_hardware_fat_windows.ps1'
- 'scripts/console_v6_fat_gate.mjs'
Expand Down Expand Up @@ -70,6 +71,7 @@ on:
- 'scripts/build_verify_windows_installer.ps1'
- 'installer/**'
- 'tests/windows_installer_contract_test.mjs'
- 'tests/fixtures/installer_graceful_close.cs'
- 'scripts/verify_native_windows_artifact.ps1'
- 'scripts/collect_hardware_fat_windows.ps1'
- 'scripts/console_v6_fat_gate.mjs'
Expand Down Expand Up @@ -264,16 +266,17 @@ jobs:
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'workflow_dispatch' && inputs.package_fat == true }}
with:
name: ArSonMix-Windows-Installer-UNQUALIFIED-${{ github.run_id }}
name: ArSonMix-Windows-Installer-Preview-${{ github.run_id }}
path: installer-output/
if-no-files-found: error
retention-days: 14
# Optional manual FAT only: never churn experimental ZIPs per commit.
# The unqualified artifact is NOT a stable release or physical audio proof.
# Preview artifact is build/installer verified. Owner physical listening is field evidence,
# distinct from automated exact-SHA hardware performance certification.
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'workflow_dispatch' && inputs.package_fat == true }}
with:
name: ArSonMix-Windows-FAT-UNQUALIFIED-${{ github.run_id }}
name: ArSonMix-Windows-FAT-Preview-${{ github.run_id }}
path: dist/
if-no-files-found: error
retention-days: 14
132 changes: 126 additions & 6 deletions installer/ArSonMix.iss
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
; ArSonMix x64 RC from exact independently verified FAT app, no new DSP or GUI.
; ArSonMix x64 per-user Inno Setup: safe in-place upgrade + single launch.
; Exact independently verified FAT app; no new DSP or GUI.
#ifndef SourceRoot
#error "Supply /DSourceRoot with SHA-verified staging directory"
#endif
#ifndef OutputRoot
#error "Supply /DOutputRoot with destination directory"
#endif
#ifndef SourceAppVersion
#error "Supply /DSourceAppVersion from the authoritative CMake project version"
#endif
[Setup]
AppId=ArSonMix.LiveStudio
AppName=ArSonMix
AppVersion=0.1.0-rc.1
AppVerName=ArSonMix RC (hardware FAT pending)
AppVersion={#SourceAppVersion}
AppVerName=ArSonMix {#SourceAppVersion} Preview
AppPublisher=ArSonMix
AppPublisherURL=https://masarray.github.io/arsonmix/
DefaultDirName={localappdata}\Programs\ArSonMix
Expand All @@ -20,19 +24,135 @@ ArchitecturesInstallIn64BitMode=x64compatible
MinVersion=10.0.17763
WizardStyle=modern
OutputDir={#OutputRoot}
OutputBaseFilename=ArSonMix-Windows-x64-Setup-UNQUALIFIED
OutputBaseFilename=ArSonMix-Windows-x64-Setup-Preview
SetupIconFile={#SourceRoot}\arsonmix-app.ico
UninstallDisplayIcon={app}\ArSonMix.exe
Compression=lzma2
SolidCompression=yes
UsePreviousAppDir=yes
DisableWelcomePage=yes
DisableDirPage=yes
DisableReadyPage=yes
DisableFinishedPage=yes
SetupMutex=ArSonMix.PerUserInstaller.SingleInstance
; Our pre-install shutdown owns the lifecycle for BOTH new and legacy
; releases. Do not let Windows Restart Manager issue a second shutdown or
; force a hung mixer after our fail-closed check. A single controlled
; WM_CLOSE followed by full process exit is required before replacing EXE.
CloseApplications=no
RestartApplications=no
[Files]
; The shutdown helper is EMBEDDED TEMPORARILY in Setup, never installed.
; It handles installed legacy builds that do not implement the new event.
Source: "ArSonMixUpdateShutdown.ps1"; Flags: dontcopy
Source: "{#SourceRoot}\verified-gui.exe"; DestDir: "{app}"; DestName: "ArSonMix.exe"; Flags: ignoreversion
Source: "{#SourceRoot}\BUILD_PROVENANCE.json"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceRoot}\README.md"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceRoot}\FactoryFX\*"; DestDir: "{app}\FactoryFX"; Flags: ignoreversion recursesubdirs createallsubdirs skipifsourcedoesntexist
[Icons]
Name: "{autoprograms}\ArSonMix"; Filename: "{app}\ArSonMix.exe"; WorkingDir: "{app}"
; No Run or UninstallDelete: do not auto-activate live audio or erase
; AppData Studio. Do not install portable_mode.txt.
; Do not create a second copy of an already running mixer. Restart Manager
; preflight closes the prior verified app before [Files]; [Run] launches exactly
; 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

; Never delete private Studio data on install/update/uninstall; never install
; portable_mode.txt or silently ARM an audio output.

; Upgrade preflight operates BEFORE [Files]: save+close native apps, support
; legacy versions with no shutdown handshake, verify the EXE is replaceable.
; Never force-terminate, never skip an occupied file, and never erase Studio.
[Code]
function OpenEventW(Access: LongWord; InheritHandle: Boolean; Name: string): THandle;
external 'OpenEventW@kernel32.dll stdcall';
function SignalEvent(EventHandle: THandle): Boolean;
external 'SetEvent@kernel32.dll stdcall';
function CloseWinHandle(EventHandle: THandle): Boolean;
external 'CloseHandle@kernel32.dll stdcall';
function OpenExclusiveFile(Path: string; DesiredAccess, ShareMode: LongWord;
SecurityAttributes: LongWord; CreationDisposition, Flags: LongWord;
Template: THandle): THandle;
external 'CreateFileW@kernel32.dll stdcall';

function InstalledExeReplaceable(Path: string): Boolean;
var
H: THandle;
begin
if not FileExists(Path) then
begin
Result := True;
Exit;
end;
{ Require read/write on the target and forbid sharing while we check.
A loaded image, other process handle, filesystem permissions or AV
quarantine must prevent installation before any user files are changed. }
H := OpenExclusiveFile(Path, $C0000000, 0, 0, 3, $80, 0);
Result := H <> THandle(-1);
if Result then
CloseWinHandle(H);
end;

function PrepareToInstall(var NeedsRestart: Boolean): String;
var
Target, HelperPath, PowerShellExe, Params: string;
ShutdownSignal: THandle;
Attempt, ExitCode: Integer;
begin
Result := '';
Target := ExpandConstant('{app}\ArSonMix.exe');
if not FileExists(Target) then
Exit; { first install: there is no existing exe to close }

{ First attempt: updated app receives its OWN graceful GUI-thread quit
event. Never signal on the audio callback or issue terminate/kill. }
ShutdownSignal := OpenEventW($0002, False,
'Local\ArSonMix.InstallShutdown.v1');
if ShutdownSignal <> 0 then
begin
if not SignalEvent(ShutdownSignal) then
begin
CloseWinHandle(ShutdownSignal);
Result := 'ArSonMix could not begin its safe session shutdown. Close the mixer normally and run Setup again. Your Studio files were not changed.';
Exit;
end;
CloseWinHandle(ShutdownSignal);
for Attempt := 1 to 100 do
begin
if not CheckForMutexes('Local\ArSonMix.MixerRunning.v1') then
Break;
Sleep(200);
end;
end;

{ Critical legacy upgrade path: older ArSonMix versions do not own the
event or mutex above. Locate ONLY processes executing the exact
installation path, request WM_CLOSE and wait for the exit of ALL of them.
Doing this explicitly avoids showing Inno's late DeleteFile code 5 UI. }
ExtractTemporaryFile('ArSonMixUpdateShutdown.ps1');
HelperPath := ExpandConstant('{tmp}\ArSonMixUpdateShutdown.ps1');
PowerShellExe := ExpandConstant('{sys}\WindowsPowerShell\v1.0\powershell.exe');
Params := '-NoProfile -NonInteractive -ExecutionPolicy Bypass -File ' +
AddQuotes(HelperPath) + ' -TargetPath ' + AddQuotes(Target) +
' -WaitSeconds 25';
ExitCode := -1;
if not Exec(PowerShellExe, Params, '', SW_HIDE,
ewWaitUntilTerminated, ExitCode) then
begin
Result := 'Unable to check the running ArSonMix process before update. Close ArSonMix normally and run Setup again. No program files were replaced.';
Exit;
end;
if ExitCode <> 0 then
begin
Log('ArSonMix legacy close preflight failed, helper exit=' + IntToStr(ExitCode));
Result := 'ArSonMix is still running or its shutdown could not be verified. Close the mixer normally, save the session, then run Setup again. No program files were replaced.';
Exit;
end;

{ An unrelated process (AV, backup, another plugin host) can still hold
the file even after ArSonMix exits. Test an EXCLUSIVE writable handle
before Inno begins updating anything. Fail closed, no Skip/Retry UI. }
if not InstalledExeReplaceable(Target) then
Result := 'ArSonMix.exe is still locked or Windows does not permit replacement. Close any running mixer, check Windows access permissions and retry Setup. Your Studio data and existing executable were not modified.';
end;
92 changes: 92 additions & 0 deletions installer/ArSonMixUpdateShutdown.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# SPDX-License-Identifier: AGPL-3.0-only
# Inno-only preflight for UPGRADES FROM OLDER ARSONMIX VERSIONS.
# Never ships into the installed program directory. Never kills a process.
# Only sends WM_CLOSE to top-level windows whose owning process image is
# the EXACT ArSonMix.exe path being replaced. Other ArSonMix copies are safe.
param(
[Parameter(Mandatory=$true)][string]$TargetPath,
[ValidateRange(1,90)][int]$WaitSeconds=25
)
Set-StrictMode -Version Latest
$ErrorActionPreference='Stop'
try {
$target=[System.IO.Path]::GetFullPath($TargetPath).TrimEnd([char]'\')
$name=[System.IO.Path]::GetFileNameWithoutExtension($target)
if($name -ne 'ArSonMix'){exit 30}
# Start with the native .NET process list, no taskkill, broad WM_CLOSE
# broadcasts, WMI process termination, or process-name-only shutdown.
function Get-TargetProcesses {
$found=@()
foreach($process in [System.Diagnostics.Process]::GetProcessesByName('ArSonMix')) {
try {
$path=$process.MainModule.FileName
if([string]::IsNullOrWhiteSpace($path)){
throw 'No process image path'
}
$path=[System.IO.Path]::GetFullPath($path)
if([string]::Equals($path,$target,[System.StringComparison]::OrdinalIgnoreCase)) {
$found+=,$process
} else {
$process.Dispose()
}
} catch {
# Windows may restrict MainModule even for a readable name.
# Do not guess identity and NEVER close by process name only.
$process.Dispose()
}
}
return @($found)
}
$matches=@(Get-TargetProcesses)
if($matches.Count -eq 0){exit 0}
# Some JUCE versions have an ownerless top-level HWND; CloseMainWindow
# alone reports false. Match HWND -> PID before posting WM_CLOSE.
Add-Type -TypeDefinition @'
using System;
using System.Runtime.InteropServices;
public static class ArSonMixInstallerWindowShutdown {
private delegate bool EnumProc(IntPtr hwnd, IntPtr unused);
[DllImport("user32.dll", SetLastError=true)]
private static extern bool EnumWindows(EnumProc callback, IntPtr unused);
[DllImport("user32.dll")]
private static extern uint GetWindowThreadProcessId(IntPtr hwnd, out uint pid);
[DllImport("user32.dll", SetLastError=true)]
private static extern bool PostMessage(IntPtr hwnd, uint message, IntPtr w, IntPtr l);
public static int CloseTopLevelWindows(int targetPid) {
int requested=0;
EnumWindows(delegate(IntPtr hwnd, IntPtr unused) {
uint owner;
GetWindowThreadProcessId(hwnd,out owner);
if(owner==(uint)targetPid && PostMessage(hwnd,0x0010,IntPtr.Zero,IntPtr.Zero))
++requested;
return true;
},IntPtr.Zero);
return requested;
}
}
'@ -ErrorAction Stop | Out-Null
foreach($process in $matches) {
try {
# JUCE handles WM_CLOSE on its message thread and can save session.
$mainWindowWasNotified=$process.CloseMainWindow()
if(-not $mainWindowWasNotified) {
$null=[ArSonMixInstallerWindowShutdown]::CloseTopLevelWindows($process.Id)
}
} finally {$process.Dispose()}
}
$end=[DateTime]::UtcNow.AddSeconds($WaitSeconds)
do {
Start-Sleep -Milliseconds 125
$live=@(Get-TargetProcesses)
$count=$live.Count
foreach($process in $live){$process.Dispose()}
if($count -eq 0){exit 0}
} while([DateTime]::UtcNow -lt $end)
# A modal unsaved-edit prompt or hung mixer must remain untouched.
# Installer aborts BEFORE opening the target EXE for replacement.
exit 21
} catch {
# Fail closed: the installer will not attempt to replace a possibly
# locked executable after an unverified shutdown operation.
exit 22
}
Loading
Loading