@@ -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 [$_ ] ) {
@@ -311,16 +311,16 @@ function Find-UnitySetupInstaller {
311
311
)
312
312
313
313
$installerTemplates = @ {
314
- [UnitySetupComponent ]::UWP = " $targetSupport /UnitySetup-UWP-.NET-Support-for-Editor-$Version .$installerExtension " ,
315
- " $targetSupport /UnitySetup-Metro-Support-for-Editor-$Version .$installerExtension " ;
314
+ [UnitySetupComponent ]::UWP = " $targetSupport /UnitySetup-UWP-.NET-Support-for-Editor-$Version .$installerExtension " ,
315
+ " $targetSupport /UnitySetup-Metro-Support-for-Editor-$Version .$installerExtension " ;
316
316
[UnitySetupComponent ]::UWP_IL2CPP = , " $targetSupport /UnitySetup-UWP-IL2CPP-Support-for-Editor-$Version .$installerExtension " ;
317
317
[UnitySetupComponent ]::Android = , " $targetSupport /UnitySetup-Android-Support-for-Editor-$Version .$installerExtension " ;
318
318
[UnitySetupComponent ]::iOS = , " $targetSupport /UnitySetup-iOS-Support-for-Editor-$Version .$installerExtension " ;
319
319
[UnitySetupComponent ]::AppleTV = , " $targetSupport /UnitySetup-AppleTV-Support-for-Editor-$Version .$installerExtension " ;
320
320
[UnitySetupComponent ]::Facebook = , " $targetSupport /UnitySetup-Facebook-Games-Support-for-Editor-$Version .$installerExtension " ;
321
321
[UnitySetupComponent ]::Linux = , " $targetSupport /UnitySetup-Linux-Support-for-Editor-$Version .$installerExtension " ;
322
- [UnitySetupComponent ]::Mac = " $targetSupport /UnitySetup-Mac-Support-for-Editor-$Version .$installerExtension " ,
323
- " $targetSupport /UnitySetup-Mac-Mono-Support-for-Editor-$Version .$installerExtension " ;
322
+ [UnitySetupComponent ]::Mac = " $targetSupport /UnitySetup-Mac-Support-for-Editor-$Version .$installerExtension " ,
323
+ " $targetSupport /UnitySetup-Mac-Mono-Support-for-Editor-$Version .$installerExtension " ;
324
324
[UnitySetupComponent ]::Mac_IL2CPP = , " $targetSupport /UnitySetup-Mac-IL2CPP-Support-for-Editor-$Version .$installerExtension " ;
325
325
[UnitySetupComponent ]::Vuforia = , " $targetSupport /UnitySetup-Vuforia-AR-Support-for-Editor-$Version .$installerExtension " ;
326
326
[UnitySetupComponent ]::WebGL = , " $targetSupport /UnitySetup-WebGL-Support-for-Editor-$Version .$installerExtension " ;
@@ -720,14 +720,14 @@ function Request-UnitySetupInstaller {
720
720
721
721
Unregister-Event - SourceIdentifier " $installerFileName -Completed" - Force
722
722
Unregister-Event - SourceIdentifier " $installerFileName -Changed" - Force
723
-
723
+
724
724
$data.webClient.Dispose ()
725
725
$data.webClient = $null
726
726
727
727
# Re-writes the last modified time for ensuring downloads are cached properly.
728
728
$downloadedFile = Get-Item $data.destination
729
729
$downloadedFile.LastWriteTime = $data.lastModified
730
-
730
+
731
731
$resource = New-Object UnitySetupResource - Property @ {
732
732
' ComponentType' = $data.componentType
733
733
' Path' = $data.destination
@@ -739,16 +739,16 @@ function Request-UnitySetupInstaller {
739
739
$elapsedTime = (Get-Date ) - $data.startTime
740
740
741
741
$progress = [int ](($data.receivedBytes / [double ]$data.totalBytes ) * 100 )
742
-
742
+
743
743
$averageSpeed = $data.receivedBytes / $elapsedTime.TotalSeconds
744
744
$secondsRemaining = ($data.totalBytes - $data.receivedBytes ) / $averageSpeed
745
-
745
+
746
746
if ([double ]::IsInfinity($secondsRemaining )) {
747
747
$averageSpeed = 0
748
748
# -1 for Write-Progress prevents seconds remaining from showing.
749
749
$secondsRemaining = -1
750
750
}
751
-
751
+
752
752
$downloadSpeed = Format-BitsPerSecond - Bytes $data.receivedBytes - Seconds $elapsedTime.TotalSeconds
753
753
754
754
Write-Progress - Activity " Downloading $installerFileName | $downloadSpeed " `
@@ -819,14 +819,14 @@ function Install-UnitySetupPackage {
819
819
}
820
820
}
821
821
}
822
-
822
+
823
823
Write-Verbose " $ ( Get-Date ) : Installing $ ( $Package.ComponentType ) to $Destination ."
824
824
$process = Start-Process @startProcessArgs
825
825
if ( $process ) {
826
826
if ( $process.ExitCode -ne 0 ) {
827
827
Write-Error " $ ( Get-Date ) : Failed with exit code: $ ( $process.ExitCode ) "
828
828
}
829
- else {
829
+ else {
830
830
Write-Verbose " $ ( Get-Date ) : Succeeded."
831
831
}
832
832
}
@@ -930,7 +930,7 @@ function Install-UnitySetupInstance {
930
930
$installPath += [io.path ]::DirectorySeparatorChar
931
931
}
932
932
933
- # Creating sparse bundle to host installing Unity in other locations
933
+ # Creating sparse bundle to host installing Unity in other locations
934
934
$unitySetupBundlePath = [io.path ]::Combine($Cache , " UnitySetup.sparsebundle" )
935
935
if (-not (Test-Path $unitySetupBundlePath )) {
936
936
Write-Verbose " Creating new sparse bundle disk image for installation."
@@ -1423,7 +1423,7 @@ function Start-UnityEditor {
1423
1423
if ( -not $PSBoundParameters.ContainsKey (' BatchMode' ) ) { $BatchMode = $true }
1424
1424
if ( -not $PSBoundParameters.ContainsKey (' Quit' ) ) { $Quit = $true }
1425
1425
}
1426
- if ( $AcceptAPIUpdate ) {
1426
+ if ( $AcceptAPIUpdate ) {
1427
1427
$sharedArgs += ' -accept-apiupdate'
1428
1428
if ( -not $PSBoundParameters.ContainsKey (' BatchMode' )) { $BatchMode = $true }
1429
1429
}
@@ -1486,7 +1486,7 @@ function Start-UnityEditor {
1486
1486
([OperatingSystem ]::Windows) {
1487
1487
$editor = Get-ChildItem " $ ( $setupInstance.Path ) " - Filter ' Unity.exe' - Recurse |
1488
1488
Select-Object - First 1 - ExpandProperty FullName
1489
-
1489
+
1490
1490
if ([string ]::IsNullOrEmpty($editor )) {
1491
1491
Write-Error " Could not find Unity.exe under setup instance path: $ ( $setupInstance.Path ) "
1492
1492
continue
@@ -1497,7 +1497,7 @@ function Start-UnityEditor {
1497
1497
}
1498
1498
([OperatingSystem ]::Mac) {
1499
1499
$editor = [io.path ]::Combine(" $ ( $setupInstance.Path ) " , " Unity.app/Contents/MacOS/Unity" )
1500
-
1500
+
1501
1501
if ([string ]::IsNullOrEmpty($editor )) {
1502
1502
Write-Error " Could not find Unity app under setup instance path: $ ( $setupInstance.Path ) "
1503
1503
continue
@@ -1521,7 +1521,7 @@ function Start-UnityEditor {
1521
1521
if ( $Credential ) { $unityArgs += ' -password' , $Credential.GetNetworkCredential ().Password }
1522
1522
if ( $Serial ) { $unityArgs += ' -serial' , [System.Net.NetworkCredential ]::new($null , $Serial ).Password }
1523
1523
1524
- # We've experienced issues with Start-Process -Wait and redirecting
1524
+ # We've experienced issues with Start-Process -Wait and redirecting
1525
1525
# output so we're using the Process class directly now.
1526
1526
$process = New-Object System.Diagnostics.Process
1527
1527
$process.StartInfo.Filename = $editor
@@ -1531,17 +1531,17 @@ function Start-UnityEditor {
1531
1531
$process.StartInfo.UseShellExecute = $false
1532
1532
$process.StartInfo.CreateNoWindow = $true
1533
1533
$process.StartInfo.WorkingDirectory = $PWD
1534
- $process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle ]::Hidden
1534
+ $process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle ]::Hidden
1535
1535
$process.Start () | Out-Null
1536
-
1536
+
1537
1537
if ( $Wait ) {
1538
1538
$process.WaitForExit ()
1539
1539
1540
1540
if ( $LogFile -and (Test-Path $LogFile - Type Leaf) ) {
1541
1541
# Note that Unity sometimes returns a success ExitCode despite the presence of errors, but we want
1542
1542
# to make sure that we flag such errors.
1543
1543
Write-UnityErrors $LogFile
1544
-
1544
+
1545
1545
Write-Verbose " Writing $LogFile to Information stream Tagged as 'Logs'"
1546
1546
Get-Content $LogFile | ForEach-Object { Write-Information - MessageData $_ - Tags ' Logs' }
1547
1547
}
@@ -1625,7 +1625,7 @@ function Get-UnityLicense {
1625
1625
# The first four bytes look like a count so skip that to pull out the serial string
1626
1626
$licenseSerial = [String ]::new($devBytes [4 .. ($devBytes.Length - 1 )])
1627
1627
if ( $Serial -and [System.Net.NetworkCredential ]::new($null , $Serial ).Password -ne $licenseSerial ) { continue ; }
1628
-
1628
+
1629
1629
$license = $doc.root.License
1630
1630
[PSCustomObject ]@ {
1631
1631
' LicenseVersion' = $license.LicenseVersion.Value
@@ -1649,11 +1649,11 @@ function Get-UnityLicense {
1649
1649
1650
1650
$alias = Get-Alias - Name $_.Name - ErrorAction ' SilentlyContinue'
1651
1651
if ( -not $alias ) {
1652
- Write-Verbose " Creating new alias $ ( $_.Name ) for $ ( $_.Value ) "
1653
- New-Alias @_
1652
+ Write-Verbose " Creating new alias $ ( $_.Name ) for $ ( $_.Value ) "
1653
+ New-Alias @_
1654
1654
}
1655
1655
elseif ( $alias.ModuleName -eq ' UnitySetup' ) {
1656
- Write-Verbose " Setting alias $ ( $_.Name ) to $ ( $_.Value ) "
1656
+ Write-Verbose " Setting alias $ ( $_.Name ) to $ ( $_.Value ) "
1657
1657
Set-Alias @_
1658
1658
}
1659
1659
else {
0 commit comments