Skip to content

Commit

Permalink
Merge pull request debauchee#978 from albertony/rc_version_info
Browse files Browse the repository at this point in the history
Add version info resource to windows exe
  • Loading branch information
p12tic authored Dec 9, 2020
2 parents bbea197 + 366342e commit e66832c
Show file tree
Hide file tree
Showing 11 changed files with 249 additions and 69 deletions.
3 changes: 3 additions & 0 deletions cmake/Version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ message (STATUS "Full Barrier version string is '" ${BARRIER_VERSION_STRING} "'"

add_definitions (-DBARRIER_VERSION="${BARRIER_VERSION}")
add_definitions (-DBARRIER_VERSION_STRING="${BARRIER_VERSION_STRING}")
add_definitions (-DBARRIER_VERSION_MAJOR=${BARRIER_VERSION_MAJOR})
add_definitions (-DBARRIER_VERSION_MINOR=${BARRIER_VERSION_MINOR})
add_definitions (-DBARRIER_VERSION_PATCH=${BARRIER_VERSION_PATCH})
add_definitions (-DBARRIER_REVISION="${BARRIER_REVISION}")
add_definitions (-DBARRIER_BUILD_DATE="${BARRIER_BUILD_DATE}")
add_definitions (-DBARRIER_BUILD_NUMBER=${BARRIER_BUILD_NUMBER})
Expand Down
11 changes: 1 addition & 10 deletions src/cmd/barrierc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,7 @@ set(sources
if (WIN32)
file(GLOB arch_headers "MSWindows*.h")
file(GLOB arch_sources "MSWindows*.cpp")
list(APPEND sources
resource.h
barrierc.ico
barrierc.rc
tb_error.ico
tb_idle.ico
tb_run.ico
tb_wait.ico
barrierc.exe.manifest
)
list(APPEND sources barrierc.rc)
elseif (APPLE)
file(GLOB arch_headers "OSX*.h")
file(GLOB arch_sources "OSX*.cpp")
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/barrierc/barrierc.exe.manifest

This file was deleted.

97 changes: 63 additions & 34 deletions src/cmd/barrierc/barrierc.rc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Microsoft Developer Studio generated resource script.
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

Expand All @@ -8,9 +8,6 @@
// Generated from the TEXTINCLUDE 2 resource.
//
#include <winresrc.h>
#if !defined(IDC_STATIC)
#define IDC_STATIC (-1)
#endif

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
Expand All @@ -19,29 +16,27 @@
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE DISCARDABLE
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END

2 TEXTINCLUDE DISCARDABLE
2 TEXTINCLUDE
BEGIN
"#include <winresrc.h>\r\n"
"\0"
END

3 TEXTINCLUDE DISCARDABLE
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
Expand All @@ -52,37 +47,64 @@ END

/////////////////////////////////////////////////////////////////////////////
//
// Icon
// Version
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_BARRIER ICON DISCARDABLE "barrierc.ico"
IDI_TASKBAR_NOT_RUNNING ICON DISCARDABLE "tb_idle.ico"
IDI_TASKBAR_NOT_WORKING ICON DISCARDABLE "tb_error.ico"
IDI_TASKBAR_NOT_CONNECTED ICON DISCARDABLE "tb_wait.ico"
IDI_TASKBAR_CONNECTED ICON DISCARDABLE "tb_run.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION BARRIER_VERSION_MAJOR, BARRIER_VERSION_MINOR, BARRIER_VERSION_PATCH, BARRIER_BUILD_NUMBER
PRODUCTVERSION BARRIER_VERSION_MAJOR, BARRIER_VERSION_MINOR, BARRIER_VERSION_PATCH, BARRIER_BUILD_NUMBER
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Debauchee Open Source Group"
VALUE "CompanyWeb", "https://github.com/debauchee/barrier/"
VALUE "FileVersion", BARRIER_VERSION
VALUE "LegalCopyright", "Copyright (C) 2018 Debauchee Open Source Group\nCopyright (C) 2012-2016 Symless Ltd.\nCopyright (C) 2008-2014 Nick Bolton\nCopyright (C) 2002-2014 Chris Schoeneman"
VALUE "ProductName", "Barrier"
VALUE "ProductVersion", BARRIER_VERSION
VALUE "OriginalFilename", "barrierc.exe"
VALUE "FileDescription", "Open source KVM software client"
VALUE "InternalName", "barrierc"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END


/////////////////////////////////////////////////////////////////////////////
//
// Dialog
// Icon
//

IDD_TASKBAR_STATUS DIALOG DISCARDABLE 0, 0, 145, 18
STYLE DS_MODALFRAME | WS_POPUP
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_TASKBAR_STATUS_STATUS,3,3,139,12,ES_AUTOHSCROLL |
ES_READONLY | NOT WS_BORDER
END
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_BARRIER ICON "barrierc.ico"
IDI_TASKBAR_NOT_RUNNING ICON "tb_idle.ico"
IDI_TASKBAR_NOT_WORKING ICON "tb_error.ico"
IDI_TASKBAR_NOT_CONNECTED ICON "tb_wait.ico"
IDI_TASKBAR_CONNECTED ICON "tb_run.ico"


/////////////////////////////////////////////////////////////////////////////
//
// Menu
//

IDR_TASKBAR MENU DISCARDABLE
IDR_TASKBAR MENU
BEGIN
POPUP "Barrier"
BEGIN
Expand All @@ -92,32 +114,39 @@ BEGIN
POPUP "Set Log Level"
BEGIN
MENUITEM "Error", IDC_TASKBAR_LOG_LEVEL_ERROR

MENUITEM "Warning", IDC_TASKBAR_LOG_LEVEL_WARNING

MENUITEM "Note", IDC_TASKBAR_LOG_LEVEL_NOTE

MENUITEM "Info", IDC_TASKBAR_LOG_LEVEL_INFO

MENUITEM "Debug", IDC_TASKBAR_LOG_LEVEL_DEBUG

MENUITEM "Debug1", IDC_TASKBAR_LOG_LEVEL_DEBUG1

MENUITEM "Debug2", IDC_TASKBAR_LOG_LEVEL_DEBUG2

END
MENUITEM SEPARATOR
MENUITEM "Quit", IDC_TASKBAR_QUIT
END
END


/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_TASKBAR_STATUS DIALOG 0, 0, 145, 18
STYLE DS_MODALFRAME | WS_POPUP
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_TASKBAR_STATUS_STATUS,3,3,139,12,ES_AUTOHSCROLL |
ES_READONLY | NOT WS_BORDER
END


/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE DISCARDABLE
STRINGTABLE
BEGIN
IDS_FAILED "Barrier is about to quit with errors or warnings. Please check the log then click OK."
IDS_INIT_FAILED "Barrier failed to initialize: %{1}"
Expand Down
3 changes: 3 additions & 0 deletions src/cmd/barrierd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

file(GLOB headers "*.h")
file(GLOB sources "*.cpp")
if (WIN32)
list(APPEND sources barrierd.rc)
endif()

if (WIN32)
add_executable (barrierd WIN32 ${sources})
Expand Down
Binary file added src/cmd/barrierd/barrierd.ico
Binary file not shown.
112 changes: 112 additions & 0 deletions src/cmd/barrierd/barrierd.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include <winresrc.h>

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE
BEGIN
"resource.h\0"
END

2 TEXTINCLUDE
BEGIN
"#include <winresrc.h>\r\n"
"\0"
END

3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END

#endif // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION BARRIER_VERSION_MAJOR, BARRIER_VERSION_MINOR, BARRIER_VERSION_PATCH, BARRIER_BUILD_NUMBER
PRODUCTVERSION BARRIER_VERSION_MAJOR, BARRIER_VERSION_MINOR, BARRIER_VERSION_PATCH, BARRIER_BUILD_NUMBER
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Debauchee Open Source Group"
VALUE "CompanyWeb", "https://github.com/debauchee/barrier/"
VALUE "FileVersion", BARRIER_VERSION
VALUE "LegalCopyright", "Copyright (C) 2018 Debauchee Open Source Group\nCopyright (C) 2012-2016 Symless Ltd.\nCopyright (C) 2008-2014 Nick Bolton\nCopyright (C) 2002-2014 Chris Schoeneman"
VALUE "ProductName", "Barrier"
VALUE "ProductVersion", BARRIER_VERSION
VALUE "OriginalFilename", "barrierd.exe"
VALUE "FileDescription", "Open source KVM software deamon"
VALUE "InternalName", "barrierd"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_BARRIER ICON "barrierd.ico"


#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

16 changes: 16 additions & 0 deletions src/cmd/barrierd/resource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by barrierc.rc
//
#define IDI_BARRIER 101

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 109
#define _APS_NEXT_COMMAND_VALUE 40016
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
11 changes: 1 addition & 10 deletions src/cmd/barriers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,7 @@ set(sources
if (WIN32)
file(GLOB arch_headers "MSWindows*.h")
file(GLOB arch_sources "MSWindows*.cpp")
list(APPEND sources
resource.h
barriers.ico
barriers.rc
tb_error.ico
tb_idle.ico
tb_run.ico
tb_wait.ico
barriers.exe.manifest
)
list(APPEND sources barriers.rc)
elseif (APPLE)
file(GLOB arch_headers "OSX*.h")
file(GLOB arch_sources "OSX*.cpp")
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/barriers/barriers.exe.manifest

This file was deleted.

Loading

0 comments on commit e66832c

Please sign in to comment.