From 25847eb4d96f8929ce913c385a6ed8cb10c3beef Mon Sep 17 00:00:00 2001 From: Dima Iholkin <38999978+dima-iholkin@users.noreply.github.com> Date: Tue, 13 Aug 2024 13:01:18 +0300 Subject: [PATCH] Try a fix. --- src/Installer/_scripts/_helpers.ps1 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Installer/_scripts/_helpers.ps1 b/src/Installer/_scripts/_helpers.ps1 index cda9a09..3525ea3 100644 --- a/src/Installer/_scripts/_helpers.ps1 +++ b/src/Installer/_scripts/_helpers.ps1 @@ -144,7 +144,16 @@ function BuildInstaller { Write-Output "devenv.exe started: platform $Platform, mod $Mod." # $toLogOrNot = "/Out " + $installerDir + "\SwitchApps_Installer\Debug\log.txt" $toLogOrNot = "" - Start-Process -FilePath $devenvFile -ArgumentList ("$solutionFile /Rebuild Debug") -Wait -NoNewWindow + $proc = Start-Process -FilePath $devenvFile -ArgumentList ("$solutionFile /Rebuild Debug") -NoNewWindow + $timeoutReached = $null + $proc | Wait-Process -Timeout 30 -ErrorAction SilentlyContinue -ErrorVariable timeoutReached + if ($timeoutReached) { + # Terminate the process: + $proc | Stop-Process + # Retry the build: + Write-Output "Retrying the build..." + Start-Process -FilePath $devenvFile -ArgumentList ("$solutionFile /Rebuild Debug") -NoNewWindow -Wait + } Write-Output "devenv.exe finished: platform $Platform, mod $Mod." # Revert the project file's modification after an x86 platform run: switch ($Platform) {