Skip to content

Conversation

@ishaksebsib
Copy link
Contributor

@ishaksebsib ishaksebsib commented Oct 2, 2025

Description

helix installation script for Windows

Related Issues

None

Checklist when merging to main

  • No compiler warnings (if applicable)
  • Code is formatted with rustfmt
  • No useless or dead code (if applicable)
  • Code is easy to understand
  • Doc comments are used for all functions, enums, structs, and fields (where appropriate)
  • All tests pass
  • Performance has not regressed (assuming change was not to fix a bug)
  • Version number has been updated in helix-cli/Cargo.toml and helixdb/Cargo.toml

Additional Notes

None

Greptile Overview

Updated On: 2025-10-03 08:17:28 UTC

Summary

This PR adds a PowerShell installation script (`install.ps1`) for Windows users to complement the existing Unix/Linux shell script. The script provides comprehensive functionality to install, uninstall, and manage the Helix CLI on Windows systems.

The implementation follows the same patterns as the existing Unix installer but adapts to Windows-specific requirements:

  • Uses PowerShell's Invoke-WebRequest instead of curl/wget
  • Handles Windows PATH management with registry updates
  • Implements UAC/administrator privilege checks for system installations
  • Supports .exe file extensions and Windows-style path separators
  • Includes robust error handling with try-catch blocks

The script maintains feature parity with the Unix version including checksum verification, progress tracking, version comparison to avoid unnecessary reinstalls, and support for both user and system-wide installations. It also includes backwards compatibility handling for different asset naming formats in GitHub releases.

This change enhances the project's accessibility by providing native Windows installation support, making it easier for Windows developers to get started with HelixDB without requiring WSL or other Unix-like environments.

Important Files Changed

Changed Files
Filename Score Overview
helix-cli/install.ps1 4/5 New PowerShell installation script for Windows with comprehensive install/uninstall functionality, error handling, and Windows-specific adaptations

Sequence Diagram

sequenceDiagram
    participant User
    participant PowerShell as "PowerShell Script"
    participant GitHub as "GitHub API"
    participant FileSystem as "File System"
    participant Environment as "Environment Variables"

    User->>PowerShell: "Execute install.ps1 with parameters"
    
    alt Help requested
        PowerShell->>User: "Display help message and exit"
    else Uninstall requested
        PowerShell->>FileSystem: "Remove helix.exe binary"
        PowerShell->>Environment: "Remove from PATH variable"
        PowerShell->>FileSystem: "Clean up empty directories"
        PowerShell->>User: "Uninstall complete"
    else Install (default)
        PowerShell->>PowerShell: "Detect system architecture"
        PowerShell->>GitHub: "Fetch release information"
        GitHub-->>PowerShell: "Return release data and assets"
        
        alt Force not set and same version exists
            PowerShell->>FileSystem: "Check existing installation"
            PowerShell->>User: "Already up to date message"
        else Install/Reinstall
            PowerShell->>FileSystem: "Create temporary directory"
            PowerShell->>GitHub: "Download helix binary"
            GitHub-->>PowerShell: "Return binary file"
            
            opt Checksum available
                PowerShell->>GitHub: "Download checksum file"
                GitHub-->>PowerShell: "Return checksum"
                PowerShell->>PowerShell: "Verify file integrity"
            end
            
            PowerShell->>FileSystem: "Create install directory"
            PowerShell->>FileSystem: "Move binary to install location"
            PowerShell->>Environment: "Update user PATH variable"
            PowerShell->>PowerShell: "Test installation by running --version"
            PowerShell->>FileSystem: "Clean up temporary files"
            PowerShell->>User: "Installation successful message"
        end
    end
Loading

@xav-db
Copy link
Member

xav-db commented Oct 3, 2025

@greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

# Map amd64 to x86_64 for Rust target format
$rustArch = "x86_64"

# new naming format strting from v2.0.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: 'strting' is misspelled

Suggested change
# new naming format strting from v2.0.2
# new naming format starting from v2.0.2
Prompt To Fix With AI
This is a comment left during a code review.
Path: helix-cli/install.ps1
Line: 143:143

Comment:
**syntax:** 'strting' is misspelled

```suggestion
    # new naming format starting from v2.0.2
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 301 to 302
$pathEntries = $userPath -split ";" | Where-Object { $_ -and $_ -ne $BinPath }
if ($pathEntries -contains $BinPath) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Logic error: filters out the target path then checks if filtered array contains it

Suggested change
$pathEntries = $userPath -split ";" | Where-Object { $_ -and $_ -ne $BinPath }
if ($pathEntries -contains $BinPath) {
$pathEntries = $userPath -split ";" | Where-Object { $_ -and $_ -ne "" }
if ($pathEntries -contains $BinPath) {
Prompt To Fix With AI
This is a comment left during a code review.
Path: helix-cli/install.ps1
Line: 301:302

Comment:
**logic:** Logic error: filters out the target path then checks if filtered array contains it

```suggestion
        $pathEntries = $userPath -split ";" | Where-Object { $_ -and $_ -ne "" }
        if ($pathEntries -contains $BinPath) {
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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