Skip to content

Commit ab04064

Browse files
committed
Issue 23018: Add version info to python[w].exe
1 parent 2587952 commit ab04064

File tree

4 files changed

+106
-33
lines changed

4 files changed

+106
-33
lines changed

PC/python.manifest

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
4+
<application>
5+
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
6+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
7+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
8+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
9+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
10+
</application>
11+
</compatibility>
12+
</assembly>

PC/python_exe.rc

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,49 @@
1-
1 ICON DISCARDABLE "pycon.ico"
1+
// Resource script for Python console EXEs.
2+
3+
#include "python_ver_rc.h"
4+
5+
// Include the manifest file that indicates we support all
6+
// current versions of Windows.
7+
#include <winuser.h>
8+
1 RT_MANIFEST "python.manifest"
9+
10+
1 ICON DISCARDABLE "pycon.ico"
11+
12+
13+
/////////////////////////////////////////////////////////////////////////////
14+
//
15+
// Version
16+
//
17+
18+
VS_VERSION_INFO VERSIONINFO
19+
FILEVERSION PYVERSION64
20+
PRODUCTVERSION PYVERSION64
21+
FILEFLAGSMASK 0x3fL
22+
#ifdef _DEBUG
23+
FILEFLAGS VS_FF_DEBUG
24+
#else
25+
FILEFLAGS 0x0L
26+
#endif
27+
FILEOS VOS__WINDOWS32
28+
FILETYPE VFT_APP
29+
FILESUBTYPE 0x0L
30+
BEGIN
31+
BLOCK "StringFileInfo"
32+
BEGIN
33+
BLOCK "000004b0"
34+
BEGIN
35+
VALUE "CompanyName", PYTHON_COMPANY "\0"
36+
VALUE "FileDescription", "Python\0"
37+
VALUE "FileVersion", PYTHON_VERSION
38+
VALUE "InternalName", "Python Console\0"
39+
VALUE "LegalCopyright", PYTHON_COPYRIGHT "\0"
40+
VALUE "OriginalFilename", "python" PYTHON_DEBUG_EXT ".exe\0"
41+
VALUE "ProductName", "Python\0"
42+
VALUE "ProductVersion", PYTHON_VERSION
43+
END
44+
END
45+
BLOCK "VarFileInfo"
46+
BEGIN
47+
VALUE "Translation", 0x0, 1200
48+
END
49+
END

PC/python_nt.rc

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,11 @@
11
// Resource script for Python core DLL.
2-
// Currently only holds version information.
3-
//
4-
#include "winver.h"
5-
6-
#define MS_WINDOWS
7-
#include "modsupport.h"
8-
#include "patchlevel.h"
9-
#ifdef _DEBUG
10-
# include "pythonnt_rc_d.h"
11-
#else
12-
# include "pythonnt_rc.h"
13-
#endif
142

15-
/* e.g., 3.3.0a1
16-
* PY_VERSION comes from patchlevel.h
17-
*/
18-
#define PYTHON_VERSION PY_VERSION "\0"
3+
#include "python_ver_rc.h"
194

20-
/* 64-bit version number as comma-separated list of 4 16-bit ints */
21-
#if PY_MICRO_VERSION > 64
22-
# error "PY_MICRO_VERSION > 64"
23-
#endif
24-
#if PY_RELEASE_LEVEL > 99
25-
# error "PY_RELEASE_LEVEL > 99"
26-
#endif
27-
#if PY_RELEASE_SERIAL > 9
28-
# error "PY_RELEASE_SERIAL > 9"
29-
#endif
30-
#define PYVERSION64 PY_MAJOR_VERSION, PY_MINOR_VERSION, FIELD3, PYTHON_API_VERSION
5+
// Include the manifest file that indicates we support all
6+
// current versions of Windows.
7+
#include <winuser.h>
8+
2 RT_MANIFEST "python.manifest"
319

3210
// String Tables
3311
STRINGTABLE DISCARDABLE
@@ -45,23 +23,23 @@ VS_VERSION_INFO VERSIONINFO
4523
PRODUCTVERSION PYVERSION64
4624
FILEFLAGSMASK 0x3fL
4725
#ifdef _DEBUG
48-
FILEFLAGS 0x1L
26+
FILEFLAGS VS_FF_DEBUG
4927
#else
5028
FILEFLAGS 0x0L
5129
#endif
52-
FILEOS 0x40004L
53-
FILETYPE 0x1L
30+
FILEOS VOS__WINDOWS32
31+
FILETYPE VFT_DLL
5432
FILESUBTYPE 0x0L
5533
BEGIN
5634
BLOCK "StringFileInfo"
5735
BEGIN
5836
BLOCK "000004b0"
5937
BEGIN
60-
VALUE "CompanyName", "Python Software Foundation\0"
38+
VALUE "CompanyName", PYTHON_COMPANY "\0"
6139
VALUE "FileDescription", "Python Core\0"
6240
VALUE "FileVersion", PYTHON_VERSION
6341
VALUE "InternalName", "Python DLL\0"
64-
VALUE "LegalCopyright", "Copyright � 2001-2015 Python Software Foundation. Copyright � 2000 BeOpen.com. Copyright � 1995-2001 CNRI. Copyright � 1991-1995 SMC.\0"
42+
VALUE "LegalCopyright", PYTHON_COPYRIGHT "\0"
6543
VALUE "OriginalFilename", PYTHON_DLL_NAME "\0"
6644
VALUE "ProductName", "Python\0"
6745
VALUE "ProductVersion", PYTHON_VERSION

PC/python_ver_rc.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Resource script for Python core DLL.
2+
// Currently only holds version information.
3+
//
4+
#include "winver.h"
5+
6+
#define PYTHON_COMPANY "Python Software Foundation"
7+
#define PYTHON_COPYRIGHT "Copyright © 2001-2014 Python Software Foundation. Copyright © 2000 BeOpen.com. Copyright © 1995-2001 CNRI. Copyright © 1991-1995 SMC."
8+
9+
#define MS_WINDOWS
10+
#include "modsupport.h"
11+
#include "patchlevel.h"
12+
#ifdef _DEBUG
13+
# include "pythonnt_rc_d.h"
14+
# define PYTHON_DEBUG_EXT "_d"
15+
#else
16+
# include "pythonnt_rc.h"
17+
# define PYTHON_DEBUG_EXT
18+
#endif
19+
20+
/* e.g., 3.3.0a1
21+
* PY_VERSION comes from patchlevel.h
22+
*/
23+
#define PYTHON_VERSION PY_VERSION "\0"
24+
25+
/* 64-bit version number as comma-separated list of 4 16-bit ints */
26+
#if PY_MICRO_VERSION > 64
27+
# error "PY_MICRO_VERSION > 64"
28+
#endif
29+
#if PY_RELEASE_LEVEL > 99
30+
# error "PY_RELEASE_LEVEL > 99"
31+
#endif
32+
#if PY_RELEASE_SERIAL > 9
33+
# error "PY_RELEASE_SERIAL > 9"
34+
#endif
35+
#define PYVERSION64 PY_MAJOR_VERSION, PY_MINOR_VERSION, FIELD3, PYTHON_API_VERSION

0 commit comments

Comments
 (0)