From 2cb7253becea2142ca845ade66bef4082331e2a5 Mon Sep 17 00:00:00 2001 From: Starg Date: Sat, 23 Dec 2023 17:34:57 +0900 Subject: [PATCH] Add version resource to sfviewer --- interface/w32g_res.rc | 7 +++---- sf_view_gui/CMakeLists.txt | 1 + sf_view_gui/sfview_dlg.rc | 41 +++++++++++++++++++++++++++++++++++++- version.h.in | 5 ++++- 4 files changed, 48 insertions(+), 6 deletions(-) diff --git a/interface/w32g_res.rc b/interface/w32g_res.rc index 59778e64..6f0c5d1f 100644 --- a/interface/w32g_res.rc +++ b/interface/w32g_res.rc @@ -4158,22 +4158,21 @@ VS_VERSION_INFO VERSIONINFO { VALUE "Comments", "\0" VALUE "CompanyName", "\0" - VALUE "FileVersion", TIMID_VERSION_RESSTR + VALUE "FileVersion", TIMID_VERSION4_RESSTR #ifdef TWSYNG32 VALUE "FileDescription", "TiMidity++ Win32GUI Synthesizer\0" VALUE "InternalName", "twsyng\0" VALUE "OriginalFilename", "twsyng.exe\0" - VALUE "ProductName", "TiMidity++ Win32GUI Synthesizer Version\0" #else VALUE "FileDescription", "TiMidity++ Win32GUI\0" VALUE "InternalName", "timw32g\0" VALUE "OriginalFilename", "timw32g.exe\0" - VALUE "ProductName", "TiMidity++ Win32GUI Version\0" #endif + VALUE "ProductName", "TiMidity++\0" VALUE "LegalCopyright", "Copyright (C) 1999-2018 Masanao Izumo \r\nCopyright (C) 1995 Tuukka Toivonen \0" VALUE "LegalTrademarks", "\0" VALUE "PrivateBuild", "\0" - VALUE "ProductVersion", TIMID_VERSION + VALUE "ProductVersion", TIMID_VERSION_RESSTR VALUE "SpecialBuild", "\0" } } diff --git a/sf_view_gui/CMakeLists.txt b/sf_view_gui/CMakeLists.txt index ea25abb8..96cdb5c4 100644 --- a/sf_view_gui/CMakeLists.txt +++ b/sf_view_gui/CMakeLists.txt @@ -22,5 +22,6 @@ add_executable( sfview_dlg.rc ) +add_dependencies(sfviewer UpdateTim41Version) target_link_libraries(sfviewer timidity_cfgforsf libarc utils comctl32 shlwapi ws2_32) install(TARGETS sfviewer) diff --git a/sf_view_gui/sfview_dlg.rc b/sf_view_gui/sfview_dlg.rc index fbdd3703..3f38da28 100644 --- a/sf_view_gui/sfview_dlg.rc +++ b/sf_view_gui/sfview_dlg.rc @@ -2,6 +2,7 @@ #include #include #include "resource.h" +#include "version.h" IDB_TREEICON BITMAP "bitmap1.bmp" @@ -30,7 +31,7 @@ END 101 DIALOGEX 0, 0, 255, 195 STYLE WS_OVERLAPPEDWINDOW | DS_CENTER EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Soundfont Viewer 1.01" +CAPTION SFVIEWER_TITLE_WITH_VERSION MENU IDR_MENU1 LANGUAGE LANG_JAPANESE, 0x1 FONT 9, "MS UI Gothic", FW_NORMAL, 0, 128 @@ -43,3 +44,41 @@ END IDI_ICON1 ICON "icon1.ico" +// +// Version Information resources +// +#ifdef _MSC_VER +LANGUAGE LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN +#endif +VS_VERSION_INFO VERSIONINFO +FILEVERSION TIMID_VERSION4_COMMA +PRODUCTVERSION TIMID_VERSION4_COMMA +FILEOS VOS__WINDOWS32 +FILETYPE VFT_APP +FILESUBTYPE VFT2_UNKNOWN +FILEFLAGSMASK 0x0000003F +FILEFLAGS 0x00000000 +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004E4" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "\0" + VALUE "FileVersion", TIMID_VERSION4_RESSTR + VALUE "FileDescription", "Soundfont Viewer\0" + VALUE "InternalName", "sfviewer\0" + VALUE "OriginalFilename", "sfviewer.exe\0" + VALUE "ProductName", "TiMidity++\0" + VALUE "LegalCopyright", "Copyright (C) 1999-2018 Masanao Izumo \r\nCopyright (C) 1995 Tuukka Toivonen \0" + VALUE "LegalTrademarks", "\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductVersion", TIMID_VERSION_RESSTR + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0000, 0x04E4 + END +END diff --git a/version.h.in b/version.h.in index affc4cf2..ac82e33d 100644 --- a/version.h.in +++ b/version.h.in @@ -23,7 +23,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define ___VERSION_H_ #define TIMID_VERSION "${tim41VersionStr}" +#define TIMID_VERSION_RESSTR "${tim41VersionStr}\0" #define TIMID_VERSION4_COMMA ${tim41Version4Comma} -#define TIMID_VERSION_RESSTR "${tim41Version4Comma}\0" +#define TIMID_VERSION4_RESSTR "${tim41Version4Comma}\0" + +#define SFVIEWER_TITLE_WITH_VERSION "Soundfont Viewer v${tim41VersionStr}" #endif /* !___VERSION_H_ */