summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authortjenssen <tim.jenssen@digia.com>2012-09-27 15:45:22 +0200
committerTim Jenssen <tim.jenssen@digia.com>2012-09-28 13:44:37 +0200
commita66d7bf15aabdb04b113b3c6a3fa1b96e4c85fe4 (patch)
tree21444ea4347684592b16cb9196b1f9b82f7fa511 /tools
parentb27243a9970ebac7c64d293cdb914b8fb5332b50 (diff)
add executableExtension to default templateBinary on windows
- and use a better name for binaryEnding -> executableExtension Change-Id: Ie0ab28152f6a9f1c8e93b0fcd2cf3eb2a976122a Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/binarycreator/binarycreator.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/tools/binarycreator/binarycreator.cpp b/tools/binarycreator/binarycreator.cpp
index 0f7523590..31cc54652 100644
--- a/tools/binarycreator/binarycreator.cpp
+++ b/tools/binarycreator/binarycreator.cpp
@@ -410,9 +410,9 @@ static QStringList createBinaryResourceFiles(const QStringList &resources)
static void printUsage()
{
- QString binaryEnding;
+ QString suffix;
#ifdef Q_OS_WIN
- binaryEnding = QLatin1String(".exe");
+ suffix = QLatin1String(".exe");
#endif
const QString appName = QFileInfo(QCoreApplication::applicationFilePath()).fileName();
std::cout << "Usage: " << appName << " [options] target" << std::endl;
@@ -440,13 +440,13 @@ static void printUsage()
std::cout << "Example (offline installer):" << std::endl;
char sep = QDir::separator().toAscii();
std::cout << " " << appName << " --offline-only -c installer-config" << sep << "config.xml -p "
- "packages-directory -t installerbase" << binaryEnding << " SDKInstaller" << binaryEnding << std::endl;
+ "packages-directory -t installerbase" << suffix << " SDKInstaller" << suffix << std::endl;
std::cout << "Creates an offline installer for the SDK, containing all dependencies." << std::endl;
std::cout << std::endl;
std::cout << "Example (online installer):" << std::endl;
std::cout << " " << appName << " -c installer-config" << sep << "config.xml -p packages-directory "
- "-e com.nokia.sdk.qt,com.nokia.qtcreator -t installerbase" << binaryEnding << " SDKInstaller"
- << binaryEnding << std::endl;
+ "-e com.nokia.sdk.qt,com.nokia.qtcreator -t installerbase" << suffix << " SDKInstaller"
+ << suffix << std::endl;
std::cout << std::endl;
std::cout << "Creates an installer for the SDK without qt and qt creator." << std::endl;
std::cout << std::endl;
@@ -552,12 +552,13 @@ int main(int argc, char **argv)
QInstaller::init();
QString templateBinary = QLatin1String("installerbase");
- QString binaryEnding;
+ QString suffix;
#ifdef Q_OS_WIN
- binaryEnding = QLatin1String(".exe");
+ suffix = QLatin1String(".exe");
+ templateBinary = templateBinary + suffix;
#endif
- if (!QFileInfo(templateBinary + binaryEnding).exists())
- templateBinary = QString::fromLatin1("%1/%2").arg(qApp->applicationDirPath(), templateBinary + binaryEnding);
+ if (!QFileInfo(templateBinary).exists())
+ templateBinary = QString::fromLatin1("%1/%2").arg(qApp->applicationDirPath(), templateBinary);
QString target;
QString configFile;
@@ -623,10 +624,10 @@ int main(int argc, char **argv)
return printErrorAndUsageAndExit(QObject::tr("Error: Template parameter missing argument."));
}
templateBinary = *it;
- #ifdef Q_OS_WIN
- if (!templateBinary.endsWith(binaryEnding))
- templateBinary = templateBinary + binaryEnding;
- #endif
+#ifdef Q_OS_WIN
+ if (!templateBinary.endsWith(suffix))
+ templateBinary = templateBinary + suffix;
+#endif
if (!QFileInfo(templateBinary).exists()) {
return printErrorAndUsageAndExit(QObject::tr("Error: Template not found at the specified "
"location."));
@@ -663,10 +664,10 @@ int main(int argc, char **argv)
"are using an old syntax.").arg(*it));
} else if (target.isEmpty()) {
target = *it;
- #ifdef Q_OS_WIN
- if (!target.endsWith(binaryEnding))
- target = target + binaryEnding;
- #endif
+#ifdef Q_OS_WIN
+ if (!target.endsWith(suffix))
+ target = target + suffix;
+#endif
} else {
return printErrorAndUsageAndExit(QObject::tr("Error: You are using an old syntax please add the "
"component name with the include option")