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

[Bug] 设置文件路径在应用程序外可能导致mac应用无法启动 #150

Open
hyrulelinks opened this issue Jun 25, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@hyrulelinks
Copy link

问题描述

在mac上启动应用闪退,无法正常启动,但通过终端运行content/macOS/app的可执行程序可以启动

预期行为

正常启动

实际行为

图标煽动但无法启动

截图或录屏

No response

哔哩哔哩漫画下载器版本号

1.5.1

系统环境

Windows10

日志

因直接运行app可执行程序正常启动,因此没有错误日志

通过源码运行,发现设置文件被放在系统根目录下,而不是在项目目录内,由于mac的沙盒机制,结合我自己的经验,凡是把设置文件放在项目外的python项目打包后的应用都无法正常启动,需要让项目启动时把设置文件放在项目目录内,然后打包应用才能正常启动,建议作者尝试修复这个问题,谢谢!

@hyrulelinks hyrulelinks added the bug Something isn't working label Jun 25, 2024
Copy link

感谢你提交的问题,我会尽快处理! (ᗜ ˰ ᗜ)

@hyrulelinks
Copy link
Author

我自己改动并测试了下,将utils.py第52行改为

elif platform == "darwin":
    appdata_path = os.path.dirname(__file__)

其他不变,则data_path在src文件夹下,然后用pyinstaller打包

结果还是老问题,双击应用图标无法启动,但终端运行app可执行程序是正常启动和运行的,关键是双击无法启动没有报错信息,无从下手到底哪里出了问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant