summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/development/qmake-manual.qdoc40
-rw-r--r--doc/src/snippets/code/doc_src_qmake-manual.qdoc15
-rw-r--r--mkspecs/common/symbian/symbian.conf2
-rw-r--r--mkspecs/features/symbian/application_icon.prf51
-rw-r--r--mkspecs/features/symbian/default_post.prf9
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.cpp20
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.h6
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp123
8 files changed, 148 insertions, 118 deletions
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index bc0df04..588a9cc 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -1449,6 +1449,46 @@
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 141
+ On the Symbian platform, a default deployment is generated for all
+ application projects. You can modify the autogenerated default
+ deployment via following \c DEPLOYMENT variable values:
+
+ \list
+ \o default_bin_deployment - Application executable
+ \o default_resource_deployment - Application resources, including icon
+ \o default_reg_deployment - Application registration file
+ \endlist
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 154
+
+ This will entirely remove the default application deployment.
+
+ On the Symbian platform, you can specify file specific install options
+ with \c{.flags} modifier. Please consult the Symbian platform documentation
+ for supported options.
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 155
+
+ This will show a message box that gives user an option to cancel the
+ installation and then automatically runs the application after
+ installation is complete.
+
+ \note Automatically running the applications after install may require signing
+ the package with better than self-signed certificate, depending on the phone model.
+ Additionally, some tools such as Runonphone may not work properly with sis
+ packages that automatically run the application upon install.
+
+ On the Symbian platform, the default package name and the default name that
+ appears in application menu is derived from the \c TARGET variable.
+ Often the default is not optimal for displaying to end user. To set a better
+ display name for these purposes, use \c{DEPLOYMENT.display_name} variable:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 156
+
On the Symbian platform, you can use \c{DEPLOYMENT.installer_header}
variable to generate smart installer wrapper for your application.
If you specify just UID of the installer package as the value, then
diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
index 379d081..4f74e9c 100644
--- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc
+++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
@@ -1014,3 +1014,18 @@ BLD_INF_RULES.prj_exports += my_exports
my_note.pkg_postrules.installer = "\"myinstallnote.txt\" - \"\", FILETEXT, TEXTCONTINUE"
DEPLOYMENT += my_note
//! [153]
+
+//! [154]
+DEPLOYMENT -= default_bin_deployment default_resource_deployment default_reg_deployment
+//! [154]
+
+//! [155]
+default_bin_deployment.flags += FILERUN RUNINSTALL
+dep_note.sources = install_note.txt
+dep_note.flags = FILETEXT TEXTEXIT
+DEPLOYMENT += dep_note
+//! [155]
+
+//! [156]
+DEPLOYMENT.display_name = My Qt App
+//! [156]
diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf
index cc5b788..0bdc8e5 100644
--- a/mkspecs/common/symbian/symbian.conf
+++ b/mkspecs/common/symbian/symbian.conf
@@ -194,7 +194,7 @@ pkg_platform_dependencies = \
"[0x20032DE7],0,0,0,{\"S60ProductID\"}" \
" "
-DEPLOYMENT += default_deployment
+DEPLOYMENT += default_deployment default_bin_deployment default_resource_deployment default_reg_deployment
defineReplace(symbianRemoveSpecialCharacters) {
# Produce identical string to what SymbianCommonGenerator::removeSpecialCharacters and
diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf
index 9a9395a..2948811 100644
--- a/mkspecs/features/symbian/application_icon.prf
+++ b/mkspecs/features/symbian/application_icon.prf
@@ -1,21 +1,39 @@
load(data_caging_paths)
-# If no_icon keyword exist, the S60 UI app is just made hidden. This because S60 app FW
-# requires the registration resource file to exist always
-contains( CONFIG, no_icon ) {
- symbian:RSS_RULES += "hidden = KAppIsHidden;"
- CONFIG -= no_icon
-} else {
-# There is no point in compiling the MIF icon if no_icon CONFIGS is set
- !isEmpty(ICON) {
+contains(CONFIG, no_icon) {
+ # If no_icon keyword exist, the S60 UI app is just made hidden. This because S60 app FW
+ # requires the registration resource file to exist always
+ contains(QT, gui):contains(CONFIG, qt) {
+ symbian:RSS_RULES += "hidden = KAppIsHidden;"
+ CONFIG -= no_icon
+ }
+}
+
+!contains(CONFIG, no_icon) {
+ baseTarget = $$symbianRemoveSpecialCharacters($$basename(TARGET))
+ symbian-abld|symbian-sbsv2 {
+ resourceZDir = $$EPOCROOT$$HW_ZDIR$$APP_RESOURCE_DIR
+ regZDir = $$EPOCROOT$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR
+ } else {
+ isEmpty(DESTDIR) {
+ resourceZDir = .
+ } else {
+ resourceZDir = $$DESTDIR
+ }
+ regZDir = $$resourceZDir
+ }
+
+ default_resource_deployment.sources += $$resourceZDir/$${baseTarget}.rsc
+ default_resource_deployment.path = $$APP_RESOURCE_DIR
+ default_reg_deployment.sources += $$regZDir/$${baseTarget}_reg.rsc
+ default_reg_deployment.path = $$REG_RESOURCE_IMPORT_DIR
+ !isEmpty(ICON) {
!count(ICON, 1) {
ICON = $$first(ICON)
warning("Only first icon specified in ICON variable is used: $$ICON")
}
- baseTarget = $$symbianRemoveSpecialCharacters($$basename(TARGET))
-
# Note: symbian-sbsv2 builds can't utilize extra compiler for mifconv, so ICON handling is done in code
!symbian-sbsv2 {
# Absolute path required for shadow builds.
@@ -27,13 +45,10 @@ contains( CONFIG, no_icon ) {
ICON_backslashed = $$ICON
symbian-abld {
+ # ${ZDIR} is defined in Makefile
mifIconZDir = ${ZDIR}$$APP_RESOURCE_DIR
} else {
- isEmpty(DESTDIR) {
- mifIconZDir = .
- } else {
- mifIconZDir = $$DESTDIR
- }
+ mifIconZDir = $$resourceZDir
}
# Extra compiler rules for mifconv
@@ -53,6 +68,10 @@ contains( CONFIG, no_icon ) {
}
# Rules to use generated MIF file from symbian resources
RSS_RULES.number_of_icons = $$size(ICON_backslashed)
- RSS_RULES.icon_file = $$APP_RESOURCE_DIR/$${baseTarget}.mif
+ RSS_RULES.icon_file = $$APP_RESOURCE_DIR/$${baseTarget}.mif
+
+ default_resource_deployment.sources += $$resourceZDir/$${baseTarget}.mif
}
}
+
+
diff --git a/mkspecs/features/symbian/default_post.prf b/mkspecs/features/symbian/default_post.prf
index 0564e9b..a9b6d0e 100644
--- a/mkspecs/features/symbian/default_post.prf
+++ b/mkspecs/features/symbian/default_post.prf
@@ -9,6 +9,11 @@ contains(TEMPLATE, ".*app") {
} else {
QMAKE_LIBS += $$QMAKE_LIBS_QT_ENTRY
}
+
+ default_bin_deployment.sources += $$symbianRemoveSpecialCharacters($$basename(TARGET)).exe
+ default_bin_deployment.path += /sys/bin
+
+ load(application_icon.prf)
}
contains(TEMPLATE, lib): {
contains(CONFIG, staticlib)|contains(CONFIG, static): {
@@ -26,10 +31,6 @@ contains(TEMPLATE, lib): {
MMP_RULES -= EXPORTUNFROZEN
}
-contains(TEMPLATE, ".*app"):contains(QT, gui):contains(CONFIG,qt) {
- load(application_icon.prf)
-}
-
isEmpty(TARGET.UID3):TARGET.UID3 = $$generate_uid("$${OUT_PWD}/$${TARGET}")
isEmpty(TARGET.UID2) {
contains(CONFIG, stdbinary) {
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
index 776a646..5a6f66f 100644
--- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
@@ -248,6 +248,8 @@ void initProjectDeploySymbian(QMakeProject* project,
continue;
}
+ QStringList flags = project->values(item + ".flags");
+
foreach(QString source, project->values(item + ".sources")) {
source = Option::fixPathToLocalOS(source);
QString nameFilter;
@@ -279,13 +281,15 @@ void initProjectDeploySymbian(QMakeProject* project,
Option::fixPathToLocalOS(targetPath.absolutePath() + "/" + info.fileName(),
false, true),
fixPathToEpocOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "/")
- + info.fileName())));
+ + info.fileName()),
+ flags));
} else {
deploymentList.append(CopyItem(
Option::fixPathToLocalOS(targetPath.absolutePath() + "/" + info.fileName(),
false, true),
fixPathToEpocOS(deploymentDrive + QLatin1String("/" SYSBIN_DIR "/")
- + info.fileName())));
+ + info.fileName()),
+ flags));
}
}
if (isPlugin(info, devicePath)) {
@@ -296,7 +300,8 @@ void initProjectDeploySymbian(QMakeProject* project,
// Generate deployment even if file doesn't exist, as this may be the case
// when generating .pkg files.
deploymentList.append(CopyItem(Option::fixPathToLocalOS(info.absoluteFilePath()),
- fixPathToEpocOS(devicePath + "/" + info.fileName())));
+ fixPathToEpocOS(devicePath + "/" + info.fileName()),
+ flags));
continue;
}
}
@@ -323,12 +328,14 @@ void initProjectDeploySymbian(QMakeProject* project,
deploymentList.append(CopyItem(
Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()),
fixPathToEpocOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "/")
- + iterator.fileName())));
+ + iterator.fileName()),
+ flags));
} else {
deploymentList.append(CopyItem(
Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()),
fixPathToEpocOS(deploymentDrive + QLatin1String("/" SYSBIN_DIR "/")
- + iterator.fileName())));
+ + iterator.fileName()),
+ flags));
}
}
createPluginStub(info, devicePath + "/" + absoluteItemPath.right(diffSize),
@@ -338,7 +345,8 @@ void initProjectDeploySymbian(QMakeProject* project,
deploymentList.append(CopyItem(
Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()),
fixPathToEpocOS(devicePath + "/" + absoluteItemPath.right(diffSize)
- + "/" + iterator.fileName())));
+ + "/" + iterator.fileName()),
+ flags));
}
}
}
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.h b/qmake/generators/symbian/initprojectdeploy_symbian.h
index 2653d2a..bc17b04 100644
--- a/qmake/generators/symbian/initprojectdeploy_symbian.h
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.h
@@ -56,9 +56,13 @@
struct CopyItem
{
- CopyItem(const QString& f, const QString& t) : from(f) , to(t) { }
+ CopyItem(const QString& f, const QString& t)
+ : from(f) , to(t) { }
+ CopyItem(const QString& f, const QString& t, const QStringList& l)
+ : from(f) , to(t), flags(l) { }
QString from;
QString to;
+ QStringList flags;
};
typedef QList<CopyItem> DeploymentList;
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
index 91e126c..0938b58 100644
--- a/qmake/generators/symbian/symbiancommon.cpp
+++ b/qmake/generators/symbian/symbiancommon.cpp
@@ -320,7 +320,9 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
// Package header
QString sisHeader = "; SIS header: name, uid, version\n#{\"%1\"},(%2),%3\n\n";
- QString visualTarget = generator->escapeFilePath(project->first("TARGET"));
+ QString visualTarget = project->values("DEPLOYMENT.display_name").join(" ");
+ if (visualTarget.isEmpty())
+ visualTarget = generator->escapeFilePath(project->first("TARGET"));
visualTarget = removePathSeparators(visualTarget);
QString wrapperTarget = visualTarget + " installer";
@@ -383,87 +385,7 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
t << manufacturerStr << endl;
}
- // Install paths on the phone *** should be dynamic at some point
- QString installPathBin = "!:\\sys\\bin";
- QString installPathResource = "!:\\resource\\apps";
- QString installPathRegResource = "!:\\private\\10003a3f\\import\\apps";
-
- // Find location of builds
- QString destDirBin;
- QString destDirResource;
- QString destDirRegResource;
- if (epocBuild) {
- destDirBin = QString("%1epoc32/release/$(PLATFORM)/$(TARGET)").arg(epocRoot());
- destDirResource = QString("%1epoc32/data/z/resource/apps").arg(epocRoot());
- destDirRegResource = QString("%1epoc32/data/z/private/10003a3f/import/apps").arg(epocRoot());
- } else {
- destDirBin = project->first("DESTDIR");
- if (destDirBin.isEmpty())
- destDirBin = ".";
- else if (destDirBin.endsWith('/') || destDirBin.endsWith('\\'))
- destDirBin.chop(1);
- destDirResource = destDirBin;
- destDirRegResource = destDirBin;
- }
-
- if (targetType == TypeExe) {
- // deploy .exe file
- t << "; Executable and default resource files" << endl;
- QString exeFile = fixedTarget + ".exe";
- t << QString("\"%1/%2\" - \"%3\\%4\"")
- .arg(destDirBin)
- .arg(exeFile)
- .arg(installPathBin)
- .arg(exeFile) << endl;
- ts << QString("\"\" - \"%1\\%2\"")
- .arg(romPath(installPathBin))
- .arg(exeFile) << endl;
-
- // deploy rsc & reg_rsc file
- if (!project->isActiveConfig("no_icon")) {
- t << QString("\"%1/%2\" - \"%3\\%4\"")
- .arg(destDirResource)
- .arg(fixedTarget + ".rsc")
- .arg(installPathResource)
- .arg(fixedTarget + ".rsc") << endl;
- ts << QString("\"\" - \"%1\\%2\"")
- .arg(romPath(installPathResource))
- .arg(fixedTarget + ".rsc") << endl;
-
- t << QString("\"%1/%2\" - \"%3\\%4\"")
- .arg(destDirRegResource)
- .arg(fixedTarget + "_reg.rsc")
- .arg(installPathRegResource)
- .arg(fixedTarget + "_reg.rsc") << endl;
- ts << QString("\"\" - \"%1\\%2\"")
- .arg(romPath(installPathRegResource))
- .arg(fixedTarget + "_reg.rsc") << endl;
-
- if (!iconFile.isEmpty()) {
- if (epocBuild) {
- t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"")
- .arg(epocRoot())
- .arg(iconFile)
- .arg(QDir::toNativeSeparators(iconFile)) << endl << endl;
- ts << QString("\"\" - \"%1\"")
- .arg(romPath(QDir::toNativeSeparators(iconFile))) << endl << endl;
- } else {
- QDir mifIconDir(project->first("DESTDIR"));
- QFileInfo mifIcon(mifIconDir.relativeFilePath(project->first("TARGET")));
- QString mifIconFileName = mifIcon.fileName();
- mifIconFileName.append(".mif");
- t << QString("\"%1/%2\" - \"!:%3\"")
- .arg(mifIcon.path())
- .arg(mifIconFileName)
- .arg(QDir::toNativeSeparators(iconFile)) << endl << endl;
- ts << QString("\"\" - \"%1\"")
- .arg(romPath(QDir::toNativeSeparators(iconFile))) << endl << endl;
- }
- }
- }
- }
-
- // deploy any additional DEPLOYMENT files
+ // deploy files specified by DEPLOYMENT variable
QString remoteTestPath;
QString zDir;
remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid);
@@ -477,6 +399,15 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
for (int i = 0; i < depList.size(); ++i) {
QString from = depList.at(i).from;
QString to = depList.at(i).to;
+ QString flags;
+ bool showOnlyFile = false;
+ foreach(QString flag, depList.at(i).flags) {
+ if (flag == QLatin1String("FT")
+ || flag == QLatin1String("FILETEXT")) {
+ showOnlyFile = true;
+ }
+ flags.append(QLatin1Char(',')).append(flag);
+ }
if (epocBuild) {
// Deploy anything not already deployed from under epoc32 instead from under
@@ -490,8 +421,15 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
}
}
- t << QString("\"%1\" - \"%2\"").arg(from.replace('\\','/')).arg(to) << endl;
- ts << QString("\"\" - \"%1\"").arg(romPath(to)) << endl;
+ // Files with "FILETEXT"/"FT" flag are meant for showing only at installation time
+ // and therefore do not belong to the stub package and will not install the file into phone.
+ if (showOnlyFile)
+ to.clear();
+ else
+ ts << QString("\"\" - \"%1\"").arg(romPath(to)) << endl;
+
+ t << QString("\"%1\" - \"%2\"%3").arg(from.replace('\\','/')).arg(to).arg(flags) << endl;
+
}
t << endl;
ts << endl;
@@ -705,6 +643,11 @@ void SymbianCommonGenerator::writeLocFile(QStringList &symbianLangCodes)
if (ft.open(QIODevice::WriteOnly)) {
generatedFiles << ft.fileName();
QTextStream t(&ft);
+
+ QString displayName = generator->project->values("DEPLOYMENT.display_name").join(" ");
+ if (displayName.isEmpty())
+ displayName = generator->escapeFilePath(generator->project->first("TARGET"));
+
t << "// ============================================================================" << endl;
t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: ";
t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
@@ -713,16 +656,16 @@ void SymbianCommonGenerator::writeLocFile(QStringList &symbianLangCodes)
t << "// ============================================================================" << endl;
t << endl;
t << "#ifdef LANGUAGE_SC" << endl;
- t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl;
- t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl;
+ t << "#define STRING_r_short_caption \"" << displayName << "\"" << endl;
+ t << "#define STRING_r_caption \"" << displayName << "\"" << endl;
foreach(QString lang, symbianLangCodes) {
t << "#elif defined LANGUAGE_" << lang << endl;
- t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl;
- t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl;
+ t << "#define STRING_r_short_caption \"" << displayName << "\"" << endl;
+ t << "#define STRING_r_caption \"" << displayName << "\"" << endl;
}
t << "#else" << endl;
- t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl;
- t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl;
+ t << "#define STRING_r_short_caption \"" << displayName << "\"" << endl;
+ t << "#define STRING_r_caption \"" << displayName << "\"" << endl;
t << "#endif" << endl;
} else {
PRINT_FILE_CREATE_ERROR(filename);