@@ -71,7 +71,7 @@ class UnitySetupInstance {
71
71
[UnitySetupComponent ]::StandardAssets = , [io.path ]::Combine(" $Path " , " Editor\Standard Assets" );
72
72
[UnitySetupComponent ]::Windows_IL2CPP = , [io.path ]::Combine(" $playbackEnginePath " , " windowsstandalonesupport\Variations\win32_development_il2cpp" );
73
73
[UnitySetupComponent ]::Metro = [io.path ]::Combine(" $playbackEnginePath " , " MetroSupport\Templates\UWP_.NET_D3D" ),
74
- [io.path ]::Combine(" $playbackEnginePath " , " MetroSupport\Templates\UWP_D3D" );
74
+ [io.path ]::Combine(" $playbackEnginePath " , " MetroSupport\Templates\UWP_D3D" );
75
75
[UnitySetupComponent ]::UWP_IL2CPP = , [io.path ]::Combine(" $playbackEnginePath " , " MetroSupport\Templates\UWP_IL2CPP_D3D" );
76
76
[UnitySetupComponent ]::Linux = , [io.path ]::Combine(" $playbackEnginePath " , " LinuxStandaloneSupport" );
77
77
[UnitySetupComponent ]::Mac = , [io.path ]::Combine(" $playbackEnginePath " , " MacStandaloneSupport" );
@@ -289,7 +289,7 @@ function Find-UnitySetupInstaller {
289
289
[UnitySetupComponent ]::Facebook = , " TargetSupportInstaller/UnitySetup-Facebook-Games-Support-for-Editor-$Version .exe" ;
290
290
[UnitySetupComponent ]::Linux = , " TargetSupportInstaller/UnitySetup-Linux-Support-for-Editor-$Version .exe" ;
291
291
[UnitySetupComponent ]::Mac = " TargetSupportInstaller/UnitySetup-Mac-Support-for-Editor-$Version .exe" ,
292
- " TargetSupportInstaller/UnitySetup-Mac-Mono-Support-for-Editor-$Version .exe" ;
292
+ " TargetSupportInstaller/UnitySetup-Mac-Mono-Support-for-Editor-$Version .exe" ;
293
293
[UnitySetupComponent ]::Vuforia = , " TargetSupportInstaller/UnitySetup-Vuforia-AR-Support-for-Editor-$Version .exe" ;
294
294
[UnitySetupComponent ]::WebGL = , " TargetSupportInstaller/UnitySetup-WebGL-Support-for-Editor-$Version .exe" ;
295
295
[UnitySetupComponent ]::Windows_IL2CPP = , " TargetSupportInstaller/UnitySetup-Windows-IL2CPP-Support-for-Editor-$Version .exe" ;
@@ -480,6 +480,7 @@ function Install-UnitySetupInstance {
480
480
' FilePath' = $installer ;
481
481
' ArgumentList' = @ (" /S" , " /D=$destination " );
482
482
' PassThru' = $true ;
483
+ ' Wait' = $true ;
483
484
}
484
485
485
486
if ($Verb ) {
@@ -488,9 +489,7 @@ function Install-UnitySetupInstance {
488
489
489
490
Write-Verbose " $ ( Get-Date ) : Installing $installer to $destination ."
490
491
$process = Start-Process @startProcessArgs
491
- if ( $process ) {
492
- $process.WaitForExit ()
493
-
492
+ if ( $process ) {
494
493
if ( $process.ExitCode -ne 0 ) {
495
494
Write-Error " $ ( Get-Date ) : Failed with exit code: $ ( $process.ExitCode ) "
496
495
}
@@ -838,7 +837,7 @@ function Start-UnityEditor {
838
837
$sharedArgs = @ ()
839
838
if ( $AcceptAPIUpdate ) {
840
839
$sharedArgs += ' -accept-apiupdate'
841
- if ( -not $PSBoundParameters.ContainsKey (' BatchMode' )) { $BatchMode = $true }
840
+ if ( -not $PSBoundParameters.ContainsKey (' BatchMode' )) { $BatchMode = $true }
842
841
}
843
842
844
843
if ( $CreateProject ) { $sharedArgs += " -createProject" , $CreateProject }
@@ -921,6 +920,8 @@ function Start-UnityEditor {
921
920
' RedirectStandardError' = New-TemporaryFile ;
922
921
}
923
922
923
+ if ($Wait ) { $setProcessArgs [' Wait' ] = $true }
924
+
924
925
Write-Verbose " Redirecting standard output to $ ( $setProcessArgs [' RedirectStandardOutput' ]) "
925
926
Write-Verbose " Redirecting standard error to $ ( $setProcessArgs [' RedirectStandardError' ]) "
926
927
@@ -934,13 +935,12 @@ function Start-UnityEditor {
934
935
935
936
$process = Start-Process @setProcessArgs
936
937
if ( $Wait ) {
937
- $process.WaitForExit ();
938
938
if ( $process.ExitCode -ne 0 ) {
939
939
if ( $LogFile -and (Test-Path $LogFile - Type Leaf) ) {
940
940
Get-Content $LogFile | ForEach-Object { Write-Information - MessageData $_ - Tags ' Logs' }
941
941
}
942
942
943
- Write-Error " Unity quit with non-zero exit code"
943
+ Write-Error " Unity quit with non-zero exit code: $ ( $process .ExitCode ) "
944
944
}
945
945
}
946
946
0 commit comments