Fix installer fallback when pipx fails

This commit is contained in:
thePR0M3TH3AN
2025-06-19 18:26:41 -04:00
parent 350113d0d7
commit 51a2d5a60b
2 changed files with 25 additions and 2 deletions

View File

@@ -24,7 +24,15 @@ if ($choco) {
} }
if (Get-Command pipx -ErrorAction SilentlyContinue) { if (Get-Command pipx -ErrorAction SilentlyContinue) {
pipx install voxvera --force try {
pipx install voxvera --force
} catch {
Write-Host 'pipx install failed, downloading binary'
$dest = "$HOME/.local/bin"
New-Item -ItemType Directory -Path $dest -Force | Out-Null
$url = 'https://github.com/PR0M3TH3AN/VoxVera/releases/latest/download/voxvera.exe'
Invoke-WebRequest -Uri $url -OutFile "$dest/voxvera.exe"
}
} else { } else {
$dest = "$HOME/.local/bin" $dest = "$HOME/.local/bin"
New-Item -ItemType Directory -Path $dest -Force | Out-Null New-Item -ItemType Directory -Path $dest -Force | Out-Null

View File

@@ -62,7 +62,22 @@ require_pkg qrencode qrencode
require_pkg convert imagemagick require_pkg convert imagemagick
if command_exists pipx; then if command_exists pipx; then
pipx install --force voxvera if ! pipx install --force voxvera; then
echo "pipx install failed, downloading binary"
install_dir="$HOME/.local/bin"
mkdir -p "$install_dir"
url="https://github.com/PR0M3TH3AN/VoxVera/releases/latest/download/voxvera"
dest="$install_dir/voxvera"
if command_exists curl; then
curl -fsSL "$url" -o "$dest"
elif command_exists wget; then
wget -q "$url" -O "$dest"
else
echo "Install curl or wget to download voxvera" >&2
exit 1
fi
chmod +x "$dest"
fi
else else
install_dir="$HOME/.local/bin" install_dir="$HOME/.local/bin"
mkdir -p "$install_dir" mkdir -p "$install_dir"