@echo off echo. echo ****************************** set MY_HOME_DIR=C:\greenstone\gs-release-builder set MY_PKG_DIR=%MY_HOME_DIR%\packages echo %MY_HOME_DIR% %MY_PKG_DIR% set JAVA_HOME=%MY_PKG_DIR%\jdk8.0.302 if not exist "%JAVA_HOME%" echo %JAVA_HOME% does not exist& goto done set PATH=%JAVA_HOME%\bin;%PATH% echo + Set JAVA_HOME=%JAVA_HOME% and updated PATH set PERL_HOME=%MY_PKG_DIR%\strawberry-perl-5.18\perl if not exist "%PERL_HOME%" echo %PERL_HOME% does not exist& goto done set _PERL_TOPLEVEL=%MY_PKG_DIR%\strawberry-perl-5.18 set PATH=%PERL_HOME%\bin;%PERL_HOME%\site\bin;%_PERL_TOPLEVEL%\c\bin;%PATH% echo + Set PERL_HOME=%PERL_HOME% and updated PATH set ANT_HOME=%MY_PKG_DIR%\apache-ant-1.9.5 if not exist "%ANT_HOME%" echo %ANT_HOME% does not exist& goto done set PATH=%ANT_HOME%\bin;%PATH% echo + Set ANT_HOME=%ANT_HOME% and updated PATH :: Setup Visual Studio set vslocation=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build if not exist "%vslocation%" echo %vslocation% does not exist& goto done pushd "%vslocation%" :: host 64bit, target 32 bit call vcvarsamd64_x86 popd set "MY_HOME_DIR=" set "MY_PKG_DIR=" goto done ::: the rest of this is old stuff :: For notes on compiling GS2 on 64 bit Win 7 see :: http://wiki.greenstone.org/doku.php?id=en:developer:compiling_apache&#compiling_the_apache-httpd_included_with_gs2_on_64_bit_windows_7 :: The following JDK 6 is copied straight from the 32 bit Win machine into the 64 bit Win machine :: It was used to debug gli's GS3ServerThread's changeover to use Process.waitFor() ::set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_13& echo @@@@@@@@@ USING JAVA 6 @@@@@@@@@ ::set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_55 set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_20 if not exist "%JAVA_HOME%" echo %JAVA_HOME% does not exist& goto done set PATH=%JAVA_HOME%\bin;%PATH% echo + Set JAVA_HOME=%JAVA_HOME% and updated PATH rem set PERL_HOME=C:\Perl64 set PERL_HOME=C:\strawberry-perl32no64\perl ::if not exist "%PERL_HOME%" echo %PERL_HOME% does not exist& goto done set PATH=%PERL_HOME%\bin;%PATH% ::set PATH=%PERL_HOME%\perl\site\bin;%PERL_HOME%\perl\bin;%PERL_HOME%\c\bin;%PATH% ::echo + Set PERL_PATH=%PERL_HOME% and updated PATH set ANT_HOME=C:\apache-ant-1.9.4 set PATH=%ANT_HOME%\bin;%PATH% ::set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;%PATH% ::set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;C:\Program Files (x86)\putty;C:\Windows\System32\UnxUtils\usr\local\wbin;%PATH% rem set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;C:\Program Files (x86)\putty;C:\Windows\System32\linuxtools;%PATH% rem echo + Set ANT_HOME=%ANT_HOME% and updated PATH :: Setup Visual Studio env :: WORKS: ::call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat" :: Running VS in 64 bit mode doesn't work, need to run in 32 bit mode. :: For now only VS9.0 (VS2008) works :: call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat" ::::::set vslocation=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools ::::::if not exist "%vslocation%" echo %vslocation% does not exist& goto done ::::::pushd "%vslocation%" ::::::call vsvars32.bat ::::::popd :: Running VS in 64 bit works for Visual Studio 12: set vslocation=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC if not exist "%vslocation%" echo %vslocation% does not exist& goto done pushd "%vslocation%" call vcvarsall.bat amd64 popd rem pushd "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC" rem call vcvarsall.bat amd64 rem popd :: VS10 fails: Common Tools folder not found for VS10 rem call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat" :: VS12 fails: Calling "vsvars32.bat" above produces the same error as calling :: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64_x86\vcvarsamd64_x86.bat :: (and possibly the same error as calling :: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat without passing "amd64" param) rem call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\vsvars32.bat" :: Error: https://groups.google.com/forum/#!topic/UniMRCP/Iybpn51UYnI :: http://msdn.microsoft.com/en-us/library/ff770576.aspx :: http://stackoverflow.com/questions/11544563/can-i-set-the-platform-toolset-from-the-command-line-when-building-with-vs2010s :: /p:PlatformToolset=v100 :: If using SetEnv.cmd to set up MS SDK env (no longer needed even for compiling GS2 with debug): ::call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" :: Run with /? to see what options it takes (/x86, /x64, /ia64, /vista, /xp, /win7 and more) ::set sdklocation=C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin ::if not exist "%sdklocation%" echo %sdklocation% does not exist& goto done ::pushd "%sdklocation%" ::call SetEnv.cmd /x64 ::popd :done echo Done echo ****************************** echo.