@echo off
title Install Forteana hands
rem The Forteana desk, hands: lets the desk help on this PC. Runs as a Python script (no exe for antivirus to remove).
set "D=%USERPROFILE%\Desktop\Forteana hands"
echo Installing Forteana hands into "%D%" ...
where py >nul 2>nul || (echo Python is not on this PC; installing it first, this takes a minute... & winget install -e --id Python.Python.3.12 --silent --accept-package-agreements --accept-source-agreements)
where py >nul 2>nul || if not exist "%WINDIR%\py.exe" (echo Python could not be installed. Install it from python.org, then run this again. & pause & exit /b 1)
if not exist "%D%" mkdir "%D%"
rem a pair code from Home rides in this file's name (install-hands-123456.cmd); hands reads it from its own name
set "N=hands.py"
set "F=%~n0"
set "C=%F:install-hands-=%"
if not "%C%"=="%F%" set "N=hands-%C%.py"
curl -s -L -o "%D%\%N%" https://forteana.ai-ministries.com/api/hands-generic.py
if not exist "%D%\%N%" (echo Could not download hands. Check the internet and run this again. & pause & exit /b 1)
if not exist "%D%\hands.json" if exist "%USERPROFILE%\Desktop\Hands.exe\hands.json" copy /y "%USERPROFILE%\Desktop\Hands.exe\hands.json" "%D%\hands.json" >nul
> "%D%\Start hands.cmd" echo @echo off
>> "%D%\Start hands.cmd" echo title Forteana hands
>> "%D%\Start hands.cmd" echo cd /d "%D%"
>> "%D%\Start hands.cmd" echo py "%N%"
>> "%D%\Start hands.cmd" echo pause
set "S=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\Forteana hands.cmd"
> "%S%" echo @echo off
>> "%S%" echo rem The Forteana desk, hands. Delete this file to stop it starting with Windows.
>> "%S%" echo start "Forteana hands" /min "%D%\Start hands.cmd"
start "Forteana hands" "%D%\Start hands.cmd"
echo Done. hands is starting in its own window; leave that window open.
timeout /t 6 >nul