Repository navigation
Expand file tree
/
Copy pathRun_VM_Manager.ps1
More file actions
58 lines (50 loc) · 2.16 KB
/
Copy pathRun_VM_Manager.ps1
File metadata and controls
58 lines (50 loc) · 2.16 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
# VM Manager Launcher - PowerShell Script
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$pythonExe = Join-Path $scriptDir ".venv\Scripts\pythonw.exe"
$appDir = Join-Path $scriptDir "app"
Write-Host "================================================" -ForegroundColor Cyan
Write-Host " Antidetect Hyper-V Manager - Launcher" -ForegroundColor Cyan
Write-Host "================================================" -ForegroundColor Cyan
Write-Host ""
# Check for virtual env
if (-not (Test-Path $pythonExe)) {
Write-Host "[ERROR] Virtual Environment (.venv) not found!" -ForegroundColor Red
Write-Host ""
Write-Host "Please run the installer first:" -ForegroundColor Yellow
Write-Host " 1. Double-click: install.bat" -ForegroundColor White
Write-Host ""
Write-Host "OR run manually in PowerShell:" -ForegroundColor Yellow
Write-Host " python -m venv .venv" -ForegroundColor White
Write-Host " .venv\Scripts\pip install -r requirements.txt" -ForegroundColor White
Write-Host ""
Read-Host "Press Enter to exit"
exit 1
}
Write-Host "[OK] Virtual environment found" -ForegroundColor Green
Write-Host "[INFO] Starting VM Manager..." -ForegroundColor Yellow
Write-Host ""
# Set working directory
Set-Location $appDir
# Launch Python directly (no admin required for UI)
$processStartInfo = New-Object System.Diagnostics.ProcessStartInfo
$processStartInfo.FileName = $pythonExe
$processStartInfo.Arguments = "main.py"
$processStartInfo.WorkingDirectory = $appDir
$processStartInfo.UseShellExecute = $true
$processStartInfo.Verb = "runas"
try {
[System.Diagnostics.Process]::Start($processStartInfo)
Write-Host "[OK] Application started successfully!" -ForegroundColor Green
} catch {
Write-Host "[ERROR] Failed to start application." -ForegroundColor Red
Write-Host ""
Write-Host "Troubleshooting:" -ForegroundColor Yellow
Write-Host " - Right-click and select 'Run with PowerShell'"
Write-Host " - Make sure Python is installed correctly"
Write-Host " - Try running manually: .venv\Scripts\python.exe app\main.py"
Write-Host ""
Read-Host "Press Enter to exit"
exit 1
}
Write-Host ""
Start-Sleep -Seconds 2