summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@digia.com>2014-09-02 11:31:28 +0200
committerOliver Wolff <oliver.wolff@digia.com>2014-09-05 13:41:16 +0200
commit385a65dee4fb40c050e233c13a560aad7814d421 (patch)
tree88c5d465e264807a50fb612a7e047055ca3ec3c9
parent364a663fcc02d3b803fa3cece2684fed3791d059 (diff)
downloadqt-creator-385a65dee4fb40c050e233c13a560aad7814d421.tar.gz
Fixed creation of mapping files for winphone 8.1
Change-Id: I42f97f8f629b6ffbf48a01409605853f60a9c02b Reviewed-by: Andrew Knight <andrew.knight@digia.com>
-rw-r--r--src/plugins/winrt/winrtpackagedeploymentstep.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/plugins/winrt/winrtpackagedeploymentstep.cpp b/src/plugins/winrt/winrtpackagedeploymentstep.cpp
index ce9e37035b..a76f519332 100644
--- a/src/plugins/winrt/winrtpackagedeploymentstep.cpp
+++ b/src/plugins/winrt/winrtpackagedeploymentstep.cpp
@@ -88,6 +88,8 @@ bool WinRtPackageDeploymentStep::init()
m_targetFilePath.append(QLatin1String(".exe"));
m_targetDirPath = appTargetFilePath.parentDir().toString();
+ if (!m_targetDirPath.endsWith(QLatin1Char('/')))
+ m_targetDirPath += QLatin1Char('/');
const QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target()->kit());
if (!qt)
@@ -98,18 +100,19 @@ bool WinRtPackageDeploymentStep::init()
m_manifestFileName = QStringLiteral("AppxManifest");
- if (qt->type() == QLatin1String(Constants::WINRT_WINPHONEQT)
- && qt->mkspec().toString().contains(QLatin1String("msvc2012"))) {
+ if (qt->type() == QLatin1String(Constants::WINRT_WINPHONEQT)) {
m_createMappingFile = true;
- m_manifestFileName = QStringLiteral("WMAppManifest");
+ if (qt->mkspec().toString().contains(QLatin1String("msvc2012")))
+ m_manifestFileName = QStringLiteral("WMAppManifest");
}
if (m_createMappingFile) {
args += QLatin1String(" -list mapping");
- m_mappingFileContent = QLatin1String("[Files]\n\"")
- + QDir::toNativeSeparators(m_targetDirPath)
- + m_manifestFileName + QLatin1String(".xml\" \"") + m_manifestFileName
- + QLatin1String(".xml\"\n");
+ m_mappingFileContent = QLatin1String("[Files]\n");
+ if (qt->mkspec().toString().contains(QLatin1String("msvc2012"))) {
+ m_mappingFileContent += QLatin1Char('"') + QDir::toNativeSeparators(m_targetDirPath) + m_manifestFileName
+ + QLatin1String(".xml\" \"") + m_manifestFileName + QLatin1String(".xml\"\n");
+ }
QDir assetDirectory(m_targetDirPath + QLatin1String("assets"));
if (assetDirectory.exists()) {
@@ -156,11 +159,12 @@ bool WinRtPackageDeploymentStep::processSucceeded(int exitCode, QProcess::ExitSt
installableFilesList.append(QPair<QString, QString>(localFilePath, remoteFilePath));
}
- // if there are no INSTALLS set we just deploy the files from windeployqt, the manifest
+ // if there are no INSTALLS set we just deploy the files from windeployqt, the manifest (in case of 2012)
// and the icons referenced in there and the actual build target
QString baseDir;
if (targetInstallationPath.isEmpty()) {
- m_targetFilePath += QLatin1String(".exe");
+ if (!m_targetFilePath.endsWith(QLatin1String(".exe")))
+ m_targetFilePath.append(QLatin1String(".exe"));
m_mappingFileContent
+= QLatin1Char('"') + QDir::toNativeSeparators(m_targetFilePath)
+ QLatin1String("\" \"")
@@ -178,6 +182,12 @@ bool WinRtPackageDeploymentStep::processSucceeded(int exitCode, QProcess::ExitSt
relativeRemotePath = pair.second;
else
relativeRemotePath = QDir(baseDir).relativeFilePath(pair.second);
+
+ if (QDir(relativeRemotePath).isAbsolute() || relativeRemotePath.startsWith(QLatin1String(".."))) {
+ // for 3.3?
+ // raiseWarning(tr("File %1 is outside of the executable's directory. These files cannot be installed.").arg(relativeRemotePath));
+ continue;
+ }
m_mappingFileContent += QLatin1Char('"') + QDir::toNativeSeparators(pair.first)
+ QLatin1String("\" \"") + QDir::toNativeSeparators(relativeRemotePath)
+ QLatin1String("\"\n");
@@ -267,7 +277,8 @@ bool WinRtPackageDeploymentStep::parseIconsAndExecutableFromManifest(QString man
icons->append(icon);
}
- QRegularExpression executablePattern(QStringLiteral("ImagePath=\"([a-zA-Z0-9_-]*\\.exe)\""));
+ const QLatin1String executablePrefix(manifestFileName.contains(QLatin1String("AppxManifest")) ? "Executable=" : "ImagePath=");
+ QRegularExpression executablePattern(executablePrefix + QStringLiteral("\"([a-zA-Z0-9_-]*\\.exe)\""));
QRegularExpressionMatch match = executablePattern.match(contents);
if (!match.hasMatch())
return false;