Allow local DVDStyler ZIP install
This commit is contained in:
parent
1ef88069bc
commit
4ea3834d76
|
|
@ -5,6 +5,7 @@ param(
|
|||
[switch]$UseScoop = $false,
|
||||
[switch]$SkipFFmpeg = $false,
|
||||
[string]$DvdStylerUrl = "",
|
||||
[string]$DvdStylerZip = "",
|
||||
[switch]$SkipDvdStyler = $false
|
||||
)
|
||||
|
||||
|
|
@ -81,6 +82,16 @@ function Ensure-DVDStylerTools {
|
|||
$userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
|
||||
$downloaded = $false
|
||||
$lastUrl = ""
|
||||
if ($DvdStylerZip) {
|
||||
if (Test-Path $DvdStylerZip) {
|
||||
Copy-Item -Path $DvdStylerZip -Destination $dvdstylerZip -Force
|
||||
$downloaded = $true
|
||||
$lastUrl = $DvdStylerZip
|
||||
} else {
|
||||
Write-Host "[ERROR] Provided DVDStyler ZIP not found: $DvdStylerZip" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
} else {
|
||||
foreach ($url in $dvdstylerUrls) {
|
||||
$lastUrl = $url
|
||||
$downloadOk = $false
|
||||
|
|
@ -141,6 +152,7 @@ function Ensure-DVDStylerTools {
|
|||
# Try next URL
|
||||
}
|
||||
}
|
||||
}
|
||||
if (-not $downloaded) {
|
||||
Write-Host "[ERROR] Failed to download DVDStyler ZIP (invalid archive)" -ForegroundColor Red
|
||||
Write-Host "Last URL tried: $lastUrl" -ForegroundColor Yellow
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|||
|
||||
# Args
|
||||
DVDSTYLER_URL=""
|
||||
DVDSTYLER_ZIP=""
|
||||
SKIP_DVD_TOOLS=""
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
|
|
@ -41,13 +42,21 @@ while [ $# -gt 0 ]; do
|
|||
DVDSTYLER_URL="$2"
|
||||
shift 2
|
||||
;;
|
||||
--dvdstyler-zip=*)
|
||||
DVDSTYLER_ZIP="${1#*=}"
|
||||
shift
|
||||
;;
|
||||
--dvdstyler-zip)
|
||||
DVDSTYLER_ZIP="$2"
|
||||
shift 2
|
||||
;;
|
||||
--skip-dvd)
|
||||
SKIP_DVD_TOOLS=true
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1"
|
||||
echo "Usage: $0 [--dvdstyler-url URL] [--skip-dvd]"
|
||||
echo "Usage: $0 [--dvdstyler-url URL] [--dvdstyler-zip PATH] [--skip-dvd]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
@ -115,7 +124,9 @@ if [ "$IS_WINDOWS" = true ]; then
|
|||
if [ "$SKIP_DVD_TOOLS" = true ]; then
|
||||
PS_ARGS+=("-SkipDvdStyler")
|
||||
fi
|
||||
if [ -n "$DVDSTYLER_URL" ]; then
|
||||
if [ -n "$DVDSTYLER_ZIP" ]; then
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$PROJECT_ROOT/scripts/install-deps-windows.ps1" -DvdStylerZip "$DVDSTYLER_ZIP" "${PS_ARGS[@]}"
|
||||
elif [ -n "$DVDSTYLER_URL" ]; then
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$PROJECT_ROOT/scripts/install-deps-windows.ps1" -DvdStylerUrl "$DVDSTYLER_URL" "${PS_ARGS[@]}"
|
||||
else
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$PROJECT_ROOT/scripts/install-deps-windows.ps1" "${PS_ARGS[@]}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user