diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-10-09 11:46:14 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-10-09 11:33:21 +0000 |
commit | 57ae75061da05b6526987f3f7183ed387a292c97 (patch) | |
tree | d2057152d1ae21c34fefd609e50e30d8ae6faacc | |
parent | 9a69a05f9b22d6851535e02c8db47f3a1c4ea4ea (diff) | |
download | qt-creator-57ae75061da05b6526987f3f7183ed387a292c97.tar.gz |
Allow packaging additional 7zips in the installer
Change-Id: I435602671ef5cde46580d4ca383930951765ebde
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
-rw-r--r-- | dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs | 9 | ||||
-rwxr-xr-x | scripts/packageIfw.py | 30 |
2 files changed, 29 insertions, 10 deletions
diff --git a/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs b/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs index 6f9d59dcec..e78f3f6dac 100644 --- a/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs +++ b/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs @@ -47,6 +47,15 @@ Component.prototype.loaded = function() } } +Component.prototype.createOperationsForArchive = function(archive) +{ + // if there are additional plugin 7zips, these must be extracted in .app/Contents on OS X + if (systemInfo.productType !== "osx" || archive.indexOf('qtcreator.7z') !== -1) + component.addOperation("Extract", archive, "@TargetDir@"); + else + component.addOperation("Extract", archive, "@TargetDir@/Qt Creator.app/Contents"); +} + Component.prototype.beginInstallation = function() { component.qtCreatorBinaryPath = installer.value("TargetDir"); diff --git a/scripts/packageIfw.py b/scripts/packageIfw.py index 67aba26a5e..0d7581d2f1 100755 --- a/scripts/packageIfw.py +++ b/scripts/packageIfw.py @@ -38,7 +38,7 @@ import shutil import inspect def usage(): - print('Usage: %s [-v|--version-string=versionstring] [-i|--installer-path=/path/to/installerfw] [-a|--archive=archive.7z] <outputname>' % os.path.basename(sys.argv[0])) + print('Usage: %s [-v|--version-string=versionstring] [-i|--installer-path=/path/to/installerfw] [-a|--archive=archive.7z] [-d|--debug] <outputname>' % os.path.basename(sys.argv[0])) def substitute_file(infile, outfile, substitutions): with open(infile, 'r') as f: @@ -53,7 +53,7 @@ def ifw_template_dir(): def main(): try: - opts, args = getopt.gnu_getopt(sys.argv[1:], 'hv:i:a:', ['help', 'version-string=', 'installer-path=', 'archive']) + opts, args = getopt.gnu_getopt(sys.argv[1:], 'hv:i:a:d', ['help', 'version-string=', 'installer-path=', 'archive', 'debug']) except: usage() sys.exit(2) @@ -64,7 +64,8 @@ def main(): version = '' ifw_location = '' - archive = '' + archives = [] + debug = False for o, a in opts: if o in ('-h', '--help'): usage() @@ -74,7 +75,9 @@ def main(): if o in ('-i', '--installer-path'): ifw_location = a if o in ('-a', '--archive'): - archive = a + archives.append(a) + if o in ('-d', '--debug'): + debug = True if (version == ''): raise Exception('Version not specified (--version-string)!') @@ -82,8 +85,8 @@ def main(): if (ifw_location == ''): raise Exception('Installer framework location not specified (--installer-path)!') - if (archive == ''): - raise Exception('Archive not specified (--archive)!') + if not archives: + raise ValueError('No archive(s) specified (--archive)!') installer_name = args[0] config_postfix = '' @@ -100,12 +103,15 @@ def main(): try: temp_dir = tempfile.mkdtemp() except: - raise Exception('Failed to create a temporary directory!') + raise IOError('Failed to create a temporary directory!') + if debug: + print('Working directory: {0}'.format(temp_dir)) try: substs = {} substs['version'] = version substs['date'] = datetime.date.today().isoformat() + substs['archives'] = ','.join(archives) template_dir = ifw_template_dir() out_config_dir = os.path.join(temp_dir,'config') @@ -127,13 +133,17 @@ def main(): data_path = os.path.join(out_packages_dir, 'org.qtproject.qtcreator.application', 'data') if not os.path.exists(data_path): os.makedirs(data_path) - shutil.copy(archive, data_path) + for archive in archives: + shutil.copy(archive, data_path) ifw_call = [os.path.join(ifw_location, 'bin', 'binarycreator'), '-c', os.path.join(out_config_dir, config_name), '-p', out_packages_dir, installer_name, '--offline-only' ] + if debug: + ifw_call.append('-v') subprocess.check_call(ifw_call, stderr=subprocess.STDOUT) finally: - print('Cleaning up...') - shutil.rmtree(temp_dir) + if not debug: + print('Cleaning up...') + shutil.rmtree(temp_dir) print('Done.') if __name__ == '__main__': |