Skip to content

[Bug]: Install script (install.ps1) forcefully exits PowerShell process on systems without winget (e.g., Windows LTSC) #41797

@itshusky01

Description

@itshusky01

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 process

Suggested Fix: Replace exit 1 with return or throw to allow the script to fail gracefully without closing the parent shell.

Steps to reproduce

  1. Launch PowerShell on a Windows system where winget is not installed.
  2. Run the official installation command: iwr -useb https://openclaw.ai/install.ps1 | iex.
    The script fails to find winget, 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:crashProcess/app exits unexpectedly or hangs

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions