@echo off
set log_path="%~dp0nxlog_kaynaklari.txt"

reg query HKEY_LOCAL_MACHINE\SOFTWARE\nxlog /v *installdir*

if %ERRORLEVEL% EQU 1 goto nxlogkur

if %ERRORLEVEL% EQU 0 goto exit

:nxlogkur

cmd /c "%~dp0Sysmon64.exe -u force"
cmd /c "%~dp0Sysmon64.exe -accepteula -i "%~dp0sysmonconfig-logsign.xml
cmd /c reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Sysmon/Operational
timeout 1

cmd /c "%~dp0nxlog_old_remove.bat"
cmd /c "%~dp0NxlogSetup.bat"

for /f "tokens=2 delims=:" %%a in ('ipconfig^|find "IPv4 Address"') do (
set ip=%%a
goto :BREAK
)

:BREAK

echo %ip: =% >> %log_path%
cmd /c hostname.exe >> %log_path%
echo ___________________________________________________________________________  >> %log_path%

echo Installation complete, You can Add a this syslog device on Logsign SIEM
echo Press any key to exit . . .
pause>nul
goto:eof



:exit

cmd /c net start nxlog

@echo off
echo Already installed...if you want to update, execute reinstall.bat
echo Press any key to exit . . .
pause>nul

goto:eof

