Skip to content

Commit 4e08ef5

Browse files
committed
Fix Windows Graphics Capture crash
due to missing hidden import `winrt.windows.foundation`
1 parent 44a4c15 commit 4e08ef5

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Diff for: .vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
"editor.defaultFormatter": "redhat.vscode-yaml"
6161
},
6262
"yaml.format.printWidth": 100,
63+
"yaml.schemas": {
64+
"https://json.schemastore.org/github-issue-config.json": ".github/ISSUE_TEMPLATE/config.yml"
65+
},
6366
"[python]": {
6467
"editor.defaultFormatter": "charliermarsh.ruff",
6568
"editor.tabSize": 4,

Diff for: .vscode/tasks.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"windows": {
44
"options": {
55
"shell": {
6-
"executable": "powershell",
6+
"executable": "pwsh",
77
"args": [
88
"-NoProfile",
99
"-ExecutionPolicy",

Diff for: scripts/build.ps1

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,19 @@ if ($IsWindows) {
2020
# These are used on Linux
2121
$arguments += @(
2222
# Installed by PyAutoGUI
23-
'--exclude=pyscreeze'
23+
'--exclude=pyscreeze',
2424
# Sometimes installed by other automation/image libraries.
2525
# Keep this exclusion even if nothing currently installs it, to stay future-proof.
26-
'--exclude=PIL')
26+
'--exclude=PIL',
27+
# Hidden import by winrt.windows.graphics.imaging.SoftwareBitmap.create_copy_from_surface_async
28+
'--hidden-import=winrt.windows.foundation')
2729
}
2830
if ($IsLinux) {
2931
$arguments += @(
3032
# Required on the CI for PyWinCtl
3133
'--hidden-import pynput.keyboard._xorg',
3234
'--hidden-import pynput.mouse._xorg')
3335
}
34-
3536
Start-Process -Wait -NoNewWindow pyinstaller -ArgumentList $arguments
3637

3738
If ($IsLinux) {

0 commit comments

Comments
 (0)