Skip to content

Commit

Permalink
Try to set bundle_dir for pyinstaller
Browse files Browse the repository at this point in the history
  • Loading branch information
R-YaTian committed Sep 26, 2024
1 parent afa57e0 commit 9295602
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion TWLMagician.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# coding=utf-8

# TWLMagician
# Version 1.2.8
# Version 1.2.9
# Author: R-YaTian
# Original "HiyaCFW-Helper" Author: mondul <[email protected]>

Expand Down Expand Up @@ -2462,6 +2462,11 @@ def transfer_main(self):
printl(_('TWLMagician启动中...'))

selfPath = path.dirname(path.abspath(argv[0]))
if sysname == 'Darwin':
import sys
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
bundle_dir = getattr(sys, '_MEIPASS', path.abspath(path.dirname(__file__)))
selfPath = bundle_dir
fatcat = path.join(selfPath, sysname, 'fatcat')
_7za = path.join(selfPath, sysname, '7za')
twltool = path.join(selfPath, sysname, 'twltool')
Expand Down

0 comments on commit 9295602

Please sign in to comment.