@@ -78,8 +78,8 @@ class UnitySetupInstance {
78
78
[UnitySetupComponent ]::Documentation = , [io.path ]::Combine(" $Path " , " Editor\Data\Documentation" );
79
79
[UnitySetupComponent ]::StandardAssets = , [io.path ]::Combine(" $Path " , " Editor\Standard Assets" );
80
80
[UnitySetupComponent ]::Windows_IL2CPP = , [io.path ]::Combine(" $playbackEnginePath " , " windowsstandalonesupport\Variations\win32_development_il2cpp" );
81
- [UnitySetupComponent ]::UWP = [io.path ]::Combine(" $playbackEnginePath " , " MetroSupport\Templates\UWP_.NET_D3D" ),
82
- [io.path ]::Combine(" $playbackEnginePath " , " MetroSupport\Templates\UWP_D3D" );
81
+ [UnitySetupComponent ]::UWP = [io.path ]::Combine(" $playbackEnginePath " , " MetroSupport\Templates\UWP_.NET_D3D" ),
82
+ [io.path ]::Combine(" $playbackEnginePath " , " MetroSupport\Templates\UWP_D3D" );
83
83
[UnitySetupComponent ]::UWP_IL2CPP = , [io.path ]::Combine(" $playbackEnginePath " , " MetroSupport\Templates\UWP_IL2CPP_D3D" );
84
84
[UnitySetupComponent ]::Linux = , [io.path ]::Combine(" $playbackEnginePath " , " LinuxStandaloneSupport" );
85
85
[UnitySetupComponent ]::Mac = , [io.path ]::Combine(" $playbackEnginePath " , " MacStandaloneSupport" );
@@ -104,12 +104,12 @@ class UnitySetupInstance {
104
104
}
105
105
106
106
# Common playback engines:
107
- $componentTests [[UnitySetupComponent ]::Android ] = , [io.path ]::Combine(" $playbackEnginePath " , " AndroidPlayer" );
108
- $componentTests [[UnitySetupComponent ]::iOS ] = , [io.path ]::Combine(" $playbackEnginePath " , " iOSSupport" );
109
- $componentTests [[UnitySetupComponent ]::AppleTV ] = , [io.path ]::Combine(" $playbackEnginePath " , " AppleTVSupport" );
107
+ $componentTests [[UnitySetupComponent ]::Android ] = , [io.path ]::Combine(" $playbackEnginePath " , " AndroidPlayer" );
108
+ $componentTests [[UnitySetupComponent ]::iOS ] = , [io.path ]::Combine(" $playbackEnginePath " , " iOSSupport" );
109
+ $componentTests [[UnitySetupComponent ]::AppleTV ] = , [io.path ]::Combine(" $playbackEnginePath " , " AppleTVSupport" );
110
110
$componentTests [[UnitySetupComponent ]::Facebook ] = , [io.path ]::Combine(" $playbackEnginePath " , " Facebook" );
111
- $componentTests [[UnitySetupComponent ]::Vuforia ] = , [io.path ]::Combine(" $playbackEnginePath " , " VuforiaSupport" );
112
- $componentTests [[UnitySetupComponent ]::WebGL ] = , [io.path ]::Combine(" $playbackEnginePath " , " WebGLSupport" );
111
+ $componentTests [[UnitySetupComponent ]::Vuforia ] = , [io.path ]::Combine(" $playbackEnginePath " , " VuforiaSupport" );
112
+ $componentTests [[UnitySetupComponent ]::WebGL ] = , [io.path ]::Combine(" $playbackEnginePath " , " WebGLSupport" );
113
113
114
114
$componentTests.Keys | ForEach-Object {
115
115
foreach ( $test in $componentTests [$_ ] ) {
@@ -312,16 +312,16 @@ function Find-UnitySetupInstaller {
312
312
)
313
313
314
314
$installerTemplates = @ {
315
- [UnitySetupComponent ]::UWP = " $targetSupport /UnitySetup-UWP-.NET-Support-for-Editor-$Version .$installerExtension " ,
316
- " $targetSupport /UnitySetup-Metro-Support-for-Editor-$Version .$installerExtension " ;
315
+ [UnitySetupComponent ]::UWP = " $targetSupport /UnitySetup-UWP-.NET-Support-for-Editor-$Version .$installerExtension " ,
316
+ " $targetSupport /UnitySetup-Metro-Support-for-Editor-$Version .$installerExtension " ;
317
317
[UnitySetupComponent ]::UWP_IL2CPP = , " $targetSupport /UnitySetup-UWP-IL2CPP-Support-for-Editor-$Version .$installerExtension " ;
318
318
[UnitySetupComponent ]::Android = , " $targetSupport /UnitySetup-Android-Support-for-Editor-$Version .$installerExtension " ;
319
319
[UnitySetupComponent ]::iOS = , " $targetSupport /UnitySetup-iOS-Support-for-Editor-$Version .$installerExtension " ;
320
320
[UnitySetupComponent ]::AppleTV = , " $targetSupport /UnitySetup-AppleTV-Support-for-Editor-$Version .$installerExtension " ;
321
321
[UnitySetupComponent ]::Facebook = , " $targetSupport /UnitySetup-Facebook-Games-Support-for-Editor-$Version .$installerExtension " ;
322
322
[UnitySetupComponent ]::Linux = , " $targetSupport /UnitySetup-Linux-Support-for-Editor-$Version .$installerExtension " ;
323
- [UnitySetupComponent ]::Mac = " $targetSupport /UnitySetup-Mac-Support-for-Editor-$Version .$installerExtension " ,
324
- " $targetSupport /UnitySetup-Mac-Mono-Support-for-Editor-$Version .$installerExtension " ;
323
+ [UnitySetupComponent ]::Mac = " $targetSupport /UnitySetup-Mac-Support-for-Editor-$Version .$installerExtension " ,
324
+ " $targetSupport /UnitySetup-Mac-Mono-Support-for-Editor-$Version .$installerExtension " ;
325
325
[UnitySetupComponent ]::Mac_IL2CPP = , " $targetSupport /UnitySetup-Mac-IL2CPP-Support-for-Editor-$Version .$installerExtension " ;
326
326
[UnitySetupComponent ]::Vuforia = , " $targetSupport /UnitySetup-Vuforia-AR-Support-for-Editor-$Version .$installerExtension " ;
327
327
[UnitySetupComponent ]::WebGL = , " $targetSupport /UnitySetup-WebGL-Support-for-Editor-$Version .$installerExtension " ;
@@ -369,8 +369,8 @@ function Find-UnitySetupInstaller {
369
369
$patchPage = " https://unity3d.com/unity/qa/patch-releases?version=$ ( $Version.Major ) .$ ( $Version.Minor ) "
370
370
$searchPages += $patchPage
371
371
372
- $webResult = Invoke-WebRequest $patchPage - UseBasicParsing
373
- $searchPages += $webResult.Links | Where-Object {
372
+ $webResult = Invoke-WebRequest $patchPage - UseBasicParsing
373
+ $searchPages += $webResult.Links | Where-Object {
374
374
$_.href -match " \/unity\/qa\/patch-releases\?version=$ ( $Version.Major ) \.$ ( $Version.Minor ) &page=(\d+)" -and $Matches [1 ] -gt 1
375
375
} | ForEach-Object { " https://unity3d.com$ ( $_.href ) " }
376
376
}
@@ -713,14 +713,14 @@ function Request-UnitySetupInstaller {
713
713
714
714
Unregister-Event - SourceIdentifier " $installerFileName -Completed" - Force
715
715
Unregister-Event - SourceIdentifier " $installerFileName -Changed" - Force
716
-
716
+
717
717
$data.webClient.Dispose ()
718
718
$data.webClient = $null
719
719
720
720
# Re-writes the last modified time for ensuring downloads are cached properly.
721
721
$downloadedFile = Get-Item $data.destination
722
722
$downloadedFile.LastWriteTime = $data.lastModified
723
-
723
+
724
724
$resource = New-Object UnitySetupResource - Property @ {
725
725
' ComponentType' = $data.componentType
726
726
' Path' = $data.destination
@@ -732,16 +732,16 @@ function Request-UnitySetupInstaller {
732
732
$elapsedTime = (Get-Date ) - $data.startTime
733
733
734
734
$progress = [int ](($data.receivedBytes / [double ]$data.totalBytes ) * 100 )
735
-
735
+
736
736
$averageSpeed = $data.receivedBytes / $elapsedTime.TotalSeconds
737
737
$secondsRemaining = ($data.totalBytes - $data.receivedBytes ) / $averageSpeed
738
-
738
+
739
739
if ([double ]::IsInfinity($secondsRemaining )) {
740
740
$averageSpeed = 0
741
741
# -1 for Write-Progress prevents seconds remaining from showing.
742
742
$secondsRemaining = -1
743
743
}
744
-
744
+
745
745
$downloadSpeed = Format-BitsPerSecond - Bytes $data.receivedBytes - Seconds $elapsedTime.TotalSeconds
746
746
747
747
Write-Progress - Activity " Downloading $installerFileName | $downloadSpeed " `
@@ -812,14 +812,14 @@ function Install-UnitySetupPackage {
812
812
}
813
813
}
814
814
}
815
-
815
+
816
816
Write-Verbose " $ ( Get-Date ) : Installing $ ( $Package.ComponentType ) to $Destination ."
817
817
$process = Start-Process @startProcessArgs
818
818
if ( $process ) {
819
819
if ( $process.ExitCode -ne 0 ) {
820
820
Write-Error " $ ( Get-Date ) : Failed with exit code: $ ( $process.ExitCode ) "
821
821
}
822
- else {
822
+ else {
823
823
Write-Verbose " $ ( Get-Date ) : Succeeded."
824
824
}
825
825
}
@@ -923,7 +923,7 @@ function Install-UnitySetupInstance {
923
923
$installPath += [io.path ]::DirectorySeparatorChar
924
924
}
925
925
926
- # Creating sparse bundle to host installing Unity in other locations
926
+ # Creating sparse bundle to host installing Unity in other locations
927
927
$unitySetupBundlePath = [io.path ]::Combine($Cache , " UnitySetup.sparsebundle" )
928
928
if (-not (Test-Path $unitySetupBundlePath )) {
929
929
Write-Verbose " Creating new sparse bundle disk image for installation."
@@ -1416,7 +1416,7 @@ function Start-UnityEditor {
1416
1416
if ( -not $PSBoundParameters.ContainsKey (' BatchMode' ) ) { $BatchMode = $true }
1417
1417
if ( -not $PSBoundParameters.ContainsKey (' Quit' ) ) { $Quit = $true }
1418
1418
}
1419
- if ( $AcceptAPIUpdate ) {
1419
+ if ( $AcceptAPIUpdate ) {
1420
1420
$sharedArgs += ' -accept-apiupdate'
1421
1421
if ( -not $PSBoundParameters.ContainsKey (' BatchMode' )) { $BatchMode = $true }
1422
1422
}
@@ -1479,7 +1479,7 @@ function Start-UnityEditor {
1479
1479
([OperatingSystem ]::Windows) {
1480
1480
$editor = Get-ChildItem " $ ( $setupInstance.Path ) " - Filter ' Unity.exe' - Recurse |
1481
1481
Select-Object - First 1 - ExpandProperty FullName
1482
-
1482
+
1483
1483
if ([string ]::IsNullOrEmpty($editor )) {
1484
1484
Write-Error " Could not find Unity.exe under setup instance path: $ ( $setupInstance.Path ) "
1485
1485
continue
@@ -1490,7 +1490,7 @@ function Start-UnityEditor {
1490
1490
}
1491
1491
([OperatingSystem ]::Mac) {
1492
1492
$editor = [io.path ]::Combine(" $ ( $setupInstance.Path ) " , " Unity.app/Contents/MacOS/Unity" )
1493
-
1493
+
1494
1494
if ([string ]::IsNullOrEmpty($editor )) {
1495
1495
Write-Error " Could not find Unity app under setup instance path: $ ( $setupInstance.Path ) "
1496
1496
continue
@@ -1514,7 +1514,7 @@ function Start-UnityEditor {
1514
1514
if ( $Credential ) { $unityArgs += ' -password' , $Credential.GetNetworkCredential ().Password }
1515
1515
if ( $Serial ) { $unityArgs += ' -serial' , [System.Net.NetworkCredential ]::new($null , $Serial ).Password }
1516
1516
1517
- # We've experienced issues with Start-Process -Wait and redirecting
1517
+ # We've experienced issues with Start-Process -Wait and redirecting
1518
1518
# output so we're using the Process class directly now.
1519
1519
$process = New-Object System.Diagnostics.Process
1520
1520
$process.StartInfo.Filename = $editor
@@ -1524,17 +1524,17 @@ function Start-UnityEditor {
1524
1524
$process.StartInfo.UseShellExecute = $false
1525
1525
$process.StartInfo.CreateNoWindow = $true
1526
1526
$process.StartInfo.WorkingDirectory = $PWD
1527
- $process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle ]::Hidden
1527
+ $process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle ]::Hidden
1528
1528
$process.Start () | Out-Null
1529
-
1529
+
1530
1530
if ( $Wait ) {
1531
1531
$process.WaitForExit ()
1532
1532
1533
1533
if ( $LogFile -and (Test-Path $LogFile - Type Leaf) ) {
1534
1534
# Note that Unity sometimes returns a success ExitCode despite the presence of errors, but we want
1535
1535
# to make sure that we flag such errors.
1536
1536
Write-UnityErrors $LogFile
1537
-
1537
+
1538
1538
Write-Verbose " Writing $LogFile to Information stream Tagged as 'Logs'"
1539
1539
Get-Content $LogFile | ForEach-Object { Write-Information - MessageData $_ - Tags ' Logs' }
1540
1540
}
@@ -1618,7 +1618,7 @@ function Get-UnityLicense {
1618
1618
# The first four bytes look like a count so skip that to pull out the serial string
1619
1619
$licenseSerial = [String ]::new($devBytes [4 .. ($devBytes.Length - 1 )])
1620
1620
if ( $Serial -and [System.Net.NetworkCredential ]::new($null , $Serial ).Password -ne $licenseSerial ) { continue ; }
1621
-
1621
+
1622
1622
$license = $doc.root.License
1623
1623
[PSCustomObject ]@ {
1624
1624
' LicenseVersion' = $license.LicenseVersion.Value
@@ -1642,11 +1642,11 @@ function Get-UnityLicense {
1642
1642
1643
1643
$alias = Get-Alias - Name $_.Name - ErrorAction ' SilentlyContinue'
1644
1644
if ( -not $alias ) {
1645
- Write-Verbose " Creating new alias $ ( $_.Name ) for $ ( $_.Value ) "
1646
- New-Alias @_
1645
+ Write-Verbose " Creating new alias $ ( $_.Name ) for $ ( $_.Value ) "
1646
+ New-Alias @_
1647
1647
}
1648
1648
elseif ( $alias.ModuleName -eq ' UnitySetup' ) {
1649
- Write-Verbose " Setting alias $ ( $_.Name ) to $ ( $_.Value ) "
1649
+ Write-Verbose " Setting alias $ ( $_.Name ) to $ ( $_.Value ) "
1650
1650
Set-Alias @_
1651
1651
}
1652
1652
else {
0 commit comments