================================================================================
RemotePulse Worker (Windows x64) - Installation & Setup Guide
================================================================================

RemotePulse Worker is a lightweight, zero-trust remote administration service for
Windows. It securely executes signed, end-to-end encrypted PowerShell commands
dispatched from your RemotePulse Mobile PWA via the central Hub.

SYSTEM REQUIREMENTS:
--------------------------------------------------------------------------------
- Windows 10 (Build 2004+), Windows 11, or Windows Server 2022+ (x64)
- .NET 10 Runtime (or Self-Contained build)
- PowerShell 7 (pwsh.exe) - install via: winget install --id Microsoft.PowerShell
- Administrator privileges for installation

Note: The installer and uninstaller run under PowerShell 7. If you launch them
from Windows PowerShell 5.1 or without administrator rights, they automatically
relaunch themselves elevated under pwsh.exe. When a script finishes it prints a
status overview; on success the window closes when you press Enter or after 8
seconds, and on error the messages stay on screen until you press Enter.


QUICK START INSTALLATION:
--------------------------------------------------------------------------------
1. Extract the entire contents of this zip archive.

2. Right-click 'Installer.ps1' and select 'Run with PowerShell'
   (or, from an Administrator PowerShell 7 prompt, run: pwsh -File .\Installer.ps1).
   It will relaunch itself elevated under PowerShell 7 if needed.

3. Setup prompts:
   a. Hub Server URL:
      Enter your Hub endpoint (e.g. https://rmpls.inspired.codes/)
      or press Enter to use default.
   b. Enrollment Token:
      Enter a single-use token minted from the Hub Server.
      (To mint a token: POST https://<hub-url>/api/admin/tokens/create).

4. Service Startup & Pairing:
   - The installer installs and starts the 'RemotePulseWorker' Windows Service.
   - It will automatically launch your default browser at:
     http://localhost:7923/

5. Mobile PWA Pairing:
   - Open your Mobile PWA (https://rmpls.inspired.codes/).
   - Open the 'Scan / Pairing' screen.
   - Scan the QR code displayed on http://localhost:7923/.

6. Ready! Your Worker is now registered, securely paired, and online.


UNINSTALLATION:
--------------------------------------------------------------------------------
To completely remove the service and application binaries:
Right-click 'Uninstaller.ps1' and select 'Run with PowerShell'.
You will be prompted whether to keep or wipe cryptographic pairing keys.


LOGS & TROUBLESHOOTING:
--------------------------------------------------------------------------------
Worker logs are stored in:
C:\ProgramData\RemotePulse\worker.log

To view live log output in PowerShell:
Get-Content -Path "C:\ProgramData\RemotePulse\worker.log" -Tail 30 -Wait
