Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4442 Fix manifest and embed it #4444

Merged
merged 1 commit into from
Dec 17, 2024
Merged

#4442 Fix manifest and embed it #4444

merged 1 commit into from
Dec 17, 2024

Conversation

GUAN-Xihao
Copy link
Contributor

@GUAN-Xihao GUAN-Xihao commented Dec 16, 2024

Fix #4442, at Windows 11 Platform the DPI Aware is not affected.

  1. it changes manifest and adds the required assemblyIdentity part. [1]
  2. And fixed gdiScaling, disableWindowFiltering, highResolutionScrollingAware, printerDriverIsolation to correct namespace. [1]
  3. Modify build.py and build.sh to replace XPRA_ZERO_PADDED_VERSION with the currentnt version.
  4. Specify the manifest location while using cx_Freeze to generate exe files. [2]

[1]: Application manifests https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests
[2]: cx_Freeze.Executable manifest https://cx-freeze.readthedocs.io/en/latest/setup_script.html

@totaam totaam merged commit 69b6742 into Xpra-org:master Dec 17, 2024
@totaam
Copy link
Collaborator

totaam commented Dec 17, 2024

I'm getting errors with this change:

Traceback (most recent call last):
  File "E:/xpra/setup.py", line 1905, in <module>
    add_gui_exe("fs/bin/xpra",                         "xpra.ico",         "Xpra")
  File "E:/xpra/setup.py", line 1898, in add_gui_exe
    add_exe(script, icon, base_name, base="Win32GUI")
  File "E:/xpra/setup.py", line 1885, in add_exe
    executables.append(Executable(
                       ^^^^^^^^^^^
  File "C:/msys64/mingw64/lib/python3.12/site-packages/cx_Freeze/executable.py", line 54, in __init__
    self.manifest = manifest
    ^^^^^^^^^^^^^
  File "C:/msys64/mingw64/lib/python3.12/site-packages/cx_Freeze/executable.py", line 177, in manifest
    self._manifest = name.read_text(encoding="utf-8")
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:/msys64/mingw64/lib/python3.12/pathlib.py", line 1027, in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:/msys64/mingw64/lib/python3.12/pathlib.py", line 1013, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'dist/Xpra.exe.manifest'

@GUAN-Xihao
Copy link
Contributor Author

I'm getting errors with this change:

FileNotFoundError: [Errno 2] No such file or directory: 'dist/Xpra.exe.manifest'

The dist/Xpra.exe.manifest should be generated by BUILD.sh / BUILD.py.

I am thinking whether we should move add_manifests() to before install_exe(args)
https://github.com/Xpra-org/xpra/blob/master/packaging/MSWindows/BUILD.py#L1332
https://github.com/Xpra-org/xpra/blob/master/packaging/MSWindows/BUILD.py#L1350

Could you suggest? It might be I have dirty cached local dists/ and messed up the manifest and exe generating sequence.

@totaam
Copy link
Collaborator

totaam commented Dec 17, 2024

I am thinking whether we should move add_manifests() to before install_exe(args)

It must be if cx_Freeze needs the manifest files to run.

@GUAN-Xihao
Copy link
Contributor Author

The manifest requirement is added by this PR.
https://github.com/GUAN-Xihao/xpra/blob/34e02f77055da41410346653faeccffa758019e6/setup.py#L1890

So we may need to do that. Not tested yet. And I am not in computer currently.
Would you mind to help to swap the sequence?

@GUAN-Xihao
Copy link
Contributor Author

By the way, I would like to explain more.

After Windows Vista, Windows will use embeded manifest in higher priority than side-by-side Xpra.exe.manifest file.

Since the shipped Xpra V6.2.2 exe embeded default manifest, the external side-by-side manifest will not affect.

Therefore I add this manifest embeding. And cx_Freezr document mentioned that will be ignore if not Windows platform. See [2].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MSWindows Manifest is invalid
2 participants