Skip to content

Commit

Permalink
#4442 fix manifest creation
Browse files Browse the repository at this point in the history
it needs to happen before calling cx_Freeze,
and we need one for each executable
  • Loading branch information
totaam committed Dec 17, 2024
1 parent 83c59af commit 0aaa53d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
33 changes: 26 additions & 7 deletions packaging/MSWindows/BUILD.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,22 +770,41 @@ def setup_share(light: bool) -> None:
rm_empty_dir(f"{DIST}/share/icons")


def add_manifests() -> None:
def add_manifests(light: bool) -> None:
step("Adding EXE manifests")
EXES = [
"Bug_Report", "Xpra-Launcher", "Xpra", "Xpra_cmd",
# these are only included in full builds:
"GTK_info", "NativeGUI_info", "Screenshot", "Xpra-Shadow",
"Bug_Report", "Xpra-Launcher", "Xpra", "Xpra_cmd", "Configure", "PDFIUM_Print",
]
if not light:
EXES += [
"Xpra-Shadow", "Xpra-Proxy_cmd", "Xpra-Proxy",
"Python_exec_cmd", "Python_exec_gui",
"Xpra-Launcher-Debug",
"Config_info",
"Python_execfile_cmd", "Python_execfile_gui",
"Print", "NVidia_info", "NvFBC_capture", "CUDA_info",
"Auth_Dialog",
"OpenGL_check",
"GTK_info", "NativeGUI_info", "Screenshot",
"Version_info", "Network_info", "Keymap_info", "Keyboard_info",
"SystemTray_Test", "U2F_Tool",
"SQLite_auth_tool", "SQL_auth_tool",
"Encoding_info", "Path_info", "Feature_info", "NativeGUI_info",
"Xpra_Audio",
"GStreamer_info", "Audio_Devices",
"gst-launch-1.0", "gst-inspect-1.0",
"Webcam_info", "Webcam_Test",
"System-Auth-Test", "LDAP-Auth-Test", "LDAP3-Auth-Test",
"System-Logon-Test", "Events_Test", "GTK_Keyboard_Test",
]
with open('packaging/MSWindows/exe.manifest', 'r') as file:
xml_file_content = file.read()
zero_padded_version = version_info.padded
xml_file_content = xml_file_content.replace("XPRA_ZERO_PADDED_VERSION", zero_padded_version)
with open('packaging/MSWindows/exe.manifest.tmp', 'w') as file:
file.write(xml_file_content)
for exe in EXES:
if os.path.exists(f"{DIST}/{exe}.exe"):
copyfile("packaging/MSWindows/exe.manifest.tmp", f"{DIST}/{exe}.exe.manifest")
copyfile("packaging/MSWindows/exe.manifest.tmp", f"{DIST}/{exe}.exe.manifest")
os.remove('packaging/MSWindows/exe.manifest.tmp')


Expand Down Expand Up @@ -1329,6 +1348,7 @@ def build(args) -> None:
if args.tests:
run_tests()
if args.install:
add_manifests(args.light)
install_exe(args)

if args.fixups:
Expand All @@ -1347,7 +1367,6 @@ def build(args) -> None:
add_numpy(args.numpy)

setup_share(args.light)
add_manifests()
gen_caches()

if args.docs:
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1917,9 +1917,10 @@ def add_service_exe(script, icon, base_name) -> None:
add_gui_exe("fs/libexec/xpra/auth_dialog", "authentication.ico", "Auth_Dialog")
# Console: provide an Xpra_cmd.exe we can run from the cmd.exe shell
add_console_exe("fs/bin/xpra", "xpra_txt.ico", "Xpra_cmd")
add_console_exe("xpra/platform/win32/scripts/exec.py", "python.ico", "Python_exec_cmd")
add_gui_exe("xpra/platform/win32/scripts/exec.py", "python.ico", "Python_exec_gui")
if gstreamer_ENABLED:
if win32_tools_ENABLED:
add_console_exe("xpra/platform/win32/scripts/exec.py", "python.ico", "Python_exec_cmd")
add_gui_exe("xpra/platform/win32/scripts/exec.py", "python.ico", "Python_exec_gui")
if gstreamer_ENABLED and win32_tools_ENABLED:
add_console_exe("packaging/MSWindows/tools/lib_delegate.py", "gstreamer.ico", "gst-launch-1.0")
add_data_files("lib/", (shutil.which("gst-launch-1.0.exe"), ))
add_console_exe("packaging/MSWindows/tools/lib_delegate.py", "gstreamer.ico", "gst-inspect-1.0")
Expand Down

0 comments on commit 0aaa53d

Please sign in to comment.