taskkill /f /im RiotClientServices.exe /t

mkdir "%LocalAppData%\Riot Games" 2>nul

rmdir "%LocalAppData%\Riot Games\Riot Client" /S /Q
rmdir "%ProgramData%\Riot Games" /S /Q
mklink /J "%LocalAppData%\Riot Games\Riot Client" "%~dp0ICafeCloud\LocalAppData"
mklink /J "%ProgramData%\Riot Games" "%~dp0ICafeCloud\ProgramData"

Reg.exe add "HKCR\riotclient" /ve /t REG_SZ /d "URL:Riot Games Protocol" /f
Reg.exe add "HKCR\riotclient" /v "URL Protocol" /t REG_SZ /d "" /f
Reg.exe add "HKCR\riotclient\DefaultIcon" /ve /t REG_SZ /d "\"%~dp0Riot Client\RiotClientServices.exe\",0" /f
Reg.exe add "HKCR\riotclient\shell\open\command" /ve /t REG_SZ /d "\"%~dp0Riot Client\RiotClientServices.exe\" --app-command=\"%%1\"" /f

set "shortcut_exe_path=%~dp0Riot Client\RiotClientServices.exe"
set "shortcut_work_dir=%~dp0Riot Client"
set "shortcut_name=Riot Client"
set "desktop_folder=%USERPROFILE%\Desktop"

powershell -Command "$s=(New-Object -ComObject WScript.Shell).CreateShortcut('%desktop_folder%\%shortcut_name%.lnk'); $s.TargetPath='%shortcut_exe_path%'; $s.WorkingDirectory='%shortcut_work_dir%'; $s.Save()"