mirror of
https://gitlab.com/openlp/packaging.git
synced 2024-12-22 21:12:50 +00:00
Fix up version numbers for InnoSetup and PortableApps
This commit is contained in:
parent
ea2c3b7be1
commit
aa3c2d2f13
@ -148,7 +148,7 @@ class WindowsBuilder(Builder):
|
|||||||
open(os.path.join(config_dir, 'OpenLP.iss'), 'w') as output_file:
|
open(os.path.join(config_dir, 'OpenLP.iss'), 'w') as output_file:
|
||||||
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)
|
content = content.replace('%(display_version)s', self.version.replace('-bzr', '.'))
|
||||||
output_file.write(content)
|
output_file.write(content)
|
||||||
|
|
||||||
def _run_innosetup(self):
|
def _run_innosetup(self):
|
||||||
@ -161,7 +161,7 @@ class WindowsBuilder(Builder):
|
|||||||
self._run_command([self.innosetup_exe, os.path.join(config_dir, 'OpenLP.iss'), '/q'],
|
self._run_command([self.innosetup_exe, os.path.join(config_dir, 'OpenLP.iss'), '/q'],
|
||||||
'Error running InnoSetup')
|
'Error running InnoSetup')
|
||||||
|
|
||||||
def _create_portableapp_directory(self):
|
def _create_portableapp_structure(self):
|
||||||
"""
|
"""
|
||||||
Checks the PortableApp directory structure amd creates
|
Checks the PortableApp directory structure amd creates
|
||||||
missing subdirs
|
missing subdirs
|
||||||
@ -180,12 +180,13 @@ class WindowsBuilder(Builder):
|
|||||||
"""
|
"""
|
||||||
self._print(' Creating PortableApps appinfo file ...')
|
self._print(' Creating PortableApps appinfo file ...')
|
||||||
config_dir = os.path.dirname(self.config_path)
|
config_dir = os.path.dirname(self.config_path)
|
||||||
portable_version = self.version.replace('-', '.') + '.0' * (3 - self.version.count('.'))
|
self.portable_version = self.version.replace('-bzr', '.')
|
||||||
|
self.portable_version = self.portable_version + '.0' * (3 - self.portable_version.count('.'))
|
||||||
with open(os.path.join(config_dir, 'appinfo.ini.default'), 'r') as input_file, \
|
with open(os.path.join(config_dir, 'appinfo.ini.default'), 'r') as input_file, \
|
||||||
open(os.path.join(self.portable_dest_path, 'App', 'Appinfo', 'appinfo.ini'), 'w') as output_file:
|
open(os.path.join(self.portable_dest_path, 'App', 'Appinfo', 'appinfo.ini'), 'w') as output_file:
|
||||||
content = input_file.read()
|
content = input_file.read()
|
||||||
content = content.replace('%(display_version)s', self.version)
|
content = content.replace('%(display_version)s', self.version)
|
||||||
content = content.replace('%(package_version)s', portable_version)
|
content = content.replace('%(package_version)s', self.portable_version)
|
||||||
output_file.write(content)
|
output_file.write(content)
|
||||||
|
|
||||||
def _run_portableapp_builder(self):
|
def _run_portableapp_builder(self):
|
||||||
@ -203,9 +204,9 @@ class WindowsBuilder(Builder):
|
|||||||
self._print(' Creating PortableApps build directory')
|
self._print(' Creating PortableApps build directory')
|
||||||
# Copy the contents of the OpenLPPortable directory to the portable
|
# Copy the contents of the OpenLPPortable directory to the portable
|
||||||
# build directory.
|
# build directory.
|
||||||
self._create_portableapp_directory()
|
|
||||||
self._create_portableapps_appinfo_file()
|
|
||||||
dir_util.copy_tree(self.portable_source_path, self.portable_dest_path)
|
dir_util.copy_tree(self.portable_source_path, self.portable_dest_path)
|
||||||
|
self._create_portableapp_structure()
|
||||||
|
self._create_portableapps_appinfo_file()
|
||||||
# Copy distribution files to portableapp build directory.
|
# Copy distribution files to portableapp build directory.
|
||||||
self._print(' Copying distribution files')
|
self._print(' Copying distribution files')
|
||||||
portable_app_path = os.path.join(self.portable_dest_path, 'App', 'OpenLP')
|
portable_app_path = os.path.join(self.portable_dest_path, 'App', 'OpenLP')
|
||||||
@ -225,7 +226,7 @@ class WindowsBuilder(Builder):
|
|||||||
self._run_command([self.portableinstaller_exe, self.portable_dest_path],
|
self._run_command([self.portableinstaller_exe, self.portable_dest_path],
|
||||||
'Error running PortableApps Installer')
|
'Error running PortableApps Installer')
|
||||||
portable_app = os.path.abspath(os.path.join(self.portable_dest_path, '..',
|
portable_app = os.path.abspath(os.path.join(self.portable_dest_path, '..',
|
||||||
'OpenLPPortable_%s.paf.exe' % self.version.replace('-', '.')))
|
'OpenLPPortable_%s.paf.exe' % self.portable_version))
|
||||||
if os.path.exists(portable_app):
|
if os.path.exists(portable_app):
|
||||||
move(portable_app, os.path.abspath(os.path.join(self.dist_path, '..')))
|
move(portable_app, os.path.abspath(os.path.join(self.dist_path, '..')))
|
||||||
self._print(' PortableApp build complete')
|
self._print(' PortableApp build complete')
|
||||||
|
Loading…
Reference in New Issue
Block a user