set GameDir=
if not defined GameDir for /f "tokens=2*" %%a in (
 'REG QUERY HKLM\SOFTWARE\Wow6432Node\LucasArts\KotOR2\ /v Path 2^>NUL ^| findstr Path'
  ) do set GameDir=%%~b

cd %GameDir%

xcopy "Hard As Hell\Source\nwscript.nss" "Hard As Hell\tslpatchdata\"  /Y

xcopy "Hard As Hell\Source\Powers\jd_force_include.nss" "Hard As Hell\Source\Grenades\"  /Y

cd "%GameDir%\Hard As Hell\Source\Grenades\"

"c:\program files\7-zip\7z" e "%GameDir%\Hard As Hell\Source\Powers\installer_proccessed.zip" 

cd %GameDir%

"Hard As Hell\tslpatchdata\nwnnsscomp.exe" "Hard As Hell\Source\Grenades\k_trp_generic.nss"

"Hard As Hell\tslpatchdata\nwnnsscomp.exe" "Hard As Hell\Source\Grenades\k_sup_grenade.nss"

del /q "Hard As Hell\Source\Grenades\jd_force_include.nss" 

del /q "Hard As Hell\Source\Grenades\jd_constants.nss" 

pause
