@echo off
setlocal

set "SRC=%~dp0app"
set "DEST=%LocalAppData%\DockApp"
set "STARTMENU=%AppData%\Microsoft\Windows\Start Menu\Programs"
set "DESKTOP=%USERPROFILE%\Desktop"
set "STARTUP=%AppData%\Microsoft\Windows\Start Menu\Programs\Startup"

if exist "%DEST%" rmdir /s /q "%DEST%"
mkdir "%DEST%"
xcopy "%SRC%\*" "%DEST%\" /E /I /Y >nul

powershell -NoProfile -ExecutionPolicy Bypass -Command ^
  "$s=New-Object -ComObject WScript.Shell; " ^
  "$lnk=$s.CreateShortcut('%STARTMENU%\Dock App.lnk'); " ^
  "$lnk.TargetPath='%DEST%\dock_app.exe'; " ^
  "$lnk.WorkingDirectory='%DEST%'; " ^
  "$lnk.IconLocation='%DEST%\dock_app.exe,0'; " ^
  "$lnk.Save(); " ^
  "$desk=$s.CreateShortcut('%DESKTOP%\Dock App.lnk'); " ^
  "$desk.TargetPath='%DEST%\dock_app.exe'; " ^
  "$desk.WorkingDirectory='%DEST%'; " ^
  "$desk.IconLocation='%DEST%\dock_app.exe,0'; " ^
  "$desk.Save(); " ^
  "$startup=$s.CreateShortcut('%STARTUP%\Dock App.lnk'); " ^
  "$startup.TargetPath='%DEST%\dock_app.exe'; " ^
  "$startup.WorkingDirectory='%DEST%'; " ^
  "$startup.IconLocation='%DEST%\dock_app.exe,0'; " ^
  "$startup.Save();"

start "" "%DEST%\dock_app.exe"
exit /b 0
