Index: /trunk/configure.vbs
===================================================================
--- /trunk/configure.vbs	(revision 60722)
+++ /trunk/configure.vbs	(revision 60723)
@@ -10,5 +10,5 @@
 
 '
-' Copyright (C) 2006-2012 Oracle Corporation
+' Copyright (C) 2006-2016 Oracle Corporation
 '
 ' This file is part of VirtualBox Open Source Edition (OSE), as
@@ -2022,6 +2022,6 @@
 
 ''
-' Checks for any Qt4 binaries.
-sub CheckForQt4(strOptQt4)
+' Checks for any Qt4/5 binaries.
+sub CheckForQt(strOptQt4, strOptQt5)
    dim strPathQt4
 
@@ -2047,17 +2047,58 @@
    ' Display the result.
    if strPathQt4 = "" then
-      CfgPrint "VBOX_WITH_QTGUI="
       PrintResultMsg "Qt4", "not found"
    else
+      PrintResult "Qt4", strPathQt4
+   end if
+
+   PrintHdr "Qt5"
+
+   '
+   ' Try to find the Qt5 installation (user specified path with --with-qt5)
+   '
+   strPathQt5 = ""
+
+   LogPrint "Checking for user specified path of Qt5 ... "
+   if (strPathQt5 = "") And (strOptQt5 <> "") then
+      strOptQt5 = UnixSlashes(strOptQt5)
+      if CheckForQt5Sub(strOptQt5) then strPathQt5 = strOptQt5
+   end if
+
+   ' Check the dev tools
+   if (strPathQt5 = "") Then
+      strPathQt5 = g_strPathDev & "/win." & g_strTargetArch & "/qt/v5.5.1-r138"
+      if CheckForQt5Sub(strPathQt5) = False then strPathQt5 = ""
+   end if
+
+   ' Display the result.
+   if strPathQt5 = "" then
+      PrintResultMsg "Qt5", "not found"
+   else
+      PrintResult "Qt5", strPathQt5
+   end if
+
+   if strPathQt5 <> "" then
+      CfgPrint "PATH_SDK_QT5          := " & strPathQt5
+      CfgPrint "PATH_TOOL_QT5         := $(PATH_SDK_QT5)"
+      CfgPrint "VBOX_PATH_QT          := $(PATH_SDK_QT5)"
+      if strPathQt4 <> "" then
+         MsgWarning "Have working path to both Qt4 ad Qt5, ignoring Qt4."
+      end if
+   elseif strPathQt4 <> "" then
       CfgPrint "PATH_SDK_QT4          := " & strPathQt4
       CfgPrint "PATH_TOOL_QT4         := $(PATH_SDK_QT4)"
       CfgPrint "VBOX_PATH_QT          := $(PATH_SDK_QT4)"
-      PrintResult "Qt4 ", strPathQt4
-   end if
-end sub
-
-
-''
-' Checks if the specified path points to an usable Qt library.
+   end if
+   if (strPathQt4 = "") And (strPathQt5 = "") then
+      CfgPrint "VBOX_WITH_QTGUI       :="
+   end if
+   if strPathQt5 = "" then
+      CfgPrint "VBOX_WITH_QTGUI_V5    :="
+   end if
+end sub
+
+
+''
+' Checks if the specified path points to an usable Qt4 library.
 function CheckForQt4Sub(strPathQt4)
 
@@ -2078,4 +2119,28 @@
       then
          CheckForQt4Sub = True
+   end if
+
+end function
+
+
+''
+' Checks if the specified path points to an usable Qt5 library.
+function CheckForQt5Sub(strPathQt5)
+
+   CheckForQt5Sub = False
+   LogPrint "trying: strPathQt5=" & strPathQt5
+
+   if   LogFileExists(strPathQt5, "bin/moc.exe") _
+    And LogFileExists(strPathQt5, "bin/uic.exe") _
+    And LogFileExists(strPathQt5, "include/QtWidgets/qwidget.h") _
+    And LogFileExists(strPathQt5, "include/QtWidgets/QApplication") _
+    And LogFileExists(strPathQt5, "include/QtGui/QImage") _
+    And LogFileExists(strPathQt5, "include/QtNetwork/QHostAddress") _
+    And (   LogFileExists(strPathQt5, "lib/Qt5Core.lib") _
+         Or LogFileExists(strPathQt5, "lib/Qt5CoreVBox.lib")) _
+    And (   LogFileExists(strPathQt5, "lib/Qt5Network.lib") _
+         Or LogFileExists(strPathQt5, "lib/Qt5NetworkVBox.lib")) _
+      then
+         CheckForQt5Sub = True
    end if
 
@@ -2137,5 +2202,4 @@
    Print "Locations:"
    Print "  --with-DDK=PATH       "
-   Print "  --with-DXSDK=PATH     "
    Print "  --with-kBuild=PATH    "
    Print "  --with-libSDL=PATH    "
@@ -2143,4 +2207,5 @@
    Print "  --with-MinGW-w64=PATH "
    Print "  --with-Qt4=PATH       "
+   Print "  --with-Qt5=PATH       "
    Print "  --with-SDK=PATH       "
    Print "  --with-VC=PATH        "
@@ -2179,4 +2244,5 @@
    strOptMinGWw64 = ""
    strOptQt4 = ""
+   strOptQt5 = ""
    strOptSDK = ""
    strOptVC = ""
@@ -2211,5 +2277,5 @@
             strOptDDK = strPath
          case "--with-dxsdk"
-            MsgWarning "Ignornig --with-dxsdk (the DirectX SDK is no longer required)."
+            MsgWarning "Ignoring --with-dxsdk (the DirectX SDK is no longer required)."
          case "--with-kbuild"
             strOptkBuild = strPath
@@ -2222,4 +2288,6 @@
          case "--with-qt4"
             strOptQt4 = strPath
+         case "--with-qt5"
+            strOptQt5 = strPath
          case "--with-sdk"
             strOptSDK = strPath
@@ -2315,5 +2383,5 @@
    CheckForSsl strOptSsl
    CheckForCurl strOptCurl
-   CheckForQt4 strOptQt4
+   CheckForQt strOptQt4, strOptQt5
    if (strOptPython <> "") then
      CheckForPython strOptPython
Index: /trunk/src/VBox/Installer/win/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Installer/win/Makefile.kmk	(revision 60722)
+++ /trunk/src/VBox/Installer/win/Makefile.kmk	(revision 60723)
@@ -5,5 +5,5 @@
 
 #
-# Copyright (C) 2006-2015 Oracle Corporation
+# Copyright (C) 2006-2016 Oracle Corporation
 #
 # This file is part of VirtualBox Open Source Edition (OSE), as
@@ -529,4 +529,5 @@
 				-E 'VBOX_WIN_INST_MERGE_$(toupper $(module))=$(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang).msm'),) \
 		-E 'VBOX_WINDOWS_ICON_FILE=$(subst /,\,$(VBOX_WINDOWS_ICON_FILE))' \
+		-E 'VBOX_QT_INFIX=$(VBOX_QT_INFIX)' \
 		-E 'VBOX_WITH_32_ON_64_MAIN_API=$(if $(VBOX_WITH_32_ON_64_MAIN_API),yes,no)' \
 		-E 'VBOX_WITH_ADDITIONS_PACKING=$(if $(VBOX_WITH_ADDITIONS_PACKING),yes,no)' \
Index: /trunk/src/VBox/Installer/win/VBoxMergeApp.wxi
===================================================================
--- /trunk/src/VBox/Installer/win/VBoxMergeApp.wxi	(revision 60722)
+++ /trunk/src/VBox/Installer/win/VBoxMergeApp.wxi	(revision 60723)
@@ -2,5 +2,5 @@
     VirtualBox Windows Installation Script (WiX)
 
-    Copyright (C) 2006-2015 Oracle Corporation
+    Copyright (C) 2006-2016 Oracle Corporation
 
     This file is part of VirtualBox Open Source Edition (OSE), as
@@ -15,4 +15,10 @@
 <Include xmlns="http://schemas.microsoft.com/wix/2006/wi"
          xmlns:difxapp="http://schemas.microsoft.com/wix/DifxAppExtension">
+
+<?ifdef env.VBOX_QT_INFIX ?>
+    <?define VBOX_QT_INFIX="$(env.VBOX_QT_INFIX)" ?>
+<?else?>
+    <?define VBOX_QT_INFIX="" ?>
+<?endif?>
 
 <?if $(env.VBOX_WITH_DOCS_PACKING) = "yes" ?>
@@ -306,19 +312,19 @@
     <?endif ?>
     <?if $(env.VBOX_WITH_QTGUI_V5) = "no" ?>
-        <File Id="file_QtCoreVBox4.dll" Name="QtCoreVBox4.dll"
-              Source="$(env.PATH_OUT)\bin\QtCoreVBox4.dll" />
-        <File Id="file_QtGuiVBox4.dll" Name="QtGuiVBox4.dll"
-              Source="$(env.PATH_OUT)\bin\QtGuiVBox4.dll" />
+        <File Id="file_QtCore$(var.VBOX_QT_INFIX)4.dll" Name="QtCore$(var.VBOX_QT_INFIX)4.dll"
+              Source="$(env.PATH_OUT)\bin\QtCore$(var.VBOX_QT_INFIX)4.dll" />
+        <File Id="file_QtGui$(var.VBOX_QT_INFIX)4.dll" Name="QtGui$(var.VBOX_QT_INFIX)4.dll"
+              Source="$(env.PATH_OUT)\bin\QtGui$(var.VBOX_QT_INFIX)4.dll" />
     <?else ?>
-        <File Id="file_Qt5CoreVBox.dll" Name="Qt5CoreVBox.dll"
-              Source="$(env.PATH_OUT)\bin\Qt5CoreVBox.dll" />
-        <File Id="file_Qt5GuiVBox.dll" Name="Qt5GuiVBox.dll"
-              Source="$(env.PATH_OUT)\bin\Qt5GuiVBox.dll" />
-        <File Id="file_Qt5WidgetsVBox.dll" Name="Qt5WidgetsVBox.dll"
-              Source="$(env.PATH_OUT)\bin\Qt5WidgetsVBox.dll" />
-        <File Id="file_Qt5PrintSupportVBox.dll" Name="Qt5PrintSupportVBox.dll"
-              Source="$(env.PATH_OUT)\bin\Qt5PrintSupportVBox.dll" />
-        <File Id="file_Qt5WinExtrasVBox.dll" Name="Qt5WinExtrasVBox.dll"
-              Source="$(env.PATH_OUT)\bin\Qt5WinExtrasVBox.dll" />
+        <File Id="file_Qt5Core$(var.VBOX_QT_INFIX).dll" Name="Qt5Core$(var.VBOX_QT_INFIX).dll"
+              Source="$(env.PATH_OUT)\bin\Qt5Core$(var.VBOX_QT_INFIX).dll" />
+        <File Id="file_Qt5Gui$(var.VBOX_QT_INFIX).dll" Name="Qt5Gui$(var.VBOX_QT_INFIX).dll"
+              Source="$(env.PATH_OUT)\bin\Qt5Gui$(var.VBOX_QT_INFIX).dll" />
+        <File Id="file_Qt5Widgets$(var.VBOX_QT_INFIX).dll" Name="Qt5Widgets$(var.VBOX_QT_INFIX).dll"
+              Source="$(env.PATH_OUT)\bin\Qt5Widgets$(var.VBOX_QT_INFIX).dll" />
+        <File Id="file_Qt5PrintSupport$(var.VBOX_QT_INFIX).dll" Name="Qt5PrintSupport$(var.VBOX_QT_INFIX).dll"
+              Source="$(env.PATH_OUT)\bin\Qt5PrintSupport$(var.VBOX_QT_INFIX).dll" />
+        <File Id="file_Qt5WinExtras$(var.VBOX_QT_INFIX).dll" Name="Qt5WinExtras$(var.VBOX_QT_INFIX).dll"
+              Source="$(env.PATH_OUT)\bin\Qt5WinExtras$(var.VBOX_QT_INFIX).dll" />
     <?endif ?>
 <?endif ?>
@@ -331,9 +337,9 @@
 <?if $(env.VBOX_GUI_USE_QGL) = "yes" ?>
     <?if $(env.VBOX_WITH_QTGUI_V5) = "no" ?>
-        <File Id="file_QtOpenGLVBox4.dll" Name="QtOpenGLVBox4.dll"
-              Source="$(env.PATH_OUT)\bin\QtOpenGLVBox4.dll" />
+        <File Id="file_QtOpenGL$(var.VBOX_QT_INFIX)4.dll" Name="QtOpenGL$(var.VBOX_QT_INFIX)4.dll"
+              Source="$(env.PATH_OUT)\bin\QtOpenGL$(var.VBOX_QT_INFIX)4.dll" />
     <?else ?>
-        <File Id="file_Qt5OpenGLVBox.dll" Name="Qt5OpenGLVBox.dll"
-              Source="$(env.PATH_OUT)\bin\Qt5OpenGLVBox.dll" />
+        <File Id="file_Qt5OpenGL$(var.VBOX_QT_INFIX).dll" Name="Qt5OpenGL$(var.VBOX_QT_INFIX).dll"
+              Source="$(env.PATH_OUT)\bin\Qt5OpenGL$(var.VBOX_QT_INFIX).dll" />
     <?endif ?>
 <?endif?>
