taskkill /f /im FiveM.exe /t

rmdir "%LocalAppData%\FiveM" /S /Q
mklink /J "%LocalAppData%\FiveM" "%~dp0ICafeCloud\LocalAppData\FiveM"

Reg.exe add "HKCU\Software\CitizenFX\FiveM" /v "Last Run Location" /d "%LocalAppData%\FiveM\FiveM.app\\" /f

Reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\CitizenFX_FiveM" /v "DisplayName" /d "FiveM" /f
Reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\CitizenFX_FiveM" /v "DisplayIcon" /d "%LocalAppData%\FiveM\FiveM.exe,0" /f
Reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\CitizenFX_FiveM" /v "HelpLink" /d "https://cfx.re/" /f
Reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\CitizenFX_FiveM" /v "InstallLocation" /d "%LocalAppData%\FiveM" /f
Reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\CitizenFX_FiveM" /v "Publisher" /d "Cfx.re" /f
Reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\CitizenFX_FiveM" /v "UninstallString" /d "\"%LocalAppData%\FiveM\FiveM.exe\" -uninstall app" /f
Reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\CitizenFX_FiveM" /v "URLInfoAbout" /d "https://cfx.re/" /f
Reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\CitizenFX_FiveM" /v "NoModify" /t REG_DWORD /d 1 /f
Reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\CitizenFX_FiveM" /v "NoRepair" /t REG_DWORD /d 1 /f

set "shortcut_exe_path=%LocalAppData%\FiveM\FiveM.exe"
set "shortcut_work_dir=%LocalAppData%\FiveM"
set "shortcut_name=FiveM"
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()"
