A set of PowerShell scripts that install a base developer environment and multiple languages for Windows.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

75 lines
3.7 KiB

Write-Warning "You must run have the MOST RECENT WINGET."
Write-Warning "winget --version"
Write-Warning "winget install which"
Write-Warning "Before running this script. If you see errors below then CTRL-C to abort."
which which
Read-Host -Prompt "Press any key to continue, or CTRL-C to abort" | Out-Null
$installs=@(
'Geany.Geany',
'Git.Git',
'Genivia.ugrep',
'Microsoft.WindowsTerminal',
'Microsoft.VCRedist.2015+.x64'
)
Write-Warning "About to install the following software:"
Write-Warning "-----------------------------------------"
foreach($pkg in $installs) { Write-Host $pkg }
Write-Warning "-----------------------------------------"
Write-Warning "This will use winget to do the installs. If you already have this software installed then winget should only upgrade them. If you don't want this then abort now."
Read-Host -Prompt "Press any key to continue, or CTRL-C to abort" | Out-Null
foreach($pkg in $installs) {
Start-Process -NoNewWindow -Wait winget -ArgumentList 'install',$pkg
}
$winlibsPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$env:APPDATA\..\Local\Programs\WinLibs")
if(Test-Path -Path $winlibsPath) {
Write-Warning "#=========================================================#"
Write-Warning "!! The directory $winlibsPath already exists, which means"
Write-Warning "!! you already have winlibs installed. Here's the version:"
cat "$winlibsPath\mingw64\version_info.txt"
Write-Warning "#=========================================================#"
Write-Warning "Here's the version that Winget will install:"
winget search BrechtSanders.WinLibs.POSIX.UCRT.LLVM
Write-Warning "--- If you want me to replace your install with this version, then stop and"
Write-Warning "delete the $winlibsPath directory before hitting ENTER to continue."
Write-Warning "!!! If you do NOT want to replace this directory then hit CTRL-C now."
Read-Host -Prompt "Press any key to continue, or CTRL-C to abort" | Out-Null
}
Write-Warning "!! Installing WinLibs in $winlibsPath"
Write-Warning "This has to be installed this way because winget won't add it to the path so I have to do it manually. If you don't want this, then hit CTRL-C and install WinLibs yourself."
Read-Host -Prompt "Press any key to continue, or CTRL-C to abort" | Out-Null
winget install --location "$winlibsPath" -e BrechtSanders.WinLibs.POSIX.UCRT.LLVM
if($env:PATH.contains($winlibsPath)) {
Write-Warning "!! Detected $winLibsPath in your PATH. Will not update your PATH."
Write-Warning "!! This is probably because you already installed it. You'll have"
Write-Warning "!! to manually remove this part of your path if you want to change it."
Write-Warning "!! But, it will probably still work since that's where I installed it."
} else {
$newPath = $env:PATH + ";$winlibsPath\mingw64\bin"
[Environment]::SetEnvironmentVariable("Path", $newPath, "User")
}
$gitPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$env:APPDATA\..\Local\Programs\Git\cmd")
Write-Warning "============= GIT CHECK ==========="
if($env:PATH.contains($gitPath)) {
Write-Host "!! Looks like your git installed correctly, but if it fails to run then uninstall it with 'winget remove git.git' then install it again with 'winget install git.git'"
} else {
Write-Warning "!! Git.Git did not add itself to the Path. The directory $gitPath is missing so I'll add it now."
$newPath = $env:PATH + ";$gitPath"
[Environment]::SetEnvironmentVariable("Path", $newPath, "User")
Write-Host "!!!!!!!! You should get the pathfixer.ps1 script to attempt to force $gitPath into the user PATH."
Write-Host "You do this the same way you got this script, just replace base.ps1 with pathfixer.ps1"
}