-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-percona-dk.ps1
More file actions
42 lines (33 loc) · 1.75 KB
/
install-percona-dk.ps1
File metadata and controls
42 lines (33 loc) · 1.75 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
# Percona DK Installer for Windows
# Usage: irm https://raw.githubusercontent.com/Percona-Lab/percona-dk/main/install-percona-dk.ps1 | iex
$ErrorActionPreference = "Stop"
$InstallerUrl = "https://raw.githubusercontent.com/Percona-Lab/percona-dk/main/installer.py"
Write-Host ""
Write-Host "Percona DK Installer" -ForegroundColor White
Write-Host ""
# ── Install uv if needed ───────────────────────────────────────
if (-not (Get-Command uv -ErrorAction SilentlyContinue)) {
Write-Host " Installing uv..." -ForegroundColor Yellow
$uvInstallScript = (Invoke-RestMethod "https://astral.sh/uv/install.ps1")
Invoke-Expression $uvInstallScript
# Refresh PATH for this session
$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") + ";" +
[System.Environment]::GetEnvironmentVariable("PATH", "User")
if (-not (Get-Command uv -ErrorAction SilentlyContinue)) {
Write-Host " uv installed but not in PATH. Please restart your shell and re-run this installer." -ForegroundColor Red
exit 1
}
Write-Host " uv installed." -ForegroundColor Green
}
# ── Download and run the Python installer ─────────────────────
$TmpDir = [System.IO.Path]::GetTempPath() + [System.Guid]::NewGuid().ToString()
New-Item -ItemType Directory -Path $TmpDir | Out-Null
try {
Write-Host " Downloading installer..." -ForegroundColor DarkGray
Invoke-WebRequest -Uri $InstallerUrl -OutFile "$TmpDir\installer.py"
Write-Host " Starting installer..."
Write-Host ""
uv run --python 3.12 "$TmpDir\installer.py"
} finally {
Remove-Item -Recurse -Force $TmpDir -ErrorAction SilentlyContinue
}