2010-11-06 23:04:47 +01:00
@ echo off
2014-12-22 14:44:09 +01:00
: : ------------------------------------------
: : Paths already initialized?
: : ------------------------------------------
if " %_LAMEXP_PATHS_INITIALIZED_% " == " %DATE% " (
goto : eof
)
: : ------------------------------------------
: : Clear Paths
: : ------------------------------------------
2010-11-10 21:39:37 +01:00
set " PATH_UPXBIN= "
set " PATH_MKNSIS= "
2013-10-18 20:44:55 +02:00
set " PATH_MSCDIR= "
2015-10-25 20:39:31 +01:00
set " PATH_WINSDK= "
2010-11-10 21:39:37 +01:00
set " PATH_QTMSVC= "
2010-11-29 14:00:27 +01:00
set " PATH_GNUPG1= "
2014-12-21 18:38:47 +01:00
set " PATH_PANDOC= "
2015-08-11 22:10:00 +02:00
set " PATH_VCTOOL= "
2011-04-08 00:25:06 +02:00
set " PATH_VCPROJ= "
2014-12-22 14:44:09 +01:00
: : ------------------------------------------
: : Setup BUILDENV_TXT
: : ------------------------------------------
2011-04-19 16:21:19 +02:00
set " BUILDENV_TXT= %~dp0 \buildenv.txt "
2011-04-10 01:10:41 +02:00
if not " %~1 " == " " (
set " BUILDENV_TXT= %~1 "
)
2014-12-22 14:44:09 +01:00
2011-04-10 01:10:41 +02:00
if not exist " %BUILDENV_TXT% " (
2014-12-23 00:23:41 +01:00
" %~dp0 \..\Utilities\CEcho.exe " red " \nCould not find \ " buildenv.txt\" in current directory!\n\nPlease create your \ " buildenv.txt\" file from 'buildenv.template.txt' first...\n "
pause && exit
2011-04-10 01:10:41 +02:00
)
2014-12-22 14:44:09 +01:00
: : ------------------------------------------
: : Parse paths from BUILDENV_TXT
: : ------------------------------------------
2011-04-10 01:10:41 +02:00
for /f " tokens=2,* " %% s in ( %BUILDENV_TXT% ) do (
2010-11-10 21:39:37 +01:00
if " %% s " == " PATH_UPXBIN " set " PATH_UPXBIN= %% ~t "
if " %% s " == " PATH_MKNSIS " set " PATH_MKNSIS= %% ~t "
2013-10-18 20:44:55 +02:00
if " %% s " == " PATH_MSCDIR " set " PATH_MSCDIR= %% ~t "
2015-10-25 20:39:31 +01:00
if " %% s " == " PATH_WINSDK " set " PATH_WINSDK= %% ~t "
2010-11-10 21:39:37 +01:00
if " %% s " == " PATH_QTMSVC " set " PATH_QTMSVC= %% ~t "
2010-11-29 14:00:27 +01:00
if " %% s " == " PATH_GNUPG1 " set " PATH_GNUPG1= %% ~t "
2014-12-21 18:38:47 +01:00
if " %% s " == " PATH_PANDOC " set " PATH_PANDOC= %% ~t "
2015-08-11 22:10:00 +02:00
if " %% s " == " PATH_VCTOOL " set " PATH_VCTOOL= %% ~t "
2011-04-08 00:25:06 +02:00
if " %% s " == " PATH_VCPROJ " set " PATH_VCPROJ= %% ~t "
2010-11-10 21:39:37 +01:00
)
2014-12-22 14:44:09 +01:00
2011-04-10 01:10:41 +02:00
set " BUILDENV_TXT= "
2014-12-22 14:44:09 +01:00
: : ------------------------------------------
: : Print all paths
: : ------------------------------------------
2014-12-23 00:23:41 +01:00
" %~dp0 \..\Utilities\CEcho.exe " yellow " \n========== BEGIN PATHS ========== "
" %~dp0 \..\Utilities\CEcho.exe " yellow " PATH_UPXBIN = \ " %PATH_UPXBIN:\=\\% \" "
" %~dp0 \..\Utilities\CEcho.exe " yellow " PATH_MKNSIS = \ " %PATH_MKNSIS:\=\\% \" "
" %~dp0 \..\Utilities\CEcho.exe " yellow " PATH_MSCDIR = \ " %PATH_MSCDIR:\=\\% \" "
2015-10-25 20:39:31 +01:00
" %~dp0 \..\Utilities\CEcho.exe " yellow " PATH_WINSDK = \ " %PATH_WINSDK:\=\\% \" "
2014-12-23 00:23:41 +01:00
" %~dp0 \..\Utilities\CEcho.exe " yellow " PATH_QTMSVC = \ " %PATH_QTMSVC:\=\\% \" "
" %~dp0 \..\Utilities\CEcho.exe " yellow " PATH_GNUPG1 = \ " %PATH_GNUPG1:\=\\% \" "
" %~dp0 \..\Utilities\CEcho.exe " yellow " PATH_PANDOC = \ " %PATH_PANDOC:\=\\% \" "
2015-08-11 22:10:00 +02:00
" %~dp0 \..\Utilities\CEcho.exe " yellow " PATH_VCTOOL = \ " %PATH_VCTOOL:\=\\% \" "
2014-12-23 00:23:41 +01:00
" %~dp0 \..\Utilities\CEcho.exe " yellow " PATH_VCPROJ = \ " %PATH_VCPROJ:\=\\% \" "
" %~dp0 \..\Utilities\CEcho.exe " yellow " =========== END PATHS ===========\n "
2014-12-22 14:44:09 +01:00
: : ------------------------------------------
: : Validate Paths
: : ------------------------------------------
call : validate_path PATH_UPXBIN " %PATH_UPXBIN% \upx.exe "
call : validate_path PATH_MKNSIS " %PATH_MKNSIS% \makensis.exe "
call : validate_path PATH_MSCDIR " %PATH_MSCDIR% \VC\vcvarsall.bat "
call : validate_path PATH_MSCDIR " %PATH_MSCDIR% \VC\bin\cl.exe "
2015-10-25 20:39:31 +01:00
call : validate_path PATH_WINSDK " %PATH_WINSDK% \Redist\ucrt\DLLs\x86\ucrtbase.dll "
2014-12-22 14:44:09 +01:00
call : validate_path PATH_QTMSVC " %PATH_QTMSVC% \bin\uic.exe "
call : validate_path PATH_QTMSVC " %PATH_QTMSVC% \bin\moc.exe "
call : validate_path PATH_QTMSVC " %PATH_QTMSVC% \bin\rcc.exe "
call : validate_path PATH_GNUPG1 " %PATH_GNUPG1% \gpg.exe "
call : validate_path PATH_PANDOC " %PATH_PANDOC% \pandoc.exe "
2015-08-11 22:10:00 +02:00
call : validate_path PATH_VCTOOL " %PATH_MSCDIR% \VC\redist\x86\Microsoft.VC %PATH_VCTOOL% .CRT\msvcp %PATH_VCTOOL% .dll "
2014-12-22 14:44:09 +01:00
call : validate_path PATH_VCPROJ " %~dp0 \..\..\ %PATH_VCPROJ% "
: : ------------------------------------------
: : Locate Qt Path
: : ------------------------------------------
if exist " %PATH_QTMSVC% \bin\qtvars.bat " goto : exit_success
if exist " %PATH_QTMSVC% \bin\qtenv2.bat " goto : exit_success
2014-12-23 00:23:41 +01:00
" %~dp0 \..\Utilities\CEcho.exe " red " \nCould not find \ " qtvars.bat\" or \ " qtenv2.bat\" in your Qt path!\n\nPlease check your PATH_QTMSVC path variable and try again...\n "
pause && exit
2014-12-22 14:44:09 +01:00
: : ------------------------------------------
: : Validate Path
: : ------------------------------------------
: validate_path
if not exist " %~2 " (
2014-12-23 00:23:41 +01:00
" %~dp0 \..\Utilities\CEcho.exe " red " \nPath %1 could not be found!\n\nPlease check your %1 path variable and try again...\n "
pause && exit
2014-12-22 14:44:09 +01:00
)
goto : eof
: : ------------------------------------------
: : Completed
: : ------------------------------------------
: exit_success
set " _LAMEXP_PATHS_INITIALIZED_= %DATE% "