-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
77 lines (69 loc) · 2.11 KB
/
install.ps1
File metadata and controls
77 lines (69 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
$ErrorActionPreference = "Stop"
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$forwardedArgs = @($args)
$runner = (Get-Process -Id $PID).Path
$hasQwen = Test-Path (Join-Path (Join-Path $scriptDir "scripts") "install-qwen.ps1")
if (-not $runner) {
if ($PSVersionTable.PSEdition -eq "Core") {
$runner = "pwsh"
} else {
$runner = "powershell"
}
}
function Invoke-ChildInstaller {
param(
[Parameter(Mandatory = $true)]
[string]$ScriptName
)
$scriptPath = Join-Path (Join-Path $scriptDir "scripts") $ScriptName
& $runner -File $scriptPath @forwardedArgs
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
}
Write-Host "What to install?"
Write-Host "Production installs:"
Write-Host " 1) Codex pack"
Write-Host " 2) Claude Code"
Write-Host " 3) Codex + Claude (default production install)"
Write-Host "Example integrations:"
Write-Host " 4) Gemini CLI (WEAK MODEL / NOT RECOMMENDED)"
if ($hasQwen) {
Write-Host " 5) Qwen (WEAK MODEL / NOT RECOMMENDED)"
Write-Host "Select 1, 2, 3, 4, or 5 [default: 3]: " -NoNewline
} else {
Write-Host " Qwen appears here once scripts/install-qwen.ps1 is available."
Write-Host "Select 1, 2, 3, or 4 [default: 3]: " -NoNewline
}
$choice = [Console]::In.ReadLine()
if ($null -eq $choice) {
Write-Error "No selection received."
exit 1
}
$normalizedChoice = $choice.Trim()
if ($normalizedChoice -eq "") {
$normalizedChoice = "3"
}
switch ($normalizedChoice) {
"1" { Invoke-ChildInstaller -ScriptName "install-codex.ps1" }
"2" { Invoke-ChildInstaller -ScriptName "install-claude.ps1" }
"3" {
Invoke-ChildInstaller -ScriptName "install-codex.ps1"
Invoke-ChildInstaller -ScriptName "install-claude.ps1"
}
"4" {
Invoke-ChildInstaller -ScriptName "install-gemini.ps1"
}
"5" {
if ($hasQwen) {
Invoke-ChildInstaller -ScriptName "install-qwen.ps1"
} else {
Write-Error "Invalid selection: $choice"
exit 1
}
}
default {
Write-Error "Invalid selection: $choice"
exit 1
}
}