@echo off
setlocal
set "INSTALL_DIR=%LOCALAPPDATA%\EasyPenpotTeam"
set "DESKTOP_DIR=%USERPROFILE%\Desktop"
set "START_MENU_DIR=%APPDATA%\Microsoft\Windows\Start Menu\Programs"
if exist "%INSTALL_DIR%" rmdir /S /Q "%INSTALL_DIR%"
mkdir "%INSTALL_DIR%"
xcopy "%~dp0app" "%INSTALL_DIR%\app\" /E /I /H /Y >nul
if errorlevel 1 exit /b 1
copy /Y "%~dp0run.cmd" "%INSTALL_DIR%\Easy Penpot Team.cmd" >nul
if not exist "%START_MENU_DIR%" mkdir "%START_MENU_DIR%"
> "%DESKTOP_DIR%\Easy Penpot Team.cmd" echo @echo off
>> "%DESKTOP_DIR%\Easy Penpot Team.cmd" echo start "" "%INSTALL_DIR%\app\Easy Penpot Team.exe"
> "%START_MENU_DIR%\Easy Penpot Team.cmd" echo @echo off
>> "%START_MENU_DIR%\Easy Penpot Team.cmd" echo start "" "%INSTALL_DIR%\app\Easy Penpot Team.exe"
echo Installed Easy Penpot Team to "%INSTALL_DIR%".
