From f1f313ed5f8d06dfe7de1715d566b487726ecc8e Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 11 Apr 2019 14:55:57 -0700 Subject: [PATCH] Detect if OpenLP is running as a frozen app, and set the VLC environment variable --- openlp/core/app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openlp/core/app.py b/openlp/core/app.py index 6aa3d9cb4..cdd023136 100644 --- a/openlp/core/app.py +++ b/openlp/core/app.py @@ -28,6 +28,7 @@ logging and a plugin framework are contained within the openlp.core module. """ import argparse import logging +import os import sys import time from datetime import datetime @@ -344,6 +345,9 @@ def main(args=None): # Bug #1018855: Set the WM_CLASS property in X11 if not is_win() and not is_macosx(): qt_args.append('OpenLP') + # Set the libvlc environment variable if we're frozen + if getattr(sys, 'frozen', False): + os.environ['PYTHON_VLC_LIB_PATH'] = str(AppLocation.get_directory(AppLocation.AppDir)) # Initialise the resources qInitResources() # Now create and actually run the application.