Skip to content

Commit b7b2a22

Browse files
Merge branch 'develop' into dev-search-paths
2 parents 460a8aa + bfa1374 commit b7b2a22

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ class UnitySetupInstance {
7777
[UnitySetupComponent]::Documentation = , [io.path]::Combine("$Path", "Editor\Data\Documentation");
7878
[UnitySetupComponent]::StandardAssets = , [io.path]::Combine("$Path", "Editor\Standard Assets");
7979
[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");
8282
[UnitySetupComponent]::UWP_IL2CPP = , [io.path]::Combine("$playbackEnginePath", "MetroSupport\Templates\UWP_IL2CPP_D3D");
8383
[UnitySetupComponent]::Linux = , [io.path]::Combine("$playbackEnginePath", "LinuxStandaloneSupport");
8484
[UnitySetupComponent]::Mac = , [io.path]::Combine("$playbackEnginePath", "MacStandaloneSupport");
@@ -103,12 +103,12 @@ class UnitySetupInstance {
103103
}
104104

105105
# 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");
109109
$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");
112112

113113
$componentTests.Keys | ForEach-Object {
114114
foreach ( $test in $componentTests[$_] ) {
@@ -311,16 +311,16 @@ function Find-UnitySetupInstaller {
311311
)
312312

313313
$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";
316316
[UnitySetupComponent]::UWP_IL2CPP = , "$targetSupport/UnitySetup-UWP-IL2CPP-Support-for-Editor-$Version.$installerExtension";
317317
[UnitySetupComponent]::Android = , "$targetSupport/UnitySetup-Android-Support-for-Editor-$Version.$installerExtension";
318318
[UnitySetupComponent]::iOS = , "$targetSupport/UnitySetup-iOS-Support-for-Editor-$Version.$installerExtension";
319319
[UnitySetupComponent]::AppleTV = , "$targetSupport/UnitySetup-AppleTV-Support-for-Editor-$Version.$installerExtension";
320320
[UnitySetupComponent]::Facebook = , "$targetSupport/UnitySetup-Facebook-Games-Support-for-Editor-$Version.$installerExtension";
321321
[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";
324324
[UnitySetupComponent]::Mac_IL2CPP = , "$targetSupport/UnitySetup-Mac-IL2CPP-Support-for-Editor-$Version.$installerExtension";
325325
[UnitySetupComponent]::Vuforia = , "$targetSupport/UnitySetup-Vuforia-AR-Support-for-Editor-$Version.$installerExtension";
326326
[UnitySetupComponent]::WebGL = , "$targetSupport/UnitySetup-WebGL-Support-for-Editor-$Version.$installerExtension";
@@ -720,14 +720,14 @@ function Request-UnitySetupInstaller {
720720

721721
Unregister-Event -SourceIdentifier "$installerFileName-Completed" -Force
722722
Unregister-Event -SourceIdentifier "$installerFileName-Changed" -Force
723-
723+
724724
$data.webClient.Dispose()
725725
$data.webClient = $null
726726

727727
# Re-writes the last modified time for ensuring downloads are cached properly.
728728
$downloadedFile = Get-Item $data.destination
729729
$downloadedFile.LastWriteTime = $data.lastModified
730-
730+
731731
$resource = New-Object UnitySetupResource -Property @{
732732
'ComponentType' = $data.componentType
733733
'Path' = $data.destination
@@ -739,16 +739,16 @@ function Request-UnitySetupInstaller {
739739
$elapsedTime = (Get-Date) - $data.startTime
740740

741741
$progress = [int](($data.receivedBytes / [double]$data.totalBytes) * 100)
742-
742+
743743
$averageSpeed = $data.receivedBytes / $elapsedTime.TotalSeconds
744744
$secondsRemaining = ($data.totalBytes - $data.receivedBytes) / $averageSpeed
745-
745+
746746
if ([double]::IsInfinity($secondsRemaining)) {
747747
$averageSpeed = 0
748748
# -1 for Write-Progress prevents seconds remaining from showing.
749749
$secondsRemaining = -1
750750
}
751-
751+
752752
$downloadSpeed = Format-BitsPerSecond -Bytes $data.receivedBytes -Seconds $elapsedTime.TotalSeconds
753753

754754
Write-Progress -Activity "Downloading $installerFileName | $downloadSpeed" `
@@ -819,14 +819,14 @@ function Install-UnitySetupPackage {
819819
}
820820
}
821821
}
822-
822+
823823
Write-Verbose "$(Get-Date): Installing $($Package.ComponentType) to $Destination."
824824
$process = Start-Process @startProcessArgs
825825
if ( $process ) {
826826
if ( $process.ExitCode -ne 0) {
827827
Write-Error "$(Get-Date): Failed with exit code: $($process.ExitCode)"
828828
}
829-
else {
829+
else {
830830
Write-Verbose "$(Get-Date): Succeeded."
831831
}
832832
}
@@ -930,7 +930,7 @@ function Install-UnitySetupInstance {
930930
$installPath += [io.path]::DirectorySeparatorChar
931931
}
932932

933-
# Creating sparse bundle to host installing Unity in other locations
933+
# Creating sparse bundle to host installing Unity in other locations
934934
$unitySetupBundlePath = [io.path]::Combine($Cache, "UnitySetup.sparsebundle")
935935
if (-not (Test-Path $unitySetupBundlePath)) {
936936
Write-Verbose "Creating new sparse bundle disk image for installation."
@@ -1423,7 +1423,7 @@ function Start-UnityEditor {
14231423
if ( -not $PSBoundParameters.ContainsKey('BatchMode') ) { $BatchMode = $true }
14241424
if ( -not $PSBoundParameters.ContainsKey('Quit') ) { $Quit = $true }
14251425
}
1426-
if ( $AcceptAPIUpdate ) {
1426+
if ( $AcceptAPIUpdate ) {
14271427
$sharedArgs += '-accept-apiupdate'
14281428
if ( -not $PSBoundParameters.ContainsKey('BatchMode')) { $BatchMode = $true }
14291429
}
@@ -1486,7 +1486,7 @@ function Start-UnityEditor {
14861486
([OperatingSystem]::Windows) {
14871487
$editor = Get-ChildItem "$($setupInstance.Path)" -Filter 'Unity.exe' -Recurse |
14881488
Select-Object -First 1 -ExpandProperty FullName
1489-
1489+
14901490
if ([string]::IsNullOrEmpty($editor)) {
14911491
Write-Error "Could not find Unity.exe under setup instance path: $($setupInstance.Path)"
14921492
continue
@@ -1497,7 +1497,7 @@ function Start-UnityEditor {
14971497
}
14981498
([OperatingSystem]::Mac) {
14991499
$editor = [io.path]::Combine("$($setupInstance.Path)", "Unity.app/Contents/MacOS/Unity")
1500-
1500+
15011501
if ([string]::IsNullOrEmpty($editor)) {
15021502
Write-Error "Could not find Unity app under setup instance path: $($setupInstance.Path)"
15031503
continue
@@ -1521,7 +1521,7 @@ function Start-UnityEditor {
15211521
if ( $Credential ) { $unityArgs += '-password', $Credential.GetNetworkCredential().Password }
15221522
if ( $Serial ) { $unityArgs += '-serial', [System.Net.NetworkCredential]::new($null, $Serial).Password }
15231523

1524-
# We've experienced issues with Start-Process -Wait and redirecting
1524+
# We've experienced issues with Start-Process -Wait and redirecting
15251525
# output so we're using the Process class directly now.
15261526
$process = New-Object System.Diagnostics.Process
15271527
$process.StartInfo.Filename = $editor
@@ -1531,17 +1531,17 @@ function Start-UnityEditor {
15311531
$process.StartInfo.UseShellExecute = $false
15321532
$process.StartInfo.CreateNoWindow = $true
15331533
$process.StartInfo.WorkingDirectory = $PWD
1534-
$process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Hidden
1534+
$process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Hidden
15351535
$process.Start() | Out-Null
1536-
1536+
15371537
if ( $Wait ) {
15381538
$process.WaitForExit()
15391539

15401540
if ( $LogFile -and (Test-Path $LogFile -Type Leaf) ) {
15411541
# Note that Unity sometimes returns a success ExitCode despite the presence of errors, but we want
15421542
# to make sure that we flag such errors.
15431543
Write-UnityErrors $LogFile
1544-
1544+
15451545
Write-Verbose "Writing $LogFile to Information stream Tagged as 'Logs'"
15461546
Get-Content $LogFile | ForEach-Object { Write-Information -MessageData $_ -Tags 'Logs' }
15471547
}
@@ -1625,7 +1625,7 @@ function Get-UnityLicense {
16251625
# The first four bytes look like a count so skip that to pull out the serial string
16261626
$licenseSerial = [String]::new($devBytes[4..($devBytes.Length - 1)])
16271627
if ( $Serial -and [System.Net.NetworkCredential]::new($null, $Serial).Password -ne $licenseSerial ) { continue; }
1628-
1628+
16291629
$license = $doc.root.License
16301630
[PSCustomObject]@{
16311631
'LicenseVersion' = $license.LicenseVersion.Value
@@ -1649,11 +1649,11 @@ function Get-UnityLicense {
16491649

16501650
$alias = Get-Alias -Name $_.Name -ErrorAction 'SilentlyContinue'
16511651
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 @_
16541654
}
16551655
elseif ( $alias.ModuleName -eq 'UnitySetup' ) {
1656-
Write-Verbose "Setting alias $($_.Name) to $($_.Value)"
1656+
Write-Verbose "Setting alias $($_.Name) to $($_.Value)"
16571657
Set-Alias @_
16581658
}
16591659
else {

0 commit comments

Comments
 (0)