mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-07 20:35:33 -04:00
Fix possible hang
This commit is contained in:
parent
7afd91316d
commit
8af95d8dbd
28
dist/platforms/windows/activate.ps1
vendored
28
dist/platforms/windows/activate.ps1
vendored
@ -15,9 +15,10 @@ if ( ($null -ne ${env:UNITY_SERIAL}) -and ($null -ne ${env:UNITY_EMAIL}) -and ($
|
|||||||
#
|
#
|
||||||
Write-Output "Requesting activation"
|
Write-Output "Requesting activation"
|
||||||
|
|
||||||
$ACTIVATION_OUTPUT = Start-Process -NoNewWindow -Wait -PassThru "$Env:UNITY_PATH/Editor/Unity.exe" `
|
$ACTIVATION_OUTPUT = Start-Process -FilePath "$Env:UNITY_PATH/Editor/Unity.exe" `
|
||||||
-ArgumentList `
|
-NoNewWindow `
|
||||||
"-batchmode `
|
-PassThru `
|
||||||
|
-ArgumentList "-batchmode `
|
||||||
-quit `
|
-quit `
|
||||||
-nographics `
|
-nographics `
|
||||||
-username $Env:UNITY_EMAIL `
|
-username $Env:UNITY_EMAIL `
|
||||||
@ -26,7 +27,28 @@ if ( ($null -ne ${env:UNITY_SERIAL}) -and ($null -ne ${env:UNITY_EMAIL}) -and ($
|
|||||||
-projectPath c:/BlankProject `
|
-projectPath c:/BlankProject `
|
||||||
-logfile -"
|
-logfile -"
|
||||||
|
|
||||||
|
# Cache the handle so exit code works properly
|
||||||
|
# https://stackoverflow.com/questions/10262231/obtaining-exitcode-using-start-process-and-waitforexit-instead-of-wait
|
||||||
|
$unityHandle = $ACTIVATION_OUTPUT.Handle
|
||||||
|
|
||||||
|
while ($true) {
|
||||||
|
if ($ACTIVATION_OUTPUT.HasExited) {
|
||||||
$ACTIVATION_EXIT_CODE = $ACTIVATION_OUTPUT.ExitCode
|
$ACTIVATION_EXIT_CODE = $ACTIVATION_OUTPUT.ExitCode
|
||||||
|
|
||||||
|
# Display results
|
||||||
|
if ($ACTIVATION_EXIT_CODE -eq 0)
|
||||||
|
{
|
||||||
|
Write-Output "Activation Succeeded"
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
Write-Output "Activation failed, with exit code $ACTIVATION_EXIT_CODE"
|
||||||
|
}
|
||||||
|
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
Start-Sleep -Seconds 3
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
34
dist/platforms/windows/return_license.ps1
vendored
34
dist/platforms/windows/return_license.ps1
vendored
@ -6,16 +6,17 @@ Write-Output "# Return License #"
|
|||||||
Write-Output "###########################"
|
Write-Output "###########################"
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($null -ne ${env:UNITY_SERIAL})
|
if (($null -ne ${env:UNITY_SERIAL}) -and ($null -ne ${env:UNITY_EMAIL}) -and ($null -ne ${env:UNITY_PASSWORD}))
|
||||||
{
|
{
|
||||||
#
|
#
|
||||||
# SERIAL LICENSE MODE
|
# SERIAL LICENSE MODE
|
||||||
#
|
#
|
||||||
# This will return the license that is currently in use.
|
# This will return the license that is currently in use.
|
||||||
#
|
#
|
||||||
$RETURN_OUTPUT = Start-Process -NoNewWindow -Wait -PassThru "$Env:UNITY_PATH/Editor/Unity.exe" `
|
$RETURN_LICENSE_OUTPUT = Start-Process -FilePath "$Env:UNITY_PATH/Editor/Unity.exe" `
|
||||||
-ArgumentList `
|
-NoNewWindow `
|
||||||
"-batchmode `
|
-PassThru `
|
||||||
|
-ArgumentList "-batchmode `
|
||||||
-quit `
|
-quit `
|
||||||
-nographics `
|
-nographics `
|
||||||
-username $Env:UNITY_EMAIL `
|
-username $Env:UNITY_EMAIL `
|
||||||
@ -23,4 +24,29 @@ if ($null -ne ${env:UNITY_SERIAL})
|
|||||||
-returnlicense `
|
-returnlicense `
|
||||||
-projectPath c:/BlankProject `
|
-projectPath c:/BlankProject `
|
||||||
-logfile -"
|
-logfile -"
|
||||||
|
|
||||||
|
# Cache the handle so exit code works properly
|
||||||
|
# https://stackoverflow.com/questions/10262231/obtaining-exitcode-using-start-process-and-waitforexit-instead-of-wait
|
||||||
|
$unityHandle = $RETURN_LICENSE_OUTPUT.Handle
|
||||||
|
|
||||||
|
while ($true) {
|
||||||
|
if ($RETURN_LICENSE_OUTPUT.HasExited) {
|
||||||
|
$RETURN_LICENSE_EXIT_CODE = $RETURN_LICENSE_OUTPUT.ExitCode
|
||||||
|
|
||||||
|
# Display results
|
||||||
|
if ($RETURN_LICENSE_EXIT_CODE -eq 0)
|
||||||
|
{
|
||||||
|
Write-Output "License Return Succeeded"
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
Write-Output "License Return failed, with exit code $RETURN_LICENSE_EXIT_CODE"
|
||||||
|
Write-Output "::warning ::License Return failed! If this is a Pro License you might need to manually `
|
||||||
|
free the seat in your Unity admin panel or you might run out of seats to activate with."
|
||||||
|
}
|
||||||
|
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
Start-Sleep -Seconds 3
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user