From 5fae261cbff5f869fca32a27e8e9e5c36b975d8e Mon Sep 17 00:00:00 2001 From: VideoTools CI Date: Fri, 23 Jan 2026 05:43:11 -0500 Subject: [PATCH] fix(install): auto-install go on windows --- DONE.md | 2 + TODO.md | 2 + docs/INSTALLATION.md | 2 +- scripts/install.sh | 99 ++++++++++++++++++++------------------------ 4 files changed, 50 insertions(+), 55 deletions(-) diff --git a/DONE.md b/DONE.md index 3a980e2..eff409f 100644 --- a/DONE.md +++ b/DONE.md @@ -22,6 +22,8 @@ - Ensured pip is installed (Linux/Windows) and skipped Go/pip installs when already present. - ✅ **Windows installer parse fix** - Normalized PowerShell here-strings to prevent parse errors during installation. +- ✅ **Go auto-install on Windows** + - Removed the Go prompt in `install.sh`; missing Go is now installed automatically. ## Version 0.1.0-dev25 (2026-01-22) - Settings Preferences Expansion diff --git a/TODO.md b/TODO.md index 0351842..8c479b9 100644 --- a/TODO.md +++ b/TODO.md @@ -8,6 +8,8 @@ This file tracks upcoming features, improvements, and known issues. - Ensure pip is installed on Linux/Windows and skip Go/pip when already present. - [X] **Windows installer parse fix** - Normalize PowerShell here-strings to prevent parser errors. +- [X] **Go auto-install in install.sh** + - Skip prompting for Go and install automatically when missing. ## Documentation: Fix Structural Errors diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index 95f96a5..0b82875 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -24,7 +24,7 @@ For Linux (Ubuntu, Fedora, Arch, etc.), macOS, and Windows Subsystem for Linux ( Before you begin, ensure your system meets these basic requirements: -- **Go:** Version 1.21 or later is required to build the application. +- **Go:** Version 1.21 or later is required to build the application; the installer will auto-install it when missing. - **FFmpeg:** Required for all video and audio processing. Our platform-specific guides cover how to install this. - **Python + pip:** Required for AI tooling and optional modules; the installers will set this up automatically where possible. - **Disk Space:** At least 2 GB of free disk space for the application and its dependencies. diff --git a/scripts/install.sh b/scripts/install.sh index 7aff0d0..b49655f 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -107,66 +107,57 @@ echo "" echo -e "${CYAN}[1/2]${NC} Checking Go installation..." if ! command -v go &> /dev/null; then echo -e "${YELLOW}WARNING:${NC} Go is not installed or not in PATH" - echo "" - read -p "Install Go (required dependency)? [y/N]: " go_choice - if [[ "$go_choice" =~ ^[Yy]$ ]]; then - echo "Installing Go..." - install_go=false - - # Detect OS and install Go - if [ "$IS_WINDOWS" = true ]; then - echo "Please download and install Go from https://go.dev/dl/ manually" - echo "After installation, run this script again." + echo "Installing Go..." + install_go=false + + if [ "$IS_WINDOWS" = true ]; then + echo "Go will be installed by the Windows dependency installer." + elif [ "$IS_DARWIN" = true ]; then + if command -v brew &> /dev/null; then + brew install go + install_go=true + else + echo "Homebrew not found. Please install Go from https://go.dev/dl/" exit 1 - elif [ "$IS_DARWIN" = true ]; then - if command -v brew &> /dev/null; then - brew install go - install_go=true - else - echo "Homebrew not found. Please install Go from https://go.dev/dl/" - exit 1 - fi - elif [ "$IS_LINUX" = true ]; then - if command -v apt-get &> /dev/null; then - sudo apt-get update - sudo apt-get install -y golang-go - install_go=true - elif command -v dnf &> /dev/null; then - sudo dnf install -y golang - install_go=true - elif command -v pacman &> /dev/null; then - sudo pacman -Sy --needed --noconfirm go - install_go=true - elif command -v zypper &> /dev/null; then - sudo zypper install -y go - install_go=true - elif command -v brew &> /dev/null; then - brew install go - install_go=true - else - echo "No supported package manager found for Go installation." - echo "Please install Go manually from https://go.dev/dl/" - exit 1 - fi fi - - if [ "$install_go" = true ]; then - # Verify Go was installed successfully - if command -v go &> /dev/null; then - echo -e "${GREEN}[OK]${NC} Go installed successfully" - else - echo -e "${RED}[ERROR]${NC} Go installation failed. Please install manually from https://go.dev/dl/" - exit 1 - fi + elif [ "$IS_LINUX" = true ]; then + if command -v apt-get &> /dev/null; then + sudo apt-get update + sudo apt-get install -y golang-go + install_go=true + elif command -v dnf &> /dev/null; then + sudo dnf install -y golang + install_go=true + elif command -v pacman &> /dev/null; then + sudo pacman -Sy --needed --noconfirm go + install_go=true + elif command -v zypper &> /dev/null; then + sudo zypper install -y go + install_go=true + elif command -v brew &> /dev/null; then + brew install go + install_go=true + else + echo "No supported package manager found for Go installation." + echo "Please install Go manually from https://go.dev/dl/" + exit 1 + fi + fi + + if [ "$install_go" = true ]; then + if command -v go &> /dev/null; then + echo -e "${GREEN}[OK]${NC} Go installed successfully" + else + echo -e "${RED}[ERROR]${NC} Go installation failed. Please install manually from https://go.dev/dl/" + exit 1 fi - else - echo -e "${RED}[ERROR]${NC} Go is required. Please install Go 1.21+ from https://go.dev/dl/" - exit 1 fi fi -GO_VERSION=$(go version | awk '{print $3}' | sed 's/go//') -echo -e "${GREEN}[OK]${NC} Found Go version: $GO_VERSION" +if command -v go &> /dev/null; then + GO_VERSION=$(go version | awk '{print $3}' | sed 's/go//') + echo -e "${GREEN}[OK]${NC} Found Go version: $GO_VERSION" +fi # Step 2: Check authoring dependencies echo ""