$ErrorActionPreference = "Stop" $installDir = Join-Path $env:LOCALAPPDATA "Programs\Tiimeer" $pythonAppUrl = "https://tiimeer.com/api/downloads/tiimeer.py" $commandsUrl = "https://tiimeer.com/api/downloads/COMMANDS.txt" New-Item -ItemType Directory -Force -Path $installDir | Out-Null Invoke-WebRequest -Uri $pythonAppUrl -OutFile (Join-Path $installDir "tiimeer.py") Invoke-WebRequest -Uri $commandsUrl -OutFile (Join-Path $installDir "COMMANDS.txt") $launcher = @' @echo off setlocal where py >nul 2>nul if not errorlevel 1 ( py "%~dp0tiimeer.py" %* exit /b %errorlevel% ) where python >nul 2>nul if not errorlevel 1 ( python "%~dp0tiimeer.py" %* exit /b %errorlevel% ) echo Python 3 is required to run Tiimeer. echo Install Python and then try again. exit /b 1 '@ Set-Content -Path (Join-Path $installDir "tiimeer.cmd") -Value $launcher -Encoding ASCII $userPath = [Environment]::GetEnvironmentVariable("Path", "User") $pathEntries = @() if ($userPath) { $pathEntries = $userPath -split ";" | Where-Object { $_.Trim() -ne "" } } $alreadyAdded = $false foreach ($entry in $pathEntries) { if ($entry.TrimEnd("\") -ieq $installDir.TrimEnd("\")) { $alreadyAdded = $true } } if (-not $alreadyAdded) { if ([string]::IsNullOrWhiteSpace($userPath)) { [Environment]::SetEnvironmentVariable("Path", $installDir, "User") } else { [Environment]::SetEnvironmentVariable("Path", "$userPath;$installDir", "User") } } Write-Host "" Write-Host "Tiimeer installed successfully." -ForegroundColor Cyan Write-Host "Open a new Command Prompt window and run:" -ForegroundColor Gray Write-Host " tiimeer" -ForegroundColor White Write-Host "" Write-Host "Files installed to: $installDir" -ForegroundColor Gray