-
-
Notifications
You must be signed in to change notification settings - Fork 69.6k
[Bug]: Install script (install.ps1) forcefully exits PowerShell process on systems without winget (e.g., Windows LTSC) #41797
Description
Bug type
Crash (process/app exits or hangs)
Summary
Problem: The install.ps1 script uses exit 1 in the Install-Node function when a package manager is not found.
Specific Snippet:
# Line 122 in the provided script
Write-Host "Or install winget (App Installer) from the Microsoft Store." -ForegroundColor Gray
exit 1 # <-- Terminates the host processSuggested Fix: Replace exit 1 with return or throw to allow the script to fail gracefully without closing the parent shell.
Steps to reproduce
- Launch
PowerShellon a Windows system where winget is not installed. - Run the official installation command:
iwr -useb https://openclaw.ai/install.ps1 | iex.
The script fails to findwinget, prints the error, and immediately closes the terminal window.
Expected behavior
The script should stop execution upon a missing dependency (like Node.js) but must not terminate the parent PowerShell process. It should print a clear error message and return control to the user, allowing them to inspect the logs or manually install the required components without losing their shell context.
Actual behavior
When winget is missing, the script prints an error message and immediately executes exit 1. Because the script is typically run via iwr | iex, this `exit command kills the entire powershell.exe or pwsh.exe session. The terminal window vanishes instantly, leaving the user with a "silent crash" experience and no way to read the error.
OpenClaw version
Latest (as of the install.ps1 hosted on openclaw.ai).
Operating system
Windows 11 LTSC (or any Windows version without Microsoft Store/winget pre-installed)
Install method
iwr -useb https://openclaw.ai/install.ps1 | iex
Model
N/A (Installer issue).
Provider / routing chain
N/A (Installer issue).
Config file / key location
No response
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response