diff --git a/bucket/boinc.json b/bucket/boinc.json index db6a589a1cb559..a5d8af5228546c 100644 --- a/bucket/boinc.json +++ b/bucket/boinc.json @@ -3,7 +3,6 @@ "description": "Volunteer scientific or grid computing client", "homepage": "https://boinc.berkeley.edu/", "license": "LGPL-3.0-or-later", - "depends": "isx", "notes": [ "Set DATADIR and INSTALLDIR in:", "Computer\\HKEY_LOCAL_MACHINE\\SOFTWARE\\Space Sciences Laboratory, U.C. Berkeley\\BOINC Setup" @@ -17,11 +16,25 @@ }, "installer": { "script": [ - "Invoke-ExternalCommand ((Get-Command 'isx' -CommandType Application).Source) -ArgumentList \"$dir\\$fname\" -LogPath \"$dir\\isx.log\" | Out-Null", - "$folder = Get-ChildItem \"$dir\" -Directory | Select-Object -First 1 -ExpandProperty FullName", + "$msiDir = \"$env:windir\\Downloaded Installations\\BOINC\"", + "$since = Get-Date", + "Start-Process \"$dir\\$fname\" -ArgumentList '/extract'", + "$msi = $null; $deadline = (Get-Date).AddSeconds(60)", + "while (-not $msi -and (Get-Date) -lt $deadline) {", + " Start-Sleep -Seconds 2", + " $msi = Get-ChildItem $msiDir -Recurse -Filter 'BOINC.msi' -ErrorAction SilentlyContinue | Where-Object LastWriteTime -ge $since | Sort-Object LastWriteTime -Descending | Select-Object -First 1", + "}", "$extract = if ($architecture -eq '64bit') { 'Program Files 64' } else { 'program files' }", - "Expand-MsiArchive \"$folder\\BOINC.msi\" \"$dir\" -ExtractDir \"$extract\\BOINC\" -Removal", - "Remove-Item $folder -Force -Recurse" + "if ($msi)", + "{", + " Write-Host \"MSI located, unpacking... This may take a moment.\"", + " Expand-MsiArchive $msi.FullName \"$dir\" -ExtractDir \"$extract\\BOINC\" -Removal", + "}", + "else", + "{", + " Write-Host \"MSI not found, installation may have failed.\" -ForegroundColor Red", + " exit 1", + "}" ] }, "post_install": [