Quiver Launcher 4

Quiver Launcher rebuilt with Tauri 2, React and a small Rust core, in place
of the .NET 3.x app, for Windows, macOS, Linux (on Chromium, as an AppImage
and a Flatpak), the Steam Deck and Android. It browses the quiverlauncher.com
catalog, installs and updates apps against the checksums Quiver verified,
adds a 3.x library with its installs where they are, and has a TV mode for
controllers, playlists, mods, Wine and Proton, Steam shortcuts, account sync
and eight languages.

Quiver Launcher 4 is source-available under the Business Source License
1.1: each version becomes MIT licensed one year after it's first published.
Quiver Launcher 3.x stays MIT licensed, on the v3 branch. The Quiver name and
logo are covered by TRADEMARKS.md, and contributions by the CLA in
CONTRIBUTING.md. announcement.json stays at the root for 3.x's banner.

Developed privately in October 2026 and squashed into this one commit. CI
runs on main, and the launcher updates from this repository's releases.
This commit is contained in:
Thomas Georgiadis committed 2026-10-31 21:54:21 +11:00
1 parent a27f9a7b1f
commit 9b5f7cce70
868 files changed
+96923 -97739

No files matched your search

+6 -1
View File
@@ -1,3 +1,8 @@
# Auto detect text files and perform LF normalization
* text=auto
packaging/flatpak/quiver-launcher text eol=lf
# Shell scripts run in Linux (e2e/wsl.sh, from a Windows checkout too): never with Windows line endings.
*.sh text eol=lf
# So is the e2e tests' stand-in browser, which the app runs by its shebang (QUIVER_BROWSER).
e2e/fake-browser.js text eol=lf
# And the CEF AppImage's AppRun hooks (apps/launcher/src-tauri/appimage), which it sources.
*.hook text eol=lf
+2 -2
View File
@@ -1,9 +1,9 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: quiverlauncher
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
ko_fi: magicturt1e
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
-24
View File
@@ -1,24 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
type: Bug
---
**Operating system**
Windows / Linux / Android (include the OS version if known)
**Quiver Launcher version**
e.g. 3.4.0
**What went wrong?**
Describe what happened and what you expected instead.
**How can we reproduce it?**
List the steps, if known. Include app or catalog names where relevant.
**Screenshots or extra details (optional)**
Add anything that helps explain the problem.
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Ubuntu's packages for a CI job: `.github/apt-install.sh libfoo-dev libbar`. Ubuntu's mirror can stall (an update
# once sat for all of its step's 8 minutes, and 62 MB once took 20): what comes from the mirror, the package lists and
# then the packages, has a time limit for each try, and a try that runs out starts again, up to three times, rather
# than holding the job. Nothing else is tried again: a package that doesn't exist, or one that won't install, fails
# at once as before. The install itself is from what was downloaded, so it doesn't wait on the mirror.
set -uo pipefail
# Within a try, a dead connection is given up on after 30 seconds and tried again.
apt=(apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30)
# Runs `apt-get …` as root, called `what` in the log, with a time limit; again if it runs out, but not if it fails.
fetch() {
local what=$1 limit=$2 status
shift 2
for try in 1 2 3; do
# timeout as root, so it can stop apt-get itself rather than only sudo.
sudo timeout --kill-after=15 "$limit" "${apt[@]}" "$@"
status=$?
# 124: the time ran out; 137: and apt-get had to be killed.
if [ "$status" -ne 124 ] && [ "$status" -ne 137 ]; then return "$status"; fi
echo "::warning::$what was still going after $limit (try $try of 3)"
done
echo "::error::$what stalled three times: Ubuntu's mirror is too slow just now. Run the job again."
return 1
}
fetch "The package lists" 2m update || exit
fetch "The download" 4m install -y --download-only "$@" || exit
sudo "${apt[@]}" install -y "$@"
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# `.github/cef-appimage-check.sh <AppImage>`: fails unless the CEF AppImage holds what Chromium loads. The bundler
# skips what it can't find without failing: Chromium's own library, NSS's modules (without which it aborts on
# SteamOS) and libxkbcommon-x11 (which winit loads).
set -euo pipefail
image=$(realpath "$1")
cd "$(mktemp -d)"
"$image" --appimage-extract > /dev/null
# uruntime's AppImages unpack to AppDir, others to squashfs-root.
root=AppDir; [ -d $root ] || root=squashfs-root
missing=0
for f in bin/libcef.so lib/libnss3.so lib/libsoftokn3.so lib/libfreeblpriv3.so lib/libnssckbi.so lib/libxkbcommon-x11.so.0; do
test -e "$root/$f" || { echo "::error::$f isn't in the AppImage"; missing=1; }
done
rm -rf "$PWD"
exit $missing
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# What a CI job needs to build the launcher for Linux on Chromium (Tauri's CEF runtime, apps/launcher/CEF-SPIKE.md)
# with apps/launcher/scripts/tauri-cef.sh, on Ubuntu 22.04. Run it after the System libraries step; the job caches
# ~/.cache/tauri-cef-cli and ~/.cache/cef, keyed on REV and Cargo.cef.lock.
set -euo pipefail
# The CEF build of the Tauri CLI, from Readest's fork of feat/cef: its AppImage bundling deploys the NSS and audio
# libraries Chromium loads at run time.
REV=6beeb209b5514f597a26f48b7a5b9fe4c59b5f12
cli=$HOME/.cache/tauri-cef-cli
# patchelf for the AppImage bundling; NSS, ALSA and libxkbcommon-x11 for the bundler to copy in.
"$(dirname "$0")/apt-install.sh" patchelf libnss3 libasound2 libxkbcommon-x11-0
# Ubuntu keeps NSS's modules in nss/, where the bundler doesn't look. Without them in the AppImage, Chromium loads the
# player's own, which on SteamOS need a newer glibc than the bundle's, and aborts.
# Some are links into nss/ there already (libfreebl3, libfreeblpriv3 on GitHub's runner), which the bundler follows
# into the AppImage's lib/nss/, where libsoftokn3 doesn't look for them: a real copy goes in their place.
for f in /usr/lib/x86_64-linux-gnu/nss/*.so; do
t=/usr/lib/x86_64-linux-gnu/${f##*/}
[ -L "$t" ] && sudo rm "$t"
[ -e "$t" ] || sudo cp "$f" "$t"
done
[ -x "$cli/bin/cargo-tauri" ] || cargo install --git https://github.com/readest/tauri --rev "$REV" tauri-cli --locked --root "$cli"
echo "TAURI_CEF_CLI=$cli/bin/cargo-tauri" >> "$GITHUB_ENV"
# cef-dll-sys and the CLI take the CEF distribution from here, downloading it only when it's missing.
echo "CEF_PATH=$HOME/.cache/cef" >> "$GITHUB_ENV"
+183
View File
@@ -0,0 +1,183 @@
name: CI
on:
pull_request:
# The base branch too, so a break that lands on it shows there.
push:
branches: [main]
workflow_dispatch:
# A newer push to a pull request replaces the run for the older one.
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
# Each job's time limit is two to three times as long as it usually takes (check 3 minutes, phone 1, windows 5,
# installer 6, appimage 5), with room for a build with nothing cached, so a stuck run stops instead of running on.
jobs:
check:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with: { workspaces: apps/launcher/src-tauri }
# Ubuntu's mirror can crawl: apt-install.sh tries a stalled download again, and the step's limit stops one that
# stays stuck rather than holding the job.
- name: System libraries
timeout-minutes: 12
run: .github/apt-install.sh libdbus-1-dev libwebkit2gtk-4.1-dev librsvg2-dev libayatana-appindicator3-dev libudev-dev
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck
- run: pnpm test
# The translation catalogs list every string in the code: a string added without running extract fails here.
- run: pnpm --filter @quiverlauncher/i18n check
- run: cargo test --manifest-path apps/launcher/src-tauri/Cargo.toml
# The end-to-end tests aren't run here: on the runner, slow and drawing without a GPU, one of them or another
# failed most runs for reasons of timing, not of the app. They run in WSL (e2e/wsl.sh).
# Every screen at Android phones' sizes (e2e/phone.test.js): the web side alone, so no Rust build.
phone:
runs-on: ubuntu-24.04
timeout-minutes: 12
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- run: pnpm install --frozen-lockfile
# Its system libraries come from Ubuntu's mirror too.
- run: pnpm --filter @quiver/e2e exec playwright install --with-deps chromium
timeout-minutes: 8
- run: pnpm --filter @quiver/e2e phone
# To look over, failed or not.
- uses: actions/upload-artifact@v4
if: always()
with:
name: Phone screenshots
path: e2e/phone-screenshots/
# A controller, the keys and the mouse around every screen (e2e/web/): the web side alone in WebKit, the Rust side
# stood in for, so no Rust build and no presses waiting on a WebDriver session (about 7 minutes).
web:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @quiver/e2e exec playwright install --with-deps webkit
timeout-minutes: 8
- run: pnpm --filter @quiver/e2e web
windows:
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with: { workspaces: apps/launcher/src-tauri }
- run: pnpm install --frozen-lockfile
- run: cargo test --manifest-path apps/launcher/src-tauri/Cargo.toml
- run: pnpm --filter @quiver/launcher tauri build --debug --no-bundle
- name: The app starts
run: |
$env:QUIVER_DATA = "$env:RUNNER_TEMP\quiver-smoke"
$app = Start-Process apps\launcher\src-tauri\target\debug\quiver-launcher.exe -PassThru
Start-Sleep 10
"still running: $(-not $app.HasExited), exit code: $($app.ExitCode)"
Get-Content "$env:QUIVER_DATA\quiver.log" -ErrorAction SilentlyContinue
Stop-Process $app -ErrorAction SilentlyContinue
installer:
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- uses: dtolnay/rust-toolchain@stable
# Shared with the release workflow's Windows build, which starts from it.
- uses: Swatinem/rust-cache@v2
with: { workspaces: apps/launcher/src-tauri, shared-key: windows-release }
- run: pnpm install --frozen-lockfile
# Unsigned until there are signing keys.
- run: pnpm --filter @quiver/launcher tauri build --bundles nsis
# Usage data (telemetry.ts): the PostHog project token, a repository variable; unset, the build sends nothing.
env:
VITE_POSTHOG_PROJECT_TOKEN: ${{ vars.POSTHOG_PROJECT_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: Quiver Launcher Windows installer
path: apps/launcher/src-tauri/target/release/bundle/nsis/*.exe
# For Linux and Steam Deck: runs without installing anything. Built on the
# oldest supported Ubuntu so it works on older and newer distros alike, on
# Chromium (Tauri's CEF runtime) as the release is.
appimage:
runs-on: ubuntu-22.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- uses: dtolnay/rust-toolchain@stable
# Kept when a later step fails too: a build from nothing takes about 20 minutes, and a run that fails after it
# would otherwise leave the next one to start from nothing again.
- uses: Swatinem/rust-cache@v2
with: { workspaces: apps/launcher/src-tauri, key: cef, cache-on-failure: true }
# The CEF build's CLI (built once per revision in cef-tools.sh) and the CEF distribution, saved as soon as each is
# there, whatever happens after.
- id: cef
run: echo "rev=$(sed -n 's/^REV=//p' .github/cef-tools.sh)" >> "$GITHUB_OUTPUT"
- id: cli
uses: actions/cache/restore@v4
with: { path: ~/.cache/tauri-cef-cli, key: "tauri-cef-cli-${{ steps.cef.outputs.rev }}" }
- id: dist
uses: actions/cache/restore@v4
with: { path: ~/.cache/cef, key: "cef-${{ hashFiles('apps/launcher/src-tauri/Cargo.cef.lock') }}" }
# Ubuntu's mirror can crawl: apt-install.sh tries a stalled download again, and the step's limit stops one that
# stays stuck rather than holding the job.
- name: System libraries
timeout-minutes: 12
run: .github/apt-install.sh libdbus-1-dev libwebkit2gtk-4.1-dev librsvg2-dev libayatana-appindicator3-dev libudev-dev libfuse2 xvfb
- name: The CEF build's tools
timeout-minutes: 25
run: .github/cef-tools.sh
- if: steps.cli.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with: { path: ~/.cache/tauri-cef-cli, key: "${{ steps.cli.outputs.cache-primary-key }}" }
- run: pnpm install --frozen-lockfile
- run: sh apps/launcher/scripts/tauri-cef.sh build --bundles appimage
env:
VITE_POSTHOG_PROJECT_TOKEN: ${{ vars.POSTHOG_PROJECT_TOKEN }}
- if: always() && steps.dist.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with: { path: ~/.cache/cef, key: "${{ steps.dist.outputs.cache-primary-key }}" }
- name: The AppImage holds what Chromium loads
run: .github/cef-appimage-check.sh apps/launcher/src-tauri/target/release/bundle/appimage/*.AppImage
- name: The AppImage starts
run: |
export QUIVER_DATA=$RUNNER_TEMP/quiver-smoke
# A smoke test isn't usage: its events go nowhere.
export QUIVER_POSTHOG_HOST=http://127.0.0.1:9
# Output goes to a file so nothing left running holds the step open.
status=0; xvfb-run -a timeout 15 apps/launcher/src-tauri/target/release/bundle/appimage/*.AppImage > $RUNNER_TEMP/app.log 2>&1 || status=$?
cat $RUNNER_TEMP/app.log $QUIVER_DATA/quiver.log 2>/dev/null || true
# 124: still running when the timeout stopped it.
test $status -eq 124
- uses: actions/upload-artifact@v4
with:
name: Quiver Launcher for Linux (AppImage)
path: apps/launcher/src-tauri/target/release/bundle/appimage/*.AppImage
-642
View File
@@ -1,642 +0,0 @@
name: .NET Desktop Build
on:
push:
branches: [ "main" ]
tags: [ "v*" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
permissions:
contents: read
env:
VELOPACK_VERSION: "1.2.0"
# Anonymous usage data: the same PostHog project as the website and v4, built into release builds.
POSTHOG_PROJECT_TOKEN: ${{ vars.POSTHOG_PROJECT_TOKEN }}
PACK_ID: QuiverLauncher
REPO_URL: https://github.com/${{ github.repository }}
jobs:
test:
runs-on: ubuntu-latest
env:
# Tests never send usage data, and never see the question about it.
POSTHOG_PROJECT_TOKEN: ""
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore QuiverLauncher.sln
- name: Test with coverage
run: dotnet test QuiverLauncher.sln -c Release --no-restore --logger "console;verbosity=normal" --blame-hang-timeout 5m --collect:"XPlat Code Coverage" --results-directory "${{ runner.temp }}/coverage"
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-cobertura
path: ${{ runner.temp }}/coverage/**/coverage.cobertura.xml
retention-days: 14
pack-windows:
needs: test
runs-on: windows-latest
# Stable OIDC subject for tags and branches: repo:…/quiver-launcher:environment:signing
environment: signing
permissions:
contents: read
id-token: write
env:
TRUSTED_SIGNING_ENABLED: ${{ vars.AZURE_TRUSTED_SIGNING_ENABLED }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
10.0.x
8.0.x
- name: Resolve pack version
id: ver
shell: bash
run: |
VERSION=$(grep -oE '<Version>[^<]+' QuiverLauncher.App.csproj | head -n1 | sed 's/<Version>//')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Pack version: $VERSION"
- name: Publish Windows x64
run: |
dotnet publish QuiverLauncher.Desktop/QuiverLauncher.Desktop.csproj -c Release -r win-x64 --self-contained true -p:PublishTrimmed=false -o publish/win-x64
Remove-Item publish/win-x64/apps.json -ErrorAction SilentlyContinue
- name: Install vpk
run: dotnet tool install -g vpk --version ${{ env.VELOPACK_VERSION }}
- name: Azure login for Artifact Signing
id: azure_login
if: env.TRUSTED_SIGNING_ENABLED == 'true'
continue-on-error: true
uses: azure/login@v3
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Write Azure Trusted Signing metadata
if: env.TRUSTED_SIGNING_ENABLED == 'true' && steps.azure_login.outcome == 'success'
shell: pwsh
run: |
$json = @"
{
"Endpoint": "${{ vars.AZURE_TRUSTED_SIGNING_ENDPOINT }}",
"CodeSigningAccountName": "${{ vars.AZURE_TRUSTED_SIGNING_ACCOUNT }}",
"CertificateProfileName": "${{ vars.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE }}"
}
"@
[System.IO.File]::WriteAllText("$PWD/signing-metadata.json", $json.Trim(), [System.Text.UTF8Encoding]::new($false))
- name: Velopack pack (Windows, signed)
if: env.TRUSTED_SIGNING_ENABLED == 'true' && steps.azure_login.outcome == 'success'
shell: pwsh
run: |
vpk pack `
--packId ${{ env.PACK_ID }} `
--packVersion ${{ steps.ver.outputs.version }} `
--packDir publish/win-x64 `
--mainExe QuiverLauncher.exe `
--icon icon.ico `
--runtime win-x64 `
--channel win `
--noInst true `
--outputDir releases/win-x64 `
--azureTrustedSignFile "$PWD/signing-metadata.json"
- name: Velopack pack (Windows, unsigned)
if: env.TRUSTED_SIGNING_ENABLED != 'true' || steps.azure_login.outcome != 'success'
shell: pwsh
run: |
if ("${{ env.TRUSTED_SIGNING_ENABLED }}" -eq "true") {
Write-Warning "Azure login failed. Windows Velopack packages will be UNSIGNED."
} else {
Write-Warning "AZURE_TRUSTED_SIGNING_ENABLED is not 'true'. Windows Velopack packages will be UNSIGNED."
}
vpk pack `
--packId ${{ env.PACK_ID }} `
--packVersion ${{ steps.ver.outputs.version }} `
--packDir publish/win-x64 `
--mainExe QuiverLauncher.exe `
--icon icon.ico `
--runtime win-x64 `
--channel win `
--noInst true `
--outputDir releases/win-x64
- name: Upload Windows Velopack artifacts
uses: actions/upload-artifact@v4
with:
name: velopack-win-x64
path: releases/win-x64/**
retention-days: 14
pack-linux:
needs: test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- rid: linux-x64
- rid: linux-arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Resolve pack version
id: ver
shell: bash
run: |
VERSION=$(grep -oE '<Version>[^<]+' QuiverLauncher.App.csproj | head -n1 | sed 's/<Version>//')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Publish ${{ matrix.rid }}
run: |
dotnet publish QuiverLauncher.Desktop/QuiverLauncher.Desktop.csproj -c Release -r ${{ matrix.rid }} --self-contained true -p:PublishTrimmed=false -o publish/${{ matrix.rid }}
# Do not bake user-data leftovers into the AppImage.
rm -f publish/${{ matrix.rid }}/apps.json \
publish/${{ matrix.rid }}/settings.json \
publish/${{ matrix.rid }}/games.json \
publish/${{ matrix.rid }}/game.json \
publish/${{ matrix.rid }}/crash.log
rm -rf publish/${{ matrix.rid }}/Apps publish/${{ matrix.rid }}/Cache
- name: Install AppImage pack dependencies
run: |
sudo apt-get update
sudo apt-get install -y squashfs-tools
- name: Install vpk
run: dotnet tool install -g vpk --version ${{ env.VELOPACK_VERSION }}
- name: Velopack pack (Linux AppImage)
run: |
vpk pack \
--packId ${{ env.PACK_ID }} \
--packVersion ${{ steps.ver.outputs.version }} \
--packDir publish/${{ matrix.rid }} \
--mainExe QuiverLauncher \
--icon Assets/quiver-icon.png \
--runtime ${{ matrix.rid }} \
--channel ${{ matrix.rid }} \
--outputDir releases/${{ matrix.rid }}
- name: Upload Linux Velopack artifacts
uses: actions/upload-artifact@v4
with:
name: velopack-${{ matrix.rid }}
path: releases/${{ matrix.rid }}/**
retention-days: 14
pack-macos:
needs: test
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- rid: osx-x64
- rid: osx-arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Resolve pack version
id: ver
shell: bash
run: |
VERSION=$(grep -oE '<Version>[^<]+' QuiverLauncher.App.csproj | head -n1 | sed 's/<Version>//')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Publish ${{ matrix.rid }}
run: |
dotnet publish QuiverLauncher.Desktop/QuiverLauncher.Desktop.csproj -c Release -r ${{ matrix.rid }} --self-contained true -p:PublishTrimmed=false -o publish/${{ matrix.rid }}
rm -f publish/${{ matrix.rid }}/apps.json
- name: Install vpk
run: dotnet tool install -g vpk --version ${{ env.VELOPACK_VERSION }}
- name: Build macOS .icns from quiver-icon.png
run: |
set -euo pipefail
SRC="Assets/quiver-icon.png"
ICONSET="QuiverLauncher.iconset"
rm -rf "$ICONSET" QuiverLauncher.icns
mkdir "$ICONSET"
for size in 16 32 128 256 512; do
sips -z "$size" "$size" "$SRC" --out "$ICONSET/icon_${size}x${size}.png" >/dev/null
double=$((size * 2))
sips -z "$double" "$double" "$SRC" --out "$ICONSET/icon_${size}x${size}@2x.png" >/dev/null
done
iconutil -c icns "$ICONSET" -o QuiverLauncher.icns
test -f QuiverLauncher.icns
# Apple Developer ID + notarization can be wired later via
# --signAppIdentity / --signInstallIdentity / --notaryProfile / --keychain.
- name: Velopack pack (macOS)
run: |
vpk pack \
--packId ${{ env.PACK_ID }} \
--packVersion ${{ steps.ver.outputs.version }} \
--packDir publish/${{ matrix.rid }} \
--mainExe QuiverLauncher \
--icon QuiverLauncher.icns \
--runtime ${{ matrix.rid }} \
--channel ${{ matrix.rid }} \
--noInst true \
--outputDir releases/${{ matrix.rid }}
# Until the app is signed with a Developer ID, give the downloadable app a complete
# ad-hoc signature. vpk leaves the bundle's seal broken, which macOS reports as
# "damaged" with no way to open it; an intact ad-hoc signature gets the usual
# "Open Anyway" prompt instead.
- name: Ad-hoc sign the portable macOS app
shell: bash
run: |
set -euo pipefail
cd releases/${{ matrix.rid }}
ZIP=$(ls *-Portable.zip)
rm -rf adhoc
mkdir adhoc
ditto -x -k "$ZIP" adhoc
APP=$(find adhoc -maxdepth 2 -name '*.app' -type d | head -n1)
test -n "$APP"
codesign --force --deep --sign - "$APP"
codesign --verify --deep --strict "$APP"
rm "$ZIP"
ditto -c -k --sequesterRsrc adhoc "$ZIP"
rm -rf adhoc
- name: Upload macOS Velopack artifacts
uses: actions/upload-artifact@v4
with:
name: velopack-${{ matrix.rid }}
path: releases/${{ matrix.rid }}/**
retention-days: 14
# Build and smoke-test the experimental Linux x64 Flatpak release bundle.
pack-flatpak:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Install Flatpak tooling
run: |
sudo apt-get update
sudo apt-get install -y flatpak libflatpak0 dbus xvfb
- name: Cache Flatpak runtimes
uses: actions/cache@v4
with:
path: ~/.local/share/flatpak
key: flatpak-runtimes-25.08-${{ runner.os }}
- name: Install Flatpak runtime + SDK
run: |
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user --noninteractive flathub org.freedesktop.Platform//25.08 org.freedesktop.Sdk//25.08 org.flatpak.Builder
- name: Publish linux-x64
run: |
dotnet publish QuiverLauncher.Desktop/QuiverLauncher.Desktop.csproj -c Release -r linux-x64 --self-contained true -p:PublishTrimmed=false -o publish/linux-x64
# Do not bake user-data leftovers into the Flatpak.
rm -f publish/linux-x64/apps.json \
publish/linux-x64/settings.json \
publish/linux-x64/games.json \
publish/linux-x64/game.json \
publish/linux-x64/crash.log
rm -rf publish/linux-x64/Apps publish/linux-x64/Cache
- name: Test native Flatpak install, update, launch and uninstall
env:
QUIVER_FLATPAK_TEST_RUNTIME: org.freedesktop.Platform/x86_64/25.08
run: |
dbus-run-session -- dotnet test QuiverLauncher.Tests/QuiverLauncher.Tests.csproj -c Release \
--filter FullyQualifiedName~FlatpakLinuxIntegrationTests --logger "console;verbosity=normal"
- name: flatpak-builder
run: |
dbus-run-session -- flatpak run org.flatpak.Builder --user --force-clean --repo=packaging/flatpak/repo \
packaging/flatpak/build packaging/flatpak/io.github.tgeorgiadis.QuiverLauncher.yml
- name: Build .flatpak bundle
run: |
flatpak build-bundle --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo \
packaging/flatpak/repo QuiverLauncher.flatpak \
io.github.tgeorgiadis.QuiverLauncher master
- name: Verify bundle reader dependencies in the runtime
run: |
flatpak build --runtime packaging/flatpak/build sh -ec '
test -x /app/bin/quiver-launcher
dependencies="$(ldd /app/lib/libflatpak.so.0)"
printf "%s\n" "$dependencies"
if printf "%s\n" "$dependencies" | grep -q "not found"; then exit 1; fi
'
flatpak build --runtime --env=XDG_DATA_HOME=/tmp/quiver-package-smoke \
packaging/flatpak/build /app/bin/quiver-launcher --help
- name: Install and smoke-test the release bundle
run: |
set -euo pipefail
flatpak install --user --noninteractive ./QuiverLauncher.flatpak
flatpak info --user io.github.tgeorgiadis.QuiverLauncher
dbus-run-session -- flatpak run io.github.tgeorgiadis.QuiverLauncher --help
# Exercise the actual desktop entry point in a headless X11 session.
# timeout=124 means the UI stayed running for the observation window.
status=0
dbus-run-session -- xvfb-run -a timeout 20s flatpak run io.github.tgeorgiadis.QuiverLauncher > flatpak-ui-smoke.log 2>&1 || status=$?
cat flatpak-ui-smoke.log
test "$status" -eq 124
- name: Upload Flatpak artifact
# Only upload a bundle after the installed-package smoke check succeeds.
uses: actions/upload-artifact@v4
with:
name: flatpak-linux-x64
path: QuiverLauncher.flatpak
if-no-files-found: error
retention-days: 14
# Publish Velopack packages to a GitHub Release when a v* tag is pushed.
# Runs even if some desktop packs fail so successful channels still ship.
# Android and Flatpak are required: tags must include a signed APK and a tested bundle.
publish-github-release:
if: always() && startsWith(github.ref, 'refs/tags/v') && needs.test.result == 'success' && needs.build-android.result == 'success' && needs.pack-flatpak.result == 'success'
needs: [test, pack-windows, pack-linux, pack-macos, pack-flatpak, build-android]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Resolve pack version
id: ver
shell: bash
run: |
VERSION=$(grep -oE '<Version>[^<]+' QuiverLauncher.App.csproj | head -n1 | sed 's/<Version>//')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
if [[ "$VERSION" == *-* ]]; then
echo "prerelease=true" >> "$GITHUB_OUTPUT"
else
echo "prerelease=false" >> "$GITHUB_OUTPUT"
fi
- name: Download Velopack artifacts
uses: actions/download-artifact@v4
with:
pattern: velopack-*
path: release-assets
merge-multiple: false
- name: Download Android APK
uses: actions/download-artifact@v4
with:
name: android-apk
path: release-assets/android
- name: Download Flatpak bundle
uses: actions/download-artifact@v4
with:
name: flatpak-linux-x64
path: release-assets/flatpak
- name: Publish GitHub Release with user + Velopack feed assets
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
TAG="${GITHUB_REF_NAME}"
VERSION="${{ steps.ver.outputs.version }}"
REPO="${{ github.repository }}"
BASE="https://github.com/${REPO}/releases/download/${TAG}"
# Drop Squirrel leftover; clients use releases.{channel}.json.
find release-assets -type f -name 'RELEASES' -delete
# Drop Setup installers if any slipped through (portable-first).
find release-assets -type f \( -name '*-Setup.exe' -o -name '*-Setup.pkg' -o -name 'assets.*.json' \) -delete
mapfile -t FILES < <(
find release-assets -type f \( \
-name '*.nupkg' -o \
-name 'releases.*.json' -o \
-name '*Portable.zip' -o \
-name '*.AppImage' -o \
-name '*.apk' -o \
-name '*.flatpak' \
\) | sort
)
if [[ ${#FILES[@]} -eq 0 ]]; then
echo "No release assets found under release-assets/"
ls -laR release-assets || true
exit 1
fi
NOTES_BODY="$(mktemp)"
{
echo "## Downloads"
echo ""
echo "- **Windows:** [${BASE}/QuiverLauncher-win-Portable.zip](${BASE}/QuiverLauncher-win-Portable.zip)"
echo "- **Linux x64:** [${BASE}/QuiverLauncher-linux-x64.AppImage](${BASE}/QuiverLauncher-linux-x64.AppImage)"
echo "- **Linux ARM64:** [${BASE}/QuiverLauncher-linux-arm64.AppImage](${BASE}/QuiverLauncher-linux-arm64.AppImage)"
echo "- **Linux x64 Flatpak (experimental):** [QuiverLauncher.flatpak](${BASE}/QuiverLauncher.flatpak)"
echo "- **Android:** [${BASE}/QuiverLauncher-android.apk](${BASE}/QuiverLauncher-android.apk)"
echo "- **macOS (Apple Silicon):** [${BASE}/QuiverLauncher-osx-arm64-Portable.zip](${BASE}/QuiverLauncher-osx-arm64-Portable.zip)"
echo "- **macOS (Intel):** [${BASE}/QuiverLauncher-osx-x64-Portable.zip](${BASE}/QuiverLauncher-osx-x64-Portable.zip)"
echo ""
echo "---"
echo ""
if [[ -f RELEASE_NOTES.md ]]; then
cat RELEASE_NOTES.md
else
echo "Quiver Launcher v${VERSION}"
fi
} > "$NOTES_BODY"
# Clean up any leftover draft from a previous failed publish.
if gh release view "$TAG" >/dev/null 2>&1; then
gh release delete "$TAG" --yes || true
fi
PRE_ARGS=()
if [[ "${{ steps.ver.outputs.prerelease }}" == "true" ]]; then
PRE_ARGS+=(--prerelease)
fi
gh release create "$TAG" \
--title "Quiver Launcher v${VERSION}" \
--notes-file "$NOTES_BODY" \
--target "$GITHUB_SHA" \
"${PRE_ARGS[@]}" \
"${FILES[@]}"
build-android:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
packages: platform-tools
- name: Install Android workload
run: dotnet workload install android
- name: Install Android SDK dependencies
run: |
dotnet build QuiverLauncher.Android/QuiverLauncher.Android.csproj -t:InstallAndroidDependencies \
-f net10.0-android \
-p:AndroidSdkDirectory="${ANDROID_HOME:-${ANDROID_SDK_ROOT}}" \
-p:AcceptAndroidSDKLicenses=True
- name: Resolve Android version
id: ver
shell: bash
run: |
VERSION=$(grep -oE '<Version>[^<]+' QuiverLauncher.App.csproj | head -n1 | sed 's/<Version>//')
BASE="${VERSION%%-*}"
IFS='.' read -r MAJOR MINOR PATCH _ <<< "${BASE}.0.0"
APP_VERSION=$((10#${MAJOR:-0} * 10000 + 10#${MINOR:-0} * 100 + 10#${PATCH:-0}))
echo "display=$VERSION" >> "$GITHUB_OUTPUT"
echo "version_code=$APP_VERSION" >> "$GITHUB_OUTPUT"
echo "Android display=$VERSION versionCode=$APP_VERSION"
- name: Detect Android signing secrets
id: sign
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
run: |
if [[ -n "${ANDROID_KEYSTORE_BASE64}" && -n "${ANDROID_KEYSTORE_PASSWORD}" && -n "${ANDROID_KEY_ALIAS}" && -n "${ANDROID_KEY_PASSWORD}" ]]; then
echo "available=true" >> "$GITHUB_OUTPUT"
else
echo "available=false" >> "$GITHUB_OUTPUT"
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
echo "Android keystore secrets are required to publish a signed APK on tags."
exit 1
fi
fi
- name: Compile Android
if: steps.sign.outputs.available != 'true'
run: dotnet build QuiverLauncher.Android/QuiverLauncher.Android.csproj -c Release
- name: Publish signed Android APK
if: steps.sign.outputs.available == 'true'
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
run: |
set -euo pipefail
KEYSTORE_PATH="QuiverLauncher.Android/ci-release.jks"
STORE_PASS="${RUNNER_TEMP}/android-store.pass"
KEY_PASS="${RUNNER_TEMP}/android-key.pass"
cleanup() {
rm -f "${KEYSTORE_PATH}" "${STORE_PASS}" "${KEY_PASS}"
}
trap cleanup EXIT
printf '%s' "${ANDROID_KEYSTORE_BASE64}" | tr -d '\r\n ' | base64 -d > "${KEYSTORE_PATH}"
printf '%s' "${ANDROID_KEYSTORE_PASSWORD}" > "${STORE_PASS}"
printf '%s' "${ANDROID_KEY_PASSWORD}" > "${KEY_PASS}"
chmod 600 "${STORE_PASS}" "${KEY_PASS}"
keytool -list -keystore "${KEYSTORE_PATH}" -storepass:file "${STORE_PASS}" >/dev/null
mkdir -p artifacts/android
dotnet publish QuiverLauncher.Android/QuiverLauncher.Android.csproj -c Release -f net10.0-android \
-p:AndroidPackageFormats=apk \
-p:ApplicationDisplayVersion="${{ steps.ver.outputs.display }}" \
-p:ApplicationVersion="${{ steps.ver.outputs.version_code }}" \
-p:AndroidKeyStore=true \
-p:AndroidSigningKeyStore=ci-release.jks \
-p:AndroidSigningStorePass="file:${STORE_PASS}" \
-p:AndroidSigningKeyAlias="${ANDROID_KEY_ALIAS}" \
-p:AndroidSigningKeyPass="file:${KEY_PASS}"
mapfile -t apks < <(find QuiverLauncher.Android -iname '*signed*.apk' -print)
if [[ ${#apks[@]} -eq 0 ]]; then
echo "No signed APK produced."
find QuiverLauncher.Android -iname '*.apk' -print || true
exit 1
fi
cp "${apks[0]}" artifacts/android/QuiverLauncher-android.apk
ls -lh artifacts/android/QuiverLauncher-android.apk
- name: Upload Android APK
if: steps.sign.outputs.available == 'true'
uses: actions/upload-artifact@v4
with:
name: android-apk
path: artifacts/android/QuiverLauncher-android.apk
retention-days: 14
+70
View File
@@ -0,0 +1,70 @@
name: Live catalog
# Read-only runs against the real catalog on quiverlauncher.com, on Linux and
# Windows. The catalog changes on its own, so they run once a day and on
# demand rather than on every push, and a failure here doesn't hold up a merge.
on:
schedule:
- cron: "17 5 * * *"
workflow_dispatch:
# And on a pull request that changes these runs.
pull_request:
paths:
- .github/workflows/live.yml
- e2e/live.test.js
- e2e/session.js
concurrency:
group: live-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
linux:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with: { workspaces: apps/launcher/src-tauri }
# Ubuntu's mirror can crawl: apt-install.sh tries a stalled download again, and the step's limit stops one that
# stays stuck rather than holding the job.
- name: System libraries
timeout-minutes: 12
run: .github/apt-install.sh libdbus-1-dev libwebkit2gtk-4.1-dev librsvg2-dev libayatana-appindicator3-dev libudev-dev webkit2gtk-driver xvfb
- run: cargo install tauri-driver --locked
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @quiver/e2e build
- name: Live catalog
timeout-minutes: 15
run: dbus-run-session -- pnpm --filter @quiver/e2e live
windows:
runs-on: windows-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with: { workspaces: apps/launcher/src-tauri }
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @quiver/e2e build
- name: WebDriver for WebView2
run: |
cargo install --git https://github.com/chippers/msedgedriver-tool
msedgedriver-tool.exe
.\msedgedriver.exe --version
# Verbose driver log, printed after the run.
Set-Content msedgedriver-verbose.cmd "@`"$PWD\msedgedriver.exe`" %* --verbose --log-path=`"$env:RUNNER_TEMP\msedgedriver.log`""
echo "NATIVE_DRIVER=$PWD\msedgedriver-verbose.cmd" >> $env:GITHUB_ENV
- name: Live catalog
timeout-minutes: 15
run: pnpm --filter @quiver/e2e live
- name: Driver log
if: always()
run: Get-Content "$env:RUNNER_TEMP\msedgedriver.log" -Tail 80 -ErrorAction SilentlyContinue
+404
View File
@@ -0,0 +1,404 @@
name: Release
# Builds the Windows installer, the portable Windows zip, the AppImage, the
# Flatpak, the Mac DMG and the Android APK, signs each for the launcher's
# self-update (update.rs), and puts them on a draft release. Nothing is public until the draft is published by hand.
#
# Run it from the Actions tab (Release, Run workflow, on main), or push a tag
# such as v4.0.0-alpha.1. The version comes from tauri.conf.json, so bump it
# there (and in Cargo.toml and package.json) first.
#
# Settings it reads (Settings > Secrets and variables > Actions):
# TAURI_SIGNING_PRIVATE_KEY, TAURI_SIGNING_PRIVATE_KEY_PASSWORD (secrets):
# from `pnpm --filter @quiver/launcher tauri signer generate`. They sign the
# downloads; unset, the release has no .sig files and can't update anyone.
# QUIVER_UPDATE_PUBKEY (variable): the matching .pub file. Built into the
# launcher so it can check those signatures; unset, it can't update itself.
# POSTHOG_PROJECT_TOKEN (variable): usage data, as in CI.
# And in the signing environment (Settings > Environments > signing), for
# Windows code signing: AZURE_CLIENT_ID, AZURE_TENANT_ID and
# AZURE_SUBSCRIPTION_ID (secrets); AZURE_TRUSTED_SIGNING_ENDPOINT, _ACCOUNT,
# _CERTIFICATE_PROFILE and AZURE_TRUSTED_SIGNING_ENABLED (variables).
# For a signed and notarised Mac build (optional): APPLE_CERTIFICATE (the
# Developer ID Application .p12, base64), APPLE_CERTIFICATE_PASSWORD,
# APPLE_SIGNING_IDENTITY, APPLE_ID, APPLE_PASSWORD (an app-specific password)
# and APPLE_TEAM_ID (secrets).
# For the Android APK: ANDROID_KEYSTORE (a .jks keystore, base64),
# ANDROID_KEYSTORE_PASSWORD, ANDROID_KEY_ALIAS and ANDROID_KEY_PASSWORD (secrets).
on:
workflow_dispatch:
push:
tags: ["v*"]
# And on a pull request that changes it, which builds everything but makes no release.
pull_request:
paths: [.github/workflows/release.yml, .github/cef-tools.sh, .github/cef-appimage-check.sh, apps/launcher/flatpak/**]
concurrency:
group: release-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
QUIVER_UPDATE_PUBKEY: ${{ vars.QUIVER_UPDATE_PUBKEY }}
VITE_POSTHOG_PROJECT_TOKEN: ${{ vars.POSTHOG_PROJECT_TOKEN }}
jobs:
version:
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: The version, the same in every file and the tag
id: version
run: |
version=$(node -p 'require("./apps/launcher/src-tauri/tauri.conf.json").version')
package=$(node -p 'require("./apps/launcher/package.json").version')
cargo=$(sed -n 's/^version = "\(.*\)"/\1/p' apps/launcher/src-tauri/Cargo.toml | head -1)
echo "tauri.conf.json $version, package.json $package, Cargo.toml $cargo"
test "$version" = "$package" && test "$version" = "$cargo"
if [ "$GITHUB_REF_TYPE" = tag ]; then test "$GITHUB_REF_NAME" = "v$version"; fi
echo "version=$version" >> "$GITHUB_OUTPUT"
windows:
needs: version
runs-on: windows-latest
timeout-minutes: 45
# Code signing through Azure Artifact Signing, the account 3.x signs with
# (spec 3.1). It logs in with GitHub OIDC, whose subject is
# repo:tgeorgiadis/quiver-launcher:environment:signing. The
# environment holds the AZURE_* secrets and variables;
# AZURE_TRUSTED_SIGNING_ENABLED set to true turns it on, and then a
# signing failure fails the build rather than shipping it unsigned.
environment: signing
permissions:
contents: read
id-token: write
env:
VERSION: ${{ needs.version.outputs.version }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
CODE_SIGNING: ${{ vars.AZURE_TRUSTED_SIGNING_ENABLED }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- uses: dtolnay/rust-toolchain@stable
# The release build cached by CI's installer job, which compiles the same
# crates. Under the default key, named after the job, this got CI's
# windows job's cache, a debug build, so every crate was compiled again.
- uses: Swatinem/rust-cache@v2
with: { workspaces: apps/launcher/src-tauri, shared-key: windows-release }
- run: pnpm install --frozen-lockfile
# Built first and bundled after the Azure login: the login's token from
# GitHub only lasts about ten minutes, which the compile alone can take.
- run: pnpm --filter @quiver/launcher tauri build --no-bundle
- name: Azure login for code signing
if: env.CODE_SIGNING == 'true'
uses: azure/login@v3
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
# Tauri runs signCommand on the app's exe and on the installer. signtool
# hands the signing to Artifact Signing's dlib, which uses the login above.
- name: Code signing setup
if: env.CODE_SIGNING == 'true'
run: |
$dir = "$env:RUNNER_TEMP\artifact-signing"
Invoke-WebRequest https://www.nuget.org/api/v2/package/Microsoft.ArtifactSigning.Client/1.0.146 -OutFile "$env:RUNNER_TEMP\artifact-signing.zip"
Expand-Archive "$env:RUNNER_TEMP\artifact-signing.zip" $dir
$dlib = "$dir\bin\x64\Azure.CodeSigning.Dlib.dll"
$signtool = (Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.*\x64\signtool.exe" | Sort-Object FullName | Select-Object -Last 1).FullName
@{
Endpoint = "${{ vars.AZURE_TRUSTED_SIGNING_ENDPOINT }}"
CodeSigningAccountName = "${{ vars.AZURE_TRUSTED_SIGNING_ACCOUNT }}"
CertificateProfileName = "${{ vars.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE }}"
} | ConvertTo-Json | Set-Content -Encoding ascii "$dir\metadata.json"
@{ bundle = @{ windows = @{ signCommand = @{
cmd = $signtool
args = @("sign", "/v", "/fd", "SHA256", "/tr", "http://timestamp.acs.microsoft.com", "/td", "SHA256", "/dlib", $dlib, "/dmdf", "$dir\metadata.json", "%1")
} } } } | ConvertTo-Json -Depth 5 | Set-Content -Encoding ascii "$dir\tauri.sign.json"
echo "TAURI_SIGN_CONFIG=--config=$dir\tauri.sign.json" >> $env:GITHUB_ENV
echo "SIGNTOOL=$signtool" "SIGN_DLIB=$dlib" "SIGN_METADATA=$dir\metadata.json" >> $env:GITHUB_ENV
- name: Warn when not code signed
if: env.CODE_SIGNING != 'true'
run: echo "::warning::AZURE_TRUSTED_SIGNING_ENABLED isn't true, so the Windows downloads aren't code signed and Windows will warn about them."
- run: pnpm --filter @quiver/launcher tauri bundle --bundles nsis $env:TAURI_SIGN_CONFIG
# Signing takes seconds; a stuck login shouldn't hold the job for its whole timeout.
timeout-minutes: 10
# Names without spaces, which GitHub would turn into dots. The installer
# keeps "-setup.exe" and the zip its 3.x name, which is how update.rs finds them.
- name: Installer and portable zip
run: |
New-Item -ItemType Directory out | Out-Null
$target = "apps\launcher\src-tauri\target\release"
Copy-Item (Get-Item "$target\bundle\nsis\*-setup.exe") "out\QuiverLauncher_${env:VERSION}_x64-setup.exe"
New-Item -ItemType Directory portable | Out-Null
# The exe Tauri leaves in target/release isn't signed after bundling
# (only the one in the installer is), so the portable copy is signed here.
Copy-Item "$target\quiver-launcher.exe" portable\QuiverLauncher.exe
if ($env:CODE_SIGNING -eq "true") {
& $env:SIGNTOOL sign /v /fd SHA256 /tr http://timestamp.acs.microsoft.com /td SHA256 /dlib $env:SIGN_DLIB /dmdf $env:SIGN_METADATA portable\QuiverLauncher.exe
if ($LASTEXITCODE) { exit $LASTEXITCODE }
}
New-Item -ItemType File portable\portable.txt | Out-Null
Compress-Archive portable\* out\QuiverLauncher-win-Portable.zip
- name: The exes are code signed
if: env.CODE_SIGNING == 'true'
run: |
foreach ($file in @(Get-Item portable\QuiverLauncher.exe) + @(Get-Item out\*-setup.exe)) {
$signature = Get-AuthenticodeSignature $file.FullName
"$($file.Name): $($signature.Status), $($signature.SignerCertificate.Subject)"
if ($signature.Status -ne "Valid") { exit 1 }
}
- name: Sign for updates
if: env.TAURI_SIGNING_PRIVATE_KEY != ''
run: |
Get-ChildItem out | ForEach-Object {
pnpm --filter @quiver/launcher tauri signer sign --app-version $env:VERSION $_.FullName
if ($LASTEXITCODE) { exit $LASTEXITCODE }
}
- name: Warn when unsigned
if: env.TAURI_SIGNING_PRIVATE_KEY == ''
run: echo "::warning::TAURI_SIGNING_PRIVATE_KEY isn't set, so the Windows downloads aren't signed and can't update anyone."
- uses: actions/upload-artifact@v4
with: { name: windows, path: out/* }
# On the oldest supported Ubuntu, so it runs on older and newer distros alike.
# Linux runs on Chromium (Tauri's CEF runtime, apps/launcher/CEF-SPIKE.md),
# which draws the Steam Deck's shelves about three times as fast as
# WebKitGTK. The Flatpak is made here too, from the same program.
appimage:
needs: version
runs-on: ubuntu-22.04
timeout-minutes: 60
env:
VERSION: ${{ needs.version.outputs.version }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
steps:
# The CEF build and the GNOME SDK the Flatpak builds on don't both fit in the runner's free space: the SDKs it
# comes with that this job never uses (Android, .NET, Haskell) make room.
- name: Room on the disk
run: |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup
df -h /
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- uses: dtolnay/rust-toolchain@stable
# Kept when a later step fails too: a build from nothing takes about 20 minutes, and a run that fails after it
# would otherwise leave the next one to start from nothing again.
- uses: Swatinem/rust-cache@v2
with: { workspaces: apps/launcher/src-tauri, key: cef, cache-on-failure: true }
# The CEF build's CLI (built once per revision in cef-tools.sh) and the CEF distribution, saved as soon as each is
# there, whatever happens after.
- id: cef
run: echo "rev=$(sed -n 's/^REV=//p' .github/cef-tools.sh)" >> "$GITHUB_OUTPUT"
- id: cli
uses: actions/cache/restore@v4
with: { path: ~/.cache/tauri-cef-cli, key: "tauri-cef-cli-${{ steps.cef.outputs.rev }}" }
- id: dist
uses: actions/cache/restore@v4
with: { path: ~/.cache/cef, key: "cef-${{ hashFiles('apps/launcher/src-tauri/Cargo.cef.lock') }}" }
# Ubuntu's mirror can crawl: apt-install.sh tries a stalled download again, and the step's limit stops one that
# stays stuck rather than holding the job.
- name: System libraries
timeout-minutes: 12
run: .github/apt-install.sh libdbus-1-dev libwebkit2gtk-4.1-dev librsvg2-dev libayatana-appindicator3-dev libudev-dev libfuse2 xvfb
- name: The CEF build's tools
timeout-minutes: 25
run: .github/cef-tools.sh
- if: steps.cli.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with: { path: ~/.cache/tauri-cef-cli, key: "${{ steps.cli.outputs.cache-primary-key }}" }
- run: pnpm install --frozen-lockfile
# The AppImage, and a deb whose program and Chromium the Flatpak packs.
- run: sh apps/launcher/scripts/tauri-cef.sh build --bundles appimage,deb
- if: always() && steps.dist.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with: { path: ~/.cache/cef, key: "${{ steps.dist.outputs.cache-primary-key }}" }
- name: The AppImage holds what Chromium loads
run: .github/cef-appimage-check.sh apps/launcher/src-tauri/target/release/bundle/appimage/*.AppImage
- name: The AppImage starts
run: |
export QUIVER_DATA=$RUNNER_TEMP/quiver-smoke QUIVER_POSTHOG_HOST=http://127.0.0.1:9 QUIVER_SKIP_UPDATES=1
status=0; xvfb-run -a timeout 15 apps/launcher/src-tauri/target/release/bundle/appimage/*.AppImage > $RUNNER_TEMP/app.log 2>&1 || status=$?
cat $RUNNER_TEMP/app.log $QUIVER_DATA/quiver.log 2>/dev/null || true
test $status -eq 124
- name: AppImage
run: |
mkdir out
cp apps/launcher/src-tauri/target/release/bundle/appimage/*.AppImage "out/QuiverLauncher_${VERSION}_amd64.AppImage"
# The Flatpak packs the program and Chromium beside it, from the deb, on
# the GNOME runtime (apps/launcher/flatpak). This Ubuntu's flatpak-builder
# is too old for the runtime; Flatpak's PPA has a current one.
- name: Flatpak
run: |
sudo add-apt-repository -y ppa:flatpak/stable
sudo apt-get install -y flatpak flatpak-builder
flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
dir=apps/launcher/flatpak
dpkg-deb -x apps/launcher/src-tauri/target/release/bundle/deb/*.deb $RUNNER_TEMP/deb
cp -a "$RUNNER_TEMP/deb/usr/share/Quiver Launcher" $dir/cef
sed -i "s/@VERSION@/$VERSION/; s/@DATE@/$(date -u +%F)/" $dir/com.quiverlauncher.QuiverLauncher.metainfo.xml
flatpak-builder --user --disable-rofiles-fuse --install-deps-from=flathub --repo=$RUNNER_TEMP/flatpak-repo --force-clean $RUNNER_TEMP/flatpak-build $dir/com.quiverlauncher.QuiverLauncher.yml
# Its runtime comes from Flathub when it's installed.
flatpak build-bundle $RUNNER_TEMP/flatpak-repo "out/QuiverLauncher_${VERSION}_x86_64.flatpak" com.quiverlauncher.QuiverLauncher --runtime-repo=https://dl.flathub.org/repo/flathub.flatpakrepo
- name: The Flatpak starts
run: |
flatpak install --user -y --noninteractive --bundle out/*.flatpak
export QUIVER_DATA=$RUNNER_TEMP/quiver-flatpak-smoke QUIVER_POSTHOG_HOST=http://127.0.0.1:9 QUIVER_SKIP_UPDATES=1
status=0; xvfb-run -a dbus-run-session -- timeout 15 flatpak run com.quiverlauncher.QuiverLauncher > $RUNNER_TEMP/flatpak.log 2>&1 || status=$?
cat $RUNNER_TEMP/flatpak.log $QUIVER_DATA/quiver.log 2>/dev/null || true
test $status -eq 124
- name: Sign for updates
if: env.TAURI_SIGNING_PRIVATE_KEY != ''
run: |
for file in out/*; do
pnpm --filter @quiver/launcher tauri signer sign --app-version "$VERSION" "$PWD/$file"
done
- name: Warn when unsigned
if: env.TAURI_SIGNING_PRIVATE_KEY == ''
run: echo "::warning::TAURI_SIGNING_PRIVATE_KEY isn't set, so the AppImage and Flatpak aren't signed and can't update anyone."
- uses: actions/upload-artifact@v4
with: { name: linux, path: out/* }
# macOS: one universal DMG for Apple silicon and Intel. update.rs sends Mac
# players to the release page, so it has no self-update file of its own.
# Signed with a Developer ID and notarised when the APPLE_* secrets are
# set; without them it's ad-hoc signed, and macOS asks the player to allow
# it in System Settings > Privacy & Security the first time.
macos:
needs: version
runs-on: macos-latest
timeout-minutes: 60
env:
VERSION: ${{ needs.version.outputs.version }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
HAS_APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE != '' }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- uses: dtolnay/rust-toolchain@stable
with: { targets: "aarch64-apple-darwin,x86_64-apple-darwin" }
- uses: Swatinem/rust-cache@v2
with: { workspaces: apps/launcher/src-tauri }
- run: pnpm install --frozen-lockfile
# Tauri reads these from the environment, and an empty one counts as set,
# so the signed build is a step of its own.
- name: Build, signed with a Developer ID and notarised
if: env.HAS_APPLE_CERTIFICATE == 'true'
run: pnpm --filter @quiver/launcher tauri build --target universal-apple-darwin --bundles dmg
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- name: Build, ad-hoc signed
if: env.HAS_APPLE_CERTIFICATE != 'true'
run: |
echo "::warning::APPLE_CERTIFICATE isn't set, so the Mac build is only ad-hoc signed and not notarised."
pnpm --filter @quiver/launcher tauri build --target universal-apple-darwin --bundles dmg --config '{"bundle":{"macOS":{"signingIdentity":"-"}}}'
- name: DMG
run: |
mkdir out
cp apps/launcher/src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg "out/QuiverLauncher_${VERSION}_universal.dmg"
- name: Sign for updates
if: env.TAURI_SIGNING_PRIVATE_KEY != ''
run: |
for file in out/*; do
pnpm --filter @quiver/launcher tauri signer sign --app-version "$VERSION" "$PWD/$file"
done
- uses: actions/upload-artifact@v4
with: { name: macos, path: out/* }
# Android: an APK for arm64, which nearly every Android phone and handheld
# is. Signed with the keystore in ANDROID_KEYSTORE (base64); Android won't
# install an unsigned APK, so without it there's no Android file.
android:
needs: version
runs-on: ubuntu-24.04
timeout-minutes: 45
env:
VERSION: ${{ needs.version.outputs.version }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
HAS_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE != '' }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- uses: actions/setup-java@v4
with: { distribution: temurin, java-version: 17 }
- uses: dtolnay/rust-toolchain@stable
with: { targets: aarch64-linux-android }
- uses: Swatinem/rust-cache@v2
with: { workspaces: apps/launcher/src-tauri }
- run: pnpm install --frozen-lockfile
# The runner has the Android SDK and NDK already.
- run: echo "NDK_HOME=$ANDROID_NDK_LATEST_HOME" >> "$GITHUB_ENV"
- name: Keystore
if: env.HAS_KEYSTORE == 'true'
run: |
echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 -d > "$RUNNER_TEMP/release.jks"
echo "ANDROID_KEYSTORE_PATH=$RUNNER_TEMP/release.jks" >> "$GITHUB_ENV"
- name: Warn when unsigned
if: env.HAS_KEYSTORE != 'true'
run: echo "::warning::ANDROID_KEYSTORE isn't set, so the APK can't be signed and the release has no Android file."
# Read by gen/android/app/build.gradle.kts.
- run: pnpm --filter @quiver/launcher tauri android build --apk --target aarch64
env:
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
- name: APK
if: env.HAS_KEYSTORE == 'true'
run: |
mkdir out
cp apps/launcher/src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk "out/QuiverLauncher_${VERSION}_arm64.apk"
- name: Sign for updates
if: env.HAS_KEYSTORE == 'true' && env.TAURI_SIGNING_PRIVATE_KEY != ''
run: |
for file in out/*; do
pnpm --filter @quiver/launcher tauri signer sign --app-version "$VERSION" "$PWD/$file"
done
- uses: actions/upload-artifact@v4
if: env.HAS_KEYSTORE == 'true'
with: { name: android, path: out/* }
# A draft, marked as a pre-release when the version has a suffix such as
# -alpha.1. Publishing it (and so making the tag, for a run from the
# Actions tab) is done by hand on the Releases page.
release:
if: github.event_name != 'pull_request'
needs: [version, windows, appimage, macos, android]
runs-on: ubuntu-24.04
permissions:
contents: write
env:
VERSION: ${{ needs.version.outputs.version }}
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/download-artifact@v4
with: { path: out, merge-multiple: true }
- name: Draft release
run: |
ls -l out
tag="v$VERSION"
prerelease=$([[ "$VERSION" == *-* ]] && echo --prerelease || true)
if draft=$(gh release view "$tag" -R "$GITHUB_REPOSITORY" --json isDraft -q .isDraft 2>/dev/null); then
# Built again: a draft's files are replaced and its notes kept. A published release is left alone.
if [ "$draft" != true ]; then echo "::error::$tag is already published; bump the version for a new release."; exit 1; fi
gh release upload "$tag" out/* --clobber -R "$GITHUB_REPOSITORY"
else
gh release create "$tag" out/* -R "$GITHUB_REPOSITORY" --draft $prerelease \
--target "$GITHUB_SHA" --title "Quiver Launcher $VERSION" --generate-notes
fi
+7 -422
View File
@@ -1,423 +1,8 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# CI-only Android signing keystore (written on the runner, never committed)
QuiverLauncher.Android/ci-release.jks
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
_test_build/
.testbuild/
_build_check*/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Flatpak Build Directory
.flatpak-builder/
FlatpakBuild/
packaging/flatpak/build/
packaging/flatpak/repo/
*.flatpak
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
# but not Directory.Build.rsp, as it configures directory-level build defaults
!Directory.Build.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
#Blender Backup files and Renders
Icon/frames/
*.blend1
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
.patch_*.py
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider / IntelliJ
.idea/
*.sln.iml
flatpak.bat
dist/
target/
*.log
.env*
!.env.example
apps/launcher/src-tauri/gen/schemas/
e2e/phone-screenshots/
-15
View File
@@ -1,15 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Quiver Launcher (Debug)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/QuiverLauncher.Desktop/bin/Debug/net10.0/QuiverLauncher.Desktop.dll",
"args": [],
"cwd": "${workspaceFolder}/QuiverLauncher.Desktop/bin/Debug/net10.0",
"console": "internalConsole"
}
]
}
-40
View File
@@ -1,40 +0,0 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/QuiverLauncher.Desktop/QuiverLauncher.Desktop.csproj",
"-c",
"Debug",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$msCompile"
},
{
"label": "test",
"command": "dotnet",
"type": "process",
"args": [
"test",
"${workspaceFolder}/QuiverLauncher.sln",
"-c",
"Release",
"--filter",
"Category!=Slow",
"--logger",
"console;verbosity=normal"
],
"group": "test",
"problemMatcher": "$msCompile"
}
]
}
-138
View File
@@ -1,138 +0,0 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Input;
using Avalonia.Layout;
using Avalonia.Media;
using Avalonia.Media.Imaging;
using Avalonia.Platform;
using System;
using System.Threading.Tasks;
using QuiverLauncher.Services;
namespace QuiverLauncher;
public partial class App
{
/// <summary>
/// macOS app menu. Items on the Application's NativeMenu appear ahead of the
/// Services/Hide/Quit items; without them macOS shows Avalonia's generic defaults
/// ("About Avalonia"). Must run from <see cref="Initialize"/>: Avalonia reads the
/// application menu once during platform setup, before the framework-initialized hook.
/// </summary>
private void InitializeMacAppMenu()
{
// Menu bar title and the "Hide"/"Quit" labels when running unbundled (dotnet run).
Name = "Quiver Launcher";
var about = new NativeMenuItem("About Quiver Launcher");
about.Click += (_, _) => _ = ShowAboutWindowAsync();
var settings = new NativeMenuItem("Settings…")
{
Gesture = new KeyGesture(Key.OemComma, KeyModifiers.Meta),
};
settings.Click += (_, _) => OpenSettingsFromMenu();
var checkUpdates = new NativeMenuItem("Check for Updates…");
checkUpdates.Click += (_, _) => _ = CheckUpdatesFromTrayAsync();
NativeMenu.SetMenu(this, new NativeMenu
{
about,
new NativeMenuItemSeparator(),
settings,
checkUpdates,
});
}
/// <summary>macOS Window menu (⌘M), attached to the main window's menu bar.</summary>
private static void InitializeMacWindowMenu(MainWindow mainWindow)
{
var minimize = new NativeMenuItem("Minimize")
{
Gesture = new KeyGesture(Key.M, KeyModifiers.Meta),
};
minimize.Click += (_, _) => mainWindow.WindowState = WindowState.Minimized;
var zoom = new NativeMenuItem("Zoom");
zoom.Click += (_, _) => mainWindow.WindowState =
mainWindow.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
NativeMenu.SetMenu(mainWindow, new NativeMenu
{
new NativeMenuItem("Window") { Menu = new NativeMenu { minimize, zoom } },
});
}
private void OpenSettingsFromMenu()
{
if (ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime { MainWindow: MainWindow mainWindow })
return;
if (!mainWindow.IsVisible)
mainWindow.RestoreFromTray();
mainWindow.OpenSettings();
}
private async Task ShowAboutWindowAsync()
{
if (ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime { MainWindow: { } owner })
return;
using var iconStream = AssetLoader.Open(new Uri("avares://QuiverLauncher/Assets/app.png"));
var repositoryLink = new Button
{
Content = VelopackUpdateService.GitHubRepoUrl.Replace("https://", string.Empty),
HorizontalAlignment = HorizontalAlignment.Center,
Background = Brushes.Transparent,
Foreground = (IBrush?)Resources["ThemeAccent"],
Cursor = new Cursor(StandardCursorType.Hand),
};
repositoryLink.Click += (_, _) => UrlLauncher.Open(VelopackUpdateService.GitHubRepoUrl);
var window = new Window
{
Title = "About Quiver Launcher",
SizeToContent = SizeToContent.WidthAndHeight,
CanResize = false,
WindowStartupLocation = WindowStartupLocation.CenterOwner,
Background = (IBrush?)Resources["ThemeBase"],
Content = new StackPanel
{
Margin = new Thickness(32, 24),
Spacing = 8,
Width = 320,
Children =
{
new Image { Source = new Bitmap(iconStream), Width = 96, Height = 96, Margin = new Thickness(0, 0, 0, 8) },
new TextBlock
{
Text = "Quiver Launcher",
FontSize = 20,
FontWeight = FontWeight.SemiBold,
HorizontalAlignment = HorizontalAlignment.Center,
},
new TextBlock
{
Text = $"Version {LauncherVersionService.ReadInstalledVersion()}",
Foreground = (IBrush?)Resources["ThemeTextSecondary"],
HorizontalAlignment = HorizontalAlignment.Center,
},
new TextBlock
{
Text = "Download, install and run apps from GitHub and GitLab releases.",
TextWrapping = TextWrapping.Wrap,
TextAlignment = TextAlignment.Center,
Margin = new Thickness(0, 8, 0, 0),
},
repositoryLink,
},
},
};
DesktopInterfaceScaling.PrepareDialog(window, owner);
await window.ShowDialog(owner);
}
}
-489
View File
@@ -1,489 +0,0 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Layout;
using Avalonia.Media;
using Avalonia.Threading;
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using QuiverLauncher.Services;
using Velopack;
namespace QuiverLauncher;
public partial class App
{
private class ProgressWindow : Window
{
private readonly TextBlock _statusText;
private readonly ProgressBar _progressBar;
private readonly TextBlock _percentText;
public ProgressWindow()
{
Title = "Updating Launcher";
Width = 450;
Height = 180;
WindowStartupLocation = WindowStartupLocation.CenterOwner;
CanResize = false;
var panel = new StackPanel
{
Margin = new Thickness(30),
Spacing = 15
};
_statusText = new TextBlock
{
Text = "Preparing download...",
FontSize = 14,
Foreground = new SolidColorBrush(Colors.White),
TextAlignment = TextAlignment.Center
};
_progressBar = new ProgressBar
{
Height = 24,
Minimum = 0,
Maximum = 100,
Value = 0
};
_percentText = new TextBlock
{
Text = "0%",
FontSize = 12,
Foreground = new SolidColorBrush(Colors.LightGray),
TextAlignment = TextAlignment.Center,
Margin = new Thickness(0, -5, 0, 0)
};
panel.Children.Add(_statusText);
panel.Children.Add(_progressBar);
panel.Children.Add(_percentText);
Content = panel;
Background = new SolidColorBrush(Color.FromRgb(0x14, 0x14, 0x1a));
}
public void UpdateProgress(double percentage, string status)
{
Dispatcher.UIThread.Post(() =>
{
_progressBar.Value = percentage;
_percentText.Text = $"{percentage:F1}%";
_statusText.Text = status;
});
}
}
public async Task<ManualLauncherCheckResult> CheckForAppUpdatesManually()
{
if (AndroidLauncherUpdater.Current is {} android)
{
await android.CheckAsync(true);
return BuildManualLauncherResult(android.Installer.Installed.VersionName, !android.HasError,
android.Error, android.HasUpdate, android.AvailableVersion);
}
if (!PlatformCapabilities.SupportsVelopack)
{
return BuildManualLauncherResult(
LauncherVersionService.ReadInstalledVersion(AppDomain.CurrentDomain.BaseDirectory),
checkSucceeded: true);
}
await _updateCheckSemaphore.WaitAsync();
try
{
return await CheckForUpdatesAndApplyCoreAsync(isManualCheck: true)
?? BuildManualLauncherResult(
_velopackUpdates.CurrentVersion
?? LauncherVersionService.ReadInstalledVersion(AppDomain.CurrentDomain.BaseDirectory),
checkSucceeded: false,
errorMessage: "Update check did not complete.");
}
finally
{
_updateCheckSemaphore.Release();
}
}
public async Task PromptForPendingLauncherUpdateAsync(bool isManualCheck = false)
{
if (await ShowUpdateNotInstalledIfNeededAsync(repeat: isManualCheck))
return;
var result = await CheckVelopackUpdatesAsync();
if (!result.UpdateAvailable || result.UpdateInfo == null)
return;
await PromptAndApplyVelopackUpdateAsync(result.UpdateInfo, result.AvailableVersion ?? "new version", result.IncludedPrerelease);
}
public async Task ApplyPendingLauncherUpdateAsync()
{
var result = await CheckVelopackUpdatesAsync();
if (!result.UpdateAvailable || result.UpdateInfo == null)
return;
await Dispatcher.UIThread.InvokeAsync(async () =>
{
await DownloadAndApplyVelopackUpdateAsync(result.UpdateInfo, result.IncludedPrerelease);
});
}
public bool IsLauncherUpdatePending() =>
_velopackUpdates.IsUpdatePendingRestart || (_velopackUpdates.LastUpdateInfo != null);
private static ManualLauncherCheckResult BuildManualLauncherResult(
string installedVersion,
bool checkSucceeded = true,
string? errorMessage = null,
bool launcherUpdatePending = false,
string? availableLauncherVersion = null) =>
new()
{
CheckSucceeded = checkSucceeded,
ErrorMessage = errorMessage,
InstalledVersion = installedVersion,
LauncherUpdatePending = launcherUpdatePending,
AvailableLauncherVersion = availableLauncherVersion,
};
private bool IsKioskLocked()
{
if (TryGetHostedMainView() is { } view)
return view.SettingsModel.KioskLocked;
try
{
return KioskLaunch.IsStartupLocked(AppSettings.Load());
}
catch
{
return KioskLaunch.IsProcessArmed;
}
}
private async Task CheckForUpdatesAndApplyAsync(bool isManualCheck = false)
{
if (!PlatformCapabilities.SupportsVelopack)
{
Trace.WriteLine("Skipping launcher self-update check (not supported on this platform).");
return;
}
if (!isManualCheck && VelopackUpdateService.ShouldSkipAutomaticSelfUpdate())
{
Trace.WriteLine("Skipping launcher self-update check (DEBUG build or QuiverLauncher_SKIP_UPDATES is set).");
return;
}
await _updateCheckSemaphore.WaitAsync();
try
{
_ = await CheckForUpdatesAndApplyCoreAsync(isManualCheck: false);
}
finally
{
_updateCheckSemaphore.Release();
}
}
private async Task<VelopackCheckResult> CheckVelopackUpdatesAsync()
{
var settings = AppSettings.Load();
return await _velopackUpdates.CheckForUpdatesAsync(
GetGitHubToken(),
allowPrereleaseLauncherUpdates: settings.AllowPrereleaseLauncherUpdates);
}
private async Task<ManualLauncherCheckResult?> CheckForUpdatesAndApplyCoreAsync(bool isManualCheck)
{
// Explain an update that just failed instead of offering the same update again.
if (!isManualCheck && await ShowUpdateNotInstalledIfNeededAsync(repeat: false))
return null;
var result = await CheckVelopackUpdatesAsync();
if (result.IsNotInstalled)
{
if (isManualCheck)
{
return BuildManualLauncherResult(
result.InstalledVersion,
checkSucceeded: true,
errorMessage: "This build is not a Velopack install, so self-update is unavailable.");
}
return null;
}
if (!result.CheckSucceeded)
{
if (isManualCheck)
{
return BuildManualLauncherResult(
result.InstalledVersion,
checkSucceeded: false,
errorMessage: result.ErrorMessage ?? "Update check failed.");
}
return null;
}
if (!result.UpdateAvailable || result.UpdateInfo == null)
{
if (isManualCheck)
{
return BuildManualLauncherResult(
result.InstalledVersion,
launcherUpdatePending: false);
}
return null;
}
if (isManualCheck)
{
return BuildManualLauncherResult(
result.InstalledVersion,
launcherUpdatePending: true,
availableLauncherVersion: result.AvailableVersion);
}
if (!UpdatePromptPolicy.ShouldPromptLauncherSelfUpdate(IsKioskLocked()))
return null;
await PromptAndApplyVelopackUpdateAsync(
result.UpdateInfo,
result.AvailableVersion ?? "new version",
result.IncludedPrerelease);
return null;
}
private bool _updateNotInstalledShown;
/// <summary>
/// True when Quiver was just reopened by an update that didn't install. Explains why once per
/// session, or again when <paramref name="repeat"/> (the player checked for updates).
/// </summary>
private async Task<bool> ShowUpdateNotInstalledIfNeededAsync(bool repeat)
{
var pendingVersion = _velopackUpdates.PendingRestartVersion;
if (!LauncherUpdateFailure.UpdateWasNotInstalled(LauncherUpdateFailure.RestartedByUpdater, pendingVersion))
return false;
Trace.WriteLine($"Launcher update to {pendingVersion} was not installed.");
if ((_updateNotInstalledShown && !repeat) || !UpdatePromptPolicy.ShouldPromptLauncherSelfUpdate(IsKioskLocked()))
return true;
_updateNotInstalledShown = true;
var logPath = OperatingSystem.IsWindows() ? LauncherUpdateFailure.DefaultLogPath(_velopackUpdates.AppId) : null;
var reason = logPath != null ? LauncherUpdateFailure.ReadReason(logPath) : LauncherUpdateFailureReason.Unknown;
var message = LauncherUpdateFailure.FormatMessage(
pendingVersion!,
_velopackUpdates.CurrentVersion,
_velopackUpdates.RootAppDir,
reason,
logPath);
await Dispatcher.UIThread.InvokeAsync(async () =>
{
if (TryGetHostedMainView() is { } view)
await view.ShowScrollableMessageAsync(message, LauncherUpdateFailure.Title);
else
await ShowMessageBoxAsync(message, LauncherUpdateFailure.Title);
});
return true;
}
private async Task PromptAndApplyVelopackUpdateAsync(
UpdateInfo updateInfo,
string versionLabel,
bool includePrerelease)
{
await Dispatcher.UIThread.InvokeAsync(async () =>
{
var message = AppUpdateReviewMessages.FormatQuiverOnlyUpdateMessage(versionLabel);
bool accepted = await ShowMessageBoxWithChoiceAsync(
message,
"Update Available",
confirmText: "Update Quiver Launcher",
dismissText: "Not now");
if (!accepted)
return;
await DownloadAndApplyVelopackUpdateAsync(updateInfo, includePrerelease);
});
}
private async Task DownloadAndApplyVelopackUpdateAsync(UpdateInfo updateInfo, bool includePrerelease)
{
ProgressWindow? progressWindow = null;
try
{
await Dispatcher.UIThread.InvokeAsync(() =>
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop &&
desktop.MainWindow != null)
{
progressWindow = new ProgressWindow();
DesktopInterfaceScaling.PrepareDialog(progressWindow, desktop.MainWindow);
_ = progressWindow.ShowDialog(desktop.MainWindow);
}
});
progressWindow?.UpdateProgress(0, "Downloading update...");
var token = GetGitHubToken();
await _velopackUpdates.DownloadUpdatesAsync(
updateInfo,
progress: p => progressWindow?.UpdateProgress(p, $"Downloading update... {p}%"),
gitHubToken: token,
includePrerelease: includePrerelease);
progressWindow?.UpdateProgress(100, "Installing update...");
await Task.Delay(300);
await Dispatcher.UIThread.InvokeAsync(() => progressWindow?.Close());
_velopackUpdates.ApplyUpdatesAndRestart(updateInfo, includePrerelease);
}
catch (Exception ex)
{
await Dispatcher.UIThread.InvokeAsync(() => progressWindow?.Close());
await ShowMessageBoxAsync($"Failed to update Quiver Launcher: {ex.Message}", "Update Error");
}
}
private static string? GetGitHubToken()
{
try
{
return AppSettings.Load()?.GitHubApiToken;
}
catch
{
return null;
}
}
private async Task<bool> ShowMessageBoxWithChoiceAsync(
string message,
string title,
string confirmText = "Yes",
string dismissText = "No")
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop &&
desktop.MainWindow != null)
{
bool result = false;
var messageBox = new Window
{
Title = title,
Width = 450,
Height = 170,
WindowStartupLocation = WindowStartupLocation.CenterOwner,
Tag = false,
Content = new StackPanel
{
Margin = new Thickness(20),
Children =
{
new TextBlock
{
Text = message,
TextWrapping = TextWrapping.Wrap,
Margin = new Thickness(0, 0, 0, 20)
},
new StackPanel
{
Orientation = Orientation.Horizontal,
HorizontalAlignment = HorizontalAlignment.Center,
Children =
{
new Button
{
Content = confirmText,
Margin = new Thickness(0, 0, 10, 0),
MinWidth = 80
},
new Button
{
Content = dismissText,
MinWidth = 80
}
}
}
}
}
};
if (((StackPanel)messageBox.Content).Children[1] is StackPanel buttonPanel &&
buttonPanel.Children[0] is Button yesButton &&
buttonPanel.Children[1] is Button noButton)
{
yesButton.Click += (_, _) =>
{
result = true;
messageBox.Tag = true;
messageBox.Close();
};
noButton.Click += (_, _) =>
{
result = false;
messageBox.Tag = false;
messageBox.Close();
};
}
GamepadModalDialogNavigation.Attach(messageBox, accepted =>
{
result = accepted;
messageBox.Tag = accepted;
});
DesktopInterfaceScaling.PrepareDialog(messageBox, desktop.MainWindow);
await messageBox.ShowDialog(desktop.MainWindow);
if (messageBox.Tag is bool tagResult)
return tagResult;
return result;
}
return false;
}
private async Task ShowMessageBoxAsync(string message, string title)
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop &&
desktop.MainWindow != null)
{
var messageBox = new Window
{
Title = title,
Width = 400,
Height = 150,
WindowStartupLocation = WindowStartupLocation.CenterOwner,
Content = new StackPanel
{
Margin = new Thickness(20),
Children =
{
new TextBlock { Text = message, TextWrapping = TextWrapping.Wrap, Margin = new Thickness(0, 0, 0, 20) },
new Button { Content = "OK", HorizontalAlignment = HorizontalAlignment.Center }
}
}
};
if (((StackPanel)messageBox.Content).Children[1] is Button okButton)
okButton.Click += (_, _) => messageBox.Close();
GamepadModalDialogNavigation.Attach(messageBox);
DesktopInterfaceScaling.PrepareDialog(messageBox, desktop.MainWindow);
await messageBox.ShowDialog(desktop.MainWindow);
}
}
}
-184
View File
@@ -1,184 +0,0 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:services="clr-namespace:QuiverLauncher.Services"
x:Class="QuiverLauncher.App"
RequestedThemeVariant="Dark">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://QuiverLauncher/Themes/LauncherFeatureResources.axaml"/>
<ResourceInclude Source="avares://QuiverLauncher/Themes/WindowDrawnDecorations.axaml"/>
</ResourceDictionary.MergedDictionaries>
<SolidColorBrush x:Key="ThemeBase" Color="#18181b"/>
<SolidColorBrush x:Key="ThemeLighter" Color="#252527"/>
<SolidColorBrush x:Key="ThemeDarker" Color="#0e0e10"/>
<SolidColorBrush x:Key="ThemeBorder" Color="#2d2d30"/>
<SolidColorBrush x:Key="ThemeText" Color="White"/>
<SolidColorBrush x:Key="ThemeTextSecondary" Color="#B8B8B8"/>
<SolidColorBrush x:Key="ThemeSuccess" Color="#22c55e"/>
<SolidColorBrush x:Key="ThemeWarning" Color="#f59e0b"/>
<SolidColorBrush x:Key="ThemeError" Color="#ef4444"/>
<SolidColorBrush x:Key="ThemeAccent" Color="#f59e0b"/>
<SolidColorBrush x:Key="ThemeFocusRing" Color="#38bdf8"/>
</ResourceDictionary>
</Application.Resources>
<Application.Styles>
<FluentTheme />
<!-- Visible selection on dark ThemeBase TextBoxes (Steam Deck / themed inputs). -->
<Style Selector="TextBox">
<Setter Property="SelectionBrush" Value="{DynamicResource ThemeAccent}"/>
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource ThemeDarker}"/>
<Setter Property="CaretBrush" Value="{DynamicResource ThemeText}"/>
<Setter Property="services:GamepadTextInput.EngageOnConfirm" Value="True"/>
</Style>
<Style Selector="ContextMenu">
<Setter Property="Background" Value="{DynamicResource ThemeBase}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="4"/>
<Setter Property="CornerRadius" Value="8"/>
</Style>
<Style Selector="MenuItem">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
<Setter Property="Padding" Value="10,8"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="services:MenuSubmenuOverlap.Enable" Value="True"/>
</Style>
<Style Selector="MenuItem:selected">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
</Style>
<Style Selector="Window.gamepad-chrome Button,
Window.gamepad-chrome TextBox,
Window.gamepad-chrome CheckBox,
Window.gamepad-chrome ComboBox">
<Setter Property="FocusAdorner" Value="{x:Null}"/>
</Style>
<!-- Focus rings only under nav chrome; :focus-visible stays for Tab. -->
<Style Selector="Window.gamepad-chrome MenuItem:focus">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="MenuItem:focus-visible">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="Window.gamepad-chrome Button:focus">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="Window.gamepad-chrome TextBox:focus /template/ Border#PART_BorderElement">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="Window.gamepad-chrome CheckBox:focus /template/ Border#NormalRectangle">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="Window.gamepad-chrome ComboBox:focus">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="Window Button:focus-visible">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<!-- Gamepad/keyboard rings. Do not require Window.gamepad-chrome — Avalonia 12
ancestor matches fail in Gamescope the same way DataTemplates do. -->
<Style Selector="Button.gamepad-focused /template/ Border">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<Style Selector="Button.gamepad-focused">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<!-- Disabled dialog buttons (e.g. Install with nothing checked) must still show the ring. -->
<Style Selector="Button.gamepad-focused:disabled">
<Setter Property="Opacity" Value="1"/>
</Style>
<Style Selector="Button.gamepad-focused:disabled /template/ Border">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
<Setter Property="Background" Value="{DynamicResource ThemeDarker}"/>
</Style>
<Style Selector="TextBox.gamepad-focused /template/ Border#PART_BorderElement">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<Style Selector="CheckBox.gamepad-focused /template/ Border#NormalRectangle">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<!-- Modal dialogs are separate Windows; ComboBox focus ring must live in App styles. -->
<Style Selector="ComboBox.gamepad-focused">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<Style Selector="ComboBox.gamepad-focused /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource ThemeDarker}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<!-- Steam virtual mouse in Gaming Mode: don't let :pointerover look like the cursor. -->
<Style Selector="Window.gamepad-chrome Button.settings:pointerover">
<Setter Property="Background" Value="Transparent"/>
</Style>
<Style Selector="Window.gamepad-chrome Button.settings.gamepad-focused:pointerover">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<!-- Dialog ComboBox popups don't inherit MainWindow styles — define item chrome here. -->
<Style Selector="ComboBoxItem:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
</Style>
<!-- Committed selection (mouse or after Confirm) — quieter than the gamepad cursor. -->
<Style Selector="ComboBoxItem:selected /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeBase}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
</Style>
<!-- Keyboard/gamepad cursor before Confirm — strong fill + orange ring. -->
<Style Selector="ComboBoxItem.gamepad-focused /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="ComboBoxItem:selected.gamepad-focused /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
</Application.Styles>
</Application>
-305
View File
@@ -1,305 +0,0 @@
using AsyncImageLoader;
using AsyncImageLoader.Loaders;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Avalonia.Platform;
using Avalonia.Threading;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using QuiverLauncher.Services;
namespace QuiverLauncher;
public partial class App : Application, INotifyPropertyChanged
{
private string _currentVersionString = string.Empty;
public string currentVersionString
{
get => _currentVersionString;
set
{
if (_currentVersionString != value)
{
_currentVersionString = value;
OnPropertyChanged();
}
}
}
public new event PropertyChangedEventHandler? PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
private static bool _hasCheckedForAppUpdates = false;
private static readonly object _updateLock = new object();
private static readonly SemaphoreSlim _updateCheckSemaphore = new(1, 1);
private readonly TaskCompletionSource _startupSelfUpdatePromptCompleted = new(TaskCreationOptions.RunContinuationsAsynchronously);
private TrayIcon? _trayIcon;
private NativeMenuItem? _trayOpenItem;
private NativeMenuItem? _trayCheckUpdatesItem;
private NativeMenuItem? _trayExitItem;
/// <summary>
/// Completes when the startup Quiver self-update check (and any prompt) finishes or is skipped.
/// The first-run welcome awaits this so the two dialogs do not stack.
/// </summary>
public Task StartupSelfUpdatePromptCompleted => _startupSelfUpdatePromptCompleted.Task;
internal static WeakReference<MainView>? CurrentHostedMainView;
/// <summary>
/// Headless tests set this so OnFrameworkInitializationCompleted does not construct
/// MainWindow or start a Velopack self-update check. Those side effects leave
/// async service work that outlives the test which created the window.
/// </summary>
internal static bool SuppressDesktopHost { get; set; }
internal static MainView? TryGetHostedMainView()
=> CurrentHostedMainView is { } weak && weak.TryGetTarget(out var view) ? view : null;
private MainView CreateHostedMainView()
{
TryGetHostedMainView()?.HandleClosed();
var view = new MainView { _app = this };
CurrentHostedMainView = new WeakReference<MainView>(view);
return view;
}
private readonly VelopackUpdateService _velopackUpdates = new();
public override void Initialize()
{
DesktopInterfaceScaling.InitializePopups();
AvaloniaXamlLoader.Load(this);
if (OperatingSystem.IsMacOS())
InitializeMacAppMenu();
}
private static bool _usageDataHandlersRegistered;
public override void OnFrameworkInitializationCompleted()
{
// Errors nobody caught go to usage data too, when the player said yes to it.
if (!_usageDataHandlersRegistered)
{
_usageDataHandlersRegistered = true;
Telemetry.RegisterCrashHandlers();
Dispatcher.UIThread.UnhandledException += (_, e) =>
Telemetry.Current.CaptureException(e.Exception, handled: false, "ui_thread");
}
#if DEBUG
Dispatcher.UIThread.UnhandledException += (_, e) =>
{
CrashLog.LogFromUiThread("Dispatcher.UIThread.UnhandledException", e.Exception);
e.Handled = true;
};
#endif
ConfigureAsyncImageLoaderCache();
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
if (SuppressDesktopHost)
{
desktop.ShutdownMode = ShutdownMode.OnExplicitShutdown;
}
else
{
desktop.ShutdownMode = ShutdownMode.OnMainWindowClose;
desktop.Exit += (_, _) => Telemetry.Current.FlushBeforeExit();
var mainWindow = new MainWindow();
mainWindow._app = this;
desktop.MainWindow = mainWindow;
if (OperatingSystem.IsMacOS())
InitializeMacWindowMenu(mainWindow);
if (PlatformCapabilities.SupportsTray)
{
InitializeTrayIcon();
mainWindow.ApplyTraySettingsFromApp();
}
}
}
else if (ApplicationLifetime is IActivityApplicationLifetime activityLifetime)
{
activityLifetime.MainViewFactory = CreateHostedMainView;
}
else if (ApplicationLifetime is ISingleViewApplicationLifetime singleView)
{
singleView.MainView = CreateHostedMainView();
}
base.OnFrameworkInitializationCompleted();
if (SuppressDesktopHost)
{
_startupSelfUpdatePromptCompleted.TrySetResult();
return;
}
lock (_updateLock)
{
if (!_hasCheckedForAppUpdates)
{
_hasCheckedForAppUpdates = true;
Task.Run(async () =>
{
try
{
await CheckForUpdatesAndApplyAsync(isManualCheck: false);
}
finally
{
_startupSelfUpdatePromptCompleted.TrySetResult();
}
});
}
else
{
_startupSelfUpdatePromptCompleted.TrySetResult();
}
}
}
private void InitializeTrayIcon()
{
if (_trayIcon != null)
return;
_trayOpenItem = new NativeMenuItem("Open Quiver Launcher");
_trayOpenItem.Click += (_, _) => RestoreMainWindowFromTray();
_trayCheckUpdatesItem = new NativeMenuItem("Check for updates");
_trayCheckUpdatesItem.Click += (_, _) => _ = CheckUpdatesFromTrayAsync();
_trayExitItem = new NativeMenuItem("Exit");
_trayExitItem.Click += (_, _) => ExitFromTray();
var menu = new NativeMenu();
menu.Items.Add(_trayOpenItem);
menu.Items.Add(_trayCheckUpdatesItem);
menu.Items.Add(new NativeMenuItemSeparator());
menu.Items.Add(_trayExitItem);
_trayIcon = new TrayIcon
{
Icon = CreateTrayWindowIcon(),
ToolTipText = "Quiver Launcher",
IsVisible = false,
Menu = menu,
};
_trayIcon.Clicked += (_, _) => RestoreMainWindowFromTray();
var icons = new TrayIcons { _trayIcon };
TrayIcon.SetIcons(this, icons);
}
private static WindowIcon CreateTrayWindowIcon()
{
var icoPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "icon.ico");
if (File.Exists(icoPath))
return new WindowIcon(icoPath);
using var stream = AssetLoader.Open(new Uri("avares://QuiverLauncher/Assets/app.png"));
return new WindowIcon(stream);
}
public void SetTrayVisible(bool visible)
{
if (_trayIcon == null)
InitializeTrayIcon();
if (_trayIcon != null)
_trayIcon.IsVisible = visible;
}
public void UpdateTrayTooltip(int pendingUpdatesCount, bool isChecking)
{
if (_trayIcon == null)
return;
if (isChecking)
{
_trayIcon.ToolTipText = "Quiver Launcher · Checking for updates…";
return;
}
if (pendingUpdatesCount <= 0)
{
_trayIcon.ToolTipText = "Quiver Launcher";
return;
}
_trayIcon.ToolTipText = pendingUpdatesCount == 1
? "Quiver Launcher · 1 app needs review"
: $"Quiver Launcher · {pendingUpdatesCount} apps need review";
}
private void RestoreMainWindowFromTray()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop &&
desktop.MainWindow is MainWindow mainWindow)
{
mainWindow.RestoreFromTray();
}
}
private async Task CheckUpdatesFromTrayAsync()
{
if (ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop ||
desktop.MainWindow is not MainWindow mainWindow)
{
return;
}
if (!mainWindow.IsVisible)
mainWindow.RestoreFromTray();
await mainWindow.RunUpdateCheckAsync(promptForReview: true, isManualCheck: true);
}
private void ExitFromTray()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop &&
desktop.MainWindow is MainWindow mainWindow)
{
mainWindow.RequestExit();
return;
}
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime lifetime)
lifetime.Shutdown();
}
private static void ConfigureAsyncImageLoaderCache()
{
try
{
var imagesCache = Path.Combine(QuiverLauncherPaths.CacheDirectory, "Images");
Directory.CreateDirectory(imagesCache);
var previous = ImageLoader.AsyncImageLoader;
ImageLoader.AsyncImageLoader = new LauncherArtworkLoader(imagesCache);
if (!ReferenceEquals(previous, ImageLoader.AsyncImageLoader))
previous?.Dispose();
}
catch (Exception ex)
{
Trace.WriteLine($"Failed to configure AsyncImageLoader disk cache: {ex.Message}");
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 932 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 547 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

+135
View File
@@ -0,0 +1,135 @@
# Contributing
Thanks for wanting to help with Quiver Launcher! Everyone is welcome to contribute: bug reports, fixes, features,
translations and docs.
- **Found a bug or have an idea?** [Open an issue](https://github.com/tgeorgiadis/quiver-launcher/issues), or ask on
[Discord](https://discord.gg/5XRThpWHGk) first if you're not sure.
- **Want to change something?** Open a pull request. For a big change, open an issue first so we can agree on the
approach before you spend time on it.
Quiver Launcher 4 is source-available under the Business Source License 1.1, and each version becomes MIT licensed one
year after it's published. You're free to read, build, change and test the code to work on a contribution. See
[LICENSE](LICENSE) for the exact terms and [TRADEMARKS.md](TRADEMARKS.md) for the Quiver name and logo.
## Contributor License Agreement
As with Apache, Google and many other projects, contributions to Quiver Launcher are made under a Contributor License
Agreement (CLA). You sign it once, on your first pull request, and it covers everything you contribute after that.
The CLA lets Thomas Georgiadis publish your work as part of Quiver Launcher, first under the Business Source License
and later under MIT, as each version's license says. **You keep the copyright to your work**, and you're free to use it
anywhere else.
### Signing it
When you open your first pull request, the CLA Assistant bot asks you to accept this agreement. Follow its
instructions to sign. You only need to sign once, unless the agreement changes. A pull request can't be merged until
it's signed.
Translations, artwork and other work only come into Quiver Launcher through pull requests, so the agreement is always
signed first. If you share something in an issue or on Discord, we'll ask you to open a pull request for it.
### The agreement
By signing, you agree to the following with Thomas Georgiadis ("the maintainer") for every contribution you submit to
Quiver Launcher, now or later.
A **contribution** is any code, artwork, documentation, translation or other work you submit for inclusion in Quiver
Launcher, by pull request, issue or otherwise. General discussion, and anything you clearly mark as "not a
contribution", isn't one.
1. **You keep your copyright.** This agreement doesn't transfer ownership of your contributions. You can use and
license them however you like elsewhere.
2. **Copyright license.** You give the maintainer a license to your contributions that's permanent, worldwide,
non-exclusive, free of charge and can't be withdrawn. It lets the maintainer reproduce, change, make works based on,
publicly display, publicly perform, sublicense and distribute your contributions and works based on them, as part
of Quiver Launcher under the Business Source License, the MIT License, or other terms the maintainer chooses.
Everyone else gets rights to your contributions through the license Quiver Launcher is published under.
3. **Patent license.** You give the maintainer and everyone who receives Quiver Launcher a patent license that's
permanent, worldwide, non-exclusive and free of charge. It lets them make, have made, use, sell, offer for sale,
import and otherwise transfer your contributions, alone or as part of Quiver Launcher. It covers only patent claims
you own or control that your contribution necessarily infringes, alone or together with Quiver Launcher. If anyone
who received Quiver Launcher sues claiming that Quiver Launcher or a contribution infringes a patent, the patent
licenses you gave that person or company under this agreement end on the day they file.
4. **You have the right to contribute it.** Each contribution is your own original work, or you have permission to
submit it under this agreement. If your employer or anyone else owns rights to your work, you've got their
permission first. If someone else's work is in a contribution, such as code or assets under their own license, say
so in your pull request, with where it came from and its license. Don't submit anything you don't have permission to
contribute.
5. **No warranty or support.** Your contributions are provided "as is", as far as the law allows. You don't have to
support them unless you choose to.
6. **Keeping it accurate.** If you learn that anything here stops being true for one of your contributions, you'll
tell the maintainer.
7. **Credit.** Contributors are thanked in the release notes, or elsewhere in the project, where that's practical.
**Contributing for a company?** If your employer owns the work, someone who can sign for them may need to agree to a
corporate version of this agreement. Open an issue and we'll sort it out before your contribution is merged.
## Pull requests
- Work on a branch and open a pull request against `main`. Every change is reviewed before it's merged.
- Keep each pull request to one change, and describe what a player would see before and after it.
- Run `pnpm typecheck` and `pnpm test` before you push.
- On Windows, [`e2e/wsl.sh`](e2e/wsl.sh) runs the end-to-end tests as CI's Linux check does, in WSL's Ubuntu 24.04, so
a failure there can be tried in minutes rather than a CI run. Its first lines say how to set it up and use it.
## How the code is laid out
| Path | What it is |
| --------------- | -------------------------------------------------------------------------- |
| `apps/launcher` | The Tauri app: React UI in `src`, Rust core in `src-tauri` |
| `packages/api` | Typed client for the catalog API (`https://api.quiverlauncher.com/api/v1`) |
| `packages/ui` | Catalog components and styles shared with quiverlauncher.com |
| `e2e` | User journeys run against the real app with WebDriver and a mock catalog |
`announcement.json` is the banner Quiver Launcher 3 shows. 3.x reads it from `main` here, so it stays at the root even
though Quiver Launcher 4 takes its announcements from quiverlauncher.com.
## Building and testing Quiver
Needs Node 22, pnpm, Rust, [CMake](https://cmake.org/download/) on the path (the build compiles SDL, which
reads controllers), and on Linux the [Tauri system libraries](https://tauri.app/start/prerequisites/) and
`libudev-dev`.
```sh
pnpm install
pnpm dev # run the app
pnpm typecheck && pnpm test
cargo test --manifest-path apps/launcher/src-tauri/Cargo.toml
```
End-to-end journeys (Linux and Windows; needs `cargo install tauri-driver`, and on Linux `webkit2gtk-driver` and `xvfb`):
```sh
pnpm --filter @quiver/e2e build
xvfb-run -a pnpm e2e
```
On Linux with no display at all, each copy of the app gets a virtual display of its own, so
`pnpm --filter @quiver/e2e e2e:ci` can run two test files at once. CI doesn't run these (on its runners
they failed for timing, not the app): on Windows, `e2e/wsl.sh` runs them in WSL. The tests against the
real catalog (`pnpm --filter @quiver/e2e live`) run once a day in CI.
How every screen looks on Android phones, without one or a build of the app (Chromium, as Playwright installs it):
```sh
pnpm --filter @quiver/e2e exec playwright install chromium # once
pnpm --filter @quiver/e2e phone
```
It fails when a screen scrolls sideways, cuts text off at its edge, squeezes text to a few letters a line, or lets
the player pinch to zoom, and saves each screen in `e2e/phone-screenshots/` (CI keeps them with each run).
`QUIVER_PHONE_API=https://api.quiverlauncher.com/api/v1` shows the real catalog instead of the mock one.
`QUIVER_API` points the app at another catalog and `QUIVER_DATA` at another data folder. A
`portable.txt` beside the executable keeps everything in a `data` folder next to it.
## Shared packages
quiverlauncher.com includes this repository as a git submodule and builds `packages/api` and `packages/ui` from
it, so the site shows apps with the same components as the launcher and checks its API against the same types.
Nothing is published to npm. A change here reaches the site when its submodule is moved to a newer commit.
The build-time and run-time variables for usage data are in [docs/usage-data.md](docs/usage-data.md).
-26
View File
@@ -1,26 +0,0 @@
using System;
using System.Globalization;
using Avalonia.Data.Converters;
using Avalonia.Media;
namespace QuiverLauncher
{
public class BooleanToStretchConverter : IValueConverter
{
public static readonly BooleanToStretchConverter Instance = new();
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is bool boolValue)
{
return boolValue ? Stretch.Fill : Stretch.Uniform;
}
return Stretch.Uniform;
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
-35
View File
@@ -1,35 +0,0 @@
using System;
using System.Globalization;
using Avalonia.Data.Converters;
namespace QuiverLauncher
{
public class DoubleScaleConverter : IValueConverter
{
public static readonly DoubleScaleConverter Instance = new();
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
double doubleValue = value switch
{
double d => d,
int i => i,
float f => f,
_ => 0d
};
if (parameter is string paramString &&
double.TryParse(paramString, NumberStyles.Float, CultureInfo.InvariantCulture, out var scale))
{
return doubleValue * scale;
}
return doubleValue;
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
-30
View File
@@ -1,30 +0,0 @@
using System;
using System.Globalization;
using Avalonia.Data.Converters;
using Avalonia;
namespace QuiverLauncher
{
public class ThicknessConverter : IValueConverter
{
public static readonly ThicknessConverter Instance = new();
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is double doubleValue)
{
return new Thickness(doubleValue, 0, 0, 0);
}
if (value is int intValue)
{
return new Thickness(intValue, 0, 0, 0);
}
return new Thickness(0);
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
-39
View File
@@ -1,39 +0,0 @@
using System.Diagnostics;
using System.Text;
using QuiverLauncher.Services;
namespace QuiverLauncher;
public static class CrashLog
{
public static void LogFromUiThread(string source, Exception ex) => Log(source, ex);
public static void Log(string source, Exception ex)
{
var message = new StringBuilder();
message.AppendLine($"[{DateTime.UtcNow:O}] {source}");
message.AppendLine(ex.ToString());
try
{
QuiverLauncherPaths.EnsureUserDataRootExists();
File.AppendAllText(QuiverLauncherPaths.CrashLogPath, message.ToString() + Environment.NewLine);
}
catch
{
// Best-effort logging only.
}
Debug.WriteLine(message.ToString());
Trace.WriteLine(message.ToString());
try
{
Console.Error.WriteLine(message.ToString());
}
catch
{
// WinExe / Android may have no console attached.
}
}
}
+119 -18
View File
@@ -1,22 +1,123 @@
MIT License
Quiver Launcher License
Copyright (c) 2026 SirDiabo
Copyright (c) 2026 Thomas Georgiadis
IN SHORT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
- You can read, build, change and test the code, share it, and send us your
changes.
- You can use Quiver Launcher: an official release, or a copy you built
yourself from our code.
- You can share the source code and modified builds for development and
testing. For production use during the first year, use an official release
or a copy you build yourself from our published source code. Unofficial
builds distributed by others do not have production-use permission.
- One year after each version comes out, its code becomes MIT licensed. From
then on, anyone can do anything MIT allows with that version. A version's
year starts on the day it's first published: when its release comes out,
or when its code first appears in our public repository.
- The Quiver name, logo and icons aren't covered by this license. See
TRADEMARKS.md.
- Quiver Launcher 3 and earlier stay MIT licensed, as before.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
This summary is here to help. The license itself is below, and if the two ever
disagree, the license is what counts.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----------------------------------------------------------------------------
Business Source License 1.1
Licensor: Thomas Georgiadis
Licensed Work: Quiver Launcher 4 and every later version published
under this License: its source code, documentation and
artwork, as published in each release and each commit
of its public source repository.
Not included: third-party material, which keeps its own
license, and the Quiver brand assets listed in
TRADEMARKS.md, which that file covers. Anything that
was published under the MIT License before, such as in
Quiver Launcher 3, also stays available under it.
(c) 2026 Thomas Georgiadis and contributors
Additional Use Grant: You may make production use of the Licensed Work if
both of the following conditions are met:
1. You use either (a) an unmodified official build
distributed by the Licensor through a channel
identified in the README, or (b) a build you make
yourself from source code published by the Licensor,
with or without your own modifications. An
organization may have an employee or authorized
representative make a build on its behalf.
2. You use that build for your own personal purposes
or your organization's internal purposes, and do
not offer the Licensed Work to third parties as a
product or service.
This Additional Use Grant does not permit production
use of unofficial builds distributed by third parties
or builds based on third-party modifications not
published by the Licensor.
It does not restrict the copying, modification,
redistribution, or non-production use permitted by
the standard Terms below.
Change Date: One year after each version of the Licensed Work is
first published by the Licensor.
Each release, and each commit in the Licensor's public
source repository,
https://github.com/tgeorgiadis/quiver-launcher, is a
version. A version is first published on the day it
first becomes publicly available from the Licensor:
the day its release is published on that repository's
Releases page, or the day its commit first appears in
that repository, whichever is earlier. The date a
commit records for itself doesn't decide this.
Publishing a version again doesn't change its Change
Date.
Change License: MIT License
Want to use Quiver Launcher in a way this doesn't allow? Ask at
https://github.com/tgeorgiadis/quiver-launcher/issues
-----------------------------------------------------------------------------
License text copyright © 2024 MariaDB plc, All Rights Reserved. “Business Source License” is a trademark of MariaDB plc.
Terms
The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License).
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.
MariaDB hereby grants you permission to use this License’s text to license your works, and to refer to it using the trademark “Business Source License”, as long as you comply with the Covenants of Licensor below.
Covenants of Licensor
In consideration of the right to use this License’s text and the “Business Source License” name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor:
To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where “compatible” means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation.
To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text “None” to specify a Change Date. Not to modify this License in any other way.
Notice
The Business Source License (this document, or the “License”) is not an Open Source license. However, the Licensed Work will eventually be made available under an Open Source License, as stated in this License.
For more information on the use of the Business Source License for MariaDB products, please visit the MariaDB Business Source License FAQ. For more information on the use of the Business Source License generally, please visit the Adopting and Developing Business Source License FAQ.
-95
View File
@@ -1,95 +0,0 @@
# Migrating to Quiver Launcher 3.0
Quiver Launcher 3.0 uses [Velopack](https://docs.velopack.io/) for packaging and self-updates. If you are on **2.4.2 or older**, the in-app updater cannot update you to 3.0. You will have to download the 3.0 version from [GitHub Quiver Launcher releases](https://github.com/tgeorgiadis/quiver-launcher/releases). Apologies for the inconvenience, but I hope it will be worth it in the long run.
## Why this change?
Previously Quiver updated itself by downloading a zip and then running a small helper script to overwrite the install in place (eg on Windows this was a `.cmd` file). Velopack replaces that custom flow with:
- **Standard self-updates** across Windows, Linux, and macOS.
- **Fewer false threat detections.** Security tools often flagged the old helper script ("download something, then rewrite program files"). Velopack applies updates without that script.
- **Signed Windows builds.** Windows packages are digitally signed. Hopefully as reputation builds, SmartScreen warnings should become less common, though you may still see some early on.
## How to migrate
1. Download Quiver Launcher 3.0 (or whatever the latest version is) for your OS from [Releases](https://github.com/tgeorgiadis/quiver-launcher/releases) into a **new** folder.
2. Quit the old Quiver / Quiver Launcher if it is running.
3. Copy `apps.json`, `settings.json`, and `Apps/` from your current folder into the new one (see your OS below). `Cache/` is optional to copy over.
4. Run the new Quiver Launcher and confirm your library looks right, then delete the old install.
### Windows
**Current (2.4.x)**
```
Quiver/
├── Quiver.exe
├── apps.json ← copy
├── settings.json ← copy
├── Apps/ ← copy
└── Cache/ ← optional
```
**New (3.0)** — paste into the outer folder (not into `current/`):
```
QuiverLauncher/
├── QuiverLauncher.exe
├── current/ # app binaries — do not put library here
├── apps.json ← paste
├── settings.json ← paste
├── Apps/ ← paste
└── Cache/ ← optional
```
### Linux
**Current (2.4.x)**
```
MyFolder/
├── Quiver… # old AppImage or binary
├── apps.json ← copy
├── settings.json ← copy
├── Apps/ ← copy
└── Cache/ ← optional
```
**New (3.0)** — put the AppImage in its own folder (it creates files beside itself), mark it executable, then paste beside it (or into `~/.local/share/QuiverLauncher/` if that folder is not writable):
```
MyFolder/
├── QuiverLauncher-linux-x64.AppImage
├── apps.json ← paste
├── settings.json ← paste
├── Apps/ ← paste
└── Cache/ ← optional
```
### macOS
**Current (2.4.x)**
```
MyFolder/
├── Quiver.app
├── apps.json ← copy
├── settings.json ← copy
├── Apps/ ← copy
└── Cache/ ← optional
```
**New (3.0)** — paste beside `QuiverLauncher.app` (or into `~/Library/Application Support/QuiverLauncher/` if the parent folder is not writable):
```
MyFolder/
├── QuiverLauncher.app
├── apps.json ← paste
├── settings.json ← paste
├── Apps/ ← paste
└── Cache/ ← optional
```
## After migrating
You'll be able to update from within Quiver Launcher again
-604
View File
@@ -1,604 +0,0 @@
<UserControl x:Class="QuiverLauncher.MainView" x:Name="ShellRoot"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:QuiverLauncher"
xmlns:views="clr-namespace:QuiverLauncher.Views"
xmlns:services="clr-namespace:QuiverLauncher.Services"
xmlns:mods="clr-namespace:QuiverLauncher.Services.Mods"
xmlns:asyncImageLoader="clr-namespace:AsyncImageLoader;assembly=AsyncImageLoader.Avalonia"
TopLevel.AutoSafeAreaPadding="False"
XYFocus.NavigationModes="Gamepad,Remote"
XYFocus.UpNavigationStrategy="Projection"
XYFocus.DownNavigationStrategy="Projection"
XYFocus.LeftNavigationStrategy="Projection"
XYFocus.RightNavigationStrategy="Projection"
FocusAdorner="{x:Null}"
Background="{Binding WindowBackground}">
<UserControl.Resources>
<!-- Theme Color Resources -->
<SolidColorBrush x:Key="ThemeBase" Color="#18181b"/>
<SolidColorBrush x:Key="ThemeLighter" Color="#252527"/>
<SolidColorBrush x:Key="ThemeDarker" Color="#0e0e10"/>
<SolidColorBrush x:Key="ThemeBorder" Color="#2d2d30"/>
<SolidColorBrush x:Key="ThemeText" Color="White"/>
<SolidColorBrush x:Key="ThemeTextSecondary" Color="#B8B8B8"/>
<SolidColorBrush x:Key="ThemeFocusRing" Color="#38bdf8"/>
</UserControl.Resources>
<UserControl.Styles><StyleInclude Source="avares://QuiverLauncher/Themes/LauncherStyles.axaml"/></UserControl.Styles>
<Border CornerRadius="0" ClipToBounds="True" Background="Transparent">
<Grid>
<SplitView x:Name="MainSplitView"
CompactPaneLength="0"
DisplayMode="Inline"
IsPaneOpen="True"
OpenPaneLength="240"
PaneBackground="{DynamicResource ThemeDarker}"
PanePlacement="Left">
<SplitView.Pane>
<!-- Left Sidebar Navigation -->
<Border x:Name="SidebarPanel"
XYFocus.NavigationModes="Gamepad,Remote"
XYFocus.UpNavigationStrategy="Projection"
XYFocus.DownNavigationStrategy="Projection"
XYFocus.LeftNavigationStrategy="Projection"
XYFocus.RightNavigationStrategy="Projection"
Background="{DynamicResource ThemeDarker}" BorderBrush="{DynamicResource ThemeBorder}" BorderThickness="0,0,1,0">
<Grid Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Logo/Header -->
<StackPanel x:Name="SidebarLogoPanel"
Grid.Row="0"
Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="6">
<Image x:Name="SidebarLogoImage"
Source="avares://QuiverLauncher/Assets/app.png"
VerticalAlignment="Center"/>
<StackPanel Orientation="Vertical"
VerticalAlignment="Center"
Margin="20,0,0,0"
Spacing="2">
<TextBlock Text="QUIVER"
FontSize="18"
FontWeight="Bold"
Foreground="{DynamicResource ThemeText}"
LetterSpacing="2"/>
<TextBlock Text="LAUNCHER"
FontSize="11"
FontWeight="SemiBold"
Foreground="{DynamicResource ThemeTextSecondary}"
LetterSpacing="2.5"/>
</StackPanel>
</StackPanel>
<!-- Navigation Buttons -->
<StackPanel x:Name="SidebarNavPanel" Grid.Row="1" Margin="12,0" VerticalAlignment="Top">
<!-- Continue Button -->
<Button x:Name="ContinueButton"
Classes="settings"
Margin="0,0,0,4"
CornerRadius="8"
Width="216"
HorizontalAlignment="Left"
Click="ContinueButton_Click"
IsVisible="{Binding Library.IsContinueVisible}">
<Grid ColumnDefinitions="*,Auto">
<StackPanel Grid.Column="0"
Orientation="Horizontal"
VerticalAlignment="Center">
<Image Width="32" Height="32"
Source="avares://QuiverLauncher/Assets/Continue.png"
Margin="0,0,12,0"/>
<TextBlock Text="Continue"
VerticalAlignment="Center"/>
</StackPanel>
<Border Grid.Column="1"
ClipToBounds="True"
MaxWidth="48"
MaxHeight="44"
Margin="8,0,0,0"
VerticalAlignment="Center"
HorizontalAlignment="Right">
<asyncImageLoader:AdvancedImage Source="{Binding Library.ContinueGameInfo.DefaultIconUrl}"
Stretch="Uniform"
MaxWidth="48"
MaxHeight="44"/>
</Border>
</Grid>
</Button>
<!-- Library Button -->
<Button x:Name="LibraryNavButton"
Classes="settings selected"
Margin="0,0,0,4"
CornerRadius="8"
Width="216"
HorizontalAlignment="Left"
Click="LibraryNavButton_Click">
<StackPanel Orientation="Horizontal">
<Image Width="32" Height="32"
Source="avares://QuiverLauncher/Assets/DefaultGame.png"
Margin="0,0,12,0"/>
<TextBlock Text="Library" ToolTip.Tip="{Binding Text, RelativeSource={RelativeSource Self}}" VerticalAlignment="Center"/>
</StackPanel>
</Button>
<!-- App Catalog Button -->
<Button x:Name="BrowseNavButton"
IsVisible="{Binding ShowCatalogNavigation}"
Classes="settings"
Margin="0,0,0,4"
CornerRadius="8"
Width="216"
HorizontalAlignment="Left"
Click="BrowseNavButton_Click">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Spacing="10">
<Image Width="32" Height="32"
Source="avares://QuiverLauncher/Assets/AppCatalog.png"
Margin="0,0,2,0"/>
<TextBlock Text="App Catalog" VerticalAlignment="Center"/>
</StackPanel>
</Button>
</StackPanel>
<ScrollViewer x:Name="SidebarBodyScroller"
Grid.Row="2"
IsVisible="False"
HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Hidden">
<StackPanel x:Name="SidebarBodyHost"/>
</ScrollViewer>
<!-- Library-only filters -->
<views:LibraryFiltersView x:Name="LibraryFiltersPanel" Grid.Row="2"/>
<!-- Footer Links -->
<StackPanel x:Name="ExternalLinksHost" Grid.Row="3" Margin="12,0,12,8" IsVisible="{Binding ShowExternalLinks}">
<Border Height="1" Background="{DynamicResource ThemeBorder}" Margin="-12,0,-12,8"/>
<StackPanel Orientation="Horizontal" Spacing="8" HorizontalAlignment="Center">
<Button x:Name="WebsiteFooterButton"
Classes="iconbutton"
Width="44"
Height="44"
ToolTip.Tip="QuiverLauncher.com"
Click="WebsiteButton_Click">
<Image Width="32" Height="32"
Source="avares://QuiverLauncher/Assets/quiver-icon.png"/>
</Button>
<Button x:Name="GitHubFooterButton"
Classes="iconbutton"
Width="44"
Height="44"
ToolTip.Tip="GitHub"
Click="GithubButton_Click">
<Image Width="32" Height="32"
Source="avares://QuiverLauncher/Assets/Github.png"/>
</Button>
<Button x:Name="DiscordFooterButton"
Classes="iconbutton"
Width="44"
Height="44"
ToolTip.Tip="Discord"
Click="DiscordButton_Click">
<Image Width="32" Height="32"
Source="avares://QuiverLauncher/Assets/Discord.png"/>
</Button>
<Button x:Name="PatreonFooterButton"
Classes="iconbutton"
Width="44"
Height="44"
ToolTip.Tip="Support Quiver on Patreon"
Click="PatreonButton_Click">
<Image Width="32" Height="32"
Source="avares://QuiverLauncher/Assets/Patreon.png"/>
</Button>
</StackPanel>
</StackPanel>
</Grid>
</Border>
</SplitView.Pane>
<!-- Main Content Area -->
<Grid x:Name="MainGrid">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Top Bar: drag layer is a sibling behind controls so BeginMoveDrag never captures chrome clicks -->
<Grid Grid.Row="0" ZIndex="1">
<Border Background="{DynamicResource ThemeDarker}"
BorderBrush="{DynamicResource ThemeBorder}"
BorderThickness="0,0,0,1"
PointerPressed="TopBar_PointerPressed"/>
<Border Classes="header-inner">
<Grid RowDefinitions="Auto,Auto">
<Grid x:Name="HeaderLayoutGrid" Grid.Row="0" ColumnDefinitions="Auto,*,Auto,Auto" RowDefinitions="Auto,Auto" VerticalAlignment="Top">
<Button x:Name="DesktopSidebarToggleButton" Grid.Column="0"
Classes="modern-icon" Width="32" Height="32" Margin="8,0,0,0" Padding="6"
VerticalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
IsVisible="{Binding IsDesktopPlatform}" Focusable="True"
AutomationProperties.Name="Hide sidebar" ToolTip.Tip="Hide sidebar">
<Path Width="20" Height="20" Stretch="Uniform" Stroke="{DynamicResource ThemeText}"
StrokeThickness="1.5" Data="M3,3 L21,3 L21,21 L3,21 Z M9,3 L9,21 M16,8 L12,12 L16,16"/>
</Button>
<Button x:Name="MobileNavButton"
Grid.Column="0"
Classes="modern-icon mobile-header-icon"
Width="28"
Height="28"
Margin="4,0,0,0"
Padding="0"
Background="Transparent"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
VerticalAlignment="Center"
IsVisible="{Binding IsMobile}"
PlatformFeedback.FeedbackType="Auto"
ToolTip.Tip="Menu"
>
<Border Width="28" Height="28" CornerRadius="8" Background="#2a2a2a">
<TextBlock Text="☰"
FontSize="14"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</Button>
<Grid x:Name="HeaderTitleColumn"
PointerPressed="TopBar_PointerPressed"
Grid.Column="1"
ColumnDefinitions="Auto,*"
MinHeight="44"
VerticalAlignment="Center">
<TextBlock x:Name="HeaderTitleText"
Text="Library" ToolTip.Tip="{Binding Text, RelativeSource={RelativeSource Self}}"
FontSize="24"
Margin="12,0,8,0"
FontWeight="Bold"
Foreground="{DynamicResource ThemeText}"
VerticalAlignment="Center"
HorizontalAlignment="Left"
TextWrapping="NoWrap"
TextTrimming="CharacterEllipsis"
IsHitTestVisible="True"/>
</Grid>
<Grid x:Name="DesktopInlineTopBar"
Grid.Column="2"
IsVisible="{Binding IsDesktopPlatform}">
<views:LibraryToolbarView x:Name="LibraryToolbar"/>
</Grid>
<StackPanel x:Name="HeaderFixedActions" Grid.Column="3"
Orientation="Horizontal"
HorizontalAlignment="Right"
VerticalAlignment="Center">
<StackPanel x:Name="MobileHeaderActions"
Orientation="Horizontal"
VerticalAlignment="Center"
IsVisible="{Binding IsMobile}">
<Button x:Name="MobileSearchToggleButton"
Classes="modern-icon mobile-header-icon"
Width="28"
Height="28"
Margin="8,0,0,0"
Padding="0"
Background="Transparent"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
IsVisible="False"
PlatformFeedback.FeedbackType="Auto"
ToolTip.Tip="Search"
>
<Border Width="28" Height="28" CornerRadius="8" Background="#2a2a2a">
<Viewbox Width="14" Height="14"
HorizontalAlignment="Center" VerticalAlignment="Center">
<Canvas Width="24" Height="24">
<Ellipse Width="16" Height="16"
Canvas.Left="1" Canvas.Top="1"
Stroke="White" StrokeThickness="2.2"
Fill="Transparent"/>
<Line StartPoint="14,14" EndPoint="22.5,22.5"
Stroke="White" StrokeThickness="2.6"
StrokeLineCap="Round"/>
</Canvas>
</Viewbox>
</Border>
</Button>
<Button x:Name="MobileAddButton"
Classes="modern-icon mobile-header-icon"
Width="28"
Height="28"
Margin="8,0,0,0"
Padding="0"
Background="Transparent"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
IsVisible="False"
PlatformFeedback.FeedbackType="Auto"
ToolTip.Tip="Add New Entry"
Click="AddNewEntryButton_Click">
<Border Width="28" Height="28" CornerRadius="8" Background="#2a2a2a">
<TextBlock Text="+"
FontSize="18"
FontWeight="SemiBold"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</Button>
<Button x:Name="MobileSortButton"
Classes="modern-icon mobile-header-icon"
Width="28"
Height="28"
Margin="8,0,0,0"
Padding="0"
Background="Transparent"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
IsVisible="False"
PlatformFeedback.FeedbackType="Auto"
ToolTip.Tip="Sort">
<Button.Flyout>
<MenuFlyout Placement="BottomEdgeAlignedRight"
Opening="MobileLibrarySortFlyout_Opening">
<MenuItem Header="Name (A-Z)" Tag="Name" Click="MobileLibrarySortItem_Click"/>
<MenuItem Header="Name (Z-A)" Tag="NameDesc" Click="MobileLibrarySortItem_Click"/>
<MenuItem Header="Installed First" Tag="Installed" Click="MobileLibrarySortItem_Click"/>
<MenuItem Header="Not Installed First" Tag="NotInstalled" Click="MobileLibrarySortItem_Click"/>
<MenuItem Header="Last Played" Tag="LastPlayed" Click="MobileLibrarySortItem_Click"/>
</MenuFlyout>
</Button.Flyout>
<Border Width="28" Height="28" CornerRadius="8" Background="#2a2a2a">
<TextBlock Text="↕"
FontSize="16"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</Button>
</StackPanel>
<!-- Version text -->
<TextBlock Text="{Binding Shell.Version}"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Foreground="{DynamicResource ThemeText}"
FontSize="14"
IsHitTestVisible="False"
IsVisible="{Binding IsDesktopPlatform}"/>
<Button x:Name="CheckForUpdatesButton"
IsVisible="{Binding ShowUpdateCheckButton}"
Classes="modern-icon"
Width="32"
Height="32"
ClipToBounds="False"
Margin="12,0,0,0"
ToolTip.Tip="{Binding Shell.CheckForUpdatesToolTip}"
Click="CheckforUpdates_Click">
<Grid Width="32" Height="32" ClipToBounds="False">
<Image Width="28"
Height="28"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Source="avares://QuiverLauncher/Assets/CheckForUpdates.png"
Opacity="{Binding Shell.CheckForUpdatesIconOpacity}"/>
<Border Width="28"
Height="2"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
ClipToBounds="True"
CornerRadius="1"
IsVisible="{Binding Shell.IsCheckingUpdates}">
<ProgressBar Height="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
BorderThickness="0"
Background="Transparent"
IsIndeterminate="True"/>
</Border>
<Border Background="#FF9500"
CornerRadius="8"
MinWidth="16"
MinHeight="18"
Padding="5,2"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,-2,-2,0"
IsVisible="{Binding Shell.UpdatesBadgeVisible}">
<TextBlock Text="{Binding Shell.UpdatesBadgeText}"
FontSize="9"
FontWeight="Bold"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<Border Background="{DynamicResource ThemeSuccess}"
CornerRadius="8"
Width="16"
Height="16"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,-2,-2,0"
IsVisible="{Binding Shell.UpdatesUpToDateBadgeVisible}">
<TextBlock Text="✓"
FontSize="10"
FontWeight="Bold"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</Grid>
</Button>
<Button x:Name="SettingsButton"
IsVisible="{Binding ShowSettingsButton}"
Classes="modern-icon"
Width="28"
Height="28"
Margin="8,0,0,0"
ToolTip.Tip="Settings"
Click="SettingsButton_Click">
<Image Width="28" Height="28"
Source="avares://QuiverLauncher/Assets/Settings.png"/>
</Button>
<!-- Minimize Button -->
<Button x:Name="MinimizeButton"
Classes="modern-icon"
Width="28"
Margin="12,0,0,0"
ClickMode="Press"
IsVisible="{Binding ShowMinimizeButton}"
Click="MinimizeButton_Click">
<Image Width="28"
Height="28"
Source="avares://QuiverLauncher/Assets/Icons/button_minimize.png"/>
</Button>
<!-- Maximize Button -->
<Button x:Name="ToggleMaximizeButton"
Classes="modern-icon"
Width="28"
Margin="8,0,0,0"
ClickMode="Press"
IsVisible="{Binding ShowWindowChromeButtons}"
ToolTip.Tip="{Binding MaximizeButtonTip}"
Click="ToggleMaximize_Click">
<Image Width="28"
Height="28"
Source="avares://QuiverLauncher/Assets/Icons/button_fullscreen.png"/>
</Button>
<!-- Close Button -->
<Button x:Name="CloseLauncherButton"
Classes="modern-icon"
Width="28"
Margin="8,0,10,0"
ClickMode="Press"
IsVisible="{Binding ShowWindowChromeButtons}"
Click="CloseLauncher_Click">
<Image Width="28"
Height="28"
Source="avares://QuiverLauncher/Assets/Icons/button_close.png"/>
</Button>
</StackPanel>
</Grid>
<Grid x:Name="MobileSecondaryTopBar"
Grid.Row="1"
Margin="8,8,8,0"
IsVisible="False">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid x:Name="MobileSearchSlot" Grid.Row="0"/>
<DockPanel x:Name="MobileLibraryActionsSlot"
Grid.Row="1"
LastChildFill="True"
Margin="0,8,0,0"/>
</Grid>
</Grid>
</Border>
</Grid>
<!-- Top strip: announcement always wins over the GitHub token warning. -->
<StackPanel Grid.Row="1" ZIndex="1">
<views:UpdateCheckStatusView x:Name="UpdateCheckStatus" DataContext="{Binding Shell}" CancelRequested="CancelUpdateCheck_Click" RetryRequested="RetryUpdateCheck_Click" DismissRequested="DismissUpdateCheck_Click"/>
<views:AndroidLauncherUpdateView x:Name="AndroidUpdateBanner" DataContext="{Binding AndroidUpdates}" IsBanner="True" IsVisible="{Binding ShowBanner, FallbackValue=False}"/>
<views:LauncherBannerView x:Name="Banners"/>
</StackPanel>
<!-- Apps Content with Settings Panel Overlay -->
<Grid Grid.Row="2">
<Control x:Name="CardGamepadFocusSink"
Width="1"
Height="1"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Opacity="0"
IsHitTestVisible="False"
Focusable="True"
FocusAdorner="{x:Null}"
KeyboardNavigation.IsTabStop="False"
XYFocus.NavigationModes="Disabled"/>
<!-- Background Image -->
<Border Background="{DynamicResource ThemeDarker}"/>
<Image x:Name="StaticBackgroundImage"
asyncImageLoader:ImageLoader.Source="{Binding Shell.BackgroundImageUri}"
Stretch="Fill"
Opacity="{Binding Shell.BackgroundOpacity}"/>
<!-- Main App List -->
<Grid><views:LibraryView x:Name="LibraryPanel"/>
<views:AppUpdateReviewView x:Name="AppUpdatesReviewPanel" IsVisible="False" Margin="30,20,6,30"/>
<views:ModsView x:Name="ModsPanel" IsVisible="False" Margin="30,20,6,30"/>
</Grid>
<!-- Browse -->
<views:BrowseView x:Name="BrowsePanel" services:MouseWheelScroll.Multiplier="{Binding #ShellRoot.SettingsModel.MouseWheelScrollSpeed}" IsVisible="False" Margin="30,20,6,30"/>
<TextBlock x:Name="GamepadHintsBar"
FontSize="11"
Foreground="{DynamicResource ThemeTextSecondary}"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Margin="0,0,0,8"
IsVisible="{Binding GamepadHintsVisible}"/>
<!-- Settings Panel Overlay -->
<views:SettingsView x:Name="SettingsPanel" HorizontalAlignment="Right" VerticalAlignment="Stretch" Width="400" IsVisible="False" ZIndex="10"/>
<!-- Browse app details -->
<views:BrowseDetailsView x:Name="BrowseDetailsPanel" services:MouseWheelScroll.Multiplier="{Binding #ShellRoot.SettingsModel.MouseWheelScrollSpeed}" Grid.RowSpan="2" IsVisible="{Binding #ShellRoot.Shell.BrowseDetailsOpen}" ZIndex="110"/>
<!-- Mod details (README / Changelog) -->
<ContentControl x:Name="ModDetailsPanel" IsVisible="{Binding Shell.ModDetailsOpen}" Grid.RowSpan="2" ZIndex="110" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/>
<!-- Entry Form Overlay -->
<views:AppEntryEditorView x:Name="EntryFormOverlay" Grid.RowSpan="2" IsVisible="{Binding #ShellRoot.Shell.EntryEditorOpen}" ZIndex="100"/>
<!-- Display Filter Overlay -->
<views:DisplayFilterEditorView x:Name="DisplayFilterOverlay" Grid.RowSpan="2" IsVisible="False" ZIndex="110"/>
<!-- Tag Edit Overlay -->
<views:MetadataEditorView x:Name="TagEditOverlay" Grid.RowSpan="2" IsVisible="{Binding #ShellRoot.Shell.TagEditorOpen}" ZIndex="110"/>
</Grid>
</Grid>
</SplitView>
<Grid x:Name="MobileNavOverlay"
IsVisible="False"
ZIndex="30">
<Border Background="#99000000"
x:Name="MobileNavDimmer"/>
<Border Width="264"
HorizontalAlignment="Left"
Background="{DynamicResource ThemeDarker}"
BorderBrush="{DynamicResource ThemeBorder}"
BorderThickness="0,0,1,0">
<Grid x:Name="MobileNavDrawerHost"/>
</Border>
</Grid>
<views:MessagePromptView x:Name="MessagePromptOverlay" ZIndex="200"/>
</Grid>
</Border>
</UserControl>
-2003
View File
File diff suppressed because it is too large. Load diff
-12
View File
@@ -1,12 +0,0 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:QuiverLauncher"
x:Class="QuiverLauncher.MainWindow"
Title="Quiver Launcher"
Width="1280" Height="720"
MinWidth="750" MinHeight="490"
Background="{Binding WindowBackground}"
WindowState="Normal"
WindowStartupLocation="CenterScreen">
<local:MainView x:Name="RootView"/>
</Window>
-42
View File
@@ -1,42 +0,0 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using QuiverLauncher.Services;
namespace QuiverLauncher;
public partial class MainWindow : Window
{
public MainView View => RootView;
public App _app
{
get => View._app;
set => View._app = value;
}
public MainWindow()
{
InitializeComponent();
DataContext = View;
App.CurrentHostedMainView = new WeakReference<MainView>(View);
_ = new DesktopHostController(this, View);
}
public void RestoreFromTray() => View.RestoreFromTray();
public void RequestExit() => View.RequestExit();
public void ApplyTraySettingsFromApp() => View.ApplyTraySettingsFromApp();
public Task RunUpdateCheckAsync(bool promptForReview, bool isManualCheck)
=> View.RunUpdateCheckAsync(promptForReview, isManualCheck);
public void OpenSettings() => View.OpenSettings();
public void OpenGitHubApiTokenSettings() => View.OpenGitHubApiTokenSettings();
public void OpenGitLabApiTokenSettings() => View.OpenGitLabApiTokenSettings();
}
-2057
View File
File diff suppressed because it is too large. Load diff
-199
View File
@@ -1,199 +0,0 @@
using Avalonia;
using Avalonia.Controls.Platform;
using QuiverLauncher.Services;
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using Velopack;
using Velopack.Locators;
namespace QuiverLauncher
{
class Program
{
[DllImport("kernel32.dll", SetLastError = true)]
private static extern bool AttachConsole(int dwProcessId);
[DllImport("kernel32.dll")]
private static extern bool FreeConsole();
private const int ATTACH_PARENT_PROCESS = -1;
[STAThread]
public static int Main(string[] args)
{
// Must be first: Velopack install/update hooks exit inside Run().
// Linux/macOS share packages by packId (/var/tmp or Library/Caches); disable
// startup auto-apply so a second AppImage/.app is not silently updated.
var velopack = VelopackApp.Build();
if (!OperatingSystem.IsWindows())
velopack.SetAutoApplyOnStartup(false);
velopack.Run();
QuiverLauncherPaths.VelopackRootAppDirProvider = () =>
{
try
{
return VelopackLocator.Current?.RootAppDir;
}
catch
{
return null;
}
};
// Linux/macOS: library beside AppImage / .app when that folder is writable.
QuiverLauncherPaths.VelopackPackageDirectoryProvider = ResolveVelopackPackageDirectory;
QuiverLauncherPaths.CompletePendingDataMove();
QuiverLauncherPaths.EnsureUserDataRootExists();
if (args.Length > 0 && args[0].StartsWith("-"))
{
if (OperatingSystem.IsWindows())
{
if (AttachConsole(ATTACH_PARENT_PROCESS))
{
Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true });
Console.SetError(new StreamWriter(Console.OpenStandardError()) { AutoFlush = true });
}
}
int exitCode = RunCLI(args);
if (OperatingSystem.IsWindows())
{
FreeConsole();
}
return exitCode;
}
#if DEBUG
RegisterDebugExceptionHandlers();
#endif
DefaultMenuInteractionHandler.MenuShowDelay = TimeSpan.Zero;
BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
return 0;
}
#if DEBUG
private static void RegisterDebugExceptionHandlers()
{
AppDomain.CurrentDomain.UnhandledException += (_, e) =>
{
if (e.ExceptionObject is Exception ex)
LogCrash("AppDomain.UnhandledException", ex);
};
TaskScheduler.UnobservedTaskException += (_, e) =>
{
LogCrash("TaskScheduler.UnobservedTaskException", e.Exception);
e.SetObserved();
};
}
internal static void LogCrashFromUiThread(string source, Exception ex)
{
LogCrash(source, ex);
}
private static void LogCrash(string source, Exception ex)
{
var message = new StringBuilder();
message.AppendLine($"[{DateTime.UtcNow:O}] {source}");
message.AppendLine(ex.ToString());
try
{
QuiverLauncherPaths.EnsureUserDataRootExists();
File.AppendAllText(QuiverLauncherPaths.CrashLogPath, message.ToString() + Environment.NewLine);
}
catch
{
// Best-effort logging only.
}
Debug.WriteLine(message.ToString());
Trace.WriteLine(message.ToString());
try
{
Console.Error.WriteLine(message.ToString());
}
catch
{
// WinExe may have no console attached.
}
}
#endif
private static string? ResolveVelopackPackageDirectory()
{
try
{
var locator = VelopackLocator.Current;
if (locator is null)
return null;
if (OperatingSystem.IsLinux() &&
locator is LinuxVelopackLocator linux &&
!string.IsNullOrWhiteSpace(linux.AppImagePath))
{
return Path.GetDirectoryName(linux.AppImagePath);
}
if (OperatingSystem.IsMacOS())
{
return QuiverLauncherPaths.ResolveMacOsPackageDirectory(
locator.RootAppDir,
locator.AppContentDir,
AppDomain.CurrentDomain.BaseDirectory);
}
}
catch
{
// Not a Velopack install, or locator unavailable.
}
return null;
}
private static int RunCLI(string[] args)
{
try
{
var cliHandler = new CLIHandler();
return cliHandler.Execute(args).GetAwaiter().GetResult();
}
catch (Exception ex)
{
Console.Error.WriteLine($"Error: {ex.Message}");
return 1;
}
}
public static AppBuilder BuildAvaloniaApp()
{
var builder = AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace();
// Gamescope (Steam Deck Gaming Mode) treats separate X11 popup windows as
// fullscreen surfaces. Embed popups in the main window so ContextMenus
// stay composited over Quiver instead of showing a black letterbox.
if (OperatingSystem.IsLinux())
{
builder = builder.With(new X11PlatformOptions { OverlayPopups = true });
}
return builder;
}
}
}
-3
View File
@@ -1,3 +0,0 @@
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("QuiverLauncher.Tests")]
-21
View File
@@ -1,21 +0,0 @@
using Android.App;
using Android.Runtime;
using Avalonia;
using Avalonia.Android;
namespace QuiverLauncher.Android;
[Application(Name = "com.quiverlauncher.app.AndroidApp")]
public class AndroidApp : AvaloniaAndroidApplication<App>
{
protected AndroidApp(nint javaReference, JniHandleOwnership transfer)
: base(javaReference, transfer)
{
}
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
return base.CustomizeAppBuilder(builder)
.WithInterFont();
}
}
@@ -1,234 +0,0 @@
using Android.Content;
using Android.Content.PM;
using AndroidX.Core.Content;
using QuiverLauncher.Models;
using QuiverLauncher.Services;
using Application = Android.App.Application;
using Uri = Android.Net.Uri;
namespace QuiverLauncher.Android;
public sealed class AndroidAppInstallLaunchService : IAppInstallLaunchService
{
private readonly Context _context;
private readonly MainActivity _activity;
public const int InstallRequestCode = 4127;
public const int UninstallRequestCode = 4128;
private static SemaphoreSlim PackageOperationGate => AndroidPackageOperations.Gate;
private static TaskCompletionSource<bool>? _installCompletion;
private static TaskCompletionSource<bool>? _uninstallCompletion;
public AndroidAppInstallLaunchService(MainActivity context)
{
_activity = context;
_context = context.ApplicationContext ?? context;
}
public static void CompleteInstall(bool success) => _installCompletion?.TrySetResult(success);
public static void CompleteUninstall(bool success) => _uninstallCompletion?.TrySetResult(success);
public async Task<bool> InstallAsync(GameInfo game, string downloadedPackagePath, string version, string gamePath)
{
if (string.IsNullOrWhiteSpace(downloadedPackagePath) || !File.Exists(downloadedPackagePath))
return false;
await PackageOperationGate.WaitAsync().ConfigureAwait(false);
try
{
var packageInfo = _context.PackageManager?.GetPackageArchiveInfo(downloadedPackagePath, PackageInfoFlags.Activities);
if (packageInfo?.PackageName is not { Length: > 0 } packageName)
throw new InvalidDataException("The downloaded APK is not a valid Android package.");
var previous = GetPackageVersion(packageName);
AndroidInstalledRelease.Begin(gamePath, version, Describe(packageInfo), previous);
game.AndroidPackageName = packageName;
await File.WriteAllTextAsync(Path.Combine(gamePath, GameStatusService.AndroidPackageFileName), packageName).ConfigureAwait(false);
var file = new Java.IO.File(downloadedPackagePath);
var uri = FileProvider.GetUriForFile(
_context,
_context.PackageName + ".fileprovider",
file);
var intent = new Intent(Intent.ActionInstallPackage);
intent.SetDataAndType(uri, "application/vnd.android.package-archive");
intent.AddFlags(ActivityFlags.GrantReadUriPermission);
intent.PutExtra(Intent.ExtraReturnResult, true);
var completion = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
_installCompletion = completion;
await Avalonia.Threading.Dispatcher.UIThread.InvokeAsync(() => _activity.StartActivityForResult(intent, InstallRequestCode));
// Keep the staged APK alive until Package Installer finishes reading it.
var accepted = await completion.Task.ConfigureAwait(false);
if (!accepted)
{
AndroidInstalledRelease.Cancel(gamePath);
return false;
}
var confirmed = await AndroidPackageReadiness.WaitAsync(() =>
GetPackageVersion(packageName) is { } installed && AndroidInstalledRelease.Resolve(gamePath, installed) == version).ConfigureAwait(false);
if (!confirmed) return false;
// Requesting an installer result can omit Android's own Open button.
// Offer it here, without treating a successful install as a failed launch.
try
{
if (await ShowInstalledPromptAsync(game).ConfigureAwait(false))
{
try { await LaunchPackageAsync(game, packageName).ConfigureAwait(false); }
catch (Exception ex)
{
await ShowInstalledPromptAsync(game, $"Installation succeeded, but the app could not be opened: {ex.Message}\n\nYou can try Play again from your Library.").ConfigureAwait(false);
}
}
}
catch (Exception ex)
{
// An activity closing while the optional Open prompt appears must
// not turn an already confirmed installation into an install failure.
System.Diagnostics.Debug.WriteLine($"Installed-app prompt unavailable: {ex.Message}");
}
return true;
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"APK install failed: {ex.Message}");
AndroidInstalledRelease.Cancel(gamePath);
throw;
}
finally
{
_installCompletion = null;
PackageOperationGate.Release();
}
}
public Task<bool> LaunchAsync(GameInfo game, string gamesFolder)
{
if (string.IsNullOrWhiteSpace(game.AndroidPackageName))
GameStatusService.TryRestoreAndroidPackageName(game, game.GetInstallPath(gamesFolder));
var packageName = game.AndroidPackageName;
if (string.IsNullOrWhiteSpace(packageName))
{
throw new InvalidOperationException(
"Quiver does not know this app's Android package id. Reinstall it from Quiver, then tap Play.");
}
return LaunchPackageAsync(game, packageName);
}
private async Task<bool> LaunchPackageAsync(GameInfo game, string packageName)
{
Intent? launch = null;
if (!await AndroidPackageReadiness.WaitAsync(() => (launch = _context.PackageManager?.GetLaunchIntentForPackage(packageName)) != null).ConfigureAwait(false))
{
throw new InvalidOperationException(
$"{game.Name} is installed but has no launcher activity Quiver can start.");
}
launch!.AddFlags(ActivityFlags.NewTask);
try
{
await Avalonia.Threading.Dispatcher.UIThread.InvokeAsync(() => _context.StartActivity(launch));
}
catch (Exception ex)
{
throw new InvalidOperationException($"Could not start {game.Name}: {ex.Message}", ex);
}
return true;
}
public async Task<bool> UninstallAsync(GameInfo game, string gamePath)
{
GameStatusService.TryRestoreAndroidPackageName(game, gamePath);
var packageName = game.AndroidPackageName;
if (string.IsNullOrWhiteSpace(packageName))
throw new InvalidOperationException("Quiver does not know this app's Android package id. You can uninstall it from Android Settings → Apps.");
await PackageOperationGate.WaitAsync().ConfigureAwait(false);
try
{
if (!IsInstalled(game)) return true;
var completion = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
_uninstallCompletion = completion;
var intent = new Intent(Intent.ActionUninstallPackage, Uri.Parse("package:" + packageName));
intent.PutExtra(Intent.ExtraReturnResult, true);
await Avalonia.Threading.Dispatcher.UIThread.InvokeAsync(() => _activity.StartActivityForResult(intent, UninstallRequestCode));
if (!await completion.Task.ConfigureAwait(false)) return false;
if (!await AndroidPackageReadiness.WaitAsync(() => !IsInstalled(game)).ConfigureAwait(false))
throw new InvalidOperationException("Android has not confirmed that the app was removed. Its saved information has been kept.");
return true;
}
finally
{
_uninstallCompletion = null;
PackageOperationGate.Release();
}
}
private async Task<bool> ShowInstalledPromptAsync(GameInfo game, string? openError = null)
{
var choice = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
await Avalonia.Threading.Dispatcher.UIThread.InvokeAsync(() =>
{
if (_activity.IsFinishing || _activity.IsDestroyed) { choice.TrySetResult(false); return; }
var builder = new global::Android.App.AlertDialog.Builder(_activity)
.SetTitle("App installed")
.SetMessage(openError ?? $"{game.Name} is ready to use.")
.SetPositiveButton(openError == null ? "Open app" : "OK", (_, _) => choice.TrySetResult(openError == null));
if (openError == null) builder.SetNegativeButton("Done", (_, _) => choice.TrySetResult(false));
var dialog = builder.Create()!;
dialog.DismissEvent += (_, _) => choice.TrySetResult(false);
dialog.Show();
});
return await choice.Task.ConfigureAwait(false);
}
public bool IsInstalled(GameInfo game)
{
var packageName = game.AndroidPackageName;
if (string.IsNullOrWhiteSpace(packageName))
return false;
try
{
return _context.PackageManager?.GetPackageInfo(packageName, PackageInfoFlags.Activities) != null;
}
catch (PackageManager.NameNotFoundException)
{
return false;
}
}
public string? GetInstalledVersion(GameInfo game, string gamePath)
{
var packageName = game.AndroidPackageName;
if (string.IsNullOrWhiteSpace(packageName))
return game.InstalledVersion;
try
{
var info = GetPackageVersion(packageName);
return info == null ? null : AndroidInstalledRelease.Resolve(gamePath, info);
}
catch (PackageManager.NameNotFoundException)
{
return null;
}
}
private AndroidPackageVersion? GetPackageVersion(string packageName)
{
try
{
var info = _context.PackageManager?.GetPackageInfo(packageName, PackageInfoFlags.Activities);
return info == null ? null : Describe(info);
}
catch (PackageManager.NameNotFoundException) { return null; }
}
private static AndroidPackageVersion Describe(PackageInfo info) => new(info.PackageName!,
OperatingSystem.IsAndroidVersionAtLeast(28) ? info.LongVersionCode : info.VersionCode,
info.VersionName, info.LastUpdateTime);
}
@@ -1,106 +0,0 @@
using Android.App;
using Android.Content;
using Android.Content.PM;
using AndroidX.Core.Content;
using Avalonia.Threading;
using QuiverLauncher.Services;
using Uri = Android.Net.Uri;
namespace QuiverLauncher.Android;
public sealed class AndroidLauncherInstaller(MainActivity activity) : IAndroidLauncherInstaller
{
public const int PermissionRequestCode = 4130;
public const int UpdateRequestCode = 4131;
private TaskCompletionSource<bool>? _permission;
private TaskCompletionSource<bool>? _installation;
private readonly CancellationTokenSource _activityLifetime = new();
private PackageManager Manager => activity.PackageManager!;
private string PackageName => activity.PackageName!;
public LauncherApkIdentity Installed => Describe(Manager.GetPackageInfo(PackageName, PackageInfoFlags.Activities)!);
private static LauncherApkIdentity Describe(PackageInfo info) => new(info.PackageName!,
OperatingSystem.IsAndroidVersionAtLeast(28) ? info.LongVersionCode : info.VersionCode, info.VersionName ?? "0.0.0");
public Task<LauncherApkIdentity> ValidateAsync(string path, string expectedVersion)
{
var flags = OperatingSystem.IsAndroidVersionAtLeast(28) ? PackageInfoFlags.SigningCertificates : PackageInfoFlags.Signatures;
var apk = Manager.GetPackageArchiveInfo(path, flags) ?? throw new InvalidDataException("The downloaded file is not a valid Android APK.");
var current = Manager.GetPackageInfo(PackageName, flags)!;
var identity = Describe(apk);
var installed = Describe(current);
AndroidLauncherPackageValidation.ValidateIdentity(installed, identity, expectedVersion);
if (!HasCompatibleSigner(current, apk))
throw new InvalidDataException("This APK was signed with a different key. It cannot update this installation of Quiver.");
return Task.FromResult(identity);
}
private static bool HasCompatibleSigner(PackageInfo current, PackageInfo candidate)
{
static HashSet<string> Keys(IEnumerable<global::Android.Content.PM.Signature>? signatures) =>
(signatures ?? []).Select(s => Convert.ToHexString(s.ToByteArray()!)).ToHashSet(StringComparer.Ordinal);
if (OperatingSystem.IsAndroidVersionAtLeast(28))
{
var installedKeys = Keys(current.SigningInfo?.GetApkContentsSigners());
var candidateKeys = Keys(candidate.SigningInfo?.GetApkContentsSigners());
return AndroidLauncherPackageValidation.HasCompatibleSigningKeys(installedKeys, candidateKeys,
Keys(candidate.SigningInfo?.GetSigningCertificateHistory()));
}
var previous = Keys(current.Signatures);
return AndroidLauncherPackageValidation.HasCompatibleSigningKeys(previous, Keys(candidate.Signatures));
}
public async Task InstallAsync(string path)
{
await AndroidPackageOperations.Gate.WaitAsync(_activityLifetime.Token).ConfigureAwait(false);
try
{
if (OperatingSystem.IsAndroidVersionAtLeast(26) && !Manager.CanRequestPackageInstalls())
{
if (!await ExplainPermissionAsync().ConfigureAwait(false)) return;
_permission = new(TaskCreationOptions.RunContinuationsAsynchronously);
await Dispatcher.UIThread.InvokeAsync(() => activity.StartActivityForResult(
new Intent(global::Android.Provider.Settings.ActionManageUnknownAppSources, Uri.Parse("package:" + PackageName)), PermissionRequestCode));
await _permission.Task.WaitAsync(_activityLifetime.Token).ConfigureAwait(false);
if (!Manager.CanRequestPackageInstalls()) throw new InvalidOperationException("Installation permission was not granted. Tap Install update to try again.");
}
_installation = new(TaskCreationOptions.RunContinuationsAsynchronously);
await Dispatcher.UIThread.InvokeAsync(() =>
{
var uri = FileProvider.GetUriForFile(activity, PackageName + ".fileprovider", new Java.IO.File(path));
var intent = new Intent(Intent.ActionInstallPackage);
intent.SetDataAndType(uri, "application/vnd.android.package-archive");
intent.AddFlags(ActivityFlags.GrantReadUriPermission);
intent.PutExtra(Intent.ExtraReturnResult, true);
activity.StartActivityForResult(intent, UpdateRequestCode);
});
await _installation.Task.WaitAsync(_activityLifetime.Token).ConfigureAwait(false);
}
finally { _permission = null; _installation = null; AndroidPackageOperations.Gate.Release(); }
}
private async Task<bool> ExplainPermissionAsync()
{
var choice = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
await Dispatcher.UIThread.InvokeAsync(() =>
{
if (activity.IsFinishing || activity.IsDestroyed) { choice.TrySetResult(false); return; }
var dialog = new AlertDialog.Builder(activity)
.SetTitle("Allow Quiver to install this update")
.SetMessage("Enable ‘Allow from this source’ in Android Settings, then return to Quiver. Android will ask you to confirm installation.")
.SetPositiveButton("Open settings", (_, _) => choice.TrySetResult(true))
.SetNegativeButton("Cancel", (_, _) => choice.TrySetResult(false)).Create()!;
dialog.DismissEvent += (_, _) => choice.TrySetResult(false);
dialog.Show();
});
return await choice.Task.WaitAsync(_activityLifetime.Token).ConfigureAwait(false);
}
public void ActivityResult(int requestCode)
{
if (requestCode == PermissionRequestCode) _permission?.TrySetResult(true);
if (requestCode == UpdateRequestCode) _installation?.TrySetResult(true);
}
public void Detach()
{
_activityLifetime.Cancel();
_permission?.TrySetCanceled(); _installation?.TrySetCanceled();
}
}
@@ -1,6 +0,0 @@
namespace QuiverLauncher.Android;
internal static class AndroidPackageOperations
{
internal static readonly SemaphoreSlim Gate = new(1, 1);
}
-91
View File
@@ -1,91 +0,0 @@
using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Views;
using Avalonia.Android;
using QuiverLauncher.Services;
namespace QuiverLauncher.Android;
[Activity(
Label = "Quiver Launcher",
Theme = "@style/MyTheme.NoActionBar",
Icon = "@mipmap/ic_launcher",
MainLauncher = true,
LaunchMode = LaunchMode.SingleTop,
WindowSoftInputMode = SoftInput.AdjustResize,
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
public class MainActivity : AvaloniaMainActivity
{
private AndroidLauncherInstaller? _launcherInstaller;
private SidebarGestureExclusion? _sidebarGestureExclusion;
protected override void OnCreate(Bundle? savedInstanceState)
{
var filesDirectory = FilesDir?.AbsolutePath;
QuiverLauncherPaths.AndroidFilesDirProvider = () => filesDirectory;
AppInstallLaunch.Current = new AndroidAppInstallLaunchService(this);
_launcherInstaller = new AndroidLauncherInstaller(this);
if (AndroidLauncherUpdater.Current == null)
AndroidLauncherUpdater.Current = new AndroidLauncherUpdater(new HttpClient { Timeout = TimeSpan.FromMinutes(30) },
Path.Combine(filesDirectory!, "launcher-updates"), _launcherInstaller, () => AppSettings.Load(),
action => Avalonia.Threading.Dispatcher.UIThread.Post(action));
else AndroidLauncherUpdater.Current.Installer = _launcherInstaller;
QuiverLauncherPaths.EnsureUserDataRootExists();
base.OnCreate(savedInstanceState);
if (OperatingSystem.IsAndroidVersionAtLeast(29) && Window?.DecorView is { } decor)
{
_sidebarGestureExclusion = new SidebarGestureExclusion(decor,
() => Content is MainView view && view.CanOpenMobileNavigation);
decor.ViewTreeObserver?.AddOnPreDrawListener(_sidebarGestureExclusion);
if (Content is MainView mainView)
mainView.LayoutUpdated += UpdateSidebarGestureExclusion;
}
}
private void UpdateSidebarGestureExclusion(object? sender, EventArgs e)
{
if (OperatingSystem.IsAndroidVersionAtLeast(29))
_sidebarGestureExclusion?.OnPreDraw();
}
protected override void OnDestroy()
{
if (Content is MainView mainView)
mainView.LayoutUpdated -= UpdateSidebarGestureExclusion;
if (OperatingSystem.IsAndroidVersionAtLeast(29) && _sidebarGestureExclusion != null)
{
Window?.DecorView?.ViewTreeObserver?.RemoveOnPreDrawListener(_sidebarGestureExclusion);
_sidebarGestureExclusion.Dispose();
_sidebarGestureExclusion = null;
}
_launcherInstaller?.Detach();
// Dispose only this activity's view; a replacement activity may already exist.
if (Content is MainView view)
view.HandleClosed();
base.OnDestroy();
}
protected override void OnActivityResult(int requestCode, Result resultCode, global::Android.Content.Intent? data)
{
base.OnActivityResult(requestCode, resultCode, data);
_launcherInstaller?.ActivityResult(requestCode);
if (requestCode == AndroidAppInstallLaunchService.InstallRequestCode)
AndroidAppInstallLaunchService.CompleteInstall(resultCode == Result.Ok);
else if (requestCode == AndroidAppInstallLaunchService.UninstallRequestCode)
AndroidAppInstallLaunchService.CompleteUninstall(resultCode == Result.Ok);
}
protected override void OnPause()
{
// The player may not come back before Android ends the process: send usage data now.
_ = Telemetry.Current.FlushAsync();
base.OnPause();
}
protected override void OnResume()
{
base.OnResume();
if (!VelopackUpdateService.ShouldSkipAutomaticSelfUpdate())
_ = AndroidLauncherUpdater.Current?.CheckAsync();
}
}
@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent>
</queries>
<application android:name="com.quiverlauncher.app.AndroidApp" android:label="Quiver Launcher" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:requestLegacyExternalStorage="false">
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>
</manifest>
@@ -1,37 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0-android</TargetFramework>
<SupportedOSPlatformVersion>24</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationId>com.quiverlauncher.app</ApplicationId>
<ApplicationVersion>30501</ApplicationVersion>
<ApplicationDisplayVersion>3.5.1</ApplicationDisplayVersion>
<AndroidPackageFormat>apk</AndroidPackageFormat>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<DisableTransitiveProjectReferences>true</DisableTransitiveProjectReferences>
<RootNamespace>QuiverLauncher.Android</RootNamespace>
<AssemblyName>QuiverLauncher.Android</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Android" Version="12.1.1" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="12.1.1" />
<PackageReference Include="System.Drawing.Common" Version="10.0.3">
<ExcludeAssets>all</ExcludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<!-- Android has no SDL controller input (PlatformCapabilities.SupportsGamepadSdl), so leave SDL's native
libraries out of the APK. Keep the version in step with QuiverLauncher.App.csproj. -->
<PackageReference Include="ppy.SDL3-CS" Version="2026.1002.1">
<ExcludeAssets>native</ExcludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\QuiverLauncher.App.csproj">
<AdditionalProperties>QuiverExcludeWindowsDrawing=true</AdditionalProperties>
</ProjectReference>
</ItemGroup>
</Project>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground>
<inset
android:drawable="@drawable/ic_launcher_foreground"
android:inset="22%"/>
</foreground>
</adaptive-icon>
@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground>
<inset
android:drawable="@drawable/ic_launcher_foreground"
android:inset="22%"/>
</foreground>
</adaptive-icon>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#171E30</color>
</resources>
@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">#0e0e10</item>
<item name="android:statusBarColor">#0e0e10</item>
<item name="android:navigationBarColor">#0e0e10</item>
<item name="android:windowLightStatusBar">false</item>
</style>
</resources>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<paths>
<cache-path name="apk_cache" path="." />
<files-path name="files" path="." />
</paths>
@@ -1,28 +0,0 @@
using Android.Graphics;
using Android.Views;
namespace QuiverLauncher.Android;
/// <summary>Reserves a thumb-height section of the left edge for the drawer on gesture-navigation devices.</summary>
[System.Runtime.Versioning.SupportedOSPlatform("android29.0")]
internal sealed class SidebarGestureExclusion(View view, Func<bool> canOpen)
: Java.Lang.Object, ViewTreeObserver.IOnPreDrawListener
{
private (int Width, int Height, bool Enabled)? _last;
public bool OnPreDraw()
{
var state = (view.Width, view.Height, canOpen());
if (_last == state) return true;
_last = state;
var density = view.Resources?.DisplayMetrics?.Density ?? 1;
// Android allows at most 200dp of edge exclusion. Keep the rest, and the
// entire right edge, available for Back. Use the lower-middle thumb area.
var height = Math.Min(view.Height, (int)(200 * density));
var top = Math.Clamp((int)(view.Height * 0.65) - height / 2, 0, Math.Max(0, view.Height - height));
view.SystemGestureExclusionRects = state.Item3
? new[] { new Rect(0, top, (int)(24 * density), top + height) }
: Array.Empty<Rect>();
return true;
}
}
-97
View File
@@ -1,97 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net10.0</TargetFramework>
<AssemblyName>QuiverLauncher</AssemblyName>
<RootNamespace>QuiverLauncher</RootNamespace>
<AssemblyTitle>Quiver Launcher</AssemblyTitle>
<AssemblyDescription>Quiver Launcher — download and manage GitHub-hosted game ports</AssemblyDescription>
<Version>3.5.1</Version>
<AssemblyVersion>3.5.1.0</AssemblyVersion>
<FileVersion>3.5.1.0</FileVersion>
<Configurations>Debug;Release</Configurations>
<Nullable>enable</Nullable>
<!-- SDL3-CS passes gamepads as SDL_Gamepad* pointers (Services/InputService.cs). -->
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ImplicitUsings>enable</ImplicitUsings>
<AvaloniaUseCompiledBindingsByDefault>false</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))">
<DefineConstants>$(DefineConstants);LINUX</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))">
<DefineConstants>$(DefineConstants);OSX</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(QuiverExcludeWindowsDrawing)' == 'true'">
<DefineConstants>$(DefineConstants);EXCLUDE_WINDOWS_DRAWING</DefineConstants>
<OutputPath>bin\android-ref\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\android-ref\$(Configuration)\</IntermediateOutputPath>
<DefaultItemExcludes>$(DefaultItemExcludes);bin/**;obj/**</DefaultItemExcludes>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AsyncImageLoader.Avalonia" Version="3.8.0" />
<PackageReference Include="Avalonia" Version="12.1.1" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="12.1.1" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="12.1.1" />
<PackageReference Include="ppy.SDL3-CS" Version="2026.1002.1" />
<PackageReference Include="SharpCompress" Version="0.50.1" />
<PackageReference Include="System.Text.Json" Version="10.0.3" />
<PackageReference Include="System.Drawing.Common" Version="10.0.3" Condition="'$(QuiverExcludeWindowsDrawing)' != 'true'" />
<PackageReference Include="NAudio" Version="2.2.1" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
<PackageReference Include="Velopack" Version="1.2.0" />
</ItemGroup>
<!-- Anonymous usage data (Services/Telemetry.cs): the PostHog project token is built in from the
POSTHOG_PROJECT_TOKEN variable by release builds. Without it nothing is ever sent. -->
<PropertyGroup>
<PostHogProjectToken Condition="'$(PostHogProjectToken)' == ''">$(POSTHOG_PROJECT_TOKEN)</PostHogProjectToken>
</PropertyGroup>
<ItemGroup Condition="'$(PostHogProjectToken)' != ''">
<AssemblyMetadata Include="PostHogProjectToken" Value="$(PostHogProjectToken)" />
</ItemGroup>
<ItemGroup>
<AvaloniaResource Include="Assets/**" />
<AvaloniaResource Include="Assets/Icons/**" />
</ItemGroup>
<ItemGroup>
<None Update="icon.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="lib\QuiverLauncher.Core\QuiverLauncher.Core.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Remove="lib\QuiverLauncher.Core\**\*.cs" />
<Compile Remove="QuiverLauncher.Tests\**\*.cs" />
<Compile Remove="QuiverLauncher.Desktop\**\*.cs" />
<Compile Remove="QuiverLauncher.Android\**\*.cs" />
<Compile Remove="Program.cs" />
<Compile Remove="tools\**\*.cs" />
<Compile Remove="_test_build\**\*.cs" />
<Compile Remove="artifacts\**\*.cs" />
<Compile Remove="bin\**\*.cs" />
<Compile Remove="obj\**\*.cs" />
<EmbeddedResource Remove="lib\QuiverLauncher.Core\**\*.*" />
<EmbeddedResource Remove="QuiverLauncher.Tests\**\*.*" />
<EmbeddedResource Remove="QuiverLauncher.Desktop\**\*.*" />
<EmbeddedResource Remove="QuiverLauncher.Android\**\*.*" />
<EmbeddedResource Remove="_test_build\**\*.*" />
<EmbeddedResource Remove="artifacts\**\*.*" />
<None Remove="lib\QuiverLauncher.Core\**\*.*" />
<None Remove="QuiverLauncher.Tests\**\*.*" />
<None Remove="QuiverLauncher.Desktop\**\*.*" />
<None Remove="QuiverLauncher.Android\**\*.*" />
<None Remove="_test_build\**\*.*" />
<None Remove="artifacts\**\*.*" />
</ItemGroup>
</Project>
-162
View File
@@ -1,162 +0,0 @@
using Avalonia;
using Avalonia.Controls.Platform;
using QuiverLauncher.Services;
using System.Runtime.InteropServices;
using Velopack;
using Velopack.Locators;
namespace QuiverLauncher.Desktop;
internal static class Program
{
[DllImport("kernel32.dll", SetLastError = true)]
private static extern bool AttachConsole(int dwProcessId);
[DllImport("kernel32.dll")]
private static extern bool FreeConsole();
private const int ATTACH_PARENT_PROCESS = -1;
[STAThread]
public static int Main(string[] args)
{
AppInstallLaunch.Current = new DesktopAppInstallLaunchService();
// Run() clears the updater's restart marker, which shows whether an update just failed.
LauncherUpdateFailure.CaptureUpdaterRestart();
var velopack = VelopackApp.Build();
if (OperatingSystem.IsWindows())
velopack.OnAfterUpdateFastCallback(_ => UserDataRescue.AfterUpdate(ResolveVelopackRootAppDir()));
else
velopack.SetAutoApplyOnStartup(false);
velopack.Run();
QuiverLauncherPaths.VelopackRootAppDirProvider = ResolveVelopackRootAppDir;
QuiverLauncherPaths.VelopackPackageDirectoryProvider = ResolveVelopackPackageDirectory;
if (OperatingSystem.IsWindows())
UserDataRescue.AtStartup(ResolveVelopackRootAppDir(), AppDomain.CurrentDomain.BaseDirectory);
QuiverLauncherPaths.CompletePendingDataMove();
QuiverLauncherPaths.EnsureUserDataRootExists();
var launch = KioskLaunch.Parse(args);
args = launch.Args;
if (args.Length > 0 && args[0].StartsWith("-"))
{
if (OperatingSystem.IsWindows())
{
if (AttachConsole(ATTACH_PARENT_PROCESS))
{
Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true });
Console.SetError(new StreamWriter(Console.OpenStandardError()) { AutoFlush = true });
}
}
int exitCode = RunCli(args);
if (OperatingSystem.IsWindows())
FreeConsole();
return exitCode;
}
#if DEBUG
RegisterDebugExceptionHandlers();
#endif
DefaultMenuInteractionHandler.MenuShowDelay = TimeSpan.Zero;
if (launch.Kiosk)
KioskLaunch.ArmProcess();
BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
return 0;
}
#if DEBUG
private static void RegisterDebugExceptionHandlers()
{
AppDomain.CurrentDomain.UnhandledException += (_, e) =>
{
if (e.ExceptionObject is Exception ex)
CrashLog.Log("AppDomain.UnhandledException", ex);
};
TaskScheduler.UnobservedTaskException += (_, e) =>
{
CrashLog.Log("TaskScheduler.UnobservedTaskException", e.Exception);
e.SetObserved();
};
}
#endif
private static string? ResolveVelopackRootAppDir()
{
try
{
return VelopackLocator.Current?.RootAppDir;
}
catch
{
return null;
}
}
private static string? ResolveVelopackPackageDirectory()
{
try
{
var locator = VelopackLocator.Current;
if (locator is null)
return null;
if (OperatingSystem.IsLinux() &&
locator is LinuxVelopackLocator linux &&
!string.IsNullOrWhiteSpace(linux.AppImagePath))
{
return Path.GetDirectoryName(linux.AppImagePath);
}
if (OperatingSystem.IsMacOS())
{
return QuiverLauncherPaths.ResolveMacOsPackageDirectory(
locator.RootAppDir,
locator.AppContentDir,
AppDomain.CurrentDomain.BaseDirectory);
}
}
catch
{
// Not a Velopack install, or locator unavailable.
}
return null;
}
private static int RunCli(string[] args)
{
try
{
var cliHandler = new CLIHandler();
return cliHandler.Execute(args).GetAwaiter().GetResult();
}
catch (Exception ex)
{
Console.Error.WriteLine($"Error: {ex.Message}");
return 1;
}
}
public static AppBuilder BuildAvaloniaApp()
{
var builder = AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace();
if (OperatingSystem.IsLinux())
builder = builder.With(new X11PlatformOptions { OverlayPopups = true });
return builder;
}
}
@@ -1,59 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ApplicationIcon>..\icon.ico</ApplicationIcon>
<AssemblyName>QuiverLauncher.Desktop</AssemblyName>
<RootNamespace>QuiverLauncher.Desktop</RootNamespace>
<AssemblyTitle>Quiver Launcher</AssemblyTitle>
<AssemblyDescription>Quiver Launcher — download and manage GitHub-hosted game ports</AssemblyDescription>
<Version>3.5.1</Version>
<AssemblyVersion>3.5.1.0</AssemblyVersion>
<FileVersion>3.5.1.0</FileVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RuntimeIdentifiers>win-x64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))">
<DefineConstants>$(DefineConstants);LINUX</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))">
<DefineConstants>$(DefineConstants);OSX</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="12.1.1" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="12.1.1" />
</ItemGroup>
<ItemGroup>
<None Include="..\icon.ico" Link="icon.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\QuiverLauncher.App.csproj" />
</ItemGroup>
<!-- AppHost can be renamed; it still loads QuiverLauncher.Desktop.dll. -->
<Target Name="AliasQuiverLauncherExe" AfterTargets="Build;Publish">
<PropertyGroup>
<_AliasDir Condition="'$(PublishDir)' != '' and Exists('$(PublishDir)$(AssemblyName).exe')">$(PublishDir)</_AliasDir>
<_AliasDir Condition="'$(PublishDir)' != '' and Exists('$(PublishDir)$(AssemblyName)')">$(PublishDir)</_AliasDir>
<_AliasDir Condition="'$(_AliasDir)' == ''">$(OutputPath)</_AliasDir>
</PropertyGroup>
<Copy SourceFiles="$(_AliasDir)$(AssemblyName).exe"
DestinationFiles="$(_AliasDir)QuiverLauncher.exe"
SkipUnchangedFiles="true"
Condition="Exists('$(_AliasDir)$(AssemblyName).exe')" />
<Copy SourceFiles="$(_AliasDir)$(AssemblyName)"
DestinationFiles="$(_AliasDir)QuiverLauncher"
SkipUnchangedFiles="true"
Condition="Exists('$(_AliasDir)$(AssemblyName)') and !Exists('$(_AliasDir)$(AssemblyName).exe')" />
</Target>
</Project>
@@ -1,140 +0,0 @@
using System.IO.Compression;
using FluentAssertions;
using QuiverLauncher.Services;
namespace QuiverLauncher.Tests;
public sealed class AndroidInstallationTests : IDisposable
{
private readonly string _root = Path.Combine(Path.GetTempPath(), "quiver-android-install", Guid.NewGuid().ToString("N"));
private string GamePath => Path.Combine(_root, "game");
private static AndroidPackageVersion Package(long updated = 100, long code = 16) => new("test.battleship", code, "0.10-spike", updated);
public AndroidInstallationTests() => Directory.CreateDirectory(GamePath);
public void Dispose() => Directory.Delete(_root, true);
private string Archive(params string[] entries)
{
var path = Path.Combine(_root, "download.zip");
using var zip = ZipFile.Open(path, ZipArchiveMode.Create);
foreach (var name in entries)
{
using var stream = new StreamWriter(zip.CreateEntry(name).Open());
stream.Write("apk-fixture-bytes");
}
return path;
}
[Theory]
[InlineData("game.apk")]
[InlineData("Android/subfolder/game.APK")]
public async Task Archive_preparation_returns_the_contained_apk_without_touching_the_install(string entry)
{
File.WriteAllText(Path.Combine(GamePath, "version.txt"), "v1.5");
var path = await AndroidPackagePreparation.PrepareAsync(Archive(entry, "readme.txt"), "Android.zip", Path.Combine(_root, "staging"));
Path.GetExtension(path).Should().BeEquivalentTo(".apk");
File.ReadAllText(path).Should().Be("apk-fixture-bytes");
File.ReadAllText(Path.Combine(GamePath, "version.txt")).Should().Be("v1.5");
}
[Fact]
public async Task Direct_apk_is_not_extracted_as_a_zip()
{
var path = Archive("AndroidManifest.xml", "classes.dex");
(await AndroidPackagePreparation.PrepareAsync(path, "game.apk", Path.Combine(_root, "staging"))).Should().Be(path);
Directory.Exists(Path.Combine(_root, "staging")).Should().BeFalse();
}
[Theory]
[InlineData("readme.txt", "game.exe", "*no APK*")]
[InlineData("first.apk", "second.apk", "*multiple APKs*")]
public async Task Missing_or_ambiguous_apks_are_explained(string first, string second, string message)
{
var action = () => AndroidPackagePreparation.PrepareAsync(Archive(first, second), "Android.zip", Path.Combine(_root, "staging"));
await action.Should().ThrowAsync<InvalidDataException>().WithMessage(message);
}
[Theory]
[InlineData("../../outside.apk")]
[InlineData("..\\..\\outside.apk")]
[InlineData("nested/../../../outside.apk")]
public async Task Archive_path_traversal_is_rejected(string entry)
{
var action = () => AndroidPackagePreparation.PrepareAsync(Archive(entry), "Android.zip", Path.Combine(_root, "staging"));
await action.Should().ThrowAsync<InvalidDataException>();
File.Exists(Path.Combine(_root, "outside.apk")).Should().BeFalse();
}
[Fact]
public async Task Invalid_archive_is_not_reported_as_installed()
{
var path = Path.Combine(_root, "bad.zip");
File.WriteAllText(path, "not an archive");
var action = () => AndroidPackagePreparation.PrepareAsync(path, "Android.zip", Path.Combine(_root, "staging"));
await action.Should().ThrowAsync<InvalidDataException>();
File.Exists(Path.Combine(GamePath, "version.txt")).Should().BeFalse();
}
[Fact]
public void Legacy_release_tag_survives_restart_even_when_apk_version_name_differs()
{
File.WriteAllText(Path.Combine(GamePath, "version.txt"), "v1.6");
AndroidInstalledRelease.Resolve(GamePath, Package()).Should().Be("v1.6");
AndroidInstalledRelease.Resolve(GamePath, Package()).Should().Be("v1.6");
}
[Fact]
public void Successful_new_install_confirms_release_and_persists_it()
{
AndroidInstalledRelease.Begin(GamePath, "v1.6", Package(0), null);
File.Exists(Path.Combine(GamePath, "version.txt")).Should().BeFalse();
AndroidInstalledRelease.Resolve(GamePath, Package()).Should().Be("v1.6");
File.ReadAllText(Path.Combine(GamePath, "version.txt")).Should().Be("v1.6");
AndroidInstalledRelease.Resolve(GamePath, Package()).Should().Be("v1.6");
}
[Fact]
public void Update_reusing_apk_version_metadata_is_confirmed_only_after_package_changes()
{
File.WriteAllText(Path.Combine(GamePath, "version.txt"), "v1.5");
AndroidInstalledRelease.Begin(GamePath, "v1.6", Package(0), Package());
AndroidInstalledRelease.Resolve(GamePath, Package()).Should().Be("v1.5");
AndroidInstalledRelease.Resolve(GamePath, Package(200)).Should().Be("v1.6");
AndroidInstalledRelease.Resolve(GamePath, Package(200)).Should().Be("v1.6");
}
[Fact]
public void Cancelled_update_preserves_the_previous_release()
{
File.WriteAllText(Path.Combine(GamePath, "version.txt"), "v1.5");
AndroidInstalledRelease.Begin(GamePath, "v1.6", Package(0), Package());
AndroidInstalledRelease.Cancel(GamePath);
AndroidInstalledRelease.Resolve(GamePath, Package()).Should().Be("v1.5");
File.ReadAllText(Path.Combine(GamePath, "version.txt")).Should().Be("v1.5");
}
[Fact]
public void Cancelled_first_install_does_not_create_an_installed_version()
{
AndroidInstalledRelease.Begin(GamePath, "v1.6", Package(0), null);
AndroidInstalledRelease.Cancel(GamePath);
File.Exists(Path.Combine(GamePath, "version.txt")).Should().BeFalse();
}
[Fact]
public void External_package_update_does_not_reuse_an_old_release_tag()
{
File.WriteAllText(Path.Combine(GamePath, "version.txt"), "v1.6");
AndroidInstalledRelease.Resolve(GamePath, Package()).Should().Be("v1.6");
AndroidInstalledRelease.Resolve(GamePath, Package(200, 17)).Should().Be("0.10-spike");
AndroidInstalledRelease.Resolve(GamePath, Package(200, 17)).Should().Be("0.10-spike");
}
[Fact]
public void A_different_package_cannot_confirm_a_pending_release()
{
AndroidInstalledRelease.Begin(GamePath, "v1.6", Package(0), null);
AndroidInstalledRelease.Resolve(GamePath, Package() with { PackageName = "different.package" }).Should().Be("0.10-spike");
File.Exists(Path.Combine(GamePath, "version.txt")).Should().BeFalse();
}
}
@@ -1,39 +0,0 @@
using FluentAssertions;
using QuiverLauncher.Services;
namespace QuiverLauncher.Tests;
public class AndroidLauncherPackageValidationTests
{
[Theory]
[InlineData("3.4.0", "3.4.0-beta.1", true)]
[InlineData("3.4.0-beta.10", "3.4.0-beta.9", true)]
[InlineData("3.4.0-beta.1", "3.4.0", false)]
[InlineData("3.4.0+build2", "3.4.0+build1", false)]
[InlineData("garbage", "3.3.4", false)]
public void Preview_ordering_respects_release_identity(string candidate, string installed, bool expected) =>
AndroidLauncherPackageValidation.IsNewerVersion(candidate, installed).Should().Be(expected);
[Theory]
[InlineData("wrong.package", 30400, "3.4.0", "v3.4.0")]
[InlineData("com.quiverlauncher.app", 30303, "3.4.0", "v3.4.0")]
[InlineData("com.quiverlauncher.app", 30400, "3.3.3", "v3.3.3")]
[InlineData("com.quiverlauncher.app", 30400, "3.4.0", "v3.5.0")]
public void Rejects_wrong_package_downgrades_and_mismatched_release(string package, long code, string version, string expected)
{
var check = () => AndroidLauncherPackageValidation.ValidateIdentity(new("com.quiverlauncher.app", 30304, "3.3.4"), new(package, code, version), expected);
check.Should().Throw<InvalidDataException>();
}
[Fact]
public void Allows_preview_to_stable_with_same_android_code() => AndroidLauncherPackageValidation.ValidateIdentity(
new("com.quiverlauncher.app", 30400, "3.4.0-beta.1"), new("com.quiverlauncher.app", 30400, "3.4.0"), "v3.4.0");
[Fact]
public void Signing_keys_must_match_or_rotate_forward_using_android_history()
{
AndroidLauncherPackageValidation.HasCompatibleSigningKeys(["release"], ["release"]).Should().BeTrue();
AndroidLauncherPackageValidation.HasCompatibleSigningKeys(["debug"], ["release"]).Should().BeFalse();
AndroidLauncherPackageValidation.HasCompatibleSigningKeys([], []).Should().BeFalse();
AndroidLauncherPackageValidation.HasCompatibleSigningKeys(["old"], ["new"], ["old", "new"]).Should().BeTrue();
AndroidLauncherPackageValidation.HasCompatibleSigningKeys(["new"], ["old"], ["old"]).Should().BeFalse();
AndroidLauncherPackageValidation.HasCompatibleSigningKeys(["a", "b"], ["a"], ["a", "b"]).Should().BeFalse();
}
}
@@ -1,268 +0,0 @@
using System.Net;
using System.Net.Http.Headers;
using System.Text.Json;
using Avalonia.Controls;
using Avalonia.Headless.XUnit;
using Avalonia.Threading;
using FluentAssertions;
using QuiverLauncher.Services;
using QuiverLauncher.Views;
namespace QuiverLauncher.Tests;
public class AndroidLauncherUpdaterTests : IDisposable
{
private readonly string _root = Path.Combine(Path.GetTempPath(), "quiver-updater-tests", Guid.NewGuid().ToString("N"));
private readonly Installer _installer = new();
private readonly AppSettings _settings = new();
private DateTimeOffset _now = DateTimeOffset.UtcNow;
private readonly List<AndroidLauncherUpdater> _updaters = [];
private static object Release(string version = "v3.4.0", bool preview = false, bool draft = false, bool apk = true, string? url = null) => new
{
tag_name = version, prerelease = preview, draft,
assets = apk ? new[] { new { name = "QuiverLauncher-android.apk", size = 3,
browser_download_url = url ?? $"https://github.com/tgeorgiadis/quiver-launcher/releases/download/{version}/QuiverLauncher-android.apk" } } : []
};
private static HttpResponseMessage Releases(params object[] releases)
{
var result = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(JsonSerializer.Serialize(releases)) };
result.Headers.ETag = new EntityTagHeaderValue("\"release-1\""); return result;
}
private AndroidLauncherUpdater Create(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler)
{
var updater = new AndroidLauncherUpdater(new HttpClient(new Handler(handler)), _root, _installer, () => _settings,
now: () => _now, backupUserData: () => LauncherUpdateBackup.Create(_root));
_updaters.Add(updater); return updater;
}
private AndroidLauncherUpdater Create(Func<HttpRequestMessage, HttpResponseMessage> handler) => Create((request, _) => Task.FromResult(handler(request)));
private static HttpResponseMessage Apk(HttpRequestMessage request) => new(HttpStatusCode.OK) { Content = new ByteArrayContent([1, 2, 3]), RequestMessage = request };
[Theory]
[InlineData("v3.3.3", false)] [InlineData("v3.3.4", false)] [InlineData("v3.4.0", true)]
public void Only_newer_versions_are_offered(string version, bool expected) =>
(AndroidLauncherUpdater.SelectRelease(JsonSerializer.Serialize(new[] { Release(version) }), "3.3.4", false) != null).Should().Be(expected);
[Fact]
public void Selection_skips_drafts_previews_and_releases_without_apks()
{
var json = JsonSerializer.Serialize(new[] { Release("v4.0.0", draft: true), Release("v3.6.0", apk: false), Release("v3.5.0-beta.1", preview: true), Release() });
AndroidLauncherUpdater.SelectRelease(json, "3.3.4", false)!.Version.Should().Be("v3.4.0");
AndroidLauncherUpdater.SelectRelease(json, "3.3.4", true)!.Version.Should().Be("v3.5.0-beta.1");
}
[Theory]
[InlineData("http://github.com/tgeorgiadis/quiver-launcher/releases/download/v3.4.0/QuiverLauncher-android.apk")]
[InlineData("https://example.com/QuiverLauncher-android.apk")]
[InlineData("https://github.com/another/repo/releases/download/v3.4.0/QuiverLauncher-android.apk")]
public void Unsupported_download_sources_are_not_offered(string url) =>
AndroidLauncherUpdater.SelectRelease(JsonSerializer.Serialize(new[] { Release(url: url) }), "3.3.4", false).Should().BeNull();
[Fact]
public async Task Checks_are_throttled_and_conditional_but_manual_checks_are_immediate()
{
var calls = 0;
var updater = Create(request => { calls++; if (calls == 1) return Releases(Release()); request.Headers.IfNoneMatch.Should().ContainSingle(); return new(HttpStatusCode.NotModified); });
await updater.CheckAsync(); await updater.CheckAsync(); calls.Should().Be(1);
await updater.CheckAsync(true); calls.Should().Be(2); updater.HasUpdate.Should().BeTrue();
_now += TimeSpan.FromHours(6); await updater.CheckAsync(); calls.Should().Be(3);
}
[Fact]
public async Task Offline_failure_retains_update_and_dismissal_across_restarts()
{
var updater = Create(_ => Releases(Release())); await updater.CheckAsync(); updater.Dismiss();
var offline = Create(_ => throw new HttpRequestException("Offline"));
offline.ShowBanner.Should().BeFalse(); offline.HasUpdate.Should().BeTrue();
await offline.CheckAsync(true); offline.Error.Should().Be("Offline"); offline.HasUpdate.Should().BeTrue();
var next = Create(_ => Releases(Release("v3.5.0"))); await next.CheckAsync(true); next.ShowBanner.Should().BeTrue();
}
[Fact]
public async Task Failure_does_not_claim_up_to_date_after_restart()
{
var updater = Create(_ => throw new HttpRequestException("Offline")); await updater.CheckAsync();
Create(_ => Releases()).AvailableText.Should().Be("Check for Quiver updates");
}
[Fact]
public async Task Rate_limit_survives_restart_and_manual_checks_respect_it()
{
var calls = 0;
var updater = Create(_ => { calls++; var response = new HttpResponseMessage(HttpStatusCode.TooManyRequests); response.Headers.RetryAfter = new RetryConditionHeaderValue(TimeSpan.FromMinutes(15)); return response; });
await updater.CheckAsync(); await updater.CheckAsync(true); calls.Should().Be(1);
var next = Create(_ => { calls++; return Releases(Release()); });
await next.CheckAsync(true); calls.Should().Be(1);
_now += TimeSpan.FromMinutes(16); await next.CheckAsync(true); calls.Should().Be(2); next.HasError.Should().BeFalse();
}
[Fact]
public async Task Changing_channel_invalidates_conditional_cache_and_ignores_cadence()
{
var calls = 0;
var updater = Create(request => { calls++; request.Headers.IfNoneMatch.Should().BeEmpty(); return Releases(Release("v3.5.0-beta.1", preview: true)); });
await updater.CheckAsync(); updater.HasUpdate.Should().BeFalse();
_settings.AllowPrereleaseLauncherUpdates = true;
await updater.CheckAsync(); calls.Should().Be(2); updater.HasUpdate.Should().BeTrue();
}
[Fact]
public async Task Concurrent_checks_make_one_request()
{
var entered = new TaskCompletionSource(); var finish = new TaskCompletionSource(); var calls = 0;
var updater = Create(async (_, _) => { calls++; entered.SetResult(); await finish.Task; return Releases(Release()); });
var check = updater.CheckAsync(); await entered.Task; await updater.CheckAsync(true); finish.SetResult(); await check; calls.Should().Be(1);
}
[Fact]
public async Task Cancelled_install_keeps_valid_apk_and_retry_does_not_download_again()
{
var downloads = 0;
var updater = Create(request => { if (request.RequestUri!.Host == "api.github.com") return Releases(Release()); downloads++; return Apk(request); });
await updater.CheckAsync(); await updater.UpdateAsync();
updater.ActionText.Should().Be("Install update"); updater.State.Should().Be(AndroidLauncherUpdateState.Ready);
_installer.Installs.Should().Be(1); downloads.Should().Be(1);
var next = Create(_ => throw new Exception("No request expected"));
await next.UpdateAsync(); _installer.Installs.Should().Be(2); next.HasError.Should().BeFalse();
}
[Fact]
public async Task Each_installer_attempt_has_a_complete_snapshot_and_retry_preserves_the_previous_copy()
{
var downloads = 0;
var updater = Create(request =>
{
if (request.RequestUri!.Host == "api.github.com") return Releases(Release());
downloads++;
return Apk(request);
});
var appsPath = Path.Combine(_root, "apps.json");
var settingsPath = Path.Combine(_root, "settings.json");
File.WriteAllText(appsPath, "{\"apps\":[{\"name\":\"Saved app\"}]}");
File.WriteAllText(settingsPath, "{\"FirstStartup\":false}");
var apps = File.ReadAllBytes(appsPath);
var settings = File.ReadAllBytes(settingsPath);
_installer.Install = () =>
{
var snapshot = Directory.GetDirectories(Path.Combine(_root, "Backups", "updates")).Single();
File.ReadAllBytes(Path.Combine(snapshot, "apps.json")).Should().Equal(apps);
File.ReadAllBytes(Path.Combine(snapshot, "settings.json")).Should().Equal(settings);
File.Exists(Path.Combine(snapshot, "manifest.json")).Should().BeTrue();
throw new InvalidOperationException("Permission denied");
};
await updater.CheckAsync();
await updater.UpdateAsync();
updater.Error.Should().Be("Permission denied");
File.WriteAllText(settingsPath, "{\"FirstStartup\":false,\"MouseWheelScrollSpeed\":3}");
_installer.Install = () =>
{
var snapshots = Directory.GetDirectories(Path.Combine(_root, "Backups", "updates"));
snapshots.Should().HaveCount(2);
snapshots.Should().Contain(p => File.ReadAllBytes(Path.Combine(p, "settings.json")).SequenceEqual(settings));
snapshots.Should().Contain(p => File.ReadAllBytes(Path.Combine(p, "settings.json")).SequenceEqual(File.ReadAllBytes(settingsPath)));
snapshots.Should().OnlyContain(p => File.ReadAllBytes(Path.Combine(p, "apps.json")).SequenceEqual(apps));
return Task.CompletedTask;
};
await updater.UpdateAsync();
updater.HasError.Should().BeFalse();
_installer.Installs.Should().Be(2);
downloads.Should().Be(1);
File.ReadAllBytes(appsPath).Should().Equal(apps);
}
[Fact]
public async Task Backup_failure_blocks_installer_handoff()
{
var updater = Create(request => request.RequestUri!.AbsolutePath.EndsWith(".apk") ? Apk(request) : Releases(Release()));
File.WriteAllText(Path.Combine(_root, "Backups"), "not a directory");
await updater.CheckAsync();
await updater.UpdateAsync();
updater.Error.Should().Contain("update stopped");
_installer.Installs.Should().Be(0);
updater.ActionText.Should().Be("Install update");
}
[Fact]
public async Task Installer_handoff_is_persisted_before_launch_and_resume_does_not_start_a_check()
{
var entered = new TaskCompletionSource(); var finish = new TaskCompletionSource();
_installer.Install = async () => { var state = JsonSerializer.Deserialize<AndroidLauncherUpdateCache>(File.ReadAllText(Path.Combine(_root, "update.json")))!; state.InstallationHandedOff.Should().BeTrue(); entered.SetResult(); await finish.Task; };
var calls = 0; var updater = Create(request => { calls++; return calls == 1 ? Releases(Release()) : Apk(request); });
await updater.CheckAsync(); var update = updater.UpdateAsync(); await entered.Task;
updater.State.Should().Be(AndroidLauncherUpdateState.AwaitingInstallation); await updater.CheckAsync(true); calls.Should().Be(2);
finish.SetResult(); await update;
}
[Fact]
public async Task Successful_install_clears_download_and_badge_on_next_startup()
{
var updater = Create(request => request.RequestUri!.Host == "api.github.com" ? Releases(Release()) : Apk(request));
await updater.CheckAsync(); await updater.UpdateAsync();
_installer.Installed = new("com.quiverlauncher.app", 30400, "3.4.0");
var next = Create(_ => Releases()); next.HasUpdate.Should().BeFalse(); next.ShowBanner.Should().BeFalse();
File.Exists(Path.Combine(_root, "quiver-update.apk")).Should().BeFalse();
}
[Fact]
public async Task Invalid_apk_never_reaches_installer_and_partial_is_deleted()
{
_installer.Invalid = true;
var updater = Create(request => request.RequestUri!.Host == "api.github.com" ? Releases(Release()) : Apk(request));
await updater.CheckAsync(); await updater.UpdateAsync();
updater.HasError.Should().BeTrue(); _installer.Installs.Should().Be(0);
Directory.GetFiles(_root, "*.apk*").Should().BeEmpty();
}
[Fact]
public async Task Tampered_completed_apk_is_revalidated_before_reuse()
{
var updater = Create(request => request.RequestUri!.Host == "api.github.com" ? Releases(Release()) : Apk(request));
await updater.CheckAsync(); await updater.UpdateAsync(); _installer.Invalid = true;
await updater.UpdateAsync(); _installer.Installs.Should().Be(1); updater.ActionText.Should().Be("Update");
}
[Fact]
public async Task Permission_failure_retains_apk_for_retry()
{
_installer.Install = () => throw new InvalidOperationException("Permission denied");
var updater = Create(request => request.RequestUri!.Host == "api.github.com" ? Releases(Release()) : Apk(request));
await updater.CheckAsync(); await updater.UpdateAsync(); updater.Error.Should().Be("Permission denied"); updater.ActionText.Should().Be("Install update");
}
[Fact]
public async Task Download_cancellation_is_not_an_error_and_can_retry()
{
var downloading = new TaskCompletionSource(); var blocked = true;
var updater = Create(async (request, token) =>
{
if (request.RequestUri!.Host == "api.github.com") return Releases(Release());
if (blocked) { downloading.SetResult(); await Task.Delay(Timeout.Infinite, token); }
return Apk(request);
});
await updater.CheckAsync(); var update = updater.UpdateAsync(); await downloading.Task; updater.CancelDownload(); await update;
updater.HasError.Should().BeFalse(); updater.CanUpdate.Should().BeTrue(); _installer.Installs.Should().Be(0);
blocked = false; await updater.UpdateAsync(); _installer.Installs.Should().Be(1);
}
[Fact]
public async Task Truncated_download_cannot_be_installed()
{
var updater = Create(request => request.RequestUri!.Host == "api.github.com" ? Releases(Release()) : new(HttpStatusCode.OK) { Content = new ByteArrayContent([1]), RequestMessage = request });
await updater.CheckAsync(); await updater.UpdateAsync(); updater.HasError.Should().BeTrue(); _installer.Installs.Should().Be(0);
}
[AvaloniaFact]
public async Task Update_check_refresh_does_not_take_focus()
{
var updater = Create(_ => Releases(Release())); await updater.CheckAsync();
var view = new AndroidLauncherUpdateView { DataContext = updater }; var input = new TextBox();
var panel = new StackPanel(); panel.Children.Add(input); panel.Children.Add(view);
var window = new Window { Width = 360, Height = 650, Content = panel };
try
{
window.Show(); window.UpdateLayout(); input.Focus();
await updater.CheckAsync(true); Dispatcher.UIThread.RunJobs(); window.UpdateLayout();
input.IsFocused.Should().BeTrue();
}
finally { window.Close(); }
}
public void Dispose()
{
foreach (var updater in _updaters) updater.Dispose();
if (Directory.Exists(_root)) Directory.Delete(_root, true);
}
private sealed class Handler(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> action) : HttpMessageHandler
{ protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) => action(request, cancellationToken); }
private sealed class Installer : IAndroidLauncherInstaller
{
public LauncherApkIdentity Installed { get; set; } = new("com.quiverlauncher.app", 30304, "3.3.4");
public bool Invalid; public int Installs;
public Func<Task>? Install;
public Task<LauncherApkIdentity> ValidateAsync(string path, string expectedVersion) => Invalid ? throw new InvalidDataException("Invalid package/signature") : Task.FromResult(new LauncherApkIdentity(Installed.PackageName, 30400, "3.4.0"));
public async Task InstallAsync(string path) { Installs++; if (Install != null) await Install(); }
}
}
@@ -1,102 +0,0 @@
using FluentAssertions;
using QuiverLauncher.Models;
using QuiverLauncher.Core.Models;
using QuiverLauncher.Services;
namespace QuiverLauncher.Tests;
public sealed class AndroidLibraryLifecycleTests : IDisposable
{
private readonly string _root = Path.Combine(Path.GetTempPath(), "quiver-android-lifecycle", Guid.NewGuid().ToString("N"));
private readonly GameInfo _game = new() { Name = "Fixture", FolderName = "game", Status = GameStatus.Installed, InstalledVersion = "v1.6", LatestVersion = "v1.6" };
public AndroidLibraryLifecycleTests()
{
Directory.CreateDirectory(_root);
File.WriteAllText(Path.Combine(_root, "version.txt"), "v1.6");
File.WriteAllText(Path.Combine(_root, GameStatusService.AndroidPackageFileName), "test.fixture");
File.WriteAllText(Path.Combine(_root, "save.dat"), "user data");
AndroidInstalledRelease.Resolve(_root, new("test.fixture", 16, "0.10-spike", 100));
}
public void Dispose() => Directory.Delete(_root, true);
[Theory]
[InlineData(false)]
[InlineData(true)]
public async Task Uninstall_waits_for_android_and_clears_receipts_only_after_confirmed_removal(bool confirm)
{
var service = new FakeInstaller();
var operation = AndroidLibraryUninstall.RunAsync(_game, _root, service);
operation.IsCompleted.Should().BeFalse();
_game.AndroidPackageName.Should().Be("test.fixture");
service.TargetPath.Should().Be(_root);
_game.IsLoading.Should().BeTrue();
File.Exists(Path.Combine(_root, "android-release.json")).Should().BeTrue();
service.Installed = !confirm;
service.Result.SetResult(confirm);
(await operation).Should().Be(confirm);
_game.IsLoading.Should().BeFalse();
_game.Status.Should().Be(confirm ? GameStatus.NotInstalled : GameStatus.Installed);
_game.InstalledVersion.Should().Be(confirm ? "" : "v1.6");
File.Exists(Path.Combine(_root, "version.txt")).Should().Be(!confirm);
File.Exists(Path.Combine(_root, "android-release.json")).Should().Be(!confirm);
File.ReadAllText(Path.Combine(_root, "save.dat")).Should().Be("user data");
File.ReadAllText(Path.Combine(_root, GameStatusService.AndroidPackageFileName)).Should().Be("test.fixture");
}
[Fact]
public async Task A_success_result_cannot_erase_receipts_while_the_app_is_still_installed()
{
var service = new FakeInstaller();
service.Result.SetResult(true);
var action = () => AndroidLibraryUninstall.RunAsync(_game, _root, service);
await action.Should().ThrowAsync<InvalidOperationException>();
_game.Status.Should().Be(GameStatus.Installed);
_game.IsLoading.Should().BeFalse();
File.Exists(Path.Combine(_root, "android-release.json")).Should().BeTrue();
}
[Fact]
public async Task Failure_to_open_the_uninstaller_preserves_the_existing_installation()
{
var service = new FakeInstaller();
service.Result.SetException(new InvalidOperationException("native prompt unavailable"));
var action = () => AndroidLibraryUninstall.RunAsync(_game, _root, service);
await action.Should().ThrowAsync<InvalidOperationException>();
_game.Status.Should().Be(GameStatus.Installed);
_game.IsLoading.Should().BeFalse();
File.ReadAllText(Path.Combine(_root, "version.txt")).Should().Be("v1.6");
}
[Fact]
public async Task Package_readiness_is_immediate_when_android_is_ready()
{
(await AndroidPackageReadiness.WaitAsync(() => true, () => throw new Exception("Unexpected delay"))).Should().BeTrue();
}
[Fact]
public async Task Package_readiness_retries_transient_missing_state_without_waiting_indefinitely()
{
var queries = 0;
var delays = 0;
(await AndroidPackageReadiness.WaitAsync(() => ++queries == 3, () => { delays++; return Task.CompletedTask; })).Should().BeTrue();
queries.Should().Be(3);
delays.Should().Be(2);
queries = 0;
delays = 0;
(await AndroidPackageReadiness.WaitAsync(() => { queries++; return false; }, () => { delays++; return Task.CompletedTask; })).Should().BeFalse();
queries.Should().Be(9);
delays.Should().Be(8);
}
private sealed class FakeInstaller : IAppInstallLaunchService
{
public bool Installed = true;
public string? TargetPath;
public TaskCompletionSource<bool> Result = new(TaskCreationOptions.RunContinuationsAsynchronously);
public Task<bool> UninstallAsync(GameInfo game, string gamePath) { TargetPath = gamePath; return Result.Task; }
public bool IsInstalled(GameInfo game) => Installed;
public string? GetInstalledVersion(GameInfo game, string gamePath) => Installed ? "v1.6" : null;
public Task<bool> InstallAsync(GameInfo game, string path, string version, string gamePath) => throw new NotSupportedException();
public Task<bool> LaunchAsync(GameInfo game, string folder) => throw new NotSupportedException();
}
}
@@ -1,99 +0,0 @@
using System.Net;
using System.Net.Http;
using System.Text;
using FluentAssertions;
using QuiverLauncher.Services;
namespace QuiverLauncher.Tests;
public class AnnouncementServiceTests
{
[Fact]
public void TryParse_returns_payload_when_valid()
{
var payload = AnnouncementService.TryParse(
"""{"id":"notice-1","enabled":true,"message":"Hello from Quiver"}""");
payload.Should().NotBeNull();
payload!.Id.Should().Be("notice-1");
payload.Message.Should().Be("Hello from Quiver");
payload.Enabled.Should().BeTrue();
}
[Fact]
public void TryParse_returns_null_when_disabled_or_incomplete()
{
AnnouncementService.TryParse(
"""{"id":"notice-1","enabled":false,"message":"Hidden"}""").Should().BeNull();
AnnouncementService.TryParse(
"""{"id":"","enabled":true,"message":"No id"}""").Should().BeNull();
AnnouncementService.TryParse(
"""{"id":"notice-1","enabled":true,"message":" "}""").Should().BeNull();
AnnouncementService.TryParse("not-json").Should().BeNull();
AnnouncementService.TryParse(null).Should().BeNull();
}
[Fact]
public void ShouldShow_respects_dismissed_ids()
{
var payload = new AnnouncementPayload
{
Id = "notice-1",
Enabled = true,
Message = "Hello",
};
AnnouncementService.ShouldShow(payload, null).Should().BeTrue();
AnnouncementService.ShouldShow(payload, []).Should().BeTrue();
AnnouncementService.ShouldShow(payload, ["other"]).Should().BeTrue();
AnnouncementService.ShouldShow(payload, ["notice-1"]).Should().BeFalse();
AnnouncementService.ShouldShow(payload, ["NOTICE-1"]).Should().BeFalse();
}
[Fact]
public async Task TryFetchAsync_returns_parsed_payload_on_success()
{
using var handler = new StubHttpMessageHandler(_ =>
new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StringContent(
"""{"id":"remote-1","enabled":true,"message":"Remote hello"}""",
Encoding.UTF8,
"application/json"),
});
using var client = new HttpClient(handler);
var payload = await AnnouncementService.TryFetchAsync(client, "https://example.com/announcement.json");
payload.Should().NotBeNull();
payload!.Id.Should().Be("remote-1");
payload.Message.Should().Be("Remote hello");
}
[Fact]
public async Task TryFetchAsync_returns_null_on_http_failure()
{
using var handler = new StubHttpMessageHandler(_ =>
new HttpResponseMessage(HttpStatusCode.NotFound));
using var client = new HttpClient(handler);
var payload = await AnnouncementService.TryFetchAsync(client, "https://example.com/missing.json");
payload.Should().BeNull();
}
private sealed class StubHttpMessageHandler : HttpMessageHandler
{
private readonly Func<HttpRequestMessage, HttpResponseMessage> _handler;
public StubHttpMessageHandler(Func<HttpRequestMessage, HttpResponseMessage> handler) =>
_handler = handler;
protected override Task<HttpResponseMessage> SendAsync(
HttpRequestMessage request,
CancellationToken cancellationToken) =>
Task.FromResult(_handler(request));
}
}
@@ -1,152 +0,0 @@
using FluentAssertions;
using QuiverLauncher.Models;
using QuiverLauncher.Services;
namespace QuiverLauncher.Tests;
public class AppCatalogServiceTests
{
[Theory]
[InlineData("https://example.com/apps.json", true)]
[InlineData("http://example.com/apps.json", true)]
[InlineData("HTTPS://EXAMPLE.COM/apps.json", true)]
[InlineData("community-app-catalog/N64-Recomps.json", false)]
[InlineData(@"C:\Catalogs\apps.json", false)]
public void IsRemoteLocation_classifies_locations(string location, bool expectedRemote)
{
AppCatalogService.IsRemoteLocation(location).Should().Be(expectedRemote);
}
[Fact]
public void ResolveLocalPath_combines_relative_paths_with_user_data_root()
{
var previous = QuiverLauncherPaths.OverrideUserDataRoot;
var temp = Path.Combine(Path.GetTempPath(), "QuiverCatalogPaths_" + Guid.NewGuid().ToString("N"));
try
{
QuiverLauncherPaths.OverrideUserDataRoot = temp;
var resolved = AppCatalogService.ResolveLocalPath("Lists/apps.json");
resolved.Should().Be(Path.Combine(Path.GetFullPath(temp), "Lists/apps.json"));
}
finally
{
QuiverLauncherPaths.OverrideUserDataRoot = previous;
}
}
[Fact]
public void ResolveLocalPath_preserves_rooted_and_remote_paths()
{
const string remote = "https://example.com/index.json";
AppCatalogService.ResolveLocalPath(remote).Should().Be(remote);
var rooted = Path.GetFullPath(Path.Combine(Path.GetTempPath(), "apps.json"));
AppCatalogService.ResolveLocalPath(rooted).Should().Be(rooted);
}
[Fact]
public void ApplyUserAppTags_replaces_tags_when_override_exists()
{
var app = new GameInfo
{
Repository = "owner/app",
Name = "Name",
FolderName = "Folder",
Tags = ["catalog"],
};
var settings = new AppSettings
{
UserAppTags = new Dictionary<string, List<string>>
{
["owner/app"] = ["custom", "n64"],
},
};
AppCatalogService.ApplyUserAppTags(app, settings);
app.Tags.Should().BeEquivalentTo(["custom", "n64"]);
}
[Fact]
public void ApplyUserAppDisplayNames_applies_settings_override()
{
var app = new GameInfo
{
Name = "Game",
Project = "Project",
Repository = "owner/game",
};
var settings = new AppSettings
{
LibraryNameStyle = LibraryNameStyle.NameOnly,
UserAppDisplayNames = new Dictionary<string, string>
{
["owner/game"] = "Custom",
},
};
AppCatalogService.ApplyUserAppDisplayNames(app, settings);
app.CustomDisplayName.Should().Be("Custom");
app.LibraryNameStyle.Should().Be(LibraryNameStyle.NameOnly);
app.DisplayName.Should().Be("Custom");
}
[Fact]
public void ParseAppsFromJson_reads_app_list_file()
{
var service = new AppCatalogService();
var apps = service.ParseAppsFromJson(TestFixtures.ReadN64RecompListJson());
apps.Should().OnlyContain(app => !string.IsNullOrWhiteSpace(app.Repository));
var zelda = apps.Should().ContainSingle(a => a.Repository == "Zelda64Recomp/Zelda64Recomp").Subject;
zelda.Name.Should().Be("Ocarina of Time & Majora's Mask");
zelda.Project.Should().Be("Zelda64Recomp");
zelda.FolderName.Should().Be("OcarinaOfTimeMajorasMask-Zelda64Recomp");
}
[Fact]
public void SerializeApp_round_trips_autoUpdate()
{
var tempDir = Path.Combine(Path.GetTempPath(), "quiver-auto-update-" + Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(tempDir);
try
{
var (service, _) = TestFixtures.CreateIsolatedCatalogService(dataDirectory: tempDir);
var apps = new List<GameInfo>
{
new()
{
Name = "Auto App",
Repository = "owner/auto",
FolderName = "Auto",
AutoUpdate = true,
},
new()
{
Name = "Manual App",
Repository = "owner/manual",
FolderName = "Manual",
AutoUpdate = false,
},
};
service.SaveLocalApps(apps);
var json = File.ReadAllText(Path.Combine(tempDir, "apps.json"));
json.Should().Contain("\"autoUpdate\": true");
json.Should().Contain("owner/manual");
// false autoUpdate is omitted from JSON and defaults to false on load
json.Should().NotContain("\"autoUpdate\": false");
var loaded = service.ParseAppsFromJson(json);
loaded.Should().ContainSingle(a => a.Repository == "owner/auto" && a.AutoUpdate);
loaded.Should().ContainSingle(a => a.Repository == "owner/manual" && !a.AutoUpdate);
}
finally
{
if (Directory.Exists(tempDir))
Directory.Delete(tempDir, recursive: true);
}
}
}
@@ -1,78 +0,0 @@
using FluentAssertions;
using QuiverLauncher;
using QuiverLauncher.Services;
namespace QuiverLauncher.Tests;
public class AppDisplayNameTests
{
[Theory]
[InlineData(LibraryNameStyle.NameOnly, "Majora's Mask", "2 Ship 2 Harkinian", "Majora's Mask")]
[InlineData(LibraryNameStyle.NameAndProject, "Majora's Mask", "2 Ship 2 Harkinian", "Majora's Mask")]
[InlineData(LibraryNameStyle.NameAndProjectInTitle, "Majora's Mask", "2 Ship 2 Harkinian", "Majora's Mask (2 Ship 2 Harkinian)")]
[InlineData(LibraryNameStyle.ProjectOnly, "Majora's Mask", "2 Ship 2 Harkinian", "2 Ship 2 Harkinian")]
[InlineData(LibraryNameStyle.NameAndProject, "Banjo-Kazooie", null, "Banjo-Kazooie")]
[InlineData(LibraryNameStyle.ProjectOnly, "Banjo-Kazooie", null, "Banjo-Kazooie")]
public void Resolve_composes_from_style(
LibraryNameStyle style,
string? name,
string? project,
string expected)
{
AppDisplayName.Resolve(name, project, customDisplayName: null, style).Should().Be(expected);
}
[Fact]
public void ResolveProjectSubtitle_shows_for_name_and_project_style()
{
AppDisplayName.ResolveProjectSubtitle(
"Banjo-Kazooie",
"BanjoRecomp",
customDisplayName: null,
LibraryNameStyle.NameAndProject)
.Should().Be("BanjoRecomp");
}
[Fact]
public void Project_and_name_style_titles_the_project_with_the_game_below_as_in_the_catalog()
{
AppDisplayName.Resolve("Banjo-Kazooie", "BanjoRecomp", null, LibraryNameStyle.ProjectAndName).Should().Be("BanjoRecomp");
AppDisplayName.ResolveProjectSubtitle("Banjo-Kazooie", "BanjoRecomp", null, LibraryNameStyle.ProjectAndName)
.Should().Be("Banjo-Kazooie");
// No project: the name is the title, with nothing under it.
AppDisplayName.Resolve("Banjo-Kazooie", null, null, LibraryNameStyle.ProjectAndName).Should().Be("Banjo-Kazooie");
AppDisplayName.ResolveProjectSubtitle("Banjo-Kazooie", null, null, LibraryNameStyle.ProjectAndName).Should().BeEmpty();
// The player's own display name still wins.
AppDisplayName.Resolve("Banjo-Kazooie", "BanjoRecomp", "My Banjo", LibraryNameStyle.ProjectAndName).Should().Be("My Banjo");
AppDisplayName.ResolveProjectSubtitle("Banjo-Kazooie", "BanjoRecomp", "My Banjo", LibraryNameStyle.ProjectAndName).Should().BeEmpty();
}
[Fact]
public void ResolveProjectSubtitle_hidden_for_in_title_and_custom_name()
{
AppDisplayName.ResolveProjectSubtitle(
"Banjo-Kazooie",
"BanjoRecomp",
customDisplayName: null,
LibraryNameStyle.NameAndProjectInTitle)
.Should().BeEmpty();
AppDisplayName.ResolveProjectSubtitle(
"Banjo-Kazooie",
"BanjoRecomp",
"My Banjo",
LibraryNameStyle.NameAndProject)
.Should().BeEmpty();
}
[Fact]
public void Resolve_custom_display_name_wins()
{
AppDisplayName.Resolve(
"Majora's Mask",
"2 Ship 2 Harkinian",
"My MM",
LibraryNameStyle.NameAndProject)
.Should().Be("My MM");
}
}
@@ -1,88 +0,0 @@
using FluentAssertions;
using QuiverLauncher.Models;
using QuiverLauncher.Services;
using QuiverLauncher.ViewModels;
namespace QuiverLauncher.Tests;
public class AppEntryEditorTests
{
[Fact]
public async Task Save_stays_busy_until_the_library_refresh_finishes()
{
var operation = new SaveOperation();
operation.Completion.SetResult(true);
var model = new AppEntryEditorViewModel();
model.Configure(operation);
model.Open();
model.Name = "jakdexter";
model.FolderName = "jakanddexter";
model.Repository = "https://github.com/open-goal/launcher";
var refreshed = new TaskCompletionSource();
var saving = model.SaveAsync(TestContext.Current.CancellationToken, () => refreshed.Task);
try
{
model.CanSave.Should().BeFalse();
(await model.SaveAsync(TestContext.Current.CancellationToken)).Should().BeFalse();
operation.Calls.Should().Be(1);
}
finally { refreshed.TrySetResult(); }
(await saving).Should().BeTrue();
model.CanSave.Should().BeTrue();
}
private sealed class SaveOperation : IAppEntryService
{
public AppEntryDraft? Draft { get; private set; }
public int Calls { get; private set; }
public TaskCompletionSource<bool> Completion { get; } = new();
public Task<bool> SaveAsync(AppEntryDraft draft, Action<EntryNotice> notice, Action<GameInfo> openFolder, CancellationToken token)
{
Draft = draft;
Calls++;
return Completion.Task;
}
}
[Fact]
public async Task Save_captures_original_entry_identity_and_cannot_close_a_reopened_editor()
{
var operation = new SaveOperation();
var model = new AppEntryEditorViewModel();
model.Configure(operation);
var game = new GameInfo { Name = "Old name", Repository = "owner/app", FolderName = "OldFolder" };
model.Open(game);
model.Name = "Updated name";
model.FolderName = "NewFolder";
var saving = model.SaveAsync(TestContext.Current.CancellationToken);
(await model.SaveAsync(TestContext.Current.CancellationToken)).Should().BeFalse();
operation.Calls.Should().Be(1);
operation.Draft!.EditingIdentityKey.Should().Be(game.InstanceKey);
operation.Draft.FolderName.Should().Be("NewFolder");
model.Close();
model.Open();
model.Name = "Another app";
operation.Completion.SetResult(true);
(await saving).Should().BeFalse();
model.Name.Should().Be("Another app");
model.Title.Should().Be("Create New Entry");
}
[Fact]
public async Task Manual_entry_requires_name_and_folder_but_not_repository()
{
var operation = new SaveOperation();
var model = new AppEntryEditorViewModel();
model.Configure(operation);
model.Open();
model.ManuallyManaged = true;
model.Name = "Manual app";
(await model.SaveAsync(TestContext.Current.CancellationToken)).Should().BeFalse();
model.Validation.Should().Be("Error: Folder name is required");
operation.Calls.Should().Be(0);
model.FolderName = "ManualApp";
operation.Completion.SetResult(true);
(await model.SaveAsync(TestContext.Current.CancellationToken)).Should().BeTrue();
operation.Draft!.ManuallyManaged.Should().BeTrue();
}
}
@@ -1,129 +0,0 @@
using FluentAssertions;
using QuiverLauncher.Models;
using QuiverLauncher.Services;
namespace QuiverLauncher.Tests;
public class AppFilesToAddServiceTests
{
[Fact]
public void Normalize_rejects_path_segments_and_deduplicates()
{
var files = AppFilesToAddService.Normalize(
[
" portable.txt ",
"portable.txt",
"../evil.txt",
"sub/dir.txt",
"config.ini",
"",
]);
files.Should().Equal("portable.txt", "config.ini");
}
[Fact]
public void ParseCommaSeparated_parses_display_format()
{
AppFilesToAddService.ParseCommaSeparated("portable.txt, config.ini")
.Should()
.Equal("portable.txt", "config.ini");
}
[Fact]
public void Sync_creates_new_files_and_removes_cleared_ones()
{
var root = Path.Combine(Path.GetTempPath(), "quiver-files-to-add-" + Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(root);
try
{
AppFilesToAddService.Sync(root, previous: null, next: ["portable.txt", "keep.txt"]);
File.Exists(Path.Combine(root, "portable.txt")).Should().BeTrue();
File.Exists(Path.Combine(root, "keep.txt")).Should().BeTrue();
File.WriteAllText(Path.Combine(root, "portable.txt"), "existing");
AppFilesToAddService.Sync(root, previous: ["portable.txt", "keep.txt"], next: ["keep.txt", "new.txt"]);
File.Exists(Path.Combine(root, "portable.txt")).Should().BeFalse();
File.Exists(Path.Combine(root, "keep.txt")).Should().BeTrue();
File.ReadAllText(Path.Combine(root, "keep.txt")).Should().BeEmpty();
File.Exists(Path.Combine(root, "new.txt")).Should().BeTrue();
}
finally
{
if (Directory.Exists(root))
Directory.Delete(root, recursive: true);
}
}
[Fact]
public void Sync_does_not_overwrite_existing_file_content()
{
var root = Path.Combine(Path.GetTempPath(), "quiver-files-to-add-" + Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(root);
try
{
var path = Path.Combine(root, "portable.txt");
File.WriteAllText(path, "keep-me");
AppFilesToAddService.Sync(root, previous: null, next: ["portable.txt"]);
File.ReadAllText(path).Should().Be("keep-me");
}
finally
{
if (Directory.Exists(root))
Directory.Delete(root, recursive: true);
}
}
[Fact]
public void SerializeApp_omits_empty_filesToAdd()
{
var tempDir = Path.Combine(Path.GetTempPath(), "quiver-files-to-add-ser-" + Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(tempDir);
try
{
var (service, _) = TestFixtures.CreateIsolatedCatalogService(dataDirectory: tempDir);
var withoutFiles = new List<GameInfo>
{
new()
{
Name = "Plain",
Repository = "owner/plain",
FolderName = "Plain",
FilesToAdd = [],
},
};
service.SaveLocalApps(withoutFiles);
var plainJson = File.ReadAllText(Path.Combine(tempDir, "apps.json"));
plainJson.Should().NotContain("filesToAdd");
var withFiles = new List<GameInfo>
{
new()
{
Name = "Recomp",
Repository = "owner/recomp",
FolderName = "Recomp",
FilesToAdd = ["portable.txt"],
},
};
service.SaveLocalApps(withFiles);
var withJson = File.ReadAllText(Path.Combine(tempDir, "apps.json"));
withJson.Should().Contain("filesToAdd");
withJson.Should().Contain("portable.txt");
var loaded = service.ParseAppsFromJson(withJson);
loaded.Single().FilesToAdd.Should().Equal("portable.txt");
}
finally
{
if (Directory.Exists(tempDir))
Directory.Delete(tempDir, recursive: true);
}
}
}
@@ -1,195 +0,0 @@
using FluentAssertions;
using QuiverLauncher.Core.Services;
using QuiverLauncher.Models;
using QuiverLauncher.Services;
using System.Text.Json;
namespace QuiverLauncher.Tests;
public class AppIdentityMigrationTests
{
[Fact]
public void HasIdentityChanged_detects_repo_or_source_change()
{
AppIdentityMigration.HasIdentityChanged("github", "owner/a", "github", "owner/a")
.Should().BeFalse();
AppIdentityMigration.HasIdentityChanged(null, "owner/a", "github", "owner/a")
.Should().BeFalse();
AppIdentityMigration.HasIdentityChanged(null, "owner/a", "gitlab", "owner/a")
.Should().BeTrue();
AppIdentityMigration.HasIdentityChanged(null, "owner/old", "gitlab", "bighead.0/ladxhd_updated")
.Should().BeTrue();
}
[Fact]
public void MigrateUserAppTags_moves_tags_to_new_repository()
{
var settings = new AppSettings();
settings.EnsureInitialized();
settings.UserAppTags["owner/old"] = ["n64", "recomp"];
AppIdentityMigration.MigrateUserAppTags(settings, "owner/old", "bighead.0/ladxhd_updated")
.Should().BeTrue();
settings.UserAppTags.Should().NotContainKey("owner/old");
settings.UserAppTags["bighead.0/ladxhd_updated"].Should().BeEquivalentTo("n64", "recomp");
}
[Fact]
public void MigrateUserAppDisplayNames_moves_custom_name_to_new_repository()
{
var settings = new AppSettings();
settings.EnsureInitialized();
settings.UserAppDisplayNames["owner/old"] = "My Custom Name";
AppIdentityMigration.MigrateUserAppDisplayNames(settings, "owner/old", "owner/new")
.Should().BeTrue();
settings.UserAppDisplayNames.Should().NotContainKey("owner/old");
settings.UserAppDisplayNames["owner/new"].Should().Be("My Custom Name");
}
[Fact]
public void MigrateUserAppTags_does_not_overwrite_existing_destination()
{
var settings = new AppSettings();
settings.EnsureInitialized();
settings.UserAppTags["owner/old"] = ["old-tag"];
settings.UserAppTags["owner/new"] = ["keep-me"];
AppIdentityMigration.MigrateUserAppTags(settings, "owner/old", "owner/new")
.Should().BeTrue();
settings.UserAppTags.Should().NotContainKey("owner/old");
settings.UserAppTags["owner/new"].Should().BeEquivalentTo("keep-me");
}
[Fact]
public void MigrateIdentity_source_only_change_clears_old_cache_without_settings_change()
{
var cacheDir = Path.Combine(Path.GetTempPath(), "QuiverIdMig_" + Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(cacheDir);
try
{
GitHubApiCache.Initialize(cacheDir);
GitHubApiCache.SetCache(null, "owner/app", "v1.0.0", "etag");
var settings = new AppSettings();
settings.EnsureInitialized();
var changed = AppIdentityMigration.MigrateIdentity(
settings,
oldRepositorySource: null,
oldRepository: "owner/app",
newRepositorySource: "gitlab",
newRepository: "owner/app");
changed.Should().BeFalse();
GitHubApiCache.TryGetCachedVersion(null, "owner/app", out _).Should().BeFalse();
}
finally
{
try { Directory.Delete(cacheDir, recursive: true); } catch { /* ignore */ }
}
}
[Fact]
public async Task Edit_persist_writes_new_repository_and_source()
{
var dir = Path.Combine(Path.GetTempPath(), "QuiverEditRepo_" + Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(dir);
try
{
var catalog = new AppCatalogService(dataDirectory: dir);
await catalog.SaveLocalAppsAsync(
[
new GameInfo
{
Name = "LA DX HD",
Repository = "OldOwner/LADXHD",
FolderName = "LADXHD",
},
]);
var apps = await catalog.LoadLocalAppsAsync();
var app = apps.Should().ContainSingle().Subject;
var oldIdentity = app.IdentityKey;
app.Repository = "bighead.0/ladxhd_updated";
app.RepositorySource = "gitlab";
oldIdentity.Should().NotBe(app.IdentityKey);
var settings = new AppSettings();
settings.EnsureInitialized();
settings.UserAppTags["OldOwner/LADXHD"] = ["zelda"];
AppIdentityMigration.MigrateIdentity(
settings,
null,
"OldOwner/LADXHD",
app.RepositorySource,
app.Repository).Should().BeTrue();
await catalog.SaveLocalAppsAsync(apps);
var json = await File.ReadAllTextAsync(Path.Combine(dir, "apps.json"));
using var document = JsonDocument.Parse(json);
var entry = document.RootElement.GetProperty("apps")[0];
entry.GetProperty("repository").GetString().Should().Be("bighead.0/ladxhd_updated");
entry.GetProperty("repositorySource").GetString().Should().Be("gitlab");
settings.UserAppTags.Should().ContainKey("bighead.0/ladxhd_updated");
settings.UserAppTags.Should().NotContainKey("OldOwner/LADXHD");
}
finally
{
try { Directory.Delete(dir, recursive: true); } catch { /* ignore */ }
}
}
[Fact]
public void Duplicate_instance_on_edit_is_detectable_when_folder_matches()
{
var existing = new GameInfo
{
Name = "Existing",
Repository = "bighead.0/ladxhd_updated",
RepositorySource = "gitlab",
FolderName = "LADXHD",
};
var editing = new GameInfo
{
Name = "LA DX HD",
Repository = "OldOwner/LADXHD",
FolderName = "Other",
};
var targetKey = RepositorySourceHelper.GetInstanceKey("gitlab", "bighead.0/ladxhd_updated", "LADXHD");
var games = new List<GameInfo> { existing, editing };
var duplicate = games.Any(g =>
!ReferenceEquals(g, editing) &&
string.Equals(g.InstanceKey, targetKey, StringComparison.OrdinalIgnoreCase));
duplicate.Should().BeTrue();
}
[Fact]
public void Same_repository_with_a_different_folder_is_not_a_duplicate_instance()
{
var existing = new GameInfo
{
Name = "EXIT",
Repository = "FluffyQuack/ReXGlue-EXIT",
FolderName = "EXIT-ReXGlue",
};
var editing = new GameInfo
{
Name = "EXIT 2",
Repository = "FluffyQuack/ReXGlue-EXIT",
FolderName = "EXIT2-ReXGlue",
};
existing.IdentityKey.Should().Be(editing.IdentityKey);
existing.InstanceKey.Should().NotBe(editing.InstanceKey);
}
}
-53
View File
@@ -1,53 +0,0 @@
using FluentAssertions;
using QuiverLauncher.Models;
using QuiverLauncher.Services;
namespace QuiverLauncher.Tests;
public class AppSearchTests
{
[Fact]
public void Matches_empty_query_matches_all()
{
var app = new GameInfo { Name = "Ocarina of Time", FolderName = "OoT" };
AppSearch.Matches(app, null).Should().BeTrue();
AppSearch.Matches(app, "").Should().BeTrue();
AppSearch.Matches(app, " ").Should().BeTrue();
AppSearch.Matches(null, "ocarina").Should().BeFalse();
AppSearch.Matches(null, "").Should().BeTrue();
}
[Fact]
public void Matches_name_repository_tags_and_display_name()
{
var app = new GameInfo
{
Name = "Ocarina of Time",
Project = "Zelda64Recomp",
CustomDisplayName = "OoT Recomp",
FolderName = "OcarinaOfTime-Zelda64Recomp",
Repository = "Zelda64Recomp/Zelda64Recomp",
Tags = ["n64", "recomp", "zelda"],
};
AppSearch.Matches(app, "ocarina").Should().BeTrue();
AppSearch.Matches(app, "oot").Should().BeTrue();
AppSearch.Matches(app, "zelda64recomp/zelda64recomp").Should().BeTrue();
AppSearch.Matches(app, "recomp").Should().BeTrue();
AppSearch.Matches(app, "mario").Should().BeFalse();
}
[Fact]
public void Matches_requires_every_token()
{
var app = new GameInfo
{
Name = "Ocarina of Time",
Tags = ["recomp", "n64"],
};
AppSearch.Matches(app, "zelda recomp").Should().BeFalse();
AppSearch.Matches(app, "ocarina recomp").Should().BeTrue();
}
}
Loaded 100 of 868 files, more files were not shown because too many files have changed in this diff. Show more