diff options
Diffstat (limited to 'packaging/win/meshbay-node.spec')
| -rw-r--r-- | packaging/win/meshbay-node.spec | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/packaging/win/meshbay-node.spec b/packaging/win/meshbay-node.spec index f1f994d..324d8c1 100644 --- a/packaging/win/meshbay-node.spec +++ b/packaging/win/meshbay-node.spec @@ -12,6 +12,44 @@ # frozen run raises ModuleNotFoundError — that is the expected way this list grows. from PyInstaller.utils.hooks import collect_all, copy_metadata +from PyInstaller.utils.win32.versioninfo import ( + FixedFileInfo, + StringFileInfo, + StringStruct, + StringTable, + VarFileInfo, + VarStruct, + VSVersionInfo, +) + +# Version resource stamped into meshbay-node.exe so the Windows Firewall prompt, +# Task Manager and the file's Properties read "MeshBay Node" rather than a bare +# exe name. Read from the installed package so it cannot drift from pyproject. +try: + from importlib.metadata import version as _pkg_version + + _ver = _pkg_version("meshbay-node") +except Exception: + _ver = "0.0.0" +_vtuple = tuple( + int(p) for p in (_ver.split("+")[0].split(".") + ["0", "0", "0", "0"])[:4] +) + +_version_info = VSVersionInfo( + ffi=FixedFileInfo(filevers=_vtuple, prodvers=_vtuple), + kids=[ + StringFileInfo([StringTable("040904B0", [ + StringStruct("CompanyName", "MeshBay"), + StringStruct("FileDescription", "MeshBay Node"), + StringStruct("FileVersion", _ver), + StringStruct("InternalName", "meshbay-node"), + StringStruct("OriginalFilename", "meshbay-node.exe"), + StringStruct("ProductName", "MeshBay Node"), + StringStruct("ProductVersion", _ver), + ])]), + VarFileInfo([VarStruct("Translation", [0x0409, 1200])]), + ], +) # Packages taken in full: data files + shared libs + every submodule. COLLECT_ALL = [ @@ -114,6 +152,7 @@ exe = EXE( codesign_identity=None, entitlements_file=None, icon="../../packages/meshbay-client/build/icon.ico", + version=_version_info, ) coll = COLLECT( exe, |