diff options
Diffstat (limited to 'util/scripts/win-binary/nsis/includes/qtenv.nsh')
-rw-r--r-- | util/scripts/win-binary/nsis/includes/qtenv.nsh | 350 |
1 files changed, 0 insertions, 350 deletions
diff --git a/util/scripts/win-binary/nsis/includes/qtenv.nsh b/util/scripts/win-binary/nsis/includes/qtenv.nsh deleted file mode 100644 index d1c3bfd..0000000 --- a/util/scripts/win-binary/nsis/includes/qtenv.nsh +++ /dev/null @@ -1,350 +0,0 @@ -!ifndef QTENV_INCLUDE -!define QTENV_INCLUDE - -!include "LogicLib.nsh" - -!macro MAKE_QTVARS_FILE Compiler QtBuildTree WinCESDK - push "${Compiler}" - push "${QtBuildTree}" - push "${WinCESDK}" - call Function_MakeQtVarsFile -!macroend ;MAKE_QTVARS_FILE - -# -# creates a qtvars.bat file in QtBuildTree\bin -# Push "vs2003" ; Compiler -# Push "c:\qt\shadowbuild" ; QtBuildTree -# Push "wincewm60professional-msvc2005" ; WinCESDK. Leave empty if it is not a CE build -# Call MakeQtVarsFile -# -Function Function_MakeQtVarsFile - Exch $0 ; WinCESDK - Exch - Exch $1 ; QtBuildTree - Exch - Exch 2 - Exch $2 ; Compiler - Exch 2 - Push $3 ; qtvars.bat file handle - Push $4 ; GetMkSpec result - Push $5 ; IsExpressVersion result - Push $6 ; GetVSVarsFile result - - Push $2 - Call GetMkSpec - Pop $4 - - CreateDirectory "$1" - CreateDirectory "$1\bin" - ClearErrors - FileOpen $3 "$1\bin\qtvars.bat" w - IfErrors done - FileWrite $3 "@echo off$\r$\n" - FileWrite $3 "rem$\r$\n" - FileWrite $3 "rem This file is generated by the Qt installer$\r$\n" - FileWrite $3 "rem$\r$\n" - FileWrite $3 "$\r$\n" - FileWrite $3 "echo Setting up a Qt environment...$\r$\n" - FileWrite $3 "$\r$\n" - FileWrite $3 "set QTDIR=$1$\r$\n" - FileWrite $3 "echo -- QTDIR set to $1$\r$\n" - FileWrite $3 "set PATH=$1\bin;%PATH%$\r$\n" - FileWrite $3 "echo -- Added $1\bin to PATH$\r$\n" - FileWrite $3 "set QMAKESPEC=$4$\r$\n" - FileWrite $3 "echo -- QMAKESPEC set to $\"$4$\"$\r$\n" - - Push $2 - Call IsExpressVersion - Pop $5 - ${If} $5 != "" - FileWrite $3 "$\r$\n" - FileWrite $3 'regedit /e S$$D$$K$$ "HKEY_LOCAL_MACHINE\Software\Microsoft\MicrosoftSDK"$\r$\n' - FileWrite $3 'if not exist S$$D$$K$$ goto ENDSDK\r$\n' - FileWrite $3 'find "Install Dir" < S$$D$$K$$ > D$$I$$R$$$\r$\n' - FileWrite $3 'del S$$D$$K$$$\r$\n' - FileWrite $3 'for /f "tokens=2 delims==" %%i in (D$$I$$R$$) do call %%i\setenv$\r$\n' - FileWrite $3 'del D$$I$$R$$$\r$\n' - FileWrite $3 ':ENDSDK\r$\n' - ${EndIf} - - Push $2 - Call GetVSVarsFile - Pop $6 - ${If} $6 != "" - FileWrite $3 "$\r$\n" - FileWrite $3 'if not "%1"=="vsvars" goto ENDVSVARS$\r$\n' - FileWrite $3 'call "$6"$\r$\n' - ${If} $0 != "" - FileWrite $3 "call $\"$1\bin\setcepaths.bat$\" $0$\r$\n" - ${EndIf} - FileWrite $3 ":ENDVSVARS$\r$\n" - - FileWrite $3 "$\r$\n" - FileWrite $3 'if not "%1"=="vsstart" goto ENDVSSTART$\r$\n' - FileWrite $3 'call "$6"$\r$\n' - ${If} $0 != "" - FileWrite $3 "call $\"$1\bin\setcepaths.bat$\" $0$\r$\n" - ${EndIf} - ${If} $2 != "vc60" - FileWrite $3 "devenv /useenv$\r$\n" - ${Else} - FileWrite $3 "msdev /useenv$\r$\n" - ${EndIf} - FileWrite $3 ":ENDVSSTART$\r$\n" - ${EndIf} - - FileWrite $3 "$\r$\n" - FileClose $3 - - done: - Pop $6 - Pop $5 - Pop $4 - Pop $3 - Pop $0 - Pop $1 - Pop $2 -FunctionEnd - -Function GetMkSpec - exch $0 - StrCmp $0 "mingw" MINGW - StrCmp $0 "vs2008" VS2008 - StrCmp $0 "vs2008ce" VS2008CE - StrCmp $0 "vs2005" VS2005 - StrCmp $0 "vs2005ce" VS2005CE - StrCmp $0 "vs2003" VS2003 - StrCmp $0 "vs2002" VS2002 - StrCmp $0 "vc60" VS60 - StrCmp $0 "icc" ICC - - MINGW: - pop $0 - push "win32-g++" - goto done - - VS2008: - pop $0 - push "win32-msvc2008" - goto done - - VS2008CE: - pop $0 - push "" - goto done - - VS2005: - pop $0 - push "win32-msvc2005" - goto done - - VS2005CE: - pop $0 - push "" - goto done - - VS2003: - pop $0 - push "win32-msvc2003" - goto done - - VS2002: - pop $0 - push "win32-msvc2002" - goto done - - VS60: - pop $0 - push "win32-msvc" - goto done - - ICC: - pop $0 - push "win32-icc" - goto done - - done: -FunctionEnd - -!define AD_COMPILER_NAME_VS2008 "Visual Studio .NET 2008" -!define AD_COMPILER_NAME_VS2008_EXPRESS "Visual C++ 2008 Express Edition" -!define AD_COMPILER_NAME_VS2005 "Visual Studio .NET 2005" -!define AD_COMPILER_NAME_VS2005_EXPRESS "Visual C++ 2005 Express Edition" -!define AD_COMPILER_NAME_VS2003 "Visual Studio .NET 2003" -!define AD_COMPILER_NAME_VS2002 "Visual Studio .NET 2002" -!define AD_COMPILER_NAME_VC60 "Visual Studio 6.0" -!define AD_COMPILER_NAME_ICC "Intel C++ Compiler" -!define AD_COMPILER_NAME_MINGW "MinGW (Must be in PATH!)" - -Function GetShortCompilerName - exch $0 - - strcmp "$0" "${AD_COMPILER_NAME_VS2008}" 0 +3 - strcpy $0 "vs2008" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_VS2008_EXPRESS}" 0 +3 - strcpy $0 "vs2008" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_VS2005}" 0 +3 - strcpy $0 "vs2005" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_VS2005_EXPRESS}" 0 +3 - strcpy $0 "vs2005" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_VS2003}" 0 +3 - strcpy $0 "vs2003" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_VS2002}" 0 +3 - strcpy $0 "vs2002" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_VC60}" 0 +3 - strcpy $0 "vc60" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_ICC}" 0 +3 - strcpy $0 "icc" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_MINGW}" 0 +3 - strcpy $0 "mingw" - goto done - - strcpy $0 "" ;this is bad! - - done: - exch $0 -FunctionEnd - -# -# returns if a compiler is installed as express version -# push "vs2005" #compiler -# call IsExpressVersion -# -Function IsExpressVersion - exch $1 - push $0 - - StrCpy $0 "" - - StrCmp $1 "vs2005" 0 +2 - ReadRegStr $0 HKLM "Software\Microsoft\VCExpress\8.0" "InstallDir" - - StrCmp $1 "vs2008" 0 +2 - ReadRegStr $0 HKLM "Software\Microsoft\VCExpress\9.0" "InstallDir" - - ClearErrors - exch $0 - exch - pop $1 -FunctionEnd - -Function AutoDetectCompilers - push $0 - push $1 - - strcpy $1 "" - - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\9.0" "InstallDir" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_VS2008}|" - - ReadRegStr $0 HKLM "Software\Microsoft\VCExpress\9.0" "InstallDir" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_VS2009_EXPRESS}|" - - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\8.0" "InstallDir" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_VS2005}|" - - ReadRegStr $0 HKLM "Software\Microsoft\VCExpress\8.0" "InstallDir" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_VS2005_EXPRESS}|" - - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\7.1" "InstallDir" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_VS2003}|" - - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\7.0" "InstallDir" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_VS2002}|" - - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\6.0\Setup" "VsCommonDir" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_VC60}|" - - ReadRegStr $0 HKLM "Software\Intel\Compilers\C++\80" "Major Version" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_ICC}|" - - strcpy $1 "$1${AD_COMPILER_NAME_MINGW}" - - exch - pop $0 - exch $1 -FunctionEnd - -Function GetVSVarsFile - exch $1 - push $0 - - StrCmp $1 "vs2008" VS2008 - StrCmp $1 "vs2008ce" VS2008 - StrCmp $1 "vs2005" VS2005 - StrCmp $1 "vs2005ce" VS2005 - StrCmp $1 "vs2003" VS2003 - StrCmp $1 "vs2002" VS2002 - StrCmp $1 "vc60" VS60 - - push "" ;empty string if not found - goto done - - VS2008: - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\9.0\Setup\VS" "ProductDir" - StrCmp $0 "" +1 foundVSDir ; found msvc.net 2008 - - ReadRegStr $0 HKLM "Software\Microsoft\VCExpress\9.0\Setup\VS" "ProductDir" - StrCmp $0 "" +1 foundVSDir ; found msvc.net 2008 express - - VS2005: - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\8.0\Setup\VS" "ProductDir" - StrCmp $0 "" +1 foundVSDir ; found msvc.net 2005 - - ReadRegStr $0 HKLM "Software\Microsoft\VCExpress\8.0\Setup\VS" "ProductDir" - StrCmp $0 "" +1 foundVSDir ; found msvc.net 2005 express - - VS2003: - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\7.1\Setup\VS" "ProductDir" - StrCmp $0 "" +1 foundVSDir ; found msvc.net 2003 - - VS2002: - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\7.0\Setup\VS" "ProductDir" - StrCmp $0 "" +1 foundVSDir ; found msvc.net 2002 - - VS60: - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++" "ProductDir" - StrCmp $0 "" +1 foundVCDir ; found msvc 6.0 - - push "" ;empty string if not found - goto done - - foundVSDir: - push "$0Common7\Tools\vsvars32.bat" - goto done - - foundVCDir: - push "$0\bin\vcvars32.bat" - - done: - exch - pop $0 - exch - pop $1 -FunctionEnd - -!endif ;QTENV_INCLUDE |