Files
picard/tagger.py
Philipp Wolfer 2dcf546fc5 Move Windows AttachConsole handling to PyInstaller launch hook
For one this is only needed on Windows when running as GUI app, not when running directly from console. Also this should happen as eraly as possible before anything else gets initialized.
2019-10-15 16:00:13 +02:00

20 lines
435 B
Python
Executable File

#!/usr/bin/env python3
import os
import sys
sys.path.insert(0, '.')
# This is needed to find resources when using pyinstaller
if getattr(sys, 'frozen', False):
basedir = getattr(sys, '_MEIPASS', '')
else:
basedir = os.path.dirname(os.path.abspath(__file__))
if sys.platform == 'win32':
os.environ['PATH'] = basedir + ';' + os.environ['PATH']
from picard.tagger import main
main(os.path.join(basedir, 'locale'), True)