forked from qt-creator/qt-creator
Installer: Support different display version than component version
The component version must be numeric, but we want to display e.g. Qt Creator 4.0.0-beta1 in the installer title. The change adds a -d parameter to the script and adds corresponding replacement variables. Display version falls back to component version. Change-Id: Ia8bcd05444e280f8a44ab321b043f4031725600d Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<Installer>
|
||||
<Name>Qt Creator</Name>
|
||||
<Version>{version}</Version>
|
||||
<Title>Qt Creator {version}</Title>
|
||||
<Title>Qt Creator {display_version}</Title>
|
||||
<Publisher>Qt Project</Publisher>
|
||||
<ProductUrl>http://www.qt.io</ProductUrl>
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
<WizardDefaultHeight>520</WizardDefaultHeight>
|
||||
<MaintenanceToolName>QtCreatorUninstaller</MaintenanceToolName>
|
||||
<!-- @homeDir@ and @rootDir@ are some of the supported vars -->
|
||||
<TargetDir>@homeDir@/qtcreator-{version}</TargetDir>
|
||||
<AdminTargetDir>/opt/qtcreator-{version}</AdminTargetDir>
|
||||
<TargetDir>@homeDir@/qtcreator-{display_version}</TargetDir>
|
||||
<AdminTargetDir>/opt/qtcreator-{display_version}</AdminTargetDir>
|
||||
</Installer>
|
||||
|
4
dist/installer/ifw/config/config-mac.xml.in
vendored
4
dist/installer/ifw/config/config-mac.xml.in
vendored
@@ -2,7 +2,7 @@
|
||||
<Installer>
|
||||
<Name>Qt Creator</Name>
|
||||
<Version>{version}</Version>
|
||||
<Title>Qt Creator {version}</Title>
|
||||
<Title>Qt Creator {display_version}</Title>
|
||||
<Publisher>Qt Project</Publisher>
|
||||
<ProductUrl>http://www.qt.io</ProductUrl>
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
<WizardDefaultHeight>560</WizardDefaultHeight>
|
||||
<MaintenanceToolName>Uninstall Qt Creator</MaintenanceToolName>
|
||||
<!-- @homeDir@ and @rootDir@ are some of the supported vars -->
|
||||
<TargetDir>@homeDir@/Applications/Qt Creator {version}</TargetDir>
|
||||
<TargetDir>@homeDir@/Applications/Qt Creator {display_version}</TargetDir>
|
||||
<AllowSpaceInPath>true</AllowSpaceInPath>
|
||||
</Installer>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<Installer>
|
||||
<Name>Qt Creator</Name>
|
||||
<Version>{version}</Version>
|
||||
<Title>Qt Creator {version}</Title>
|
||||
<Title>Qt Creator {display_version}</Title>
|
||||
<Publisher>Qt Project</Publisher>
|
||||
<ProductUrl>http://www.qt.io</ProductUrl>
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
<WizardDefaultHeight>560</WizardDefaultHeight>
|
||||
<MaintenanceToolName>QtCreatorUninst</MaintenanceToolName>
|
||||
<!-- @homeDir@ and @rootDir@ are some of the supported vars -->
|
||||
<TargetDir>@rootDir@/Qt/qtcreator-{version}</TargetDir>
|
||||
<TargetDir>@rootDir@/Qt/qtcreator-{display_version}</TargetDir>
|
||||
<StartMenuDir>Qt Creator</StartMenuDir>
|
||||
</Installer>
|
||||
|
@@ -36,7 +36,7 @@ import shutil
|
||||
import inspect
|
||||
|
||||
def usage():
|
||||
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]))
|
||||
print('Usage: %s [-v|--version-string=versionstring] [-d|--display-version=versionstring] [-i|--installer-path=/path/to/installerfw] [-a|--archive=archive.7z] [--debug] <outputname>' % os.path.basename(sys.argv[0]))
|
||||
|
||||
def substitute_file(infile, outfile, substitutions):
|
||||
with open(infile, 'r') as f:
|
||||
@@ -51,7 +51,7 @@ def ifw_template_dir():
|
||||
|
||||
def main():
|
||||
try:
|
||||
opts, args = getopt.gnu_getopt(sys.argv[1:], 'hv:i:a:d', ['help', 'version-string=', 'installer-path=', 'archive', 'debug'])
|
||||
opts, args = getopt.gnu_getopt(sys.argv[1:], 'hv:d:i:a:', ['help', 'version-string=', 'display-version=', 'installer-path=', 'archive', 'debug'])
|
||||
except:
|
||||
usage()
|
||||
sys.exit(2)
|
||||
@@ -61,6 +61,7 @@ def main():
|
||||
sys.exit(2)
|
||||
|
||||
version = ''
|
||||
display_version = ''
|
||||
ifw_location = ''
|
||||
archives = []
|
||||
debug = False
|
||||
@@ -70,16 +71,21 @@ def main():
|
||||
sys.exit(0)
|
||||
if o in ('-v', '--version-string'):
|
||||
version = a
|
||||
if o in ['-d', '--display-version']:
|
||||
display_version = a
|
||||
if o in ('-i', '--installer-path'):
|
||||
ifw_location = a
|
||||
if o in ('-a', '--archive'):
|
||||
archives.append(a)
|
||||
if o in ('-d', '--debug'):
|
||||
if o in ['--debug']:
|
||||
debug = True
|
||||
|
||||
if (version == ''):
|
||||
raise Exception('Version not specified (--version-string)!')
|
||||
|
||||
if not display_version:
|
||||
display_version = version
|
||||
|
||||
if (ifw_location == ''):
|
||||
raise Exception('Installer framework location not specified (--installer-path)!')
|
||||
|
||||
@@ -108,6 +114,7 @@ def main():
|
||||
try:
|
||||
substs = {}
|
||||
substs['version'] = version
|
||||
substs['display_version'] = display_version
|
||||
substs['date'] = datetime.date.today().isoformat()
|
||||
substs['archives'] = ','.join(archives)
|
||||
|
||||
|
Reference in New Issue
Block a user