SPRAG for Windows 11
====================

Sprag turns your iPhone into a mouse, keyboard and remote for this PC over your home Wi-Fi.

1. START
   - Extract the "Sprag" folder from the zip (right click > Extract all).
   - Put the Sprag folder in a fixed place (for example Documents\Sprag) BEFORE the first launch, and when you update,
     extract the new zip over the same folder, so "Start with Windows" keeps pointing at the right file.
   - Double-click Sprag.exe. Nothing to install. (Sprag also repairs the Start with Windows entry if the folder was moved.)
   - If Windows shows "Windows protected your PC": More info > Run anyway (the program is not signed yet).

1b. UPDATES
   - Sprag updates itself. Two minutes after it starts and then every 6 hours it looks for a new version on
     www.antonio.ai/sprag, downloads it, checks that it is really ours (digital signature, size and fingerprint) and installs
     it when no phone is connected and no game is running. Sprag closes for a few seconds and opens again by itself; your
     settings and paired phones stay. Then a note says "Sprag is updated to 0.1.x" with what changed.
   - Tray menu: "Check for updates" (right away) and "Update automatically" (on by default; also in Settings > Connection).
     When it is off, Sprag only tells you that a new version is there and installs it if you press "Update".
   - If a phone is connected Sprag waits, or press "Restart to update" in the note. During a game it always waits.
   - If the Sprag folder cannot be written (for example under C:\Program Files) or an update fails, Sprag says so and
     "Download" opens the site: extract the new zip over the same folder by hand.

2. FIREWALL
   - Allow Sprag on Private networks when Windows asks. iPhone and PC must be on the same Wi-Fi.

3. PAIR THE IPHONE
   - Open Sprag on the iPhone and scan the QR in the Sprag window: that is all, nothing to click on the PC.
     The QR changes every 30 seconds and is hidden from screen sharing and screenshots.
   - No camera? Type the 16-character code instead; then confirm the matching number and press Enter on the PC.

3c. ANSWERING WINDOWS PERMISSION PROMPTS (UAC) FROM THE PHONE
   - Sprag offers this by itself in ONE window, when it matters (after you pair an iPhone, or the first time Windows asks for
     permission while your phone is connected). You can also open it from the tray menu:
     "Let my iPhone answer administrator prompts".
   - The window says what gets installed (TightVNC, a small open-source program that can only be reached from this PC) and which
     paired phones may answer (the fingerprint is beside the name; all are ticked, keep only your own).
     Press "Install" with this PC's own mouse or keyboard. You do not copy any file: everything is inside Sprag.
   - To remove it: the same menu item, untick it and Sprag removes it completely.
   - TightVNC is free software under the GPL (version 2): its licence and source note are in the "vendor" folder next to Sprag.exe
     (TightVNC-LICENSE.txt, TightVNC-SOURCE.txt). Sprag takes its files out of the unmodified package and sets them up itself; nothing is registered in Windows Settings > Apps.
   - If an earlier test version of Sprag installed another helper (UltraVNC), it is removed automatically and you are told once:
     then switch the menu item on again to use the new one. A TightVNC or UltraVNC that you installed yourself is never touched:
     then Sprag installs nothing and tells you to remove yours in Windows Settings > Apps.
