Skip to content

Commit 46027e3

Browse files
authored
Merge pull request #136 from StephenHodgson/dev-hub-default-install-path
updated default installation path to be the hub path
2 parents e8f5a0f + 0842ca8 commit 46027e3

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,17 @@ function Install-UnitySetupInstance {
475475
$localDestinations += , $Destination
476476
}
477477
else {
478-
$localDestinations += , "C:\Program Files\Unity-$($i.Version)"
478+
switch (Get-OperatingSystem) {
479+
([OperatingSystem]::Windows) {
480+
$localDestinations += , "C:\Program Files\Unity\Hub\Editor\$($i.Version)"
481+
}
482+
([OperatingSystem]::Linux) {
483+
throw "Install-UnitySetupInstance has not been implemented on the Linux platform. Contributions welcomed!";
484+
}
485+
([OperatingSystem]::Mac) {
486+
$localDestinations += , "/Applications/Unity/Hub/Editor/$($i.Version)"
487+
}
488+
}
479489
}
480490

481491
if ( Test-Path $destPath ) {
@@ -617,7 +627,7 @@ function Get-UnitySetupInstance {
617627
}
618628
([OperatingSystem]::Mac) {
619629
if (-not $BasePath) {
620-
$BasePath = @('/Applications/Unity*')
630+
$BasePath = @('/Applications/Unity*', '/Applications/Unity/Hub/Editor/*')
621631
}
622632
$ivyPath = 'Unity.app/Contents/UnityExtensions/Unity/Networking/ivy.xml'
623633
}

0 commit comments

Comments
 (0)