1
0
mirror of https://gitlab.com/openlp/packaging.git synced 2024-12-22 13:02:50 +00:00

No need to find 32-bit Program Files because OpenLP is 64-bit; Only copy MuPDF if PyMuPDF is not installed; Use the proper Program Files directory for VLC

This commit is contained in:
Raoul Snyman 2019-05-15 15:39:12 -07:00
parent cccbb6d246
commit e88f99966e

View File

@ -357,11 +357,7 @@ class WindowsBuilder(Builder):
super().setup_system_paths() super().setup_system_paths()
self.python_root = os.path.dirname(self.python) self.python_root = os.path.dirname(self.python)
self.site_packages = os.path.join(self.python_root, 'Lib', 'site-packages') self.site_packages = os.path.join(self.python_root, 'Lib', 'site-packages')
# Default program_files to 'Program Files (x86)' - the folder for 32-bit programs on 64-bit systems, if that self.program_files = os.getenv('PROGRAMFILES')
# does not exists the host system is 32-bit so fallback to 'Program Files'.
self.program_files = os.getenv('PROGRAMFILES(x86)')
if not self.program_files:
self.program_files = os.getenv('PROGRAMFILES')
self._print_verbose(' {:.<20}: {}'.format('site packages: ', self.site_packages)) self._print_verbose(' {:.<20}: {}'.format('site packages: ', self.site_packages))
self._print_verbose(' {:.<20}: {}'.format('program files: ', self.program_files)) self._print_verbose(' {:.<20}: {}'.format('program files: ', self.program_files))
@ -398,12 +394,19 @@ class WindowsBuilder(Builder):
copy(os.path.join(self.helpfile_path, 'OpenLP.chm'), os.path.join(self.dist_path, 'OpenLP.chm')) copy(os.path.join(self.helpfile_path, 'OpenLP.chm'), os.path.join(self.dist_path, 'OpenLP.chm'))
else: else:
self._print('... WARNING: Windows help file not found') self._print('... WARNING: Windows help file not found')
self._print_verbose('... mutool.exe') try:
if self.mutool_exe and os.path.isfile(self.mutool_exe): # Check if PyMuPDF is installed
copy(os.path.join(self.mutool_exe), os.path.join(self.dist_path, 'mutool.exe')) import fitz # noqa
else: HAS_PYMUPDF = True
self._print('... WARNING: mutool.exe not found') except ImportError:
vlc_path = os.path.join('C:\\', 'Program Files', 'VideoLAN', 'VLC') HAS_PYMUPDF = False
if not HAS_PYMUPDF:
self._print_verbose('... mutool.exe')
if self.mutool_exe and os.path.isfile(self.mutool_exe):
copy(os.path.join(self.mutool_exe), os.path.join(self.dist_path, 'mutool.exe'))
else:
self._print('... WARNING: mutool.exe not found')
vlc_path = os.path.join(self.program_files, 'VideoLAN', 'VLC')
for fname in ['libvlc.dll', 'libvlccore.dll']: for fname in ['libvlc.dll', 'libvlccore.dll']:
self._print_verbose('... {}'.format(fname)) self._print_verbose('... {}'.format(fname))
copy(os.path.join(vlc_path, fname), os.path.join(self.dist_path, fname)) copy(os.path.join(vlc_path, fname), os.path.join(self.dist_path, fname))