@echo off
setlocal
set CILJ=%LOCALAPPDATA%\Toss
echo Instaliram u %CILJ%
if exist "%CILJ%" rmdir /S /Q "%CILJ%"
mkdir "%CILJ%"
xcopy /E /I /Q /Y "%~dp0*" "%CILJ%" >nul
del /Q "%CILJ%\Instaliraj.bat" 2>nul

set START=%APPDATA%\Microsoft\Windows\Start Menu\Programs
powershell -NoProfile -Command ^
 "$w=New-Object -ComObject WScript.Shell;" ^
 "$s=$w.CreateShortcut('%START%\Screentoss.lnk');$s.TargetPath='%CILJ%\screentoss-gui.exe';$s.WorkingDirectory='%CILJ%';$s.Save();" ^
 "$s=$w.CreateShortcut('%START%\Filetoss.lnk');$s.TargetPath='%CILJ%\filetoss-gui.exe';$s.WorkingDirectory='%CILJ%';$s.Save()"

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v Screentoss /t REG_SZ /d "\"%CILJ%\screentoss-gui.exe\"" /f >nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v Filetoss /t REG_SZ /d "\"%CILJ%\filetoss-gui.exe\"" /f >nul

echo.
echo Gotovo. Screentoss i Filetoss su u izborniku Start i dizu se s Windowsima.
echo Za Screentoss jos treba ffmpeg:  winget install Gyan.FFmpeg
echo.
pause
