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