dll filer

This commit is contained in:
2026-04-24 09:31:03 +02:00
parent 25c2dd9e78
commit 09412073cd
2 changed files with 33 additions and 8 deletions

View File

@@ -2,10 +2,32 @@
block_cipher = None
import os, glob
# Find VLC installation
VLC_PATH = None
for _p in [
r'C:\Program Files\VideoLAN\VLC',
r'C:\Program Files (x86)\VideoLAN\VLC',
]:
if os.path.exists(os.path.join(_p, 'libvlc.dll')):
VLC_PATH = _p
break
VLC_BINARIES = []
if VLC_PATH:
VLC_BINARIES = [
(os.path.join(VLC_PATH, 'libvlc.dll'), '.'),
(os.path.join(VLC_PATH, 'libvlccore.dll'), '.'),
]
for _dll in glob.glob(os.path.join(VLC_PATH, 'plugins', '**', '*.dll'), recursive=True):
_rel = os.path.relpath(os.path.dirname(_dll), VLC_PATH)
VLC_BINARIES.append((_dll, _rel))
a = Analysis(
['main.py'],
pathex=['.'],
binaries=[],
binaries=VLC_BINARIES,
datas=[
('translations', 'translations'),
],
@@ -20,7 +42,7 @@ a = Analysis(
'ui.scan_worker', 'ui.bpm_worker', 'ui.tag_editor',
'ui.settings_dialog', 'ui.playlist_browser',
'ui.playlist_info_dialog', 'ui.dance_info_dialog',
'ui.dance_picker_dialog', 'ui.share_dialog',
'ui.dance_picker_dialog', 'ui.alt_dance_picker_dialog', 'ui.share_dialog',
'ui.register_dialog',
'player.player',
'local.local_db', 'local.scanner', 'local.file_watcher',

View File

@@ -8,13 +8,16 @@ Start:
import sys
import os
if getattr(sys, 'frozen', False):
# Kørende som PyInstaller .exe — sæt VLC sti til app-mappen
_app_dir = os.path.dirname(sys.executable)
os.environ.setdefault("VLC_PLUGIN_PATH", os.path.join(_app_dir, "plugins"))
APP_VERSION = "0.9.5"
# VLC setup — skal ske FØR vlc importeres
if getattr(sys, 'frozen', False):
_app_dir = os.path.dirname(sys.executable)
_libvlc = os.path.join(_app_dir, 'libvlc.dll')
if os.path.exists(_libvlc):
os.environ['PYTHON_VLC_LIB_PATH'] = _libvlc
os.environ['VLC_PLUGIN_PATH'] = os.path.join(_app_dir, 'plugins')
sys.path.insert(0, os.path.dirname(__file__))
from app_logger import setup_logging
@@ -63,4 +66,4 @@ def main():
if __name__ == "__main__":
main()
main()