Skip to content

Commit 6d48640

Browse files
Merge branch 'develop' into dev-UnitySetupInstance
2 parents 1edea46 + bfa1374 commit 6d48640

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

UnitySetup/UnitySetup.psm1

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

106106
# 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");
110110
$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");
113113

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

314314
$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";
317317
[UnitySetupComponent]::UWP_IL2CPP = , "$targetSupport/UnitySetup-UWP-IL2CPP-Support-for-Editor-$Version.$installerExtension";
318318
[UnitySetupComponent]::Android = , "$targetSupport/UnitySetup-Android-Support-for-Editor-$Version.$installerExtension";
319319
[UnitySetupComponent]::iOS = , "$targetSupport/UnitySetup-iOS-Support-for-Editor-$Version.$installerExtension";
320320
[UnitySetupComponent]::AppleTV = , "$targetSupport/UnitySetup-AppleTV-Support-for-Editor-$Version.$installerExtension";
321321
[UnitySetupComponent]::Facebook = , "$targetSupport/UnitySetup-Facebook-Games-Support-for-Editor-$Version.$installerExtension";
322322
[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";
325325
[UnitySetupComponent]::Mac_IL2CPP = , "$targetSupport/UnitySetup-Mac-IL2CPP-Support-for-Editor-$Version.$installerExtension";
326326
[UnitySetupComponent]::Vuforia = , "$targetSupport/UnitySetup-Vuforia-AR-Support-for-Editor-$Version.$installerExtension";
327327
[UnitySetupComponent]::WebGL = , "$targetSupport/UnitySetup-WebGL-Support-for-Editor-$Version.$installerExtension";
@@ -369,8 +369,8 @@ function Find-UnitySetupInstaller {
369369
$patchPage = "https://unity3d.com/unity/qa/patch-releases?version=$($Version.Major).$($Version.Minor)"
370370
$searchPages += $patchPage
371371

372-
$webResult = Invoke-WebRequest $patchPage -UseBasicParsing
373-
$searchPages += $webResult.Links | Where-Object {
372+
$webResult = Invoke-WebRequest $patchPage -UseBasicParsing
373+
$searchPages += $webResult.Links | Where-Object {
374374
$_.href -match "\/unity\/qa\/patch-releases\?version=$($Version.Major)\.$($Version.Minor)&page=(\d+)" -and $Matches[1] -gt 1
375375
} | ForEach-Object { "https://unity3d.com$($_.href)" }
376376
}
@@ -713,14 +713,14 @@ function Request-UnitySetupInstaller {
713713

714714
Unregister-Event -SourceIdentifier "$installerFileName-Completed" -Force
715715
Unregister-Event -SourceIdentifier "$installerFileName-Changed" -Force
716-
716+
717717
$data.webClient.Dispose()
718718
$data.webClient = $null
719719

720720
# Re-writes the last modified time for ensuring downloads are cached properly.
721721
$downloadedFile = Get-Item $data.destination
722722
$downloadedFile.LastWriteTime = $data.lastModified
723-
723+
724724
$resource = New-Object UnitySetupResource -Property @{
725725
'ComponentType' = $data.componentType
726726
'Path' = $data.destination
@@ -732,16 +732,16 @@ function Request-UnitySetupInstaller {
732732
$elapsedTime = (Get-Date) - $data.startTime
733733

734734
$progress = [int](($data.receivedBytes / [double]$data.totalBytes) * 100)
735-
735+
736736
$averageSpeed = $data.receivedBytes / $elapsedTime.TotalSeconds
737737
$secondsRemaining = ($data.totalBytes - $data.receivedBytes) / $averageSpeed
738-
738+
739739
if ([double]::IsInfinity($secondsRemaining)) {
740740
$averageSpeed = 0
741741
# -1 for Write-Progress prevents seconds remaining from showing.
742742
$secondsRemaining = -1
743743
}
744-
744+
745745
$downloadSpeed = Format-BitsPerSecond -Bytes $data.receivedBytes -Seconds $elapsedTime.TotalSeconds
746746

747747
Write-Progress -Activity "Downloading $installerFileName | $downloadSpeed" `
@@ -812,14 +812,14 @@ function Install-UnitySetupPackage {
812812
}
813813
}
814814
}
815-
815+
816816
Write-Verbose "$(Get-Date): Installing $($Package.ComponentType) to $Destination."
817817
$process = Start-Process @startProcessArgs
818818
if ( $process ) {
819819
if ( $process.ExitCode -ne 0) {
820820
Write-Error "$(Get-Date): Failed with exit code: $($process.ExitCode)"
821821
}
822-
else {
822+
else {
823823
Write-Verbose "$(Get-Date): Succeeded."
824824
}
825825
}
@@ -923,7 +923,7 @@ function Install-UnitySetupInstance {
923923
$installPath += [io.path]::DirectorySeparatorChar
924924
}
925925

926-
# Creating sparse bundle to host installing Unity in other locations
926+
# Creating sparse bundle to host installing Unity in other locations
927927
$unitySetupBundlePath = [io.path]::Combine($Cache, "UnitySetup.sparsebundle")
928928
if (-not (Test-Path $unitySetupBundlePath)) {
929929
Write-Verbose "Creating new sparse bundle disk image for installation."
@@ -1416,7 +1416,7 @@ function Start-UnityEditor {
14161416
if ( -not $PSBoundParameters.ContainsKey('BatchMode') ) { $BatchMode = $true }
14171417
if ( -not $PSBoundParameters.ContainsKey('Quit') ) { $Quit = $true }
14181418
}
1419-
if ( $AcceptAPIUpdate ) {
1419+
if ( $AcceptAPIUpdate ) {
14201420
$sharedArgs += '-accept-apiupdate'
14211421
if ( -not $PSBoundParameters.ContainsKey('BatchMode')) { $BatchMode = $true }
14221422
}
@@ -1479,7 +1479,7 @@ function Start-UnityEditor {
14791479
([OperatingSystem]::Windows) {
14801480
$editor = Get-ChildItem "$($setupInstance.Path)" -Filter 'Unity.exe' -Recurse |
14811481
Select-Object -First 1 -ExpandProperty FullName
1482-
1482+
14831483
if ([string]::IsNullOrEmpty($editor)) {
14841484
Write-Error "Could not find Unity.exe under setup instance path: $($setupInstance.Path)"
14851485
continue
@@ -1490,7 +1490,7 @@ function Start-UnityEditor {
14901490
}
14911491
([OperatingSystem]::Mac) {
14921492
$editor = [io.path]::Combine("$($setupInstance.Path)", "Unity.app/Contents/MacOS/Unity")
1493-
1493+
14941494
if ([string]::IsNullOrEmpty($editor)) {
14951495
Write-Error "Could not find Unity app under setup instance path: $($setupInstance.Path)"
14961496
continue
@@ -1514,7 +1514,7 @@ function Start-UnityEditor {
15141514
if ( $Credential ) { $unityArgs += '-password', $Credential.GetNetworkCredential().Password }
15151515
if ( $Serial ) { $unityArgs += '-serial', [System.Net.NetworkCredential]::new($null, $Serial).Password }
15161516

1517-
# We've experienced issues with Start-Process -Wait and redirecting
1517+
# We've experienced issues with Start-Process -Wait and redirecting
15181518
# output so we're using the Process class directly now.
15191519
$process = New-Object System.Diagnostics.Process
15201520
$process.StartInfo.Filename = $editor
@@ -1524,17 +1524,17 @@ function Start-UnityEditor {
15241524
$process.StartInfo.UseShellExecute = $false
15251525
$process.StartInfo.CreateNoWindow = $true
15261526
$process.StartInfo.WorkingDirectory = $PWD
1527-
$process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Hidden
1527+
$process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Hidden
15281528
$process.Start() | Out-Null
1529-
1529+
15301530
if ( $Wait ) {
15311531
$process.WaitForExit()
15321532

15331533
if ( $LogFile -and (Test-Path $LogFile -Type Leaf) ) {
15341534
# Note that Unity sometimes returns a success ExitCode despite the presence of errors, but we want
15351535
# to make sure that we flag such errors.
15361536
Write-UnityErrors $LogFile
1537-
1537+
15381538
Write-Verbose "Writing $LogFile to Information stream Tagged as 'Logs'"
15391539
Get-Content $LogFile | ForEach-Object { Write-Information -MessageData $_ -Tags 'Logs' }
15401540
}
@@ -1618,7 +1618,7 @@ function Get-UnityLicense {
16181618
# The first four bytes look like a count so skip that to pull out the serial string
16191619
$licenseSerial = [String]::new($devBytes[4..($devBytes.Length - 1)])
16201620
if ( $Serial -and [System.Net.NetworkCredential]::new($null, $Serial).Password -ne $licenseSerial ) { continue; }
1621-
1621+
16221622
$license = $doc.root.License
16231623
[PSCustomObject]@{
16241624
'LicenseVersion' = $license.LicenseVersion.Value
@@ -1642,11 +1642,11 @@ function Get-UnityLicense {
16421642

16431643
$alias = Get-Alias -Name $_.Name -ErrorAction 'SilentlyContinue'
16441644
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 @_
16471647
}
16481648
elseif ( $alias.ModuleName -eq 'UnitySetup' ) {
1649-
Write-Verbose "Setting alias $($_.Name) to $($_.Value)"
1649+
Write-Verbose "Setting alias $($_.Name) to $($_.Value)"
16501650
Set-Alias @_
16511651
}
16521652
else {

0 commit comments

Comments
 (0)