more windows tomfoolery
This commit is contained in:
@@ -4,31 +4,17 @@ $winget = Get-Command winget -ErrorAction SilentlyContinue
|
||||
if (!$winget) {
|
||||
Write-Host "Error: winget is not installed." -Foreground Red
|
||||
Write-Host "This script probably will not work without winget." -Foreground Red
|
||||
Write-Host "Run 'Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe' in to install winget." -Foreground Red
|
||||
Write-Host "Run 'Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe' and then search for 'App Installer' on the Microsoft Store to install winget." -Foreground Red
|
||||
Write-Host "If you do install winget, this script should handle the rest." -Foreground Red
|
||||
}
|
||||
|
||||
# Check that python is installed
|
||||
if (-not (Get-Command "python" -ErrorAction SilentlyContinue)) {
|
||||
Write-Host "Error: python is not installed." -Foreground Red
|
||||
|
||||
if ($winget) {
|
||||
Write-Host "Attempting to install python."
|
||||
(winget install --id=Python.Python.3.11 -e) | Out-Null
|
||||
}
|
||||
else {
|
||||
Write-Host "Please install python to continue." -Foreground Red
|
||||
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
|
||||
|
||||
if ($winget) {
|
||||
Write-Host "Attempting to install java."
|
||||
(winget install AdoptOpenJDK.OpenJDK.11) | Out-Null
|
||||
winget install AdoptOpenJDK.OpenJDK.11
|
||||
}
|
||||
else {
|
||||
Write-Host "Please install java to continue." -Foreground Red
|
||||
|
||||
Reference in New Issue
Block a user