Fix copying Qt translations and add x86 or x64 to the bundled files.

This commit is contained in:
Tomas Groth 2019-03-08 22:20:20 +01:00
parent b32cc6d693
commit 39a14d029d
3 changed files with 16 additions and 7 deletions

View File

@ -134,6 +134,7 @@ class WindowsBuilder(Builder):
content = input_file.read() content = input_file.read()
content = content.replace('%(branch)s', self.branch_path) content = content.replace('%(branch)s', self.branch_path)
content = content.replace('%(display_version)s', self.version.replace('-bzr', '.')) content = content.replace('%(display_version)s', self.version.replace('-bzr', '.'))
content = content.replace('%(arch)s', self.arch)
output_file.write(content) output_file.write(content)
def _run_innosetup(self): def _run_innosetup(self):
@ -176,6 +177,7 @@ class WindowsBuilder(Builder):
content = input_file.read() content = input_file.read()
content = content.replace('%(display_version)s', self.portable_version) content = content.replace('%(display_version)s', self.portable_version)
content = content.replace('%(package_version)s', self.portable_version) content = content.replace('%(package_version)s', self.portable_version)
content = content.replace('%(arch)s', self.arch)
output_file.write(content) output_file.write(content)
def _run_portableapp_builder(self): def _run_portableapp_builder(self):
@ -252,7 +254,7 @@ class WindowsBuilder(Builder):
""" """
Return the path to Qt translation files on macOS Return the path to Qt translation files on macOS
""" """
return os.path.join(self.site_packages, 'PyQt5', 'translations') return os.path.join(self.site_packages, 'PyQt5', 'Qt', 'translations')
def add_extra_args(self, parser): def add_extra_args(self, parser):
""" """
@ -285,6 +287,13 @@ class WindowsBuilder(Builder):
self.helpfile_path = os.path.join(self.manual_build_path, 'htmlhelp') self.helpfile_path = os.path.join(self.manual_build_path, 'htmlhelp')
self.winres_path = os.path.join(self.branch_path, 'resources', 'windows') self.winres_path = os.path.join(self.branch_path, 'resources', 'windows')
def setup_extra(self):
"""
Extra setup to run
"""
# Detect python instance bit size
self.arch = 'x86' if sys.maxsize == 0x7fffffff else 'x64'
def copy_extra_files(self): def copy_extra_files(self):
""" """
Copy all the Windows-specific files. Copy all the Windows-specific files.
@ -334,9 +343,8 @@ class WindowsBuilder(Builder):
Return a list of any extra parameters we wish to use Return a list of any extra parameters we wish to use
""" """
parameters = [] parameters = []
# Detect python instance bit size dll_path = '{pf}\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\{arch}\\*.dll'.format(pf=self.program_files,
arch = 'x86' if sys.maxsize == 0x7fffffff else 'x64' arch=self.arch)
dll_path = '{pf}\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\{arch}\\*.dll'.format(pf=self.program_files, arch=arch)
# Finds the UCRT DDLs available from the Windows 10 SDK # Finds the UCRT DDLs available from the Windows 10 SDK
for binary in glob.glob(dll_path): for binary in glob.glob(dll_path):
parameters.append('--add-binary') parameters.append('--add-binary')

View File

@ -7,6 +7,7 @@
#define AppPublisher "OpenLP Developers" #define AppPublisher "OpenLP Developers"
#define AppURL "http://openlp.org/" #define AppURL "http://openlp.org/"
#define AppExeName "OpenLP.exe" #define AppExeName "OpenLP.exe"
#define Arch "%(arch)"
#define FileHandle FileOpen("%(branch)s\dist\OpenLP\.version") #define FileHandle FileOpen("%(branch)s\dist\OpenLP\.version")
#define FileLine FileRead(FileHandle) #define FileLine FileRead(FileHandle)
@ -30,7 +31,7 @@ DefaultGroupName={#AppName}
AllowNoIcons=true AllowNoIcons=true
LicenseFile=LICENSE.txt LicenseFile=LICENSE.txt
OutputDir=%(branch)s\dist\ OutputDir=%(branch)s\dist\
OutputBaseFilename=OpenLP-{#RealVersion}-setup OutputBaseFilename=OpenLP-{#RealVersion}-{#Arch}-setup
Compression=lzma/Max Compression=lzma/Max
SolidCompression=true SolidCompression=true
SetupIconFile=OpenLP.ico SetupIconFile=OpenLP.ico

View File

@ -18,8 +18,8 @@ Freeware=true
CommercialUse=true CommercialUse=true
[Version] [Version]
DisplayVersion=%(display_version)s DisplayVersion=%(display_version)s-%(arch)s
PackageVersion=%(package_version)s PackageVersion=%(package_version)s-%(arch)s
[Control] [Control]
Icons=1 Icons=1