-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunity.ps1
More file actions
31 lines (25 loc) · 1.17 KB
/
unity.ps1
File metadata and controls
31 lines (25 loc) · 1.17 KB
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
$INSTALLER_URL = "https://public-cdn.cloud.unity3d.com/hub/prod/UnityHubSetup.exe"
$INSTALLER_ARGS = "/S"
$host.ui.RawUI.WindowTitle = "UnityInstaller"
Clear-Host
Write-Host "Download in corso..." -ForegroundColor White -BackgroundColor Blue
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest $INSTALLER_URL -OutFile UnityHubSetup.exe
Write-Host "Download completato!" -ForegroundColor Black -BackgroundColor Green
try {
Write-Host "Installazione in corso..." -ForegroundColor Black -BackgroundColor Yellow
Start-Process UnityHubSetup.exe -ArgumentList $INSTALLER_ARGS -ea SilentlyContinue -Wait
Clear-Host
Write-Host "Installazione completata!" -ForegroundColor Black -BackgroundColor Green
Start-Sleep -Seconds 1
Remove-Item UnityHubSetup.exe
} catch {
Clear-Host
Write-Host "Houston! Abbiamo un problema!" -ForegroundColor Black -BackgroundColor Red
Write-Host "Non sono riuscito ad avviare l'installer." -ForegroundColor Black -BackgroundColor Red
Start-Sleep -Seconds 1
Remove-Item UnityHubSetup.exe
}
Write-Host "Lo script si chiudera' fra 3 secondi." -ForegroundColor White -BackgroundColor Blue
Start-Sleep -Seconds 3
Exit-PSHostProcess