-
Notifications
You must be signed in to change notification settings - Fork 136
/
bootstrap.ps1
61 lines (45 loc) · 1.83 KB
/
bootstrap.ps1
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
59
60
61
$windows_sdk_ver = 20348
$build_directory = "c:\build"
$scoop_installer = "install_scoop.ps1";
Write-Host "Downloading Scoop install script..."
Invoke-WebRequest -useb get.scoop.sh -outfile $scoop_installer
if (!(Test-Path -Path $scoop_installer)) {
$fullpath = Join-Path $PWD $scoop_installer
Write-Host "Download failed. $fullpath does not exist."
exit 1
}
Write-Host "Running Scoop install script..."
& ".\$scoop_installer" -RunAsAdmin
try {
scoop help
} catch {
Write-Host "A Scoop error occured. Probably hasn't installed correctly. $($_.Exception.Message)"
exit 1
}
Write-Host "Installing essential apps via Scoop"
scoop install git
scoop bucket add versions
scoop install python310 nodejs18 cmake yarn
Write-Host "Downloading Visual Studio Build Tools..."
Invoke-WebRequest -Uri 'https://aka.ms/vs/17/release/vs_BuildTools.exe' -OutFile "$env:TEMP\vs_BuildTools.exe"
# no scoop installer for vs build tools because there are too many options
Start-Process -FilePath "$env:TEMP\vs_BuildTools.exe" -ArgumentList `
"--passive", "--wait",
"--add Microsoft.VisualStudio.Workload.VCTools",
"--includeRecommended",
"--add Microsoft.NetCore.Component.Runtime.6.0",
"--add Microsoft.NetCore.Component.SDK",
"--add Microsoft.VisualStudio.Component.VC.ATL",
"--add Microsoft.VisualStudio.Component.Windows10SDK.$windows_sdk_ver",
"--remove Microsoft.VisualStudio.Component.VC.CMake.Project" `
-Wait `
-PassThru
Write-Host "Cloning and Building Vortex from GitHub..."
New-Item -ItemType Directory -Force -Path $build_directory
Set-Location $build_directory
& git clone https://github.com/Nexus-Mods/Vortex.git vortex
& yarn config set msvs_version $msvs_ver --global
Set-Location vortex
& yarn install
& yarn run build
Write-Host "Environment setup complete."