Skip to content

Commit

Permalink
* unified T-Clock's version number by adding common include: version.h
Browse files Browse the repository at this point in the history
(it's actually part of my autoversion program that normally gets called before each build and increments revision number. Will be added later maybe...)
* updated project files related to the version change and removed missing file resource.h from DLL
  • Loading branch information
White-Tiger committed Jun 18, 2014
1 parent 12aef07 commit 8b66660
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 25 deletions.
1 change: 1 addition & 0 deletions Source/Clock/Win32/Win32.Clock.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
<ClCompile Include="..\utl.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\common\version.h" />
<ClInclude Include="..\resource.h" />
<ClInclude Include="..\tclock.h" />
</ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions Source/Clock/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ BOOL CheckTCDLL(void) //------------------------------------------------------
}
//================================================================================================
//----------------------------//--------+++--> Verify the Correct Version of tClock.dll is Present:
BOOL CheckDLL(char* fname) //-----------------------------{ 2.0.2.99 }--------------------+++-->
BOOL CheckDLL(char* fname) //-------------------------------------------------------------+++-->
{
DWORD size;
char szVersion[32] = {0};
Expand All @@ -496,10 +496,10 @@ BOOL CheckDLL(char* fname) //-----------------------------{ 2.0.2.99 }--------
VS_FIXEDFILEINFO* pffi;
UINT uLen;
if(VerQueryValue(pBlock, "\\\0", (LPVOID*)&pffi, &uLen)) {
if(HIWORD(pffi->dwFileVersionMS) == 2 &&
LOWORD(pffi->dwFileVersionMS) == 0 &&
HIWORD(pffi->dwFileVersionLS) == 2 &&
LOWORD(pffi->dwFileVersionLS) == 99) {
if(HIWORD(pffi->dwFileVersionMS) == VER_MAJOR &&
LOWORD(pffi->dwFileVersionMS) == VER_MINOR &&
HIWORD(pffi->dwFileVersionLS) == VER_BUILD &&
LOWORD(pffi->dwFileVersionLS) == VER_REVISION) {
br = TRUE; //--+++--> Correct tClock.dll File Version Found!
} else {
wsprintf(szVersion, "Version: %d.%d.%d.%d",
Expand Down
2 changes: 1 addition & 1 deletion Source/Clock/pageabout.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void OnLinkClicked(HWND hDlg, UINT id)
if(id==IDC_ABT_MAILuri) {
strcpy(str, "mailto:");
GetDlgItemText(hDlg, id, str+strlen(str), 64);
strcat(str, "?subject=About "); strcat(str, CONF_START);
strcat(str, "?subject=About "); strcat(str, ABT_TITLE);
}else
GetDlgItemText(hDlg, id, str, 64);
ShellExecute(hDlg, NULL, str, NULL, "", SW_SHOWNORMAL);
Expand Down
3 changes: 2 additions & 1 deletion Source/Clock/tclock.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#else
# define TCLOCK_SUFFIX ""
#endif
#define ABT_TITLE "T-Clock Redux" TCLOCK_SUFFIX " - 2.0.2 build 99"
#define ABT_TITLE "T-Clock Redux" TCLOCK_SUFFIX " - " VER_SHORT2 " build " STR(VER_REVISION)
#define ABT_TCLOCK "T-Clock 2010 is Stoic Joker's rewrite of their code which allows it to run on Windows XP and up. While he removed some of T-Clock's previous functionality. He felt this makes it a more \"Administrator Friendly\" application as it no longer required elevated privileges to run.\n\nT-Clock Redux continues what Stoic Joker's T-Clock 2010 started and will be further improved and kept up-to-date."
#define CONF_START "T-Clock Redux" TCLOCK_SUFFIX
#define CONF_START_OLD "Stoic Joker's T-Clock 2010" TCLOCK_SUFFIX
Expand All @@ -36,6 +36,7 @@
#include <Shlwapi.h>//PathFileExists
#include <Psapi.h>//EmptyWorkingSet
#include "resource.h"
#include "../common/version.h"

#ifndef GWL_WNDPROC
#define GWL_WNDPROC GWLP_WNDPROC
Expand Down
9 changes: 5 additions & 4 deletions Source/Clock/version.rc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#include "../common/version.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -30,8 +31,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,2,99
PRODUCTVERSION 2,0,2,99
FILEVERSION VER_RC
PRODUCTVERSION VER_RC
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -49,11 +50,11 @@ BEGIN
VALUE "Comments", "SystemTray Clock Utility"
VALUE "CompanyName", "-"
VALUE "FileDescription", "T-Clock Redux"
VALUE "FileVersion", "2.0.2 #99"
VALUE "FileVersion", VER_SHORT " #" STR(VER_REVISION)
VALUE "InternalName", "Clock.exe"
VALUE "OriginalFilename", "Clock.exe"
VALUE "ProductName", "T-Clock Redux"
VALUE "ProductVersion", "2.0.2 #99"
VALUE "ProductVersion", VER_SHORT " #" STR(VER_REVISION)
END
END
BLOCK "VarFileInfo"
Expand Down
3 changes: 2 additions & 1 deletion Source/DLL/Win32/Win32.DLL.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@
<ClCompile Include="..\utl.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\resource.h" />
<ClInclude Include="..\..\common\version.h" />
<ClInclude Include="..\..\Clock\resource.h" />
<ClInclude Include="..\tcdll.h" />
</ItemGroup>
<ItemGroup>
Expand Down
11 changes: 6 additions & 5 deletions Source/DLL/version.rc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Microsoft Visual C++ generated resource script.
//
#include "../common/version.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -28,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,2,99
PRODUCTVERSION 2,0,2,99
FILEVERSION VER_RC
PRODUCTVERSION VER_RC
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -44,14 +45,14 @@ BEGIN
BEGIN
BLOCK "000004b0"
BEGIN
VALUE "Comments", "Used by T-Clock to ""Hook"" into the tray clock"
VALUE "Comments", "T-Clock tray-""Hook"""
VALUE "CompanyName", "-"
VALUE "FileDescription", "T-Clock Redux DLL"
VALUE "FileVersion", "2.0.2 #99"
VALUE "FileVersion", VER_SHORT " #" STR(VER_REVISION)
VALUE "InternalName", "Clock.dll"
VALUE "OriginalFilename", "Clock.dll"
VALUE "ProductName", "T-Clock Redux"
VALUE "ProductVersion", "2.0.2 #99"
VALUE "ProductVersion", VER_SHORT "#" STR(VER_REVISION)
END
END
BLOCK "VarFileInfo"
Expand Down
5 changes: 1 addition & 4 deletions Source/T-Clock.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,6 @@
<Option target="dll" />
<Option target="dll debug" />
</Unit>
<Unit filename="DLL/resource.h">
<Option target="dll" />
<Option target="dll debug" />
</Unit>
<Unit filename="DLL/tcdll.h">
<Option target="dll" />
<Option target="dll debug" />
Expand All @@ -292,6 +288,7 @@
<Option target="dll" />
<Option target="dll debug" />
</Unit>
<Unit filename="common/version.h" />
<Extensions>
<code_completion />
<envvars />
Expand Down
5 changes: 1 addition & 4 deletions Source/T-Clock64.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,6 @@
<Option target="dll" />
<Option target="dll debug" />
</Unit>
<Unit filename="DLL/resource.h">
<Option target="dll" />
<Option target="dll debug" />
</Unit>
<Unit filename="DLL/tcdll.h">
<Option target="dll" />
<Option target="dll debug" />
Expand All @@ -306,6 +302,7 @@
<Option target="dll" />
<Option target="dll debug" />
</Unit>
<Unit filename="common/version.h" />
<Extensions>
<code_completion />
<envvars />
Expand Down
39 changes: 39 additions & 0 deletions Source/common/version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* Note: to use integer defines as strings, use for example STR(VER_REVISION) */
#pragma once
#ifndef AUTOVERSION_H
#define AUTOVERSION_H
# define XSTR(x) #x
# define STR(x) XSTR(x)
/** Version **/
#define VER_MAJOR 2
#define VER_MINOR 1
#define VER_BUILD 0
#define VER_STATUS 2
#define VER_STATUS_S "Release Candidate"
#define VER_STATUS_SS "rc"
#define VER_STATUS_SS2 "гc"
#define VER_REVISION 57
#define VER_FULL "2.1.0 Release Candidate"
#define VER_SHORT "2.1rc0"
#define VER_SHORT2 "2.1.0"
#define VER_SHORT3 "2.1гc0"
#define VER_RC 2, 1, 0, 57
/** Date/Time **/
#define VER_TIMESTAMP 1403117331
#define VER_DATE_SEC 51
#define VER_DATE_MIN 48
#define VER_DATE_HOUR 18
#define VER_DATE_DAY 18
#define VER_DATE_MONTH 06
#define VER_DATE_YEAR 2014
#define VER_DATE_WDAY 0
#define VER_DATE_YDAY 169
#define VER_DATE_WDAY_SS "Wed"
#define VER_DATE_WDAY_S "Wednesday"
#define VER_DATE_MONTH_SS "Jun"
#define VER_DATE_MONTH_S "June"
#define VER_DATE "Wed, June 18, 2014 18:48:51 UTC"
#define VER_DATES "2013-05-26 18:48:51 UTC"
#define VER_DATE_TIME "18:48:51"
#define VER_DATE_DATE "2014-06-18"
#endif

0 comments on commit 8b66660

Please sign in to comment.