34 lines
1.2 KiB
PowerShell
Executable File
34 lines
1.2 KiB
PowerShell
Executable File
# got to the directory where the script is located
|
|
Push-Location $PSScriptRoot
|
|
|
|
# check if winget is installed and if so, set a flag to true
|
|
$winget = Get-Command winget -ErrorAction SilentlyContinue
|
|
|
|
# trust desktop-shortcut.ps1 for good measure
|
|
Unblock-File .\desktop-shortcut.ps1
|
|
|
|
if (!$winget) {
|
|
Write-Host "Error: winget is not installed." -Foreground Red
|
|
Write-Host "This script will not work without winget." -Foreground Red
|
|
Write-Host "Please install winget - trying to open Microsoft Store" -Foreground Yellow
|
|
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
|
|
Start-Process "ms-windows-store://pdp/?ProductId=9NBLGGH4NNS1"
|
|
exit 1
|
|
}
|
|
|
|
# Check that java is installed
|
|
if (-not (Get-Command "C:\Program Files\AdoptOpenJDK\jdk-11.0.11.9-hotspot\bin\java" -ErrorAction SilentlyContinue)) {
|
|
Write-Host "Error: java is not installed." -Foreground Red
|
|
|
|
Write-Host "Attempting to install java."
|
|
winget install AdoptOpenJDK.OpenJDK.11
|
|
}
|
|
|
|
if (-not (Test-Path ".venv")) { python -m venv .venv }
|
|
|
|
. .\.venv\Scripts\Activate.ps1
|
|
|
|
(python -m pip install --upgrade pip) | Out-Null
|
|
(python -m pip install -r requirements.txt) | Out-Null
|
|
|
|
python client.py |