Repository navigation
Expand file tree
/
Copy pathinstall.ps1
More file actions
executable file
·64 lines (55 loc) · 1.9 KB
/
Copy pathinstall.ps1
File metadata and controls
executable file
·64 lines (55 loc) · 1.9 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
# install.ps1 — Quick installer for msgcli on Windows
# Usage: irm https://msgcli.org/install.ps1 | iex
$ErrorActionPreference = "Stop"
$REPO = if ($env:MSGCLI_REPO) { $env:MSGCLI_REPO } else { "https://github.com/msgcli/msgcli" }
function Find-Python {
$candidates = @("python", "python3", "py")
foreach ($cmd in $candidates) {
$found = Get-Command $cmd -ErrorAction SilentlyContinue
if ($found) {
return $found.Source
}
}
return $null
}
function Check-Python($python) {
try {
& $python -c "import sys; assert sys.version_info >= (3, 9)" 2>$null
if ($LASTEXITCODE -ne 0) {
$ver = & $python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))" 2>$null
Write-Host "Error: Python >= 3.9 is required (found $ver)" -ForegroundColor Red
exit 1
}
} catch {
Write-Host "Error: Python >= 3.9 is required" -ForegroundColor Red
exit 1
}
}
function Check-Pip($python) {
& $python -m pip --version 2>$null | Out-Null
if ($LASTEXITCODE -ne 0) {
Write-Host "Error: pip is not installed" -ForegroundColor Red
exit 1
}
}
function Install {
$python = Find-Python
if (-not $python) {
Write-Host "Error: python is not installed" -ForegroundColor Red
exit 1
}
Check-Python $python
Check-Pip $python
Write-Host "Installing msgcli..."
& $python -m pip install --upgrade "git+${REPO}.git"
& $python -m pip install --upgrade cryptography
Write-Host ""
Write-Host "msgcli installed successfully!" -ForegroundColor Green
Write-Host ""
Write-Host "Quick start:"
Write-Host " msg <username> # Hybrid mode (server + client)"
Write-Host " msg user@host # Client connect and chat"
Write-Host " msg --server # Server mode"
Write-Host "For more details, visit https://msgcli.org"
}
Install