mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
feat: add install.sh and install.ps1 download scripts with docs update
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/bfeecfa8-81d9-45da-b1a7-b2dd6804b34f Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
This commit is contained in:
parent
301ea6b9db
commit
d08cf803b8
4 changed files with 186 additions and 0 deletions
48
docs/.vuepress/public/install.ps1
Normal file
48
docs/.vuepress/public/install.ps1
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# Minecraft Console Client - Installer for Windows
|
||||
# Downloads the latest MinecraftClient binary for your Windows architecture.
|
||||
# Usage (PowerShell): iwr -useb https://mccteam.github.io/install.ps1 | iex
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$REPO = "MCCTeam/Minecraft-Console-Client"
|
||||
$OUTPUT = "MinecraftClient.exe"
|
||||
|
||||
# --- Detect CPU architecture ---
|
||||
$arch = [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture
|
||||
$archId = switch ($arch) {
|
||||
'X64' { 'x64' }
|
||||
'X86' { 'x86' }
|
||||
'Arm64' { 'arm64' }
|
||||
default {
|
||||
Write-Error "Unsupported CPU architecture: $arch"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
$suffix = "win-$archId"
|
||||
|
||||
# --- Fetch latest release metadata from GitHub API ---
|
||||
$apiUrl = "https://api.github.com/repos/$REPO/releases/latest"
|
||||
Write-Host "Fetching latest release information..."
|
||||
$release = Invoke-RestMethod -Uri $apiUrl -UseBasicParsing
|
||||
|
||||
# --- Locate the correct asset ---
|
||||
$asset = $release.assets | Where-Object { $_.name -like "*-$suffix.exe" } | Select-Object -First 1
|
||||
|
||||
if (-not $asset) {
|
||||
Write-Error "Could not find a release asset for '$suffix'."
|
||||
exit 1
|
||||
}
|
||||
|
||||
$downloadUrl = $asset.browser_download_url
|
||||
$tag = $release.tag_name
|
||||
|
||||
Write-Host "Downloading MinecraftClient $tag ($suffix)..."
|
||||
|
||||
# Suppress the progress bar to avoid cluttering the terminal and speed up the download
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
Invoke-WebRequest -Uri $downloadUrl -OutFile $OUTPUT -UseBasicParsing
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Downloaded: .\$OUTPUT"
|
||||
Write-Host "Run with: .\$OUTPUT --help"
|
||||
100
docs/.vuepress/public/install.sh
Normal file
100
docs/.vuepress/public/install.sh
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
#!/bin/sh
|
||||
# Minecraft Console Client - Installer
|
||||
# Downloads the latest MinecraftClient binary for your Linux or macOS platform.
|
||||
# Usage: curl -fsSL https://mccteam.github.io/install.sh | sh
|
||||
# or: wget -qO- https://mccteam.github.io/install.sh | sh
|
||||
|
||||
set -e
|
||||
|
||||
REPO="MCCTeam/Minecraft-Console-Client"
|
||||
OUTPUT="MinecraftClient"
|
||||
|
||||
# --- Detect OS ---
|
||||
OS=$(uname -s)
|
||||
case "$OS" in
|
||||
Linux) PLATFORM="linux" ;;
|
||||
Darwin) PLATFORM="osx" ;;
|
||||
*)
|
||||
echo "Error: Unsupported OS '$OS'. This script supports Linux and macOS." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# --- Detect CPU architecture ---
|
||||
ARCH=$(uname -m)
|
||||
case "$ARCH" in
|
||||
x86_64|amd64) ARCH_ID="x64" ;;
|
||||
aarch64|arm64) ARCH_ID="arm64" ;;
|
||||
armv7l|armv8l|armhf) ARCH_ID="arm" ;;
|
||||
arm*) ARCH_ID="arm" ;;
|
||||
*)
|
||||
echo "Error: Unsupported CPU architecture '$ARCH'." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# macOS does not have an arm (32-bit) build
|
||||
if [ "$PLATFORM" = "osx" ] && [ "$ARCH_ID" = "arm" ]; then
|
||||
echo "Error: 32-bit ARM is not supported on macOS." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SUFFIX="${PLATFORM}-${ARCH_ID}"
|
||||
|
||||
# --- Download helpers: prefer curl, fall back to wget ---
|
||||
_download_stdout() {
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
curl -fsSL "$1"
|
||||
elif command -v wget >/dev/null 2>&1; then
|
||||
wget -qO- "$1"
|
||||
else
|
||||
echo "Error: Neither 'curl' nor 'wget' is available. Please install one and retry." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
_download_file() {
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
curl -fL --progress-bar -o "$2" "$1"
|
||||
elif command -v wget >/dev/null 2>&1; then
|
||||
wget -O "$2" "$1"
|
||||
else
|
||||
echo "Error: Neither 'curl' nor 'wget' is available. Please install one and retry." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# --- Fetch latest release metadata from GitHub API ---
|
||||
API_URL="https://api.github.com/repos/${REPO}/releases/latest"
|
||||
echo "Fetching latest release information..."
|
||||
RELEASE_JSON=$(_download_stdout "$API_URL")
|
||||
|
||||
# --- Parse asset download URL (no external tools required) ---
|
||||
# The JSON key "browser_download_url" appears once per asset.
|
||||
# We match the key followed by the URL, anchoring on the platform-arch suffix
|
||||
# and the closing quote so that e.g. "linux-arm" does not match "linux-arm64".
|
||||
# The ' *: *' pattern handles optional spaces around the colon (GitHub API adds spaces).
|
||||
ASSET_URL=$(printf '%s' "$RELEASE_JSON" \
|
||||
| grep -o '"browser_download_url" *: *"[^"]*-'"${SUFFIX}"'"' \
|
||||
| grep -o 'https://[^"]*' \
|
||||
| head -1)
|
||||
|
||||
if [ -z "$ASSET_URL" ]; then
|
||||
echo "Error: Could not find a release asset for platform '${SUFFIX}'." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# --- Extract tag name for display ---
|
||||
TAG=$(printf '%s' "$RELEASE_JSON" \
|
||||
| grep -o '"tag_name" *: *"[^"]*"' \
|
||||
| head -1 \
|
||||
| grep -o '"[^"]*"$' \
|
||||
| tr -d '"')
|
||||
|
||||
echo "Downloading MinecraftClient ${TAG} (${SUFFIX})..."
|
||||
_download_file "$ASSET_URL" "$OUTPUT"
|
||||
chmod +x "$OUTPUT"
|
||||
|
||||
echo ""
|
||||
echo "Downloaded: ./${OUTPUT}"
|
||||
echo "Run with: ./${OUTPUT} --help"
|
||||
|
|
@ -4,6 +4,7 @@ title: Installation
|
|||
|
||||
# Installation
|
||||
|
||||
- [Quick Install (one-liner)](#quick-install)
|
||||
- [YouTube Tutorials](#youtube-tutorials)
|
||||
- [Download a compiled binary](#download-a-compiled-binary)
|
||||
- [Building from the source code](#building-from-the-source-code)
|
||||
|
|
@ -11,6 +12,42 @@ title: Installation
|
|||
- [Run on Android](#run-on-android)
|
||||
- [Run MCC 24/7 on a VPS](#run-on-a-vps)
|
||||
|
||||
## Quick Install
|
||||
|
||||
The quickest way to get MCC is to run the installer script for your platform. It auto-detects your OS and CPU architecture, fetches the latest release from GitHub, and saves the binary to your current directory.
|
||||
|
||||
### Linux / macOS
|
||||
|
||||
Open a terminal in the folder where you want MCC and run:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://mccteam.github.io/install.sh | sh
|
||||
```
|
||||
|
||||
If you prefer `wget`:
|
||||
|
||||
```bash
|
||||
wget -qO- https://mccteam.github.io/install.sh | sh
|
||||
```
|
||||
|
||||
The script downloads `MinecraftClient` and marks it executable. Supported architectures: `x64`, `arm64`, `arm` (Linux only).
|
||||
|
||||
### Windows
|
||||
|
||||
Open **PowerShell** in the folder where you want MCC and run:
|
||||
|
||||
```powershell
|
||||
iwr -useb https://mccteam.github.io/install.ps1 | iex
|
||||
```
|
||||
|
||||
The script downloads `MinecraftClient.exe`. Supported architectures: `x64`, `x86`, `arm64`.
|
||||
|
||||
::: tip
|
||||
You can also download the scripts directly and inspect them before running:
|
||||
- Linux/macOS: [install.sh](https://mccteam.github.io/install.sh)
|
||||
- Windows: [install.ps1](https://mccteam.github.io/install.ps1)
|
||||
:::
|
||||
|
||||
## YouTube Tutorials
|
||||
|
||||
If you're not the kind of person that likes textual tutorials, our community has made video tutorials available on YouTube.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue