Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
Add RC file with version information
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwhite committed Aug 3, 2016
1 parent b50e49d commit 996b245
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@
* the build will fail.
*/

// Major, minor, and patch version numbers. These will always be integers.
//
// Version information.
//

// Major, minor, build, and patch version numbers. These will always be
// integers.
#define PEPATCH_MAJOR ${MAJOR}
#define PEPATCH_MINOR ${MINOR}
#define PEPATCH_PATCH ${PATCH}
#define PEPATCH_BUILD 0 // Unused

// The output of `git describe --always --dirty`. Note that this does not
// include the major, minor, and patch versions.
Expand All @@ -51,7 +57,17 @@
// HEAD`.
#define PEPATCH_GIT_COMMIT_LONG "${GIT_COMMIT_LONG}"

#define PEPATCH_VERSION "${MAJOR}.${MINOR}.${PATCH}-${GIT_COMMIT_SHORT}"
#define PEPATCH_VERSION "${MAJOR}.${MINOR}.${PATCH}-${GIT_VERSION}"

// A pretty version in the form of "v1.0.0-226f798-dirty"
#define PEPATCH_PRETTY_VERSION "v${MAJOR}.${MINOR}.${PATCH}-${GIT_VERSION}"

//
// Miscellaneous information.
//

#define PEPATCH_INTERNAL_NAME "PE Patch"
#define PEPATCH_PRODUCT_NAME "PE Patch"
#define PEPATCH_DESCRIPTION "Reproducible builds for Windows."
#define PEPATCH_COPYRIGHT "Copyright (c) Jason White 2016"
#define PEPATCH_ORIGINAL_FILENAME "pepatch.exe"
68 changes: 68 additions & 0 deletions src/version.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright (c) 2016 Jason White
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include <verrsrc.h>
#include <winres.h>

#include "version.h"

#ifdef APSTUDIO_INVOKED
# error This file must be edited manually.
#endif

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)

/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION PEPATCH_MAJOR,PEPATCH_MINOR,PEPATCH_PATCH,PEPATCH_BUILD
PRODUCTVERSION PEPATCH_MAJOR,PEPATCH_MINOR,PEPATCH_PATCH,PEPATCH_BUILD
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", PEPATCH_DESCRIPTION
VALUE "FileVersion", PEPATCH_VERSION
VALUE "InternalName", PEPATCH_INTERNAL_NAME
VALUE "LegalCopyright", PEPATCH_COPYRIGHT
VALUE "OriginalFilename", PEPATCH_ORIGINAL_FILENAME
VALUE "ProductName", PEPATCH_PRODUCT_NAME
VALUE "ProductVersion", PEPATCH_VERSION
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
3 changes: 3 additions & 0 deletions vs/vs2015/pepatch/pepatch.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@
<ClInclude Include="..\..\..\src\pemap.h" />
<ClInclude Include="..\..\..\src\pepatch.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\src\version.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
5 changes: 5 additions & 0 deletions vs/vs2015/pepatch/pepatch.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,9 @@
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\src\version.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

0 comments on commit 996b245

Please sign in to comment.