|
| 1 | +$JAVA_VERSION='21.0.6.7' |
| 2 | +$NODEJS_VERSION='22.16.0' |
| 3 | + |
| 4 | +$GOLANG_BOOTSTRAPPER_VERSION='2.29' |
| 5 | +$P4_VERSION='25.1' |
| 6 | +$ANT_VERSION='1.10.15' |
| 7 | +$NANT_VERSION='0.92' |
| 8 | + |
| 9 | +# Copy over configs |
| 10 | +New-Item "${env:USERPROFILE}\.gradle" -ItemType Directory | Out-Null |
| 11 | +New-Item "${env:USERPROFILE}\.m2" -ItemType Directory | Out-Null |
| 12 | +New-Item "${env:USERPROFILE}\.bundle" -ItemType Directory | Out-Null |
| 13 | + |
| 14 | +Copy-Item "$PSScriptroot\bundle-config" "${env:USERPROFILE}\.bundle\config" |
| 15 | +Copy-Item "$PSScriptroot\gitconfig-windows" "${env:USERPROFILE}\.gitconfig" |
| 16 | +Copy-Item "$PSScriptroot\init.gradle" "${env:USERPROFILE}\.gradle\init.gradle" |
| 17 | +Copy-Item "$PSScriptroot\npmrc" "${env:USERPROFILE}\.npmrc" |
| 18 | +Copy-Item "$PSScriptroot\settings.xml" "${env:USERPROFILE}\.m2\settings.xml" |
| 19 | + |
| 20 | +function Winget-Install { |
| 21 | + winget install --accept-source-agreements --accept-package-agreements --disable-interactivity @args |
| 22 | +} |
| 23 | + |
| 24 | +function PrefixToSystemAndCurrentPath { |
| 25 | + param ( |
| 26 | + [Parameter(Mandatory=$true)] |
| 27 | + [string]$PathPrefix |
| 28 | + ) |
| 29 | + $newSystemPath = "$PathPrefix;" + [System.Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine) |
| 30 | + $env:Path = $newSystemPath + ";" + [System.Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::User) |
| 31 | + [Environment]::SetEnvironmentVariable("Path", $newSystemPath, [EnvironmentVariableTarget]::Machine) |
| 32 | +} |
| 33 | + |
| 34 | +# install winget |
| 35 | +Get-WindowsOptionalFeature -Online | ? FeatureName -like *winget* |
| 36 | + |
| 37 | +# install packages |
| 38 | +Winget-Install OpenJS.NodeJS.LTS --version="${NODEJS_VERSION}" |
| 39 | +corepack enable |
| 40 | +yarn --version |
| 41 | + |
| 42 | +Winget-Install EclipseAdoptium.Temurin.21.JDK --version="${JAVA_VERSION}" |
| 43 | + |
| 44 | +Winget-Install Git.Git Mercurial.Mercurial Slik.Subversion Google.Chrome |
| 45 | +git config --global core.autocrlf false |
| 46 | + |
| 47 | +Winget-Install RubyInstallerTeam.RubyWithDevKit.3.2 |
| 48 | +ridk install 2 3 # Update packages and install development toolchain |
| 49 | + |
| 50 | +# install p4 client and p4d / helix-core-server |
| 51 | +New-Item "${env:ProgramFiles}\\Perforce\\bin\\" -ItemType Directory | Out-Null |
| 52 | +PrefixToSystemAndCurrentPath("${env:ProgramFiles}\\Perforce\\bin") |
| 53 | +Invoke-WebRequest https://cdist2.perforce.com/perforce/r$P4_VERSION/bin.ntx64/p4.exe -Outfile "${env:ProgramFiles}\\Perforce\\bin\\p4.exe" |
| 54 | +Invoke-WebRequest https://cdist2.perforce.com/perforce/r$P4_VERSION/bin.ntx64/p4d.exe -Outfile "${env:ProgramFiles}\\Perforce\\bin\\p4d.exe" |
| 55 | + |
| 56 | +# Install ant |
| 57 | +Invoke-WebRequest https://dlcdn.apache.org//ant/binaries/apache-ant-${ANT_VERSION}-bin.zip -Outfile "${env:TEMP}\\ant.zip" |
| 58 | +Expand-Archive -Path "${env:TEMP}\\ant.zip" -DestinationPath "C:\\tools" |
| 59 | +PrefixToSystemAndCurrentPath("C:\\tools\\apache-ant-${ANT_VERSION}\\bin") |
| 60 | +Remove-Item "${env:TEMP}\\ant.zip" -Force |
| 61 | + |
| 62 | +# Install nant |
| 63 | +Invoke-WebRequest https://onboardcloud.dl.sourceforge.net/project/nant/nant/${NANT_VERSION}/nant-${NANT_VERSION}-bin.zip?viasf=1 -Outfile "${env:TEMP}\\nant.zip" |
| 64 | +Expand-Archive -Path "${env:TEMP}\\nant.zip" -DestinationPath "C:\\tools" |
| 65 | +PrefixToSystemAndCurrentPath("C:\\tools\\nant-${NANT_VERSION}\\bin") |
| 66 | +Remove-Item "${env:TEMP}\\nant.zip" -Force |
| 67 | + |
| 68 | +# install gocd bootstrapper |
| 69 | +Invoke-WebRequest https://github.com/gocd-contrib/gocd-golang-bootstrapper/releases/download/${GOLANG_BOOTSTRAPPER_VERSION}/go-bootstrapper-${GOLANG_BOOTSTRAPPER_VERSION}.windows.amd64.exe -Outfile C:\\go-agent.exe |
| 70 | + |
| 71 | +Add-LocalGroupMember -Group "Administrators" -Member "ContainerAdministrator" |
0 commit comments