From 6f16f5ff8ac4668a155cecd4b1c3329f5eabfcec Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Fri, 27 Oct 2023 00:57:04 -0700 Subject: [PATCH] Additional debug changes for fixing windows hanging --- dist/platforms/windows/build.ps1 | 8 ++++-- dist/platforms/windows/entrypoint.ps1 | 37 ++++++++++----------------- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/dist/platforms/windows/build.ps1 b/dist/platforms/windows/build.ps1 index 4568b8af..4a6cce0e 100644 --- a/dist/platforms/windows/build.ps1 +++ b/dist/platforms/windows/build.ps1 @@ -158,11 +158,15 @@ $unityArgs = $unityArgs | Where-Object { $_ -ne $null } $process = Start-Process -FilePath "C:\Program Files\Unity\Hub\Editor\$Env:UNITY_VERSION\Editor\Unity.exe" ` -ArgumentList $unityArgs ` - -NoNewWindow ` -PassThru while (!$process.HasExited) { if ($process.HasExited) { + Get-Process + + Start-Sleep -Seconds 10 + + Get-Process # Display results if ($process.ExitCode -eq 0) @@ -185,5 +189,5 @@ while (!$process.HasExited) { exit $process.ExitCode } - Start-Sleep -Seconds 1 + Start-Sleep -Seconds 5 } diff --git a/dist/platforms/windows/entrypoint.ps1 b/dist/platforms/windows/entrypoint.ps1 index 9f67424e..fb3ccc10 100644 --- a/dist/platforms/windows/entrypoint.ps1 +++ b/dist/platforms/windows/entrypoint.ps1 @@ -3,35 +3,24 @@ Get-Process # Import any necessary registry keys, ie: location of windows 10 sdk # No guarantee that there will be any necessary registry keys, ie: tvOS Get-ChildItem -Path c:\regkeys -File | ForEach-Object {reg import $_.fullname} -Start-Sleep 3 -Get-Process # Register the Visual Studio installation so Unity can find it regsvr32 C:\ProgramData\Microsoft\VisualStudio\Setup\x64\Microsoft.VisualStudio.Setup.Configuration.Native.dll -Start-Sleep 3 -Get-Process - -# Setup Git Credentials -& "c:\steps\set_gitcredential.ps1" -Start-Sleep 3 -Get-Process - -# Activate Unity -& "c:\steps\activate.ps1" -Start-Sleep 3 -Get-Process - -# Build the project -& "c:\steps\build.ps1" -Start-Sleep 3 -Get-Process - -# Free the seat for the activated license -& "c:\steps\return_license.ps1" -Start-Sleep 3 -Get-Process # Kill the regsvr process Get-Process -Name regsvr32 | ForEach-Object { Stop-Process -Id $_.Id -Force } + +# Setup Git Credentials +& "c:\steps\set_gitcredential.ps1" + +# Activate Unity +& "c:\steps\activate.ps1" + +# Build the project +& "c:\steps\build.ps1" + +# Free the seat for the activated license +& "c:\steps\return_license.ps1" + Start-Sleep 3 Get-Process