UI: Automatically generate Windows file description

This defines the main OBS Windows executable with a resource file,
including a version number accessible externally and a File
description which appears in Windows Task Manager.
master
Matt Gajownik 2019-01-29 22:10:20 +11:00
parent b5e656828f
commit 4b9d050b33
2 changed files with 36 additions and 0 deletions

View File

@ -32,6 +32,16 @@ include(ObsHelpers)
include(ObsCpack)
include(GNUInstallDirs)
if(WIN32)
string(REPLACE "-" ";" UI_VERSION_SPLIT ${OBS_VERSION})
list(GET UI_VERSION_SPLIT 0 UI_VERSION)
string(REPLACE "." ";" UI_VERSION_SEMANTIC ${UI_VERSION})
list(GET UI_VERSION_SEMANTIC 0 UI_VERSION_MAJOR)
list(GET UI_VERSION_SEMANTIC 1 UI_VERSION_MINOR)
list(GET UI_VERSION_SEMANTIC 2 UI_VERSION_PATCH)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/UI/obs.rc.in ${CMAKE_CURRENT_SOURCE_DIR}/UI/obs.rc)
endif()
# Must be a string in the format of "x.x.x-rcx"
if(DEFINED RELEASE_CANDIDATE)
set(OBS_VERSION "${RELEASE_CANDIDATE}")

26
UI/obs.rc.in Normal file
View File

@ -0,0 +1,26 @@
IDI_ICON1 ICON DISCARDABLE "../cmake/winrc/obs-studio.ico"
1 VERSIONINFO
FILEVERSION ${UI_VERSION_MAJOR},${UI_VERSION_MINOR},${UI_VERSION_PATCH},0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "OBS"
VALUE "FileDescription", "OBS Studio"
VALUE "FileVersion", "${UI_VERSION}"
VALUE "InternalName", "obs"
VALUE "OriginalFilename", "obs"
VALUE "ProductName", "OBS Studio"
VALUE "ProductVersion", "${UI_VERSION}"
VALUE "Comments", "Free and open source software for video recording and live streaming"
VALUE "LegalCopyright", "(C) Hugh Bailey"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 0x04B0
END
END