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

echo.
echo  ============================================
echo   RefDrop Helper — Uninstaller
echo  ============================================
echo.
echo   This will:
echo     1. Remove the Chrome registry entry
echo     2. Delete the helper app from AppData
echo.
echo   Your PureRef files and Chrome extension
echo   will NOT be affected.
echo.
echo  ============================================
echo.

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

echo.
echo   Uninstalling...
echo.

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

if %ERRORLEVEL% NEQ 0 (
    echo.
    echo  ============================================
    echo   Something went wrong.
    echo   You can manually delete:
    echo     %%LOCALAPPDATA%%\RefDrop
    echo  ============================================
    echo.
    pause
    exit /b 1
)

echo.
echo  ============================================
echo.
echo   Uninstall complete!
echo.
echo   RefDrop Helper has been removed.
echo   You can safely delete this folder too.
echo.
echo  ============================================
echo.
pause
