@echo off
chcp 65001 >nul 2>&1
title RefDrop Helper Installer
color 0F

echo.
echo  ============================================
echo   RefDrop Helper — Installer
echo  ============================================
echo.
echo   What is this?
echo   RefDrop Helper is a small bridge app that
echo   lets the RefDrop Chrome extension send
echo   images directly to PureRef on your desktop.
echo.
echo   What will this installer do?
echo     1. Copy the helper app to AppData
echo     2. Register it with Chrome (registry)
echo     3. That's it — no background processes,
echo        no startup programs, no data collection.
echo.
echo   Safe to run — open source, no admin needed.
echo.
echo  ============================================
echo.

set /p confirm="  Press [Y] to install, or any other key to cancel: "
if /i not "%confirm%"=="Y" (
    echo.
    echo   Installation cancelled.
    echo.
    pause
    exit /b 0
)

echo.
echo   Installing...
echo.

:: Run the PowerShell installer from the same directory as this bat file
powershell -ExecutionPolicy Bypass -File "%~dp0install.ps1"

if %ERRORLEVEL% NEQ 0 (
    echo.
    echo  ============================================
    echo   Something went wrong.
    echo   Please try again or visit:
    echo   https://refdrop.mmwo.io/#getting-started
    echo  ============================================
    echo.
    pause
    exit /b 1
)

echo.
echo  ============================================
echo.
echo   Installation complete!
echo.
echo   Next steps:
echo     1. Restart Chrome (close all windows)
echo     2. Open PureRef
echo     3. Hover any image in Chrome and press
echo        Alt+Click to send it to PureRef
echo.
echo   Enjoy RefDrop!
echo.
echo  ============================================
echo.
pause
