Skip to content

Commit

Permalink
Fix Windows Graphics Capture crash
Browse files Browse the repository at this point in the history
due to missing hidden import `winrt.windows.foundation`
  • Loading branch information
Avasam committed Feb 3, 2025
1 parent 44a4c15 commit 4e08ef5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"yaml.format.printWidth": 100,
"yaml.schemas": {
"https://json.schemastore.org/github-issue-config.json": ".github/ISSUE_TEMPLATE/config.yml"
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.tabSize": 4,
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"windows": {
"options": {
"shell": {
"executable": "powershell",
"executable": "pwsh",
"args": [
"-NoProfile",
"-ExecutionPolicy",
Expand Down
7 changes: 4 additions & 3 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ if ($IsWindows) {
# These are used on Linux
$arguments += @(
# Installed by PyAutoGUI
'--exclude=pyscreeze'
'--exclude=pyscreeze',
# Sometimes installed by other automation/image libraries.
# Keep this exclusion even if nothing currently installs it, to stay future-proof.
'--exclude=PIL')
'--exclude=PIL',
# Hidden import by winrt.windows.graphics.imaging.SoftwareBitmap.create_copy_from_surface_async
'--hidden-import=winrt.windows.foundation')
}
if ($IsLinux) {
$arguments += @(
# Required on the CI for PyWinCtl
'--hidden-import pynput.keyboard._xorg',
'--hidden-import pynput.mouse._xorg')
}

Start-Process -Wait -NoNewWindow pyinstaller -ArgumentList $arguments

If ($IsLinux) {
Expand Down

0 comments on commit 4e08ef5

Please sign in to comment.