-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathinstall_languages.ps1
More file actions
105 lines (94 loc) · 4.61 KB
/
install_languages.ps1
File metadata and controls
105 lines (94 loc) · 4.61 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Quick Installation Script for Missing Languages
# Run this in PowerShell as Administrator
Write-Host "=====================================================================" -ForegroundColor Cyan
Write-Host "Installing Missing Language Support for Code Debugger" -ForegroundColor Cyan
Write-Host "=====================================================================" -ForegroundColor Cyan
Write-Host ""
# Check if running as Administrator
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not $isAdmin) {
Write-Host "ERROR: Please run this script as Administrator!" -ForegroundColor Red
Write-Host "Right-click PowerShell and select 'Run as Administrator'" -ForegroundColor Yellow
exit 1
}
# Function to check if command exists
function Test-Command($command) {
try {
if (Get-Command $command -ErrorAction Stop) {
return $true
}
} catch {
return $false
}
}
Write-Host "[1/4] Checking Chocolatey..." -ForegroundColor Yellow
if (-not (Test-Command choco)) {
Write-Host "Installing Chocolatey package manager..." -ForegroundColor Green
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Refresh environment
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
} else {
Write-Host "Chocolatey already installed!" -ForegroundColor Green
}
Write-Host ""
Write-Host "[2/4] Installing PHP..." -ForegroundColor Yellow
if (Test-Command php) {
Write-Host "PHP already installed: $(php --version | Select-Object -First 1)" -ForegroundColor Green
} else {
Write-Host "Installing PHP via Chocolatey..." -ForegroundColor Green
choco install php -y
refreshenv
}
Write-Host ""
Write-Host "[3/4] Installing Ruby..." -ForegroundColor Yellow
if (Test-Command ruby) {
Write-Host "Ruby already installed: $(ruby --version)" -ForegroundColor Green
} else {
Write-Host "Installing Ruby via Chocolatey..." -ForegroundColor Green
choco install ruby -y
refreshenv
}
Write-Host ""
Write-Host "[4/4] Installing .NET SDK (for C#)..." -ForegroundColor Yellow
if (Test-Command dotnet) {
Write-Host ".NET SDK already installed: $(dotnet --version)" -ForegroundColor Green
} else {
Write-Host "Installing .NET SDK via Chocolatey..." -ForegroundColor Green
choco install dotnet-sdk -y
refreshenv
}
Write-Host ""
Write-Host "=====================================================================" -ForegroundColor Cyan
Write-Host "IMPORTANT: Rust Installation" -ForegroundColor Yellow
Write-Host "=====================================================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Rust requires a separate installer. Please follow these steps:" -ForegroundColor White
Write-Host ""
Write-Host "1. Open a new PowerShell window (as regular user, not admin)" -ForegroundColor Green
Write-Host "2. Run this command:" -ForegroundColor Green
Write-Host ""
Write-Host ' Invoke-WebRequest -Uri "https://win.rustup.rs/x86_64" -OutFile "rustup-init.exe"; .\rustup-init.exe' -ForegroundColor Cyan
Write-Host ""
Write-Host "3. Press '1' to proceed with standard installation" -ForegroundColor Green
Write-Host "4. Wait for installation to complete" -ForegroundColor Green
Write-Host "5. Close and reopen PowerShell" -ForegroundColor Green
Write-Host ""
Write-Host "=====================================================================" -ForegroundColor Cyan
Write-Host "Installation Complete!" -ForegroundColor Green
Write-Host "=====================================================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Next Steps:" -ForegroundColor Yellow
Write-Host "1. Install Rust using the instructions above" -ForegroundColor White
Write-Host "2. Close and reopen PowerShell" -ForegroundColor White
Write-Host "3. Verify installations by running: " -ForegroundColor White
Write-Host " php --version" -ForegroundColor Cyan
Write-Host " ruby --version" -ForegroundColor Cyan
Write-Host " dotnet --version" -ForegroundColor Cyan
Write-Host " rustc --version" -ForegroundColor Cyan
Write-Host ""
Write-Host "4. Test the debugger:" -ForegroundColor White
Write-Host " cd <your-project-directory>" -ForegroundColor Cyan
Write-Host " python test_complex_new_languages_success.py" -ForegroundColor Cyan
Write-Host ""