# Master Tool installer for Windows. In PowerShell: # # irm https://cybertoken.io/master-tool/install.ps1 | iex # # Downloads the newest Master Tool from GitLab (software1015210/master-tool, branch main) # as a zip - no git needed - and runs its install.ps1: the tool in # %LOCALAPPDATA%\master-tool, Start Menu entries, a master-tool command, and Python 3 # through winget if it's missing. No admin rights needed. # # Environment: MASTER_TOOL_REPO_URL where to download from (default: the GitLab repo) # Everything is inside this script block, which runs at the very end: a download cut off # half-way runs nothing. & { $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' # Windows PowerShell downloads far faster without the progress bar [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 $repo = if ($env:MASTER_TOOL_REPO_URL) { $env:MASTER_TOOL_REPO_URL.TrimEnd('/') } else { 'https://gitlab.com/software1015210/master-tool' } $url = "$repo/-/archive/main/master-tool-main.zip" $work = Join-Path $env:TEMP ("master-tool-install-" + [guid]::NewGuid().ToString('N').Substring(0, 8)) New-Item -ItemType Directory -Force $work | Out-Null try { Write-Host "== Master Tool installer" Write-Host "Downloading $url ..." $zip = Join-Path $work 'master-tool-main.zip' Invoke-WebRequest -Uri $url -OutFile $zip -UseBasicParsing Expand-Archive -Path $zip -DestinationPath $work -Force $installer = Join-Path $work 'master-tool-main\install.ps1' if (-not (Test-Path $installer)) { throw "The Master Tool on GitLab ($repo, branch main) has no Windows installer (install.ps1) yet. Try again later." } & powershell -NoProfile -ExecutionPolicy Bypass -File $installer if ($LASTEXITCODE -ne 0) { throw "install.ps1 failed (exit code $LASTEXITCODE)." } } finally { Set-Location $env:TEMP Remove-Item $work -Recurse -Force -ErrorAction SilentlyContinue } }