Warning
As of 2.9 this is no longer supported. The Windows agent can be built on Linux systems. Patches to update the Windows compilation support are very welcome.
Note
Originally posted Compiling the OSSEC Windows Agent on Windows by mstarks, duplicated here with permission.
Most people that use the OSSEC Windows agent download a pre-compiled copy from the OSSEC site. While that is a good option for many individual users, it may not suit those with more specific needs and/or those in enterprise environments. Users who fall into those categories could benefit from customizing the agent and maintaining internal builds in order to suit their individual needs.
There are already instructions on how to compile the Windows agent on Linux, but ironically the process doesn’t work so well on Windows. I had a need to make this work on Windows, so I thought I would share the process with you.
src\win32
folder and rename the extension to .cmd.src\win32
foldersrc\win32
, make any desired customizations, and execute gen_win.cmd. This should gather all of the required files and place them in src\win-pkg
.src\win-pkg
and executing make.bat (I assume you have the chops to know how to change directories :) )."c:\Program Files\NSIS\makensis.exe" ossec-installer.nsi
If you see no errors and a binary named ossec-win32-agent.exe, everything was successful. Congratulations, you now have a custom-made version of OSSEC!