Skip to content

fix(installer): handle WinAppRuntime 0xC0000142 crash silently — bump to 1.0.16#37

Merged
pexatar merged 1 commit into
mainfrom
fix/wappsdk-installer-error
May 14, 2026
Merged

fix(installer): handle WinAppRuntime 0xC0000142 crash silently — bump to 1.0.16#37
pexatar merged 1 commit into
mainfrom
fix/wappsdk-installer-error

Conversation

@pexatar

@pexatar pexatar commented May 14, 2026

Copy link
Copy Markdown
Owner

Bug

WindowsAppRuntimeInstall-x64.exe crashes with STATUS_DLL_INIT_FAILED (0xC0000142)
on systems where Windows App Runtime 1.8 is already installed. When launched from the
[Run] section, Inno Setup spawns the process normally and the OS-level crash dialog
appears before Inno Setup can handle the failure.

Root cause

0xC0000142 = STATUS_DLL_INIT_FAILED — the EXE's own DLL initialization fails
at process startup. This happens when a side-by-side manifest dependency that the
runtime installer needs can't be loaded (typically because the runtime is already
present and the install environment is inconsistent). The EXE never reaches main().

Fix

Moved the runtime bootstrap from [Run] to a [Code] Pascal Script function
TryInstallWindowsAppRuntime():

  • Uses Exec() which catches launch failures before the OS shows any dialog
  • If Exec() returns false (process couldn't start): logs the error silently,
    assumes runtime already installed, continues without blocking the user
  • If Exec() returns exit code 0 or 0x80073D21 (already registered): success
  • Any other exit code: logged as warning, installation continues

Called from CurStepChanged(ssPostInstall) after all files are in place.

Version bump

  • PassKey.Desktop.csproj: 1.0.151.0.16
  • Installer/PassKey.iss: 1.0.151.0.16

🤖 Generated with Claude Code

Problem: WindowsAppRuntimeInstall-x64.exe crashes with STATUS_DLL_INIT_FAILED
(0xC0000142) on systems where Windows App Runtime 1.8 is already installed.
Running it from [Run] causes a visible error dialog during installation.

Fix: Move the runtime bootstrap from [Run] to a [Code] Pascal Script function
(TryInstallWindowsAppRuntime) that uses Exec() instead of direct [Run] entry.
Exec() captures the launch failure silently and logs it — no dialog shown.
If the runtime is already installed (the common case on Windows 10/11),
PassKey installs cleanly without any error prompts.

Also bumps versions to 1.0.16:
- PassKey.Desktop.csproj: Version/AssemblyVersion/FileVersion → 1.0.16
- Installer/PassKey.iss: AppVersion → 1.0.16
(keeps exe self-reported version in sync with GitHub release tag)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pexatar pexatar merged commit d35de88 into main May 14, 2026
1 check passed
@pexatar pexatar deleted the fix/wappsdk-installer-error branch May 14, 2026 14:26
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