Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

1.5 KB
Raw Blame
#!/usr/bin/env pwsh
# Windows install script for Jan app

param(
    [string]$IsNightly = "false"
)

$installerPath = "$env:TEMP\jan-installer.exe"
$isNightly = [System.Convert]::ToBoolean($IsNightly)

Write-Host "Installing Jan app..."
Write-Host "Is nightly build: $isNightly"

# Try silent installation first
try {
    Start-Process -FilePath $installerPath -ArgumentList "/S" -Wait -NoNewWindow
    Write-Host "Jan app installed silently"
}
catch {
    Write-Host "Silent installation failed, trying normal installation..."
    Start-Process -FilePath $installerPath -Wait -NoNewWindow
}

# Wait a bit for installation to complete
Start-Sleep -Seconds 10

Write-Host "[INFO] Waiting for Jan app first initialization (120 seconds)..."
Write-Host "This allows Jan to complete its initial setup and configuration"
Start-Sleep -Seconds 120
Write-Host "[SUCCESS] Initialization wait completed"

# Verify installation based on nightly flag
if ($isNightly) {
    $defaultJanPath = "$env:LOCALAPPDATA\Programs\jan-nightly\Jan-Desktop-nightly.exe"
    $processName = "Jan-Desktop-nightly.exe"
} else {
    $defaultJanPath = "$env:LOCALAPPDATA\Programs\jan\Jan-Desktop.exe"
    $processName = "Jan-Desktop.exe"
}

if (Test-Path $defaultJanPath) {
    Write-Host "Jan app installed successfully at: $defaultJanPath"
    Write-Output "JAN_APP_PATH=$defaultJanPath" >> $env:GITHUB_ENV
    Write-Output "JAN_PROCESS_NAME=$processName" >> $env:GITHUB_ENV
} else {
    Write-Warning "Jan app not found at expected location: $defaultJanPath"
    Write-Host "Will auto-detect during test run"
}