Files
YouTubeDL/tools/run-installer-test.ps1
T
DepressedCat 5f2aad00f4
Check extension and helper / check (push) Canceled after 0s
Publish YouTubeDL 1.4.5 and website on Gitea
2026-10-10 23:53:17 +03:00

17 lines
759 B
PowerShell

param([Parameter(Mandatory=$true)][string]$InstallerPath)
$ErrorActionPreference = 'Stop'
$taskInstaller = (Resolve-Path -LiteralPath $InstallerPath).Path
$taskPreviousFlag = $env:YTDL_INSTALL_NONINTERACTIVE
try {
if ($taskInstaller.EndsWith('.exe', [StringComparison]::OrdinalIgnoreCase)) {
$taskProcess = Start-Process -FilePath $taskInstaller -ArgumentList '--silent' -WindowStyle Hidden -Wait -PassThru
if ($taskProcess.ExitCode -ne 0) { throw "Offline installer failed: $($taskProcess.ExitCode)" }
return
}
$env:YTDL_INSTALL_NONINTERACTIVE = '1'
& $taskInstaller
if ($LASTEXITCODE -ne 0) { throw "Helper installer failed: $LASTEXITCODE" }
} finally {
$env:YTDL_INSTALL_NONINTERACTIVE = $taskPreviousFlag
}