This document explains the automatic setup scripts for Type Copy.
Type Copy includes three setup scripts that automate the entire installation process:
| Script | Platform | Language | Best For |
|---|---|---|---|
setup.bat |
Windows | Batch | All Windows users, double-click to run |
setup.ps1 |
Windows | PowerShell | Advanced Windows users, better error handling |
setup.sh |
macOS/Linux | Bash | Unix-based systems |
All scripts perform these steps:
-
Check Python Installation
- Detects if Python 3.7+ is installed
- Checks if Python is accessible in PATH
-
Install Python (if needed)
- Downloads Python 3.12.1 from python.org (Windows)
- Uses package manager (brew, apt, dnf, etc.) on Linux/macOS
- Installs silently with recommended options
-
Configure PATH
- Adds Python to user PATH automatically
- Adds Scripts folder to PATH (for pip)
- Refreshes environment without restart
-
Install Dependencies
- Installs pyperclip via pip
- Upgrades pip to latest version
- Verifies successful installation
-
Additional Setup (Linux)
- Installs xclip or xsel for clipboard support
- Detects package manager automatically
-
Verification
- Tests Python execution
- Tests pyperclip import
- Shows success message
-
Launch Type Copy
- Optionally runs the main script
- Passes command-line arguments through
Easiest method (GUI):
1. Download the repository
2. Double-click setup.bat
3. Wait for installation
4. Press Enter to run Type Copy
Command line:
cd C:\path\to\type_copy
setup.bat
# With arguments for Type Copy
setup.bat --exclude test --exclude docsFeatures:
- ✅ Works on all Windows versions (7, 8, 10, 11)
- ✅ No admin rights required (installs for current user)
- ✅ Color-coded output
- ✅ Automatic Python download (25 MB)
- ✅ PATH modification
- ✅ Error messages in plain English
What it does:
- Checks for Python in PATH
- If not found, downloads Python 3.12.1 from python.org
- Installs Python silently with these options:
InstallAllUsers=0(current user only)PrependPath=1(add to PATH)Include_pip=1(include pip)
- Refreshes environment variables
- Installs pyperclip
- Runs Type Copy
Command line:
# Basic usage
.\setup.ps1
# Skip Python installation
.\setup.ps1 -SkipPythonInstall
# Quiet mode (no prompts)
.\setup.ps1 -QuietRight-click method:
1. Right-click setup.ps1
2. Select "Run with PowerShell"
3. If blocked, run: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Features:
- ✅ Better error handling than .bat
- ✅ Colored output with Write-Host
- ✅ Parameter support
- ✅ Admin detection
- ✅ Detailed progress messages
- ✅ Professional output formatting
Parameters:
-SkipPythonInstall- Don't install Python, just check-Quiet- Don't prompt to run Type Copy
What it does: Same as setup.bat but with:
- Better error messages
- PowerShell-native file downloads
- More robust PATH detection
- Environment variable refresh
- Progress indicators
Command line:
# Make executable (first time only)
chmod +x setup.sh
# Run setup
./setup.sh
# With arguments for Type Copy
./setup.sh --exclude testFeatures:
- ✅ Auto-detects OS (macOS, Ubuntu, Fedora, Arch, etc.)
- ✅ Uses system package manager
- ✅ Installs clipboard tools (Linux)
- ✅ Color-coded output
- ✅ sudo prompts only when needed
- ✅ Creates alias suggestion
What it does:
macOS:
- Checks for Python 3
- If not found, installs via Homebrew
- Installs pyperclip via pip
- Uses built-in pbcopy for clipboard
Linux:
- Detects package manager (apt/dnf/yum/pacman)
- Installs Python 3 and pip
- Installs clipboard utility (xclip/xsel)
- Installs pyperclip
- Verifies all components
- Windows 7 or later (tested on 10/11)
- Internet connection (to download Python)
- ~100 MB disk space (for Python)
- Optional: Administrator rights (for system-wide PATH)
- macOS 10.13+ (High Sierra or later)
- Homebrew (will prompt to install if missing)
- Internet connection
- Xcode Command Line Tools (installed by Homebrew)
- Debian/Ubuntu: apt package manager
- Fedora: dnf package manager
- RHEL/CentOS: yum package manager
- Arch: pacman package manager
- Internet connection
- sudo access (for package installation)
"Python download failed"
- Check internet connection
- Firewall/antivirus may be blocking download
- Download manually from: https://www.python.org/downloads/
- Make sure to check "Add Python to PATH"
"Access denied" or "Permission error"
- Run setup.bat as Administrator
- Or install Python manually for current user
"Python installed but not accessible"
- Restart Command Prompt
- Or restart computer
- Or run:
refreshenv(if you have Chocolatey)
"pyperclip installation failed"
python -m pip install --user pyperclipPowerShell execution policy error:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser"Homebrew not found" Install Homebrew first:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)""Command Line Tools not installed"
xcode-select --install"Permission denied"
chmod +x setup.sh
./setup.sh"Package manager not found"
- Script supports apt, dnf, yum, pacman
- For other distros, install Python manually:
# Find your distro's Python package # Usually: python3, python3-pip
"xclip installation failed"
# Ubuntu/Debian
sudo apt install xclip
# Fedora
sudo dnf install xclip
# Arch
sudo pacman -S xclip"pip not found"
python3 -m ensurepip
# or
sudo apt install python3-pipEdit setup.bat and change:
set PYTHON_VERSION=3.12.1
set PYTHON_URL=https://www.python.org/ftp/python/%PYTHON_VERSION%/python-%PYTHON_VERSION%-amd64.exeWindows:
echo. | setup.batPowerShell:
.\setup.ps1 -QuietLinux/macOS:
yes | ./setup.shModify setup.bat before the install line:
"%INSTALLER_PATH%" /quiet InstallAllUsers=0 PrependPath=1 TargetDir=C:\MyPythonAll platforms:
python --version
python -c "import pyperclip; print('OK')"✅ Safe operations:
- Download from official python.org (Windows)
- Use official package managers (Linux/macOS)
- Install to user directory (no admin needed)
- Modify user PATH only (not system PATH)
- Install from official PyPI (pyperclip)
- Downloads executables from internet (Windows)
- Modifies PATH environment variable
- Installs software packages
- May use sudo (Linux)
Before running, you can review the scripts:
setup.bat- Plain text batch filesetup.ps1- Plain text PowerShellsetup.sh- Plain text shell script
All scripts are open source and can be audited.
If you prefer not to run automated scripts:
- Install Python manually from python.org
- Check "Add Python to PATH"
- Run:
pip install pyperclip
To remove everything installed by setup scripts:
Windows:
- Go to: Settings → Apps → Apps & features
- Find "Python 3.12" → Uninstall
- Remove from PATH (optional):
- Search "Environment Variables"
- Edit user PATH
- Remove Python entries
macOS:
brew uninstall python3
pip3 uninstall pyperclipLinux:
# Ubuntu/Debian
sudo apt remove python3 python3-pip xclip
# Fedora
sudo dnf remove python3 python3-pip xclipIf the setup scripts don't work:
- Check requirements (internet, disk space)
- Try manual installation (see README.md)
- Check documentation (WINDOWS_SETUP.md)
- Open an issue with error messages
To improve the setup scripts:
- Test on your platform
- Report issues with OS/version details
- Submit pull requests with fixes
- Add support for new package managers
- v2.1.0 (2025-12-22) - Added automatic setup scripts
- setup.bat for Windows
- setup.ps1 for PowerShell
- setup.sh for Linux/macOS