summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/binarycreator/binarycreator.cpp9
-rw-r--r--tools/devtool/main.cpp11
2 files changed, 17 insertions, 3 deletions
diff --git a/tools/binarycreator/binarycreator.cpp b/tools/binarycreator/binarycreator.cpp
index 1a6a10471..23261211d 100644
--- a/tools/binarycreator/binarycreator.cpp
+++ b/tools/binarycreator/binarycreator.cpp
@@ -241,10 +241,12 @@ static int assemble(Input input, const QInstaller::Settings &settings, const QSt
QTemporaryFile out;
QString targetName = input.outputPath;
-#ifdef Q_OS_OSX
+#if defined Q_OS_OSX || defined Q_OS_WIN
QDir resourcePath(QFileInfo(input.outputPath).dir());
+#ifdef Q_OS_OSX
resourcePath.cdUp();
resourcePath.cd(QLatin1String("Resources"));
+#endif
targetName = resourcePath.filePath(QLatin1String("installer.dat"));
#endif
@@ -262,7 +264,10 @@ static int assemble(Input input, const QInstaller::Settings &settings, const QSt
QInstaller::openForWrite(&out);
QFile exe(input.installerExePath);
-#ifdef Q_OS_OSX
+#if defined Q_OS_OSX || defined Q_OS_WIN
+ // remove the target
+ if (QFile::exists(input.outputPath))
+ QFile::remove(input.outputPath);
if (!exe.copy(input.outputPath)) {
throw Error(QString::fromLatin1("Cannot copy %1 to %2: %3").arg(exe.fileName(),
input.outputPath, exe.errorString()));
diff --git a/tools/devtool/main.cpp b/tools/devtool/main.cpp
index c9aaab71c..27c459ecc 100644
--- a/tools/devtool/main.cpp
+++ b/tools/devtool/main.cpp
@@ -173,6 +173,11 @@ int main(int argc, char *argv[])
if (QInstaller::isInBundle(path, &bundlePath))
path = QDir(bundlePath).filePath(QLatin1String("Contents/Resources/installer.dat"));
+#ifdef Q_OS_WIN
+ QDir resourcePath(path);
+ resourcePath.cdUp();
+ path = resourcePath.filePath(QLatin1String("installer.dat"));
+#endif
int result = EXIT_FAILURE;
QVector<QByteArray> resourceMappings;
quint64 cookie = QInstaller::BinaryContent::MagicCookie;
@@ -191,8 +196,12 @@ int main(int argc, char *argv[])
QFileInfo fi(path);
if (QInstaller::isInBundle(fi.absoluteFilePath(), &bundlePath))
fi.setFile(bundlePath);
+#ifdef Q_OS_WIN
+ QFileInfo appName = arguments.first();
+ path = fi.absoluteDir().filePath(appName.baseName() + QLatin1String(".dat"));
+#else
path = fi.absolutePath() + QLatin1Char('/') + fi.baseName() + QLatin1String(".dat");
-
+#endif
tmp.close();
tmp.setFileName(path);
QInstaller::openForRead(&tmp);