diff --git a/sakura/preBuild.bat b/sakura/preBuild.bat
index d3055d4b81..fe3eb61359 100644
--- a/sakura/preBuild.bat
+++ b/sakura/preBuild.bat
@@ -50,6 +50,7 @@ if "%GIT_ENABLED%" == "1" (
: Output gitrev.h
set GITREV_H=..\sakura_core\gitrev.h
type nul > %GITREV_H%
+echo #pragma once >> %GITREV_H%
if "%COMMITID%" == "" (
type nul >> %GITREV_H%
) else (
diff --git a/sakura/sakura.vcxproj b/sakura/sakura.vcxproj
index b68706fda1..7d416a4bed 100644
--- a/sakura/sakura.vcxproj
+++ b/sakura/sakura.vcxproj
@@ -158,7 +158,7 @@
call preBuild.bat
- NDEBUG;%(PreprocessorDefinitions)
+ NDEBUG;_WIN64;%(PreprocessorDefinitions)
0x0411
@@ -227,7 +227,7 @@
call preBuild.bat
- _DEBUG;%(PreprocessorDefinitions)
+ _DEBUG;_WIN64;%(PreprocessorDefinitions)
0x0411
@@ -502,6 +502,7 @@
+
diff --git a/sakura/sakura.vcxproj.filters b/sakura/sakura.vcxproj.filters
index 0b8eef990c..85387fc925 100644
--- a/sakura/sakura.vcxproj.filters
+++ b/sakura/sakura.vcxproj.filters
@@ -1085,6 +1085,9 @@
Cpp Source Files\uiparts
+
+ Other Files
+
diff --git a/sakura_core/dlg/CDlgAbout.cpp b/sakura_core/dlg/CDlgAbout.cpp
index 3369615f0f..cf5f53e1ce 100644
--- a/sakura_core/dlg/CDlgAbout.cpp
+++ b/sakura_core/dlg/CDlgAbout.cpp
@@ -24,8 +24,8 @@
#include "uiparts/HandCursor.h"
#include "util/file.h"
#include "util/module.h"
-#include "gitrev.h"
#include "sakura_rc.h" // 2002/2/10 aroka 復帰
+#include "version.h"
#include "sakura.hh"
// バージョン情報 CDlgAbout.cpp //@@@ 2002.01.07 add start MIK
@@ -160,22 +160,28 @@ BOOL CDlgAbout::OnInitDialog( HWND hwndDlg, WPARAM wParam, LPARAM lParam )
// Last Modified: 1999/9/9 00:00:00
// (あればSKR_PATCH_INFOの文字列がそのまま表示)
CNativeT cmemMsg;
- cmemMsg.AppendString(LS(STR_DLGABOUT_APPNAME));
+ cmemMsg.AppendString(LS(STR_DLGABOUT_APPNAME)); // e.g. "サクラエディタ", "Sakura Editor"
cmemMsg.AppendString(_T(" "));
- // バージョン&リビジョン情報
+ // バージョン情報・コンフィグ情報 //
+#ifdef GIT_COMMIT_HASH
+#define VER_GITHASH "(GitHash " GIT_COMMIT_HASH ")\r\n"
+#else
+#define VER_GITHASH ""
+#endif
DWORD dwVersionMS, dwVersionLS;
GetAppVersionInfo( NULL, VS_VERSION_INFO, &dwVersionMS, &dwVersionLS );
- auto_sprintf(szMsg, _T("Ver. %d.%d.%d.%d\r\n"),
- HIWORD(dwVersionMS),
- LOWORD(dwVersionMS),
- HIWORD(dwVersionLS),
- LOWORD(dwVersionLS)
+ auto_sprintf(szMsg,
+ _T(
+ "v%d.%d.%d.%d %hs %hs\r\n"
+ "%hs"
+ ),
+ HIWORD(dwVersionMS), LOWORD(dwVersionMS), HIWORD(dwVersionLS), LOWORD(dwVersionLS), // e.g. {2, 3, 2, 0}
+ VER_PLATFORM, // e.g. "64bit", "32bit"
+ VER_CONFIG, // e.g. "DEBUG", ""
+ VER_GITHASH // e.g. "(GitHash 4a0de5798394409af14ec69c310ba0c86efdfc05)\r\n", ""
);
- cmemMsg.AppendString(szMsg);
-#if defined(GIT_COMMIT_HASH)
- cmemMsg.AppendString(_T("(GitHash " GIT_COMMIT_HASH ")\r\n"));
-#endif
+ cmemMsg.AppendString( szMsg );
#if defined(GIT_URL)
cmemMsg.AppendString(_T("(GitURL " GIT_URL ")\r\n"));
#endif
diff --git a/sakura_core/sakura_rc.rc b/sakura_core/sakura_rc.rc
index 6800bce4e7..929f892c1f 100644
--- a/sakura_core/sakura_rc.rc
+++ b/sakura_core/sakura_rc.rc
@@ -9,7 +9,7 @@
#else
#include "sakura_lang.h"
#endif
-#include "gitrev.h"
+#include "version.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
@@ -2814,16 +2814,7 @@ BEGIN
VALUE "LegalTrademarks", " \0"
VALUE "OriginalFilename", "sakura.exe\0"
VALUE "ProductName", "TNGfB^\0"
- VALUE "ProductVersion", PR_VER_STR
-#if defined(GIT_SHORT_COMMIT_HASH)
- " (GitHash " GIT_SHORT_COMMIT_HASH ")"
-#endif
-#ifdef _DEBUG
- " Debug version"
-#endif
-#ifndef _UNICODE
- " ANSI"
-#endif
+ VALUE "ProductVersion", RESOURCE_VERSION_STRING(PR_VER_STR) // e.g. "2.3.2.0 (4a0de579) UNICODE 64bit DEBUG"
END
END
BLOCK "VarFileInfo"
diff --git a/sakura_core/version.h b/sakura_core/version.h
new file mode 100644
index 0000000000..59b9e25cc8
--- /dev/null
+++ b/sakura_core/version.h
@@ -0,0 +1,32 @@
+#pragma once
+
+#include "gitrev.h"
+
+#ifdef _UNICODE
+#define VER_CHARSET "UNICODE"
+#else
+#define VER_CHARSET "ANSI"
+#endif
+
+#ifdef _WIN64
+#define VER_PLATFORM "64bit"
+#else
+#define VER_PLATFORM "32bit"
+#endif
+
+#ifdef _DEBUG
+#define VER_CONFIG "DEBUG"
+#else
+#define VER_CONFIG ""
+#endif
+
+#ifdef _DEBUG
+#define SPACE_WHEN_DEBUG " "
+#else
+#define SPACE_WHEN_DEBUG ""
+#endif
+
+// リソース埋め込み用バージョン文字列
+// e.g. "2.3.2.0 (4a0de579) UNICODE 64bit DEBUG"
+// e.g. "2.3.2.0 (4a0de579) UNICODE 64bit"
+#define RESOURCE_VERSION_STRING(_VersionString) _VersionString " (" GIT_SHORT_COMMIT_HASH ") " VER_CHARSET " " VER_PLATFORM SPACE_WHEN_DEBUG VER_CONFIG
diff --git a/sakura_lang_en_US/sakura_lang.h b/sakura_lang_en_US/sakura_lang.h
index d211d6f4d9..e73a16ca78 100644
--- a/sakura_lang_en_US/sakura_lang.h
+++ b/sakura_lang_en_US/sakura_lang.h
@@ -46,5 +46,7 @@
#include "../sakura_core/String_define.h"
#endif
+#include "../sakura_core/version.h" // #define RESOURCE_VERSION_STRING(_VersionString)
+
#endif /* SAKURA_SAKURA_LANG_C627B14F_9909_441B_B510_9BBB2D3F078B_H_ */
/*[EOF]*/
diff --git a/sakura_lang_en_US/sakura_lang_en_US.vcxproj b/sakura_lang_en_US/sakura_lang_en_US.vcxproj
index 15acd2e043..32ad30e575 100644
--- a/sakura_lang_en_US/sakura_lang_en_US.vcxproj
+++ b/sakura_lang_en_US/sakura_lang_en_US.vcxproj
@@ -159,7 +159,7 @@
ProgramDatabase
- _DEBUG;%(PreprocessorDefinitions)
+ _DEBUG;_WIN64;%(PreprocessorDefinitions)
0x0411
@@ -241,7 +241,7 @@
true
- NDEBUG;%(PreprocessorDefinitions)
+ NDEBUG;_WIN64;%(PreprocessorDefinitions)
0x0411
@@ -261,7 +261,7 @@
-
+
diff --git a/sakura_lang_en_US/sakura_lang_rc.rc b/sakura_lang_en_US/sakura_lang_rc.rc
index 6a1e363547..b37a7c9ec3 100644
--- a/sakura_lang_en_US/sakura_lang_rc.rc
+++ b/sakura_lang_en_US/sakura_lang_rc.rc
@@ -9,7 +9,7 @@
#else
#include "sakura_lang.h"
#endif
-#include "../sakura_core/gitrev.h"
+#include "../sakura_core/version.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
@@ -2790,7 +2790,6 @@ END
//
// Version
//
-
VS_VERSION_INFO VERSIONINFO
FILEVERSION FL_VER
PRODUCTVERSION PR_VER
@@ -2817,16 +2816,7 @@ BEGIN
VALUE "LegalTrademarks", " \0"
VALUE "OriginalFilename", "sakura.exe\0"
VALUE "ProductName", "Sakura Editor Language DLL\0"
- VALUE "ProductVersion", PR_VER_STR
-#if defined(GIT_SHORT_COMMIT_HASH)
- " (GitHash " GIT_SHORT_COMMIT_HASH ")"
-#endif
-#ifdef _DEBUG
- " Debug version"
-#endif
-#ifndef _UNICODE
- " ANSI"
-#endif
+ VALUE "ProductVersion", RESOURCE_VERSION_STRING(PR_VER_STR) // e.g. "2.3.2.0 4a0de579 UNICODE 64bit DEBUG"
END
END
BLOCK "VarFileInfo"