diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp
index ec646942b04699b39b4e4818633ce3bcd979e799..771888a33d33c1726cf0a2122189b42cf58df50c 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp
+++ b/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp
@@ -542,10 +542,23 @@ QList<ProjectExplorer::HeaderPath> S60ToolChainMixin::epocHeaderPaths() const
 
 void S60ToolChainMixin::addEpocToEnvironment(Utils::Environment *env) const
 {
+#if defined(Q_OS_WIN)
+    QString winDir = QLatin1String(qgetenv("WINDIR"));
+    if (!winDir.isEmpty())
+        env->prependOrSetPath(QDir(winDir).filePath(QLatin1String("system32")));
+#endif
+
     QDir epocDir(m_device.epocRoot);
+
     env->prependOrSetPath(epocDir.filePath(QLatin1String("epoc32/tools"))); // e.g. make.exe
-    env->prependOrSetPath(epocDir.filePath(QLatin1String("epoc32/gcc/bin"))); // e.g. gcc.exe
-    env->prependOrSetPath(epocDir.filePath(QLatin1String("perl/bin"))); // e.g. perl.exe (special SDK version)
+
+    if (epocDir.exists(QLatin1String("epoc32/gcc/bin")))
+        env->prependOrSetPath(epocDir.filePath(QLatin1String("epoc32/gcc/bin"))); // e.g. cpp.exe, *NOT* gcc.exe
+    // Find perl in the special Symbian flavour:
+    if (epocDir.exists(QLatin1String("../../tools/perl/bin")))
+        env->prependOrSetPath(epocDir.filePath(QLatin1String("../../tools/perl/bin")));
+    else
+        env->prependOrSetPath(epocDir.filePath(QLatin1String("perl/bin")));
 
     addBaseToEnvironment(env);
 }
@@ -593,13 +606,9 @@ void S60ToolChainMixin::addGnuPocToEnvironment(Utils::Environment *env) const
 
 void S60ToolChainMixin::addBaseToEnvironment(Utils::Environment *env) const
 {
-    QString sbsHome(env->value(QLatin1String("SBS_HOME"))); // Do we use Raptor/SBSv2?
-    if (!sbsHome.isEmpty())
-        env->prependOrSetPath(sbsHome + QDir::separator() + QLatin1String("bin"));
-
     QString epocRootPath(m_device.epocRoot);
-    if (!epocRootPath.endsWith(QChar('/')))
-        epocRootPath.append(QChar('/'));
+    if (!epocRootPath.endsWith(QLatin1Char('/')))
+        epocRootPath.append(QLatin1Char('/'));
     env->set(QLatin1String("EPOCROOT"), QDir::toNativeSeparators(S60Devices::cleanedRootPath(epocRootPath)));
 }
 
diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp
index 5189d87feb2b095925c0a0843a51550223189dc1..031eceee840fab0760b25aef0e68247bb1a25a5b 100644
--- a/src/plugins/qt4projectmanager/qtversionmanager.cpp
+++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp
@@ -1594,8 +1594,13 @@ void QtVersion::setMsvcVersion(const QString &version)
 void QtVersion::addToEnvironment(Utils::Environment &env) const
 {
     env.set("QTDIR", QDir::toNativeSeparators(versionInfo().value("QT_INSTALL_DATA")));
-    if (isBuildWithSymbianSbsV2() && !m_sbsV2Directory.isEmpty())
-        env.prependOrSetPath(m_sbsV2Directory);
+    if (isBuildWithSymbianSbsV2()) {
+        QString sbsHome(env.value(QLatin1String("SBS_HOME")));
+        if (!m_sbsV2Directory.isEmpty())
+            env.prependOrSetPath(m_sbsV2Directory);
+        else if (!sbsHome.isEmpty())
+            env.prependOrSetPath(sbsHome + QLatin1Char('/') + QLatin1String("bin"));
+    }
     env.prependOrSetPath(versionInfo().value("QT_INSTALL_BINS"));
 }