diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-04 14:51:08 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-04 14:51:08 +0200 |
| commit | d04b915580c8ba05beb0943a6fab9b04e12294e4 (patch) | |
| tree | 0fc0dd05ded2e0450602e06fa370c623c65dd2dc /packaging/win/meshbay-node.spec | |
| parent | b53298e339b47c6f0b53ab9fd0cfa3fb7741fc28 (diff) | |
| download | meshbay-d04b915580c8ba05beb0943a6fab9b04e12294e4.tar.gz | |
feat(packaging): stamp the frozen node exe, document Windows networking
meshbay-node.spec now builds a VSVersionInfo (ProductName "MeshBay Node",
version read from the installed package so it tracks pyproject) and passes
it to EXE(version=...). The Windows Firewall prompt, Task Manager and the
file's Properties then show "MeshBay Node" instead of a bare exe name —
the prompt the operator has to answer on first run.
packaging/win/README.md gains a Networking section: the first-run firewall
prompt (allow Private AND Public — a VM adapter is Public), that a flat LAN
needs nothing else, what a routed/multi-subnet LAN additionally needs, the
libvirt-NAT caveat, and a pointer to the packaged Linux firewall profiles.
test_packaging_win.py covers the version resource.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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, |