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
1 changed files with 4 additions and 0 deletions

View File

@ -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.