Skip to content

Commit

Permalink
Add version resource for Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
mungre committed Aug 21, 2024
1 parent 7752058 commit 1309506
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/VS2010/BeebAsm.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@
<ClInclude Include="..\stringutils.h" />
<ClInclude Include="..\symboltable.h" />
<ClInclude Include="..\value.h" />
<ClInclude Include="..\version.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\beebasm.rc">
<Culture Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">0x0809</Culture>
<Culture Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">0x0809</Culture>
</ResourceCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
8 changes: 8 additions & 0 deletions src/VS2010/BeebAsm.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,13 @@
<ClInclude Include="..\scopedsymbolname.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\version.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\beebasm.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
77 changes: 77 additions & 0 deletions src/beebasm.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*************************************************************************************************/
/**
beebasm.rc


Copyright (C) Charles Reilly 2024

This file is part of BeebAsm.

BeebAsm is free software: you can redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

BeebAsm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with BeebAsm, as
COPYING.txt. If not, see <http://www.gnu.org/licenses/>.
*/
/*************************************************************************************************/

#include <verrsrc.h>
#include "version.h"

// This is the source charset. String resources are stored in utf-16 in the exe.
// (This whole file is actually ASCII but it contains a copyright symbol escaped
// in the Windows-1252 encoding.)
#pragma code_page(1252)

LANGUAGE 9, 1

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

#ifdef _DEBUG
#define DLL_FLAGS VS_FF_DEBUG
#else
#define DLL_FLAGS 0x0L
#endif

1 VERSIONINFO
FILEVERSION MAJOR_VERSION,MINOR_VERSION,RELEASE_NUMBER,BUILD_NUMBER
PRODUCTVERSION MAJOR_VERSION,MINOR_VERSION,RELEASE_NUMBER,BUILD_NUMBER
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS DLL_FLAGS
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
// 0x0809 = MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_UK)
// 0x04B0 = CP_WINUNICODE
BLOCK "080904b0"
BEGIN
//VALUE "Comments", "\0"
//VALUE "CompanyName", "beebasm\0"
VALUE "FileDescription", "beebasm\0"
VALUE "FileVersion", VERSION "\0"
VALUE "InternalName", "beebasm\0"
VALUE "LegalCopyright", "Copyright \xA9 " EXPAND_TO_STRING(COPYRIGHT_YEAR) " The beebasm contributors\0"
VALUE "LegalTrademarks", "\0"
//VALUE "OriginalFilename", "beebasm.exe\0"
//VALUE "PrivateBuild", "\0"
VALUE "ProductName", "beebasm\0"
VALUE "ProductVersion", VERSION "\0"
//VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0809, 0x04B0
END
END
4 changes: 1 addition & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@
#include "BASIC.h"
#include "macro.h"
#include "random.h"
#include "version.h"


using namespace std;


#define VERSION "1.10"


/*************************************************************************************************/
/**
main()
Expand Down
28 changes: 28 additions & 0 deletions src/version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*************************************************************************************************/
/**
version.h
*/
/*************************************************************************************************/

#ifndef VERSION_H_
#define VERSION_H_

#define COPYRIGHT_YEAR 2024

// The version numbers
#define MAJOR_VERSION 1
#define MINOR_VERSION 10

// Something appended to the version, e.g. "rc2" for a release candidate
#define SPECIAL_VERSION ""

// Currently unused, though they are displayed in Explorer by some versions of Windows
#define RELEASE_NUMBER 0
#define BUILD_NUMBER 0

#define STRINGIZE(x) #x
#define EXPAND_TO_STRING(x) STRINGIZE(x)

#define VERSION EXPAND_TO_STRING(MAJOR_VERSION) "." EXPAND_TO_STRING(MINOR_VERSION) SPECIAL_VERSION

#endif // VERSION_H_

0 comments on commit 1309506

Please sign in to comment.