diff --git a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp
index ab23b827f8e907b0054cc64ab7cf389b67e7253a..7cd6ca1f6a79082493f0a02b314006cf809c7e24 100644
--- a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp
+++ b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -23,10 +23,19 @@ class QmlApplicationViewerPrivate
 
 QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
 {
+#ifdef Q_OS_UNIX
 #ifdef Q_OS_MAC
     if (!QDir::isAbsolutePath(path))
         return QCoreApplication::applicationDirPath()
                 + QLatin1String("/../Resources/") + path;
+#else
+    const QString pathInShareDir = QCoreApplication::applicationDirPath()
+        + QLatin1String("/../share/")
+        + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+        + QLatin1Char('/') + path;
+    if (QFileInfo(pathInShareDir).exists())
+        return pathInShareDir;
+#endif
 #endif
     return path;
 }
diff --git a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.pri b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.pri
index 42391327e1562804b99e184390bcb10189d25a0b..da53f3bc94b469f03d68902b50fc661fac2f0ea4 100644
--- a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.pri
+++ b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -69,17 +69,18 @@ symbian {
             QMAKE_EXTRA_TARGETS += first copydeploymentfolders
         }
     }
+    installPrefix = /opt
     for(deploymentfolder, DEPLOYMENTFOLDERS) {
         item = item$${deploymentfolder}
         itemfiles = $${item}.files
         $$itemfiles = $$eval($${deploymentfolder}.source)
         itempath = $${item}.path
-        $$itempath = /opt/share/$$eval($${deploymentfolder}.target)
+        $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
         INSTALLS += $$item
     }
     icon.files = $${TARGET}.png
     icon.path = /usr/share/icons/hicolor/64x64
     desktopfile.files = $${TARGET}.desktop
-    target.path = /opt/bin
+    target.path = $${installPrefix}/bin
     INSTALLS += desktopfile icon target
 }