@echo off
REM Remove broken Windows install so you can install a fresh Stable or Beta build.
setlocal EnableExtensions
echo.
echo === vCut Windows cleanup / upgrade prep ===
echo This closes vCut and removes a broken install so you can install fresh.
echo.
pause

echo Closing vCut...
taskkill /F /IM vCut.exe /T >nul 2>&1
timeout /t 1 /nobreak >nul
taskkill /F /IM vCut.exe /T >nul 2>&1

echo Removing app folders...
if exist "%LOCALAPPDATA%\Programs\vCut" rmdir /s /q "%LOCALAPPDATA%\Programs\vCut"
if exist "%LOCALAPPDATA%\Programs\vcut-desktop" rmdir /s /q "%LOCALAPPDATA%\Programs\vcut-desktop"
if exist "%LOCALAPPDATA%\vCut" rmdir /s /q "%LOCALAPPDATA%\vCut"

echo Cleaning Start Menu / Desktop shortcuts...
del /f /q "%APPDATA%\Microsoft\Windows\Start Menu\Programs\vCut.lnk" >nul 2>&1
del /f /q "%USERPROFILE%\Desktop\vCut.lnk" >nul 2>&1
del /f /q "%PUBLIC%\Desktop\vCut.lnk" >nul 2>&1

echo Cleaning uninstall registry entries (current user)...
for /f "tokens=*" %%K in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall" 2^>nul') do (
  reg query "%%K" /v DisplayName 2>nul | findstr /i "vCut" >nul && reg delete "%%K" /f >nul 2>&1
)

echo.
echo Next:
echo   1. Sign in at https://vcut-uat.pages.dev/login.html
echo   2. Open Download — pick Stable (2.74.x) or Beta (0.1.x Studio)
echo   3. Download Windows — wait for the full Setup.exe
echo   4. Run the installer (replaces previous install)
echo.
pause
endlocal
