Skip to content

Commit

Permalink
print build info
Browse files Browse the repository at this point in the history
  • Loading branch information
drdaxxy committed Jan 25, 2018
1 parent 0eafa58 commit beec2a6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ obj
*.opendb
*.vcxproj.user
.vs
packages
packages
Injection/versioninfo.h
16 changes: 16 additions & 0 deletions Injection/Injection.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>(for /f %%i in ('git describe --always --dirty --tags') do ((echo #define GIT_VERSION ^"%%i^") &gt; $(ProjectDir)versioninfo.h))
REM for /f %i in ('echo Test') do echo %i</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-iRO|Win32'">
<ClCompile>
Expand All @@ -122,6 +126,10 @@
<ModuleDefinitionFile>
</ModuleDefinitionFile>
</Link>
<PreBuildEvent>
<Command>(for /f %%i in ('git describe --always --dirty --tags') do ((echo #define GIT_VERSION ^"%%i^") &gt; $(ProjectDir)versioninfo.h))
REM for /f %i in ('echo Test') do echo %i</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-bRO|Win32'">
<ClCompile>
Expand All @@ -142,6 +150,10 @@
<ModuleDefinitionFile>
</ModuleDefinitionFile>
</Link>
<PreBuildEvent>
<Command>(for /f %%i in ('git describe --always --dirty --tags') do ((echo #define GIT_VERSION ^"%%i^") &gt; $(ProjectDir)versioninfo.h))
REM for /f %i in ('echo Test') do echo %i</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-jRO|Win32'">
<ClCompile>
Expand All @@ -162,6 +174,10 @@
<ModuleDefinitionFile>
</ModuleDefinitionFile>
</Link>
<PreBuildEvent>
<Command>(for /f %%i in ('git describe --always --dirty --tags') do ((echo #define GIT_VERSION ^"%%i^") &gt; $(ProjectDir)versioninfo.h))
REM for /f %i in ('echo Test') do echo %i</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="Core\FastFont\CacheInfo.h" />
Expand Down
4 changes: 4 additions & 0 deletions Injection/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include "Core/RoCodeBind.h"

#include "versioninfo.h"

static BOOL g_useMinHook = TRUE;

BOOL InstallProxyFunction(LPCTSTR dllname,LPCSTR exportname,VOID *ProxyFunction,LPVOID *pOriginalFunction)
Expand Down Expand Up @@ -320,6 +322,8 @@ BOOL APIENTRY DllMain( HMODULE hModule,

CreateTinyConsole();
OpenSharedMemory();

DEBUG_LOGGING_NORMAL(("Version: %s (Built at: %s %s)", GIT_VERSION, __DATE__, __TIME__));
#ifdef USE_WS2_32DLLINJECTION
InstallProxyFunction(
_T("ws2_32.dll"), "recv",
Expand Down
1 change: 1 addition & 0 deletions test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
for /f %%i in ('git describe --always --dirty --tags') do ((echo #define GIT_VERSION ^"%%i^") > C:\Users\drdax\Source\Repos\SimpleROHook\Injection\Injection\versioninfo.h)

0 comments on commit beec2a6

Please sign in to comment.