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