Skip to content

fix(bootstrap): retry the Windows extraction elsewhere when innoextract cannot write - #190

Merged
Zaldaryon merged 1 commit into
mainfrom
fix/extract-cfa-8dot3
Oct 30, 2026
Merged

Zaldaryon merged 1 commit into
mainfrom
fix/extract-cfa-8dot3

Conversation

@Zaldaryon

Copy link
Copy Markdown
Collaborator

Follow-up to #189. The preflight there creates the deepest installer path from PowerShell, so it cannot see blocks that judge innoextract.exe itself, such as Controlled Folder Access. This change handles that case instead of stopping the install.

What changes on Windows:

  • A staging directory inside a folder that Controlled Folder Access protects is skipped while the feature is blocking (registry value 1). The protected set is Documents, Pictures, Videos, Music, Desktop and Favorites for the user and Public, plus folders added in Windows Security. The state is read from the registry because Get-MpPreference needs a running Defender service and, for the folder list, admin rights.
  • bootstrap.ps1 runs the extraction through Invoke-ExtractWithStageFallback. When innoextract exits non-zero, the staging directory is removed and the next location is tried, up to three attempts. If all fail, the error lists each location with its exit code. With Controlled Folder Access on, it also names the Windows Security page (Ransomware protection, Allow an app through Controlled folder access) and the innoextract.exe path to allow.
  • Staging candidates that differ only by a trailing separator are one entry. The temp folder and its 8.3 form were listed twice when the user name is short enough that the 8.3 form is the same path.
  • scripts/tests/extract-stage-root.ps1 left optimum-ix-* directories in the temp folder after each run. It now removes them.

Testing, on Windows 11:

  • scripts/tests/extract-stage-root.ps1 passes under Windows PowerShell 5.1 and PowerShell 7. The new checks cover Controlled Folder Access at 0, 1, 2 and unreadable, protected-folder matching (including a sibling with a shared name prefix), retry order, the attempt limit, cleanup of failed attempts, and the first-attempt error keeping its -VanillaDir advice. Removing the protected-folder skip, the retry, or the exclusion list each makes the suite fail.
  • bootstrap.ps1 ran end to end under both hosts against the cached 1.22.7 installer: 122 patches applied, 0 failed, no staging directory left behind.
  • With Invoke-ExtractWithStageFallback and the real innoextract 1.13.0, a simulated block on the temp folder made the first attempt fail and the second extract all 20,096 files under D:\.

Not covered: I could not turn Controlled Folder Access on (no admin rights, Defender service not answering), so the block was simulated and the registry read was only checked against an absent key. The 8.3 check in the test is skipped on volumes without 8.3 names, which includes the one I tested on, so the Windows CI run is the first place it executes.

…ct cannot write

The preflight probe runs as PowerShell, so it cannot see blocks that judge innoextract.exe, such as Controlled Folder Access. Staging directories inside a folder that Controlled Folder Access protects are now skipped while it blocks, and a failed extraction is retried in the next staging location (up to three attempts) before the install stops. The final error lists each location and, with Controlled Folder Access on, names the Windows Security setting and the extractor to allow.

Candidate staging parents that differ only by a trailing separator, such as the temp folder and its unshortened 8.3 form, are now one entry. The staging test no longer leaves optimum-ix-* directories in the temp folder, and it covers the new behavior.
@Zaldaryon
Zaldaryon marked this pull request as ready for review October 30, 2026 19:20
@Zaldaryon
Zaldaryon merged commit fb8d681 into main Oct 30, 2026
14 checks passed
@Zaldaryon
Zaldaryon deleted the fix/extract-cfa-8dot3 branch October 30, 2026 21:35
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