mirror of
https://gitlab.com/openlp/packaging.git
synced 2024-12-22 04:52: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:
|
||||
content = input_file.read()
|
||||
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)
|
||||
|
||||
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'],
|
||||
'Error running InnoSetup')
|
||||
|
||||
def _create_portableapp_directory(self):
|
||||
def _create_portableapp_structure(self):
|
||||
"""
|
||||
Checks the PortableApp directory structure amd creates
|
||||
missing subdirs
|
||||
@ -180,12 +180,13 @@ class WindowsBuilder(Builder):
|
||||
"""
|
||||
self._print(' Creating PortableApps appinfo file ...')
|
||||
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, \
|
||||
open(os.path.join(self.portable_dest_path, 'App', 'Appinfo', 'appinfo.ini'), 'w') as output_file:
|
||||
content = input_file.read()
|
||||
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)
|
||||
|
||||
def _run_portableapp_builder(self):
|
||||
@ -203,9 +204,9 @@ class WindowsBuilder(Builder):
|
||||
self._print(' Creating PortableApps build directory')
|
||||
# Copy the contents of the OpenLPPortable directory to the portable
|
||||
# build directory.
|
||||
self._create_portableapp_directory()
|
||||
self._create_portableapps_appinfo_file()
|
||||
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.
|
||||
self._print(' Copying distribution files')
|
||||
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],
|
||||
'Error running PortableApps Installer')
|
||||
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):
|
||||
move(portable_app, os.path.abspath(os.path.join(self.dist_path, '..')))
|
||||
self._print(' PortableApp build complete')
|
||||
|
Loading…
Reference in New Issue
Block a user