Monorepo for Aesthetic.Computer aesthetic.computer
at main 109 lines 4.9 kB view raw
1# Install UE5 Build Dependencies via CLI 2# Run as Administrator 3 4#Requires -RunAsAdministrator 5 6Write-Host "=========================================" -ForegroundColor Cyan 7Write-Host "Installing UE5 Build Dependencies" -ForegroundColor Cyan 8Write-Host "=========================================" -ForegroundColor Cyan 9Write-Host "" 10 11# Check if running as admin 12$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) 13if (!$isAdmin) { 14 Write-Host "[ERROR] This script must be run as Administrator!" -ForegroundColor Red 15 Write-Host "Right-click PowerShell and select 'Run as Administrator'" -ForegroundColor Yellow 16 exit 1 17} 18 19# 1. Install .NET Framework 4.8 Developer Pack 20Write-Host "Step 1: Installing .NET Framework 4.8 Developer Pack..." -ForegroundColor Yellow 21Write-Host "" 22 23# Check if already installed by looking for reference assemblies 24$netfxRefPath = "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8" 25if (Test-Path $netfxRefPath) { 26 Write-Host "[OK] .NET Framework 4.8 Developer Pack already installed" -ForegroundColor Green 27 Write-Host "" 28} else { 29 Write-Host "[INFO] .NET Framework 4.8 Developer Pack not detected" -ForegroundColor Cyan 30 Write-Host "" 31 Write-Host "Please download and install manually:" -ForegroundColor Yellow 32 Write-Host "" 33 Write-Host " 1. Visit: https://dotnet.microsoft.com/download/dotnet-framework/net48" -ForegroundColor Cyan 34 Write-Host " 2. Download: Developer Pack" -ForegroundColor Cyan 35 Write-Host " 3. Run the installer with default options" -ForegroundColor Cyan 36 Write-Host "" 37 Write-Host "Or use winget:" -ForegroundColor Yellow 38 Write-Host " winget install Microsoft.DotNet.Framework.DeveloperPack_4" -ForegroundColor Gray 39 Write-Host "" 40 41 # Offer to open the download page 42 $openBrowser = Read-Host "Open download page in browser? (Y/n)" 43 if ($openBrowser -ne 'n' -and $openBrowser -ne 'N') { 44 Start-Process "https://dotnet.microsoft.com/download/dotnet-framework/net48" 45 Write-Host "[OK] Browser opened" -ForegroundColor Green 46 } 47 48 Write-Host "" 49 Write-Host "[WARNING] Build will fail without .NET Framework 4.8 Developer Pack" -ForegroundColor Yellow 50 Write-Host "Press any key to continue or Ctrl+C to exit..." -ForegroundColor Gray 51 $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown') 52} 53 54Write-Host "" 55 56# 2. Install MSVC v14.38 Build Tools using VS Installer 57Write-Host "Step 2: Installing MSVC v14.38 Build Tools..." -ForegroundColor Yellow 58Write-Host "" 59 60$vsInstaller = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" 61 62if (!(Test-Path $vsInstaller)) { 63 Write-Host "[WARNING] Visual Studio Installer not found!" -ForegroundColor Yellow 64 Write-Host "Installing Visual Studio Build Tools 2022..." -ForegroundColor Gray 65 66 # Download VS Build Tools bootstrapper 67 $vsBuildToolsUrl = "https://aka.ms/vs/17/release/vs_BuildTools.exe" 68 $vsBuildTools = "$env:TEMP\vs_BuildTools.exe" 69 70 Invoke-WebRequest -Uri $vsBuildToolsUrl -OutFile $vsBuildTools -UseBasicParsing 71 72 # Install VS Build Tools with required components 73 Write-Host "Installing Visual Studio Build Tools (this may take 10-20 minutes)..." -ForegroundColor Gray 74 Start-Process -FilePath $vsBuildTools -ArgumentList ` 75 "--quiet", ` 76 "--wait", ` 77 "--norestart", ` 78 "--add", "Microsoft.VisualStudio.Workload.VCTools", ` 79 "--add", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", ` 80 "--add", "Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64", ` 81 "--add", "Microsoft.VisualStudio.Component.Windows11SDK.22621" ` 82 -Wait 83 84 Remove-Item $vsBuildTools -ErrorAction SilentlyContinue 85} else { 86 Write-Host "Modifying existing Visual Studio installation..." -ForegroundColor Gray 87 88 # Modify existing installation to add MSVC v14.38 89 Start-Process -FilePath $vsInstaller -ArgumentList ` 90 "modify", ` 91 "--installPath", "`"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools`"", ` 92 "--quiet", ` 93 "--norestart", ` 94 "--add", "Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64" ` 95 -Wait 96} 97 98Write-Host "[OK] MSVC v14.38 Build Tools installed" -ForegroundColor Green 99Write-Host "" 100 101Write-Host "=========================================" -ForegroundColor Cyan 102Write-Host "[SUCCESS] Dependencies installed!" -ForegroundColor Green 103Write-Host "=========================================" -ForegroundColor Cyan 104Write-Host "" 105Write-Host "You may need to restart your terminal or computer." -ForegroundColor Yellow 106Write-Host "" 107Write-Host "Next: Try building again:" -ForegroundColor Cyan 108Write-Host " powershell.exe -ExecutionPolicy Bypass -File .\build-false-work.ps1" -ForegroundColor White 109Write-Host ""