-call _paths.bat
-if not "%LAMEXP_ERROR%"=="0" GOTO:EOF
-REM -----------------------------------------------------------------
-call "%PATH_MSVC90%\VC\bin\vcvars32.bat" x86
-call "%PATH_QTMSVC%\bin\qtvars.bat"
-REM -----------------------------------------------------------------
-set "LAMEXP_ERROR=1"
-msbuild.exe /property:Configuration=%2 /property:Platform=Win32 /target:Clean /verbosity:detailed %1
-if not "%ERRORLEVEL%"=="0" GOTO:EOF
-echo ----------------------------------------------------------------
-set "LAMEXP_ERROR=1"
-msbuild.exe /property:Configuration=%2 /property:Platform=Win32 /target:Rebuild /verbosity:detailed %1
+echo.
+
+:: ---------------------------------------------------------------------------
+:: SETUP PATHS
+:: ---------------------------------------------------------------------------
+
+call "%~dp0\_paths.bat"
+call "%PATH_MSCDIR%\VC\bin\vcvars32.bat" x86
+
+if exist "%PATH_QTMSVC%\bin\qtenv2.bat" (
+ call "%PATH_QTMSVC%\bin\qtenv2.bat"
+)
+
+if exist "%PATH_QTMSVC%\bin\qtvars.bat" (
+ call "%PATH_QTMSVC%\bin\qtvars.bat"
+)
+
+:: ---------------------------------------------------------------------------
+:: BUILD THE PROJECT
+:: ---------------------------------------------------------------------------
+
+msbuild.exe /property:Configuration=%3 /property:Platform=%2 /target:Clean /verbosity:normal "%~1"