Fix Windows packaging: Switch to onedir mode for stable DLL paths#178
Merged
Fix Windows packaging: Switch to onedir mode for stable DLL paths#178
Conversation
Co-authored-by: WSXYT <102407247+WSXYT@users.noreply.github.com>
Collaborator
|
@copilot wtf???我用的就是windows报错 |
…issue Co-authored-by: WSXYT <102407247+WSXYT@users.noreply.github.com>
Co-authored-by: WSXYT <102407247+WSXYT@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix packaging issue causing errors after restart
Fix PyInstaller packaging: switch to onedir mode to resolve DLL loading failures
Jan 29, 2026
Co-authored-by: WSXYT <102407247+WSXYT@users.noreply.github.com>
Contributor
Author
Copilot
AI
changed the title
Fix PyInstaller packaging: switch to onedir mode to resolve DLL loading failures
Fix: Add cross-platform import compatibility for uiaccess module
Jan 29, 2026
…ution Co-authored-by: WSXYT <102407247+WSXYT@users.noreply.github.com>
Copilot
AI
changed the title
Fix: Add cross-platform import compatibility for uiaccess module
Fix Windows packaging: Switch to onedir mode for stable DLL paths
Jan 29, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Windows packaging issues by converting PyInstaller from onefile to onedir mode, ensuring stable DLL paths and enabling cross-platform packaging.
Changes:
- Converted PyInstaller spec to onedir mode by moving binaries/data to COLLECT block only
- Added platform-conditional imports in uiaccess.py to prevent Windows-only module import errors on other platforms during packaging
- Removed problematic
runtime_tmpdirparameter that caused temporary extraction paths
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Secrandom.spec | Converts PyInstaller configuration from onefile to onedir mode by adding exclude_binaries=True and moving all resources to COLLECT block |
| app/common/windows/uiaccess.py | Adds platform guards for ctypes.wintypes import with dummy types for non-Windows platforms to enable cross-platform packaging |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PyInstaller spec was configured for onefile mode (binaries bundled into exe), causing DLL loading failures on Windows after packaging. The exe extracts to
%TEMP%\_MEIxxxxx\on each run, makingget_app_root()return unstable temporary paths whereuiaccess.dlland other resources cannot be reliably located.Changes
Secrandom.spec: Convert to onedir modeexclude_binaries=Trueto EXE blocka.binaries,a.zipfiles,a.datasfrom EXE argumentsruntime_tmpdirparameterapp/common/windows/uiaccess.py: Add platform-conditional importctypes.wintypesimport withos.name == "nt"checkResult
get_app_root()now returns the stable exe directory instead of temporary extraction paths, ensuring DLL loading and data file access work reliably.Original prompt
创建自 VS Code。
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.