forked from youngwoocho02/unity-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
21 lines (16 loc) · 774 Bytes
/
Copy pathinstall.ps1
File metadata and controls
21 lines (16 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ErrorActionPreference = "Stop"
$repo = "youngwoocho02/unity-cli"
$installDir = "$env:LOCALAPPDATA\unity-cli"
$exe = "$installDir\unity-cli.exe"
New-Item -ItemType Directory -Force -Path $installDir | Out-Null
$url = "https://github.com/$repo/releases/latest/download/unity-cli-windows-amd64.exe"
Write-Host "Downloading unity-cli for windows/amd64..."
Invoke-WebRequest -Uri $url -OutFile $exe -UseBasicParsing
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($userPath -notlike "*$installDir*") {
[Environment]::SetEnvironmentVariable("Path", "$installDir;$userPath", "User")
$env:Path = "$installDir;$env:Path"
Write-Host "Added $installDir to PATH (restart shell to apply)"
}
Write-Host "Installed unity-cli to $exe"
& $exe version