Skip to content

fix(installer): resolve Windows installation and upgrade failures - #208

Merged
iuyo5678 merged 7 commits into
mainfrom
fix/windows-installer-architecture
Sep 10, 2026
Merged

fix(installer): resolve Windows installation and upgrade failures#208
iuyo5678 merged 7 commits into
mainfrom
fix/windows-installer-architecture

Conversation

@iuyo5678

@iuyo5678 iuyo5678 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Windows installation can fail to detect an x64 machine or download a ZIP into a temporary directory containing brackets. Upgrades can continue to use an older CLI or daemon, and ARM64 installation can request an archive that the release does not publish.

The installer now:

  • Reads Windows architecture environment variables and requires a manifest entry before downloading an ARM64 package. Missing ARM64 packages fail clearly before download; this does not add native Windows ARM64 support. Pinned x64 releases retain compatibility with missing manifests.
  • Uses literal filesystem APIs throughout: HTTP responses are saved with File.WriteAllBytes using the raw response bytes, directories are created with Directory.CreateDirectory, and checksum checks and cleanup use -LiteralPath. ZIP extraction uses .NET to avoid Windows PowerShell 5.1's wildcard destination handling. New-Item has no -LiteralPath parameter.
  • Uses the downloaded CLI to stop the daemon before either creating or replacing the installation. Both cases fail closed if stop fails, leave daemon metadata untouched, and remove staged files. The error identifies daemon.json under the current BSK_HOME (or the default user home) and tells the user to stop any running daemon, remove that file, and retry. Fresh installations no longer report a daemon restart.
  • Places the installation directory first in session and user PATH, removing duplicate entries for that directory while preserving other entries. Command checks explicitly cover only the current session; the final message warns that Machine PATH entries or aliases can still take precedence in a new terminal and asks the user to verify Get-Command bsk -All there.

Changes are limited to install.ps1 and its regression tests.

Validation:

  • The Main-flow fixture now serves a real ZIP over loopback HTTP. It only redirects the request URL; the native Invoke-WebRequest and production disk-writing code run unchanged. It no longer substitutes File.Copy for the download.
  • Red: Windows PowerShell 5.1 CI at defa542 fails in the real Invoke-WebRequest -OutFile call with FileOpenFailure for temp [literal], before checksum verification.
  • Green: CI at f995620 passes the full installer suite with real HTTP downloads and production disk writes on both Windows PowerShell 5.1 and PowerShell 7.
  • Real daemon tests cover replacement and new-directory installation, failed-stop cleanup, the reported recovery path, and fresh-install output. Main-flow tests cover command precedence and the new-terminal warning, bracketed paths, missing/listed ARM64 packages, pinned legacy x64 releases, and checksum failure cleanup.
  • Local PowerShell 7.6.6 helper tests pass. A real loopback HTTP probe using the production write statements preserves all 256 byte values in a bracketed destination.
  • git diff --check passes.

@iuyo5678 iuyo5678 changed the title fix(installer): detect Windows architecture without RuntimeInformation fix(installer): handle Windows architecture and existing daemons Sep 9, 2026
@iuyo5678 iuyo5678 changed the title fix(installer): handle Windows architecture and existing daemons fix(installer): resolve Windows installation and upgrade failures Sep 9, 2026
@iuyo5678
iuyo5678 merged commit 5aaa36b into main Sep 10, 2026
5 checks passed
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.

2 participants