Detect if OpenLP is running as a frozen app, and set the VLC environment variable

This commit is contained in:
Raoul Snyman 2019-04-11 14:55:57 -07:00
parent 288e77e155
commit f1f313ed5f

View File

@ -28,6 +28,7 @@ logging and a plugin framework are contained within the openlp.core module.
""" """
import argparse import argparse
import logging import logging
import os
import sys import sys
import time import time
from datetime import datetime from datetime import datetime
@ -344,6 +345,9 @@ def main(args=None):
# Bug #1018855: Set the WM_CLASS property in X11 # Bug #1018855: Set the WM_CLASS property in X11
if not is_win() and not is_macosx(): if not is_win() and not is_macosx():
qt_args.append('OpenLP') 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 # Initialise the resources
qInitResources() qInitResources()
# Now create and actually run the application. # Now create and actually run the application.