mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-22 09:18:18 +00:00
PICARD-2291: Fix DLL search path in Windows portable install
Move setting the PATH to include the package folder earlier in the PyInstaller hooks.
This commit is contained in:
@@ -67,7 +67,7 @@ if os.path.isfile(ab_extractor_name):
|
||||
|
||||
runtime_hooks = []
|
||||
if os_name == 'Windows':
|
||||
runtime_hooks.append('scripts/pyinstaller/win-console-hook.py')
|
||||
runtime_hooks.append('scripts/pyinstaller/win-startup-hook.py')
|
||||
elif os_name == 'Darwin':
|
||||
runtime_hooks.append('scripts/pyinstaller/macos-library-path-hook.py')
|
||||
if '--onefile' in sys.argv:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# Picard, the next-generation MusicBrainz tagger
|
||||
#
|
||||
# Copyright (C) 2019 Philipp Wolfer
|
||||
# Copyright (C) 2019, 2021 Philipp Wolfer
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
@@ -18,7 +18,8 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
|
||||
from ctypes import windll
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
@@ -26,8 +27,9 @@ import sys
|
||||
# to get stdout / stderr logged to console. This needs to happen before
|
||||
# logging gets imported.
|
||||
# See https://stackoverflow.com/questions/54536/win32-gui-app-that-writes-usage-text-to-stdout-when-invoked-as-app-exe-help
|
||||
if sys.platform == 'win32':
|
||||
from ctypes import windll
|
||||
if windll.kernel32.AttachConsole(-1):
|
||||
sys.stdout = open('CON', 'w')
|
||||
sys.stderr = open('CON', 'w')
|
||||
if windll.kernel32.AttachConsole(-1):
|
||||
sys.stdout = open('CON', 'w')
|
||||
sys.stderr = open('CON', 'w')
|
||||
|
||||
# Ensure bundled DLLs are loaded
|
||||
os.environ['PATH'] = sys._MEIPASS + os.pathsep + os.environ['PATH']
|
||||
@@ -12,9 +12,6 @@ if getattr(sys, 'frozen', False):
|
||||
else:
|
||||
basedir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
if sys.platform == 'win32':
|
||||
os.environ['PATH'] = basedir + ';' + os.environ['PATH']
|
||||
|
||||
try:
|
||||
from picard.tagger import main
|
||||
main(os.path.join(basedir, 'locale'), %(autoupdate)s)
|
||||
|
||||
Reference in New Issue
Block a user