Skip to content

Commit 5d5eb06

Browse files
committed
fix images path
1 parent 07e761f commit 5d5eb06

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ jobs:
174174
if: ${{ startsWith(matrix.target, 'windows') }}
175175
working-directory: fujinet-pc-launcher
176176
shell: pwsh
177-
run: pyinstaller --clean --onedir --noconfirm --noconsole --python-option u --name launcher --icon launcher\images\launcher-bg.ico --add-data "launcher\images;images" launcher\__main__.py
178-
177+
run: pyinstaller --clean --onedir --noconfirm --noconsole --python-option u --name launcher --icon launcher\images\launcher-bg.ico --add-data 'launcher\images;images' launcher\__main__.py
179178
- name: '🚧 [macOS] Build FujiNet-PC Launcher'
180179
if: ${{ startsWith(matrix.target, 'macos') }}
181180
working-directory: fujinet-pc-launcher

launcher/config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ def __init__(self) -> None:
8686

8787

8888
def image_path(self, fname):
89-
return os.path.join(self.launcher_dir, "images", fname)
89+
if getattr(sys, 'frozen', False):
90+
base = getattr(sys, '_MEIPASS', os.path.dirname(sys.executable))
91+
else:
92+
base = self.launcher_rundir
93+
return os.path.join(base, "images", fname)
9094

9195
def print_dir_info(self):
9296
print("launcher dir:", self.launcher_dir)

0 commit comments

Comments
 (0)