Fix watch.bat to call default task

Fix watch.bat to call default task


rem watches, compiles & runs tests
rem skips running any tests which have LONG in description
ginkgo watch --skip=LONGTEST

Test watcher script for Windows

Test watcher script for Windows


:: Copyright 2018 The Outline Authors
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::      http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

@echo off

set DEVICE_NAME=outline-tap0
set DEVICE_HWID=tap0901

:: Check whether the device already exists.
netsh interface show interface name=%DEVICE_NAME% >nul
if %errorlevel% equ 0 (
  echo TAP network device already exists.
  goto :configure
)

:: Add the device, recording the names of devices before and after to help
:: us find the name of the new device.
::
:: Note:
::  - While we could limit the search to devices having ServiceName=%DEVICE_HWID%,
::    that will cause wmic to output just "no instances available" when there
::    are no other TAP devices present, messing up the diff.
::  - We do not use findstr, etc., to strip blank lines because those ancient tools
::    typically don't understand/output non-Latin characters (wmic *does*, even on
::    Windows 7).
set BEFORE_DEVICES=%tmp%\outlineinstaller-tap-devices-before.txt
set AFTER_DEVICES=%tmp%\outlineinstaller-tap-devices-after.txt

echo Creating TAP network device...
echo Storing current network device list...
wmic nic where "netconnectionid is not null" get netconnectionid > "%BEFORE_DEVICES%"
if %errorlevel% neq 0 (
  echo Could not store network device list. >&2
  exit /b 1
)
type "%BEFORE_DEVICES%"

echo Creating TAP network device...
tap-windows6\tapinstall install tap-windows6\OemVista.inf %DEVICE_HWID%
if %errorlevel% neq 0 (
  echo Could not create TAP network device. >&2
  exit /b 1
)
echo Storing new network device list...
wmic nic where "netconnectionid is not null" get netconnectionid > "%AFTER_DEVICES%"
if %errorlevel% neq 0 (
  echo Could not store network device list. >&2
  exit /b 1
)
type "%AFTER_DEVICES%"

:: Find the name of the new device and rename it.
::
:: Obviously, this command is a beast; roughly what it does, in this order, is:
::  - perform a diff on the *trimmed* (in case wmic uses different column widths) before and after
::    text files
::  - remove leading/trailing space and blank lines with trim()
::  - store the result in NEW_DEVICE
::  - print NEW_DEVICE, for debugging (though non-Latin characters may appear as ?)
::  - invoke netsh
::
:: Running all this in one go helps reduce the need to deal with temporary
:: files and the character encoding headaches that follow.
::
:: Note that we pipe input from /dev/null to prevent Powershell hanging forever
:: waiting on EOF.
echo Searching for new TAP network device name...
powershell "(compare-object (cat \"%BEFORE_DEVICES%\" | foreach-object {$_.trim()}) (cat \"%AFTER_DEVICES%\" | foreach-object {$_.trim()}) | format-wide -autosize | out-string).trim() | set-variable NEW_DEVICE; write-host \"New TAP device name: ${NEW_DEVICE}\"; netsh interface set interface name = \"${NEW_DEVICE}\" newname = \"%DEVICE_NAME%\"" <nul
if %errorlevel% neq 0 (
  echo Could not find or rename new TAP network device. >&2
  exit /b 1
)

:: We've occasionally seen delays before netsh will "see" the new device, at least for
:: purposes of configuring IP and DNS ("netsh interface show interface name=xxx" does not
:: seem to be affected).
echo Testing that the new TAP network device is visible to netsh...
netsh interface ip show interfaces | find "%DEVICE_NAME%" >nul
if %errorlevel% equ 0 goto :configure

:loop
echo waiting...
:: timeout doesn't like the environment created by nsExec::ExecToStack and exits with:
:: "ERROR: Input redirection is not supported, exiting the process immediately."
waitfor /t 10 thisisnotarealsignalname >nul 2>&1
netsh interface ip show interfaces | find "%DEVICE_NAME%" >nul
if %errorlevel% neq 0 goto :loop

:configure
echo (Re-)configuring TAP network device...

:: Give the device an IP address.
:: 10.0.85.x is a guess which we hope will work for most users (Docker for
:: Windows uses 10.0.75.x by default): if the address is already in use the
:: script will fail and the installer will show an error message to the user.
:: TODO: Actually search the system for an unused subnet or make the subnet
::       configurable in the Outline client.
netsh interface ip set address %DEVICE_NAME% static 10.0.85.2 255.255.255.0
if %errorlevel% neq 0 (
  echo Could not set TAP network device subnet. >&2
  exit /b 1
)

:: Windows has no system-wide DNS server; each network device can have its
:: "own" set of DNS servers. Windows seems to use the DNS server(s) of the
:: network device associated with the default gateway. This is good for us
:: as it means we do not have to modify the DNS settings of any other network
:: device in the system. Configure with OpenDNS and Dyn resolvers.
echo Configuring primary DNS...
netsh interface ip set dnsservers %DEVICE_NAME% static address=208.67.222.222
if %errorlevel% neq 0 (
  echo Could not configure TAP device primary DNS. >&2
  exit /b 1
)
echo Configuring secondary DNS...
netsh interface ip add dnsservers %DEVICE_NAME% 216.146.35.35 index=2
if %errorlevel% neq 0 (
  echo Could not configure TAP device secondary DNS. >&2
  exit /b 1
)
echo TAP network device added and configured successfully

:: Copyright 2018 The Outline Authors
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::      http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

@echo off
setlocal

set DEVICE_NAME=outline-tap0
set DEVICE_HWID=tap0901

:: Because we've seen multiple failures due to commands (netsh, etc.) not being
:: found, append some common directories to the PATH.
::
:: Note:
::  - %SystemRoot% almost always expands to c:\windows.
::  - Do *not* surround with quotes.
set PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%\system32\wbem;%SystemRoot%\system32\WindowsPowerShell/v1.0

:: Check whether the device already exists.
netsh interface show interface name=%DEVICE_NAME% >nul
if %errorlevel% equ 0 (
  echo TAP network device already exists.
  goto :configure
)

:: Add the device, recording the names of devices before and after to help
:: us find the name of the new device.
::
:: Note:
::  - While we could limit the search to devices having ServiceName=%DEVICE_HWID%,
::    that will cause wmic to output just "no instances available" when there
::    are no other TAP devices present, messing up the diff.
::  - We do not use findstr, etc., to strip blank lines because those ancient tools
::    typically don't understand/output non-Latin characters (wmic *does*, even on
::    Windows 7).
set BEFORE_DEVICES=%tmp%\outlineinstaller-tap-devices-before.txt
set AFTER_DEVICES=%tmp%\outlineinstaller-tap-devices-after.txt

echo Creating TAP network device...
echo Storing current network device list...
wmic nic where "netconnectionid is not null" get netconnectionid > "%BEFORE_DEVICES%"
if %errorlevel% neq 0 (
  echo Could not store network device list. >&2
  exit /b 1
)
type "%BEFORE_DEVICES%"

echo Creating TAP network device...
tap-windows6\tapinstall install tap-windows6\OemVista.inf %DEVICE_HWID%
if %errorlevel% neq 0 (
  echo Could not create TAP network device. >&2
  exit /b 1
)
echo Storing new network device list...
wmic nic where "netconnectionid is not null" get netconnectionid > "%AFTER_DEVICES%"
if %errorlevel% neq 0 (
  echo Could not store network device list. >&2
  exit /b 1
)
type "%AFTER_DEVICES%"

:: Find the name of the new device and rename it.
::
:: Obviously, this command is a beast; roughly what it does, in this order, is:
::  - perform a diff on the *trimmed* (in case wmic uses different column widths) before and after
::    text files
::  - remove leading/trailing space and blank lines with trim()
::  - store the result in NEW_DEVICE
::  - print NEW_DEVICE, for debugging (though non-Latin characters may appear as ?)
::  - invoke netsh
::
:: Running all this in one go helps reduce the need to deal with temporary
:: files and the character encoding headaches that follow.
::
:: Note that we pipe input from /dev/null to prevent Powershell hanging forever
:: waiting on EOF.
echo Searching for new TAP network device name...
powershell "(compare-object (cat \"%BEFORE_DEVICES%\" | foreach-object {$_.trim()}) (cat \"%AFTER_DEVICES%\" | foreach-object {$_.trim()}) | format-wide -autosize | out-string).trim() | set-variable NEW_DEVICE; write-host \"New TAP device name: ${NEW_DEVICE}\"; netsh interface set interface name = \"${NEW_DEVICE}\" newname = \"%DEVICE_NAME%\"" <nul
if %errorlevel% neq 0 (
  echo Could not find or rename new TAP network device. >&2
  exit /b 1
)

:: We've occasionally seen delays before netsh will "see" the new device, at least for
:: purposes of configuring IP and DNS ("netsh interface show interface name=xxx" does not
:: seem to be affected).
echo Testing that the new TAP network device is visible to netsh...
netsh interface ip show interfaces | find "%DEVICE_NAME%" >nul
if %errorlevel% equ 0 goto :configure

:loop
echo waiting...
:: timeout doesn't like the environment created by nsExec::ExecToStack and exits with:
:: "ERROR: Input redirection is not supported, exiting the process immediately."
waitfor /t 10 thisisnotarealsignalname >nul 2>&1
netsh interface ip show interfaces | find "%DEVICE_NAME%" >nul
if %errorlevel% neq 0 goto :loop

:configure
echo (Re-)configuring TAP network device...

:: Give the device an IP address.
:: 10.0.85.x is a guess which we hope will work for most users (Docker for
:: Windows uses 10.0.75.x by default): if the address is already in use the
:: script will fail and the installer will show an error message to the user.
:: TODO: Actually search the system for an unused subnet or make the subnet
::       configurable in the Outline client.
netsh interface ip set address %DEVICE_NAME% static 10.0.85.2 255.255.255.0
if %errorlevel% neq 0 (
  echo Could not set TAP network device subnet. >&2
  exit /b 1
)

:: Windows has no system-wide DNS server; each network device can have its
:: "own" set of DNS servers. Windows seems to use the DNS server(s) of the
:: network device associated with the default gateway. This is good for us
:: as it means we do not have to modify the DNS settings of any other network
:: device in the system. Configure with OpenDNS and Dyn resolvers.
echo Configuring primary DNS...
netsh interface ip set dnsservers %DEVICE_NAME% static address=208.67.222.222
if %errorlevel% neq 0 (
  echo Could not configure TAP device primary DNS. >&2
  exit /b 1
)
echo Configuring secondary DNS...
netsh interface ip add dnsservers %DEVICE_NAME% 216.146.35.35 index=2
if %errorlevel% neq 0 (
  echo Could not configure TAP device secondary DNS. >&2
  exit /b 1
)
echo TAP network device added and configured successfully


@echo off

if not exist "genie.exe" (
	echo Downloading genie...
	bitsadmin /transfer "genie" "https://github.com/bkaradzic/bx/raw/master/tools/bin/windows/genie.exe" "%~dp0\genie.exe"
)

IF "%1"=="" (
	echo No argument set
	echo Exemple : build.bat vs2015
	exit 1
)

genie.exe %*

@echo off

if not exist "genie.exe" (
	echo Downloading genie...
	rem bitsadmin /transfer "genie" "https://github.com/bkaradzic/bx/raw/master/tools/bin/windows/genie.exe" "%~dp0\genie.exe"
	powershell Invoke-WebRequest -Uri "https://github.com/bkaradzic/bx/raw/master/tools/bin/windows/genie.exe" -OutFile "%~dp0\genie.exe"
)

IF "%1"=="" (
	echo No argument set
	echo Exemple : build.bat vs2015
	exit 1
)

genie.exe %*

Use powershell instead of bitsadmin for download genie.exe


taskkill.exe /F /IM java.exe
taskkill.exe /F /IM javaW.exe
java -jar myrobotlab.jar -service python Python webGui WebGui -invoke python execFile %cd%/script.py

Update mrl.bat

Update mrl.bat

kill java before launch


@echo off
set root=%~dp0%
%root%..\node_modules\.bin\mocha  %root%ut --recursive -R spec

add win run.cmd

add win run.cmd


set BITS=""
set ARCH=""
if "%1%"=="" (
  if "%MBITS%" == "" (set BITS=32) else (set BITS=%MBITS%)
) else (
  set BITS=%1%
)
if "%BITS%"=="32" (
  set ARCH=i686
) else (
  set ARCH=x86_64
)

echo Build %BITS% bits with mingw-w64-%ARCH%

set OPATH=%PATH%
SET MSYS2=C:\msys64

set MINGW=%MSYS2%\mingw%BITS%\bin;%MSYS2%\usr\bin
set PATH=%MINGW%;%OPATH%;%CD%\Neovim\bin

pacman -Sy --noconfirm
pacman -S --needed --noconfirm mingw-w64-%ARCH%-gcc
pacman -S --needed --noconfirm mingw-w64-%ARCH%-cmake
pacman -S --needed --noconfirm mingw-w64-%ARCH%-jasper
pacman -S --needed --noconfirm mingw-w64-%ARCH%-python2
pacman -S --needed --noconfirm mingw-w64-%ARCH%-qt5-static

set MINGW=%MSYS2%\mingw%BITS%\bin
set PATH=%MINGW%;%OPATH%

rem CMake/MinGW workaround - remove sh.exe from PATH
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
where sh

set QTDIR=%MSYS2%\mingw%BITS%\qt5-static
set CMAKE_PREFIX_PATH=%QTDIR%
SET NVIM_QT_RUNTIME_PATH=../src/gui/runtime bin/nvim-qt

set PATH=%PATH%;%QTDIR%\bin;%CD%\Neovim\bin;

mkdir build
cd build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DUSE_STATIC_QT=1 ^
-DCMAKE_PREFIX_PATH=%QTDIR% -DCMAKE_INSTALL_PREFIX=../INSTALL ..
cmake --build . --target install
strip ..\INSTALL\bin\nvim-qt.exe

rem ctest -VV

set BITS=""
set ARCH=""
if "%1%"=="" (
  if "%MBITS%" == "" (set BITS=32) else (set BITS=%MBITS%)
) else (
  set BITS=%1%
)
if "%BITS%"=="32" (
  set ARCH=i686
) else (
  set ARCH=x86_64
)

echo Build %BITS% bits with mingw-w64-%ARCH%

set OPATH=%PATH%
SET MSYS2=C:\msys64

set MINGW=%MSYS2%\mingw%BITS%\bin;%MSYS2%\usr\bin
set PATH=%MINGW%;%OPATH%;%CD%\Neovim\bin

pacman -Sy --noconfirm
pacman -S --needed --noconfirm mingw-w64-%ARCH%-gcc
pacman -S --needed --noconfirm mingw-w64-%ARCH%-cmake
pacman -S --needed --noconfirm mingw-w64-%ARCH%-jasper
pacman -S --needed --noconfirm mingw-w64-%ARCH%-python2
pacman -S --needed --noconfirm mingw-w64-%ARCH%-qt5-static

set MINGW=%MSYS2%\mingw%BITS%\bin
set PATH=%MINGW%;%OPATH%

rem CMake/MinGW workaround - remove sh.exe from PATH
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
where sh

set QTDIR=%MSYS2%\mingw%BITS%\qt5-static
set CMAKE_PREFIX_PATH=%QTDIR%
SET NVIM_QT_RUNTIME_PATH=../src/gui/runtime bin/nvim-qt

set PATH=%PATH%;%QTDIR%\bin;%CD%\Neovim\bin;

mkdir build
cd build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DUSE_STATIC_QT=1 ^
-DCMAKE_PREFIX_PATH=%QTDIR% -DCMAKE_INSTALL_PREFIX=../INSTALL ..
cmake --build . --target install
ctest -VV
strip ..\INSTALL\bin\nvim-qt.exe

Enable tests when link qt5-staick

Enable tests when link qt5-staick


setlocal EnableDelayedExpansion

echo OFF

where curl
if errorlevel 1 (
    if not exist user_install.bat (
        echo "You must first install the cURL program or download manually the user_install.bat file"
        exit 1
    )
)

if exist user_install.bat (
    set CLEAN_INSTALL=0
) else (
    set CLEAN_INSTALL=1
)
if not exist user_install.bat curl https://raw.githubusercontent.com/StatisKit/StatisKit/master/doc/user/user_install.bat -o user_install.bat
if errorlevel 1 (
    echo "Download of the user_install.bat file for Conda installation failed."
    echo "Developer configuration failed."
    exit 1
)
call user_install.bat
if errorlevel 1 exit 1
if "%CLEAN_INSTALL%"=="1" del user_install.bat
echo ON
echo !PATH!

python -c "import conda_build" >nul 2>nul
if errorlevel 1 (
    conda install -n root conda-build -y
) else (
    conda update -n root conda-build -y
)
python -c "import binstar_client" >nul 2>nul
if errorlevel 1 (
    conda install -n root anaconda-client -y
) else (
    conda update -n root anaconda-client -y
)

if "%ENVIRONMENT%"== "" (
    conda env update statiskit/statiskit-dev
    if errorlevel 1 (
        echo "Installation of the development environment failed."
        echo "Developer configuration failed."
        exit 1
    ) else (
        echo "Developer configuration succeded."
    )
) else (
    conda env update statiskit/statiskit-dev -n %ENVIRONMENT%
    if errorlevel 1 (
        echo "Installation of the development environment failed."
        echo "Developer configuration failed."
        exit 1
    ) else (
        echo "Developer configuration succeded."
    )
)

echo OFF

echo OFF

where curl
if errorlevel 1 (
    if not exist user_install.bat (
        echo "You must first install the cURL program or download manually the user_install.bat file"
        exit 1
    )
)

if exist user_install.bat (
    set CLEAN_INSTALL=0
) else (
    set CLEAN_INSTALL=1
)
if not exist user_install.bat curl https://raw.githubusercontent.com/StatisKit/StatisKit/master/doc/user/user_install.bat -o user_install.bat
if errorlevel 1 (
    echo "Download of the user_install.bat file for Conda installation failed."
    echo "Developer configuration failed."
    exit 1
)
call user_install.bat
if errorlevel 1 exit 1
if "%CLEAN_INSTALL%"=="1" del user_install.bat

python -c "import conda_build" >nul 2>nul
if errorlevel 1 (
    conda install -n root conda-build -y
) else (
    conda update -n root conda-build -y
)
python -c "import binstar_client" >nul 2>nul
if errorlevel 1 (
    conda install -n root anaconda-client -y
) else (
    conda update -n root anaconda-client -y
)

:: if "%ENVIRONMENT%"== "" (
::     conda env update statiskit/statiskit-dev
::     if errorlevel 1 (
::         echo "Installation of the development environment failed."
::         echo "Developer configuration failed."
::         exit 1
::     ) else (
::         echo "Developer configuration succeded."
::     )
:: ) else (
::     conda env update statiskit/statiskit-dev -n %ENVIRONMENT%
::     if errorlevel 1 (
::         echo "Installation of the development environment failed."
::         echo "Developer configuration failed."
::         exit 1
::     ) else (
::         echo "Developer configuration succeded."
::     )
:: )

echo OFF

Update developer_install.bat

Update developer_install.bat


@echo off
::
:: Prebuild generator for the OpenMetaverse Library
::
:: Command Line Options:
:: (none)            - create solution/project files and create compile.bat file to build solution
:: msbuild           - Create project files, compile solution
:: msbuild runtests  - create project files, compile solution, run unit tests
:: msbuild docs      - create project files, compile solution, build API documentation
:: msbuild docs dist - Create project files, compile solution, run unit tests, build api documentation, create binary zip
::                   - and exe installer
::
:: nant		     - Create project files, run nant to compile solution
:: nant runtests     - Create project files, run nant to compile solution, run unit tests
::

echo ##########################################
echo creating prebuild files for: vs2010
echo Parameters: %1 %2
echo ##########################################

:: run prebuild to generate solution/project files from prebuild.xml configuration file
bin\Prebuild.exe /target vs2012

:: build compile.bat file based on command line parameters
echo @echo off > compile.bat
if(.%1)==(.) echo C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild OpenMetaverse.sln >> compile.bat

if(.%1)==(.msbuild) echo echo ==== COMPILE BEGIN ==== >> compile.bat
if(.%1)==(.msbuild) echo %SystemRoot%\Microsoft.NET\Framework\v3.5\MSBuild.exe /p:Configuration=Release OpenMetaverse.sln >> compile.bat
if(.%1)==(.msbuild) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

if(.%1)==(.nant) echo nant >> compile.bat
if(.%1)==(.nant) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

if(.%2)==(.docs) echo echo ==== GENERATE DOCUMENTATION BEGIN ==== >> compile.bat
if(.%2)==(.docs) echo %SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /p:Configuration=Release docs\OpenMetaverse.shfbproj >> compile.bat
if(.%2)==(.docs) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat
if(.%2)==(.docs) echo 7z.exe a -tzip docs\documentation.zip docs\trunk >> compile.bat
if(.%2)==(.docs) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

if(.%2)==(.runtests) echo echo ==== UNIT TESTS BEGIN ==== >> compile.bat
if(.%2)==(.runtests) echo nunit-console bin\OpenMetaverse.Tests.dll /exclude:Network /nodots /labels /xml:testresults.xml >> compile.bat

if(.%2)==(.runtests) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

:: nsis compiler needs to be in path
if(.%3)==(.dist) echo echo ==== GENERATE DISTRIBUTION BEGIN ==== >> compile.bat
if(.%3)==(.dist) echo makensis.exe /DPlatform=test docs\OpenMetaverse-installer.nsi >> compile.bat
if(.%3)==(.dist) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat
if(.%3)==(.dist) echo 7z.exe a -tzip dist\openmetaverse-dist.zip @docs\distfiles.lst >> compile.bat
if(.%3)==(.dist) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

echo :SUCCESS >> compile.bat
echo echo Build Successful! >> compile.bat
echo exit /B 0 >> compile.bat
echo :FAIL >> compile.bat
echo echo Build Failed, check log for reason >> compile.bat
echo exit /B 1 >> compile.bat

:: perform the appropriate action
if(.%1)==(.msbuild) compile.bat
if(.%1)==(.nant) compile.bat
if(.%1)==(.dist) compile.bat

@echo off
::
:: Prebuild generator for the OpenMetaverse Library
::
:: Command Line Options:
:: (none)            - create solution/project files and create compile.bat file to build solution
:: msbuild           - Create project files, compile solution
:: msbuild runtests  - create project files, compile solution, run unit tests
:: msbuild docs      - create project files, compile solution, build API documentation
:: msbuild docs dist - Create project files, compile solution, run unit tests, build api documentation, create binary zip
::                   - and exe installer
::
:: nant		     - Create project files, run nant to compile solution
:: nant runtests     - Create project files, run nant to compile solution, run unit tests
::

echo ##########################################
echo creating prebuild files for: vs2012
echo Parameters: %1 %2
echo ##########################################

:: run prebuild to generate solution/project files from prebuild.xml configuration file
bin\Prebuild.exe /target vs2012

:: build compile.bat file based on command line parameters
echo @echo off > compile.bat
if(.%1)==(.) echo C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild OpenMetaverse.sln >> compile.bat

if(.%1)==(.msbuild) echo echo ==== COMPILE BEGIN ==== >> compile.bat
if(.%1)==(.msbuild) echo %SystemRoot%\Microsoft.NET\Framework\v3.5\MSBuild.exe /p:Configuration=Release OpenMetaverse.sln >> compile.bat
if(.%1)==(.msbuild) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

if(.%1)==(.nant) echo nant >> compile.bat
if(.%1)==(.nant) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

if(.%2)==(.docs) echo echo ==== GENERATE DOCUMENTATION BEGIN ==== >> compile.bat
if(.%2)==(.docs) echo %SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /p:Configuration=Release docs\OpenMetaverse.shfbproj >> compile.bat
if(.%2)==(.docs) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat
if(.%2)==(.docs) echo 7z.exe a -tzip docs\documentation.zip docs\trunk >> compile.bat
if(.%2)==(.docs) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

if(.%2)==(.runtests) echo echo ==== UNIT TESTS BEGIN ==== >> compile.bat
if(.%2)==(.runtests) echo nunit-console bin\OpenMetaverse.Tests.dll /exclude:Network /nodots /labels /xml:testresults.xml >> compile.bat

if(.%2)==(.runtests) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

:: nsis compiler needs to be in path
if(.%3)==(.dist) echo echo ==== GENERATE DISTRIBUTION BEGIN ==== >> compile.bat
if(.%3)==(.dist) echo makensis.exe /DPlatform=test docs\OpenMetaverse-installer.nsi >> compile.bat
if(.%3)==(.dist) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat
if(.%3)==(.dist) echo 7z.exe a -tzip dist\openmetaverse-dist.zip @docs\distfiles.lst >> compile.bat
if(.%3)==(.dist) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat

echo :SUCCESS >> compile.bat
echo echo Build Successful! >> compile.bat
echo exit /B 0 >> compile.bat
echo :FAIL >> compile.bat
echo echo Build Failed, check log for reason >> compile.bat
echo exit /B 1 >> compile.bat

:: perform the appropriate action
if(.%1)==(.msbuild) compile.bat
if(.%1)==(.nant) compile.bat
if(.%1)==(.dist) compile.bat

minor: Change runprebuild2012.bat to say it is creating vs2010 files and not vs2012


echo off

REM Usage: set_pycompiler C:\Python37 mingw32
REM Where %PYTHON_DIR% is the directory of your Python installation.
REM Compiler option can be "mingw32" or "msvc".
REM In Pyslvs project.
set HERE=%~dp0
set PYTHON_DIR=%1
set COMPILER=%2

REM Create "distutils.cfg"
echo [build]>> "%PYTHON_DIR%\Lib\distutils\distutils.cfg"
echo compiler=%COMPILER%>> "%PYTHON_DIR%\Lib\distutils\distutils.cfg"

REM Apply the patch of "cygwinccompiler.py".
REM Unix "patch" command of Msys.
patch "%PYTHON_DIR%\lib\distutils\cygwinccompiler.py" "%HERE%patch.diff"

REM Copy "vcruntime140.dll" to "libs".
copy "%PYTHON_DIR%\vcruntime140.dll" "%PYTHON_DIR%\libs"

echo off

REM Usage: set_pycompiler C:\Python37 mingw32
REM Where %PYTHON_DIR% is the directory of your Python installation.
REM Compiler option can be "mingw32" or "msvc".
REM In Pyslvs project.
set HERE=%~dp0
set PYTHON_DIR=%1
set COMPILER=%2

REM Create "distutils.cfg"
set DISTUTILS=%PYTHON_DIR%\Lib\distutils\distutils.cfg
if exist "%DISTUTILS%" del "%DISTUTILS%" /Q /S
echo [build]>> "%DISTUTILS%"
echo compiler=%COMPILER%>> "%DISTUTILS%"
echo patched file "%DISTUTILS%"
REM Apply the patch of "cygwinccompiler.py".
REM Unix "patch" command of Msys.
patch -N "%PYTHON_DIR%\lib\distutils\cygwinccompiler.py" "%HERE%\patch.diff"

REM Copy "vcruntime140.dll" to "libs".
copy "%PYTHON_DIR%\vcruntime140.dll" "%PYTHON_DIR%\libs"
echo copied "vcruntime140.dll".

Allow reusing "set_compiler" command.

Allow reusing "set_compiler" command.


@echo off
REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
REM for details. All rights reserved. Use of this source code is governed by a
REM BSD-style license that can be found in the LICENSE file.

setlocal
rem Handle the case where dart-sdk/bin has been symlinked to.
set DIR_NAME_WITH_SLASH=%~dp0
set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
rem Get rid of surrounding quotes.
for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi

rem Get absolute full name for SDK_DIR.
for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi

set DART2JS=%SDK_DIR%lib\_internal\compiler\implementation\dart2js.dart
set DART=%BIN_DIR%\dart
set SNAPSHOT=%BIN_DIR%\snapshots\utils_wrapper.dart.snapshot

set EXTRA_OPTIONS=
set EXTRA_VM_OPTIONS=

if _%DART2JS_DEVELOPER_MODE%_ == _1_ (
  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --checked
)

if exist "%SNAPSHOT%" (
  echo Using snapshot "%SNAPSHOT%" >&2
  set EXTRA_OPTIONS=%EXTRA_OPTIONS% --library-root=%SDK_DIR%
)

rem See comments regarding options below in dart2js shell script.
set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --heap_growth_rate=512

if exist "%SNAPSHOT%" (
  "%DART%" %EXTRA_VM_OPTIONS% "%SNAPSHOT%" "dart2js" %EXTRA_OPTIONS% %*
) else (
  "%DART%" %EXTRA_VM_OPTIONS% "%DART2JS%" %EXTRA_OPTIONS% %*
)

endlocal

exit /b %errorlevel%

:follow_links
setlocal
for %%i in (%1) do set result=%%~fi
set current=
for /f "tokens=2 delims=[]" %%i in ('dir /a:l ^"%~dp1^" 2^>nul ^
                                     ^| find ">     %~n1 ["') do (
  set current=%%i
)
if not "%current%"=="" call :follow_links "%current%", result
endlocal & set %~2=%result%
goto :eof

:end

@echo off
REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
REM for details. All rights reserved. Use of this source code is governed by a
REM BSD-style license that can be found in the LICENSE file.

setlocal
rem Handle the case where dart-sdk/bin has been symlinked to.
set DIR_NAME_WITH_SLASH=%~dp0
set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
rem Get rid of surrounding quotes.
for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi

rem Get absolute full name for SDK_DIR.
for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi

set DART2JS=%SDK_DIR%lib\_internal\compiler\implementation\dart2js.dart
set DART=%BIN_DIR%\dart
set SNAPSHOT=%BIN_DIR%\snapshots\utils_wrapper.dart.snapshot

set EXTRA_OPTIONS=
set EXTRA_VM_OPTIONS=

if _%DART2JS_DEVELOPER_MODE%_ == _1_ (
  set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --checked
)

if exist "%SNAPSHOT%" (
  echo Using snapshot "%SNAPSHOT%" >&2
  set EXTRA_OPTIONS=%EXTRA_OPTIONS% --library-root="%SDK_DIR%"
)

rem See comments regarding options below in dart2js shell script.
set EXTRA_VM_OPTIONS=%EXTRA_VM_OPTIONS% --heap_growth_rate=512

if exist "%SNAPSHOT%" (
  "%DART%" %EXTRA_VM_OPTIONS% "%SNAPSHOT%" "dart2js" %EXTRA_OPTIONS% %*
) else (
  "%DART%" %EXTRA_VM_OPTIONS% "%DART2JS%" %EXTRA_OPTIONS% %*
)

endlocal

exit /b %errorlevel%

:follow_links
setlocal
for %%i in (%1) do set result=%%~fi
set current=
for /f "tokens=2 delims=[]" %%i in ('dir /a:l ^"%~dp1^" 2^>nul ^
                                     ^| find ">     %~n1 ["') do (
  set current=%%i
)
if not "%current%"=="" call :follow_links "%current%", result
endlocal & set %~2=%result%
goto :eof

:end

Fix issue 9844 by adressing additional review comments

Comments by Peter here should fix it:
https://codereview.chromium.org/13812019/
Review URL: https://codereview.chromium.org//14222009

git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@21331 260f80e4-7a28-3924-810f-c04153c831b5


npm install --user "%USERNAME%"  ^
            --python=python2.7   ^
            --loglevel warn      ^
            .
npm start
npm prune --production
del /s /q %PREFIX%\share\man\man1\gulp.1
robocopy build %PREFIX%/static /s /e
:: OS X installs node-gyp globally for some reason which means it ends up in ${PREFIX}
if exist %PREFIX%\lib\node_modules del /s /q %PREFIX%\lib\node_modules
:: Seems some other cruft is left lying around ..
if exist %PREFIX%\build\tmp del /s /q %PREFIX%\build\tmp

Create bld.bat

Create bld.bat


nmake -nologo -f ifdef.mak

move ifdef.exe %CINTSYSDIR%\ifdef.exe

nmake -nologo -f ifdef.mak clean

undo revision 22284, which was a test for write permission

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@22286 27541ba8-7e3a-0410-8455-c3a389f83636


git init
touch README.md
git add README.md
git add .gitignore
git commit -m"initial commit"
cd external
git submodule add --depth 1 -- https://github.com/fmtlib/fmt.git
git submodule add --depth 1 -- https://github.com/gabime/spdlog.git
cd ..

git init
touch README.md
git add README.md
git add .gitignore
git commit -m"initial commit"
cd external
git submodule add --depth 1 -- https://github.com/fmtlib/fmt.git
git submodule add --depth 1 -- https://github.com/gabime/spdlog.git
git submodule add --depth 1 -- https://github.com/onqtam/doctest.git
cd ..

Fix batch script missing submodule

Fix batch script missing submodule


@echo off
cls
:start
echo Starting server...

"Nomad Server\NomadServer.exe" -name "My Oxide Server" -port 5127 -slots 10 -clientVersion "0.91" -password "" -tcpLobby "149.202.51.185" 25565

echo.
echo Restarting server...
echo.
goto start

@echo off
cls
:start
echo Starting server...

"Nomad Server\NomadServer.exe" -name "My Oxide Server" -port 5127 -slots 10 -clientVersion "0.92" -password "" -tcpLobby "149.202.51.185" 25565

echo.
echo Restarting server...
echo.
goto start

Patch for version 0.92 update

[Nomad] Patch for version 0.92 update


@echo off
cls
echo This is only a placeholder file; all Windows 7/8/8.1 telemetry purging code is directly integrated into the main Tron script
pause

@echo off
cls
echo.
echo This is a placeholder file; all Windows 7/8/8.1 telemetry purge code is directly integrated into the main

Tron script
echo.

pause

Update purge_windows_7-8-81_telemetry.bat


:: Copyright 2012 The Go Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style
:: license that can be found in the LICENSE file.

:: Environment variables that control make.bat:
::
:: GOROOT_FINAL: The expected final Go root, baked into binaries.
:: The default is the location of the Go tree during the build.
::
:: GOHOSTARCH: The architecture for host tools (compilers and
:: binaries).  Binaries of this type must be executable on the current
:: system, so the only common reason to set this is to set
:: GOHOSTARCH=386 on an amd64 machine.
::
:: GOARCH: The target architecture for installed packages and tools.
::
:: GOOS: The target operating system for installed packages and tools.
::
:: GO_GCFLAGS: Additional 5g/6g/8g arguments to use when
:: building the packages and commands.
::
:: GO_LDFLAGS: Additional 5l/6l/8l arguments to use when
:: building the commands.
::
:: CGO_ENABLED: Controls cgo usage during the build. Set it to 1
:: to include all cgo related files, .c and .go file with "cgo"
:: build directive, in the build. Set it to 0 to ignore them.

@echo off

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

if exist make.bat goto ok
echo Must run make.bat from Go src directory.
goto fail
:ok

:: Clean old generated file that will cause problems in the build.
del /F ".\pkg\runtime\runtime_defs.go" 2>NUL

:: Grab default GOROOT_FINAL and set GOROOT for build.
:: The expression %VAR:\=\\% means to take %VAR%
:: and apply the substitution \ = \\, escaping the
:: backslashes.  Then we wrap that in quotes to create
:: a C string.
cd ..
set GOROOT=%CD%
cd src
if "x%GOROOT_FINAL%"=="x" set GOROOT_FINAL=%GOROOT%
set DEFGOROOT=-DGOROOT_FINAL="\"%GOROOT_FINAL:\=\\%\""

echo # Building C bootstrap tool.
echo cmd/dist
if not exist ..\bin\tool mkdir ..\bin\tool
:: Windows has no glob expansion, so spell out cmd/dist/*.c.
gcc -O2 -Wall -Werror -o cmd/dist/dist.exe -Icmd/dist %DEFGOROOT% cmd/dist/buf.c cmd/dist/build.c cmd/dist/buildgc.c cmd/dist/buildgo.c cmd/dist/buildruntime.c cmd/dist/goc2c.c cmd/dist/main.c cmd/dist/windows.c cmd/dist/arm.c
if errorlevel 1 goto fail
.\cmd\dist\dist env -wp >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

if x%1==x--dist-tool goto copydist
if x%2==x--dist-tool goto copydist

echo # Building compilers and Go bootstrap tool.
set buildall=-a
if x%1==x--no-clean set buildall=
.\cmd\dist\dist bootstrap %buildall% -v
if errorlevel 1 goto fail
:: Delay move of dist tool to now, because bootstrap cleared tool directory.
move .\cmd\dist\dist.exe "%GOTOOLDIR%\dist.exe"
"%GOTOOLDIR%\go_bootstrap" clean -i std
echo.

if not %GOHOSTARCH% == %GOARCH% goto localbuild
if not %GOHOSTOS% == %GOOS% goto localbuild
goto mainbuild

:localbuild
echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH%
setlocal
set GOOS=%GOHOSTOS%
set GOARCH=%GOHOSTARCH%
"%GOTOOLDIR%\go_bootstrap" install -gcflags "%GO_GCFLAGS%" -ldflags "%GO_LDFLAGS%" -v std
endlocal
if errorlevel 1 goto fail
echo.

:mainbuild
echo # Building packages and commands.
"%GOTOOLDIR%\go_bootstrap" install -gcflags "%GO_GCFLAGS%" -ldflags "%GO_LDFLAGS%" -a -v std
if errorlevel 1 goto fail
del "%GOTOOLDIR%\go_bootstrap.exe"
echo.

if x%1==x--no-banner goto nobanner
"%GOTOOLDIR%\dist" banner
:nobanner

goto end

:copydist
mkdir "%GOTOOLDIR%" 2>NUL
copy cmd\dist\dist.exe "%GOTOOLDIR%\"
goto end

:fail
set GOBUILDFAIL=1

:end
if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL%

return exit code to dashboard builder

make.bat: return exit code to dashboard builder

Fixes issue 7806.

LGTM=minux
R=golang-codereviews, minux
CC=golang-codereviews
https://codereview.appspot.com/104690043


@echo off

setlocal enableextensions enabledelayedexpansion

rem this will be eventually overridden by phpsdk_setvars, but nothing wrong to use the same name here
set PHP_SDK_ROOT_PATH=%~dp0
set PHP_SDK_ROOT_PATH=%PHP_SDK_ROOT_PATH:~0,-1%

:getopt
if /i "%1" equ "-h" goto help
if /i "%1" equ "-c" set CRT=%2 & shift
if /i "%1" equ "-a" set ARCH=%2 & shift
if /i "%1" equ "-t" set TASK=%2 & shift
if /i "%1" equ "--task-args" set TASK_ARGS=%2 & shift
shift
if not (%1)==() goto getopt

if "%CRT%" equ "" goto help
if "%ARCH%" equ "" goto help
goto skip_help

:help
	echo Usage: phpsdk-starter -c ^<crt^> -a ^<arch^> [-t ^<task_script.bat^>]
	exit /b 0

:skip_help

set CRT=%CRT: =%
set ARCH=%ARCH: =%

set PHP_SDK_RUN_FROM_ROOT=1

title PHP SDK

call %PHP_SDK_ROOT_PATH%\bin\phpsdk_setshell.bat %CRT% %ARCH%

set PHP_SDK_RUN_FROM_ROOT=
set CRT=
set ARCH=

if errorlevel 3 (
	exit /b %errorlevel%
)

if "%TASK%" neq "" (
	if exist "%TASK%" (
		set TASK_ARGS=%TASK_ARGS:"=%

		if exist "%PHP_SDK_ROOT_PATH%\phpsdk-local.bat" (
			cmd /c "!PHP_SDK_VC_SHELL_CMD! && %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %PHP_SDK_ROOT_PATH%\phpsdk-local.bat && %TASK% !TASK_ARGS!"
		) else (
			cmd /c "!PHP_SDK_VC_SHELL_CMD! && %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %TASK% !TASK_ARGS!"
		)
		set TASK=
		exit /b
	) else (
		echo could not find the task file
		set TASK=
		exit /b 3
	)
)

if exist "%PHP_SDK_ROOT_PATH%\phpsdk-local.bat" (
	cmd /k "!PHP_SDK_VC_SHELL_CMD! && %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %PHP_SDK_ROOT_PATH%\bin\phpsdk_dumpenv.bat && %PHP_SDK_ROOT_PATH%\phpsdk-local.bat && echo. && set prompt=$P$_$+$$$S"
) else (
	cmd /k "!PHP_SDK_VC_SHELL_CMD! && %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %PHP_SDK_ROOT_PATH%\bin\phpsdk_dumpenv.bat && set prompt=$P$_$+$$$S"
)

exit /b

@echo off

setlocal enableextensions enabledelayedexpansion

rem this will be eventually overridden by phpsdk_setvars, but nothing wrong to use the same name here
set PHP_SDK_ROOT_PATH=%~dp0
set PHP_SDK_ROOT_PATH=%PHP_SDK_ROOT_PATH:~0,-1%

:getopt
if /i "%1" equ "-h" goto help
if /i "%1" equ "-c" set CRT=%2 & shift
if /i "%1" equ "-a" set ARCH=%2 & shift
if /i "%1" equ "-t" set TASK=%2 & shift
if /i "%1" equ "--task-args" set TASK_ARGS=%2 & shift
shift
if not (%1)==() goto getopt

if "%CRT%" equ "" goto help
if "%ARCH%" equ "" goto help
goto skip_help

:help
	echo Usage: phpsdk-starter -c ^<crt^> -a ^<arch^> [-t ^<task_script.bat^> [task script args]]
	exit /b 0

:skip_help

set CRT=%CRT: =%
set ARCH=%ARCH: =%

set PHP_SDK_RUN_FROM_ROOT=1

title PHP SDK

call %PHP_SDK_ROOT_PATH%\bin\phpsdk_setshell.bat %CRT% %ARCH%

set PHP_SDK_RUN_FROM_ROOT=
set CRT=
set ARCH=

if errorlevel 3 (
	exit /b %errorlevel%
)

if "%TASK%" neq "" (
	if exist "%TASK%" (
		set TASK_ARGS=%TASK_ARGS:"=%

		if exist "%PHP_SDK_ROOT_PATH%\phpsdk-local.bat" (
			cmd /c "!PHP_SDK_VC_SHELL_CMD! && %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %PHP_SDK_ROOT_PATH%\phpsdk-local.bat && %TASK% !TASK_ARGS!"
		) else (
			cmd /c "!PHP_SDK_VC_SHELL_CMD! && %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %TASK% !TASK_ARGS!"
		)
		set TASK=
		exit /b
	) else (
		echo could not find the task file
		set TASK=
		exit /b 3
	)
)

if exist "%PHP_SDK_ROOT_PATH%\phpsdk-local.bat" (
	cmd /k "!PHP_SDK_VC_SHELL_CMD! && %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %PHP_SDK_ROOT_PATH%\bin\phpsdk_dumpenv.bat && %PHP_SDK_ROOT_PATH%\phpsdk-local.bat && echo. && set prompt=$P$_$+$$$S"
) else (
	cmd /k "!PHP_SDK_VC_SHELL_CMD! && %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %PHP_SDK_ROOT_PATH%\bin\phpsdk_dumpenv.bat && set prompt=$P$_$+$$$S"
)

exit /b

extend help msg

extend help msg


@echo off
REM This is the version of MakeHelp.bat for use with VS2005 on Veronica
REM Changes were for where the MFC help map file (afxhelp.hm) is found
REM the BCG help map file (BCGControlBar.hm) and where the release
REM version of HexEdit.exe is found (now in D:\Andrew\cpp_out\HexEdit\).

REM It creates the help map files used by RoboHelp to do context
REM help and What's this help using HexEdit.chm.
REM It also replaces the icon in the release version of HexEdit.exe.

ECHO Command IDs
echo // MAKEHELP.BAT generated Help Map file. >"HTMLHELP\CmdIdMap.h"
echo // Commands (ID_* and IDM_*) >>"HTMLHELP\CmdIdMap.h"
makehm ID_,HID_,0x10000 IDM_,HIDM_,0x10000 resource.h >"CmdIdMap.tmp"
sed "s/^HID/#define HID/"  <"CmdIdMap.tmp" >>"HTMLHELP\CmdIdMap.h"
del "CmdIdMap.tmp"

ECHO MFC Command IDs
rem copy /y I:\Micros~1\vc98\mfc\include\afxhelp.hm  AfxIdMap.tmp
rem copy /y "C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include\afxhelp.hm"  AfxIdMap.tmp
rem copy /y "C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afxhelp.hm"  AfxIdMap.tmp
copy /y "C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afxhelp.hm"  AfxIdMap.tmp
sed "s/^HID/#define HID/"  <AfxIdMap.tmp >AfxId2.tmp
sed "s/^AFX_HID/#define AFX_HID/"  <AfxId2.tmp   >"HTMLHELP\AfxIdMap.h"
del AfxIdMap.tmp
del AfxId2.tmp

ECHO Dialog IDs
echo // MAKEHELP.BAT generated Help Map file. >"HTMLHELP\DlgIdMap.h"
echo // Dialogs (IDD_*) >>"HTMLHELP\DlgIdMap.h"
makehm IDD_,HIDD_,0x20000 resource.h >"DlgIdMap.tmp"
sed "s/^HID/#define HID/"  <"DlgIdMap.tmp" >>"HTMLHELP\DlgIdMap.h"
del "DlgIdMap.tmp"

ECHO Control IDs (for What's This help)
copy /y helpid.hm+resource.hm  HTMLHelp\CtlIdMap.h

rem ECHO BCG Control IDs
rem copy /y "D:\Devel\BCG6_2\BCGControlBar\Help\BCGControlBar.hm" BcgIdMap.tmp
rem sed "s/^HID/#define HID/"  <BcgIdMap.tmp >"HTMLHELP\BcgIdMap.h"
rem del BcgIdMap.tmp

ECHO Fix up hexedit.exe icon since the resource compiler cannot handle the new icon format
ReplaceVistaIcon  D:\Andrew\cpp_out\HexEdit\ReleaseVS2005\hexedit.exe   res\hexedit2.ico

@echo off
REM This is the version of MakeHelp.bat for use with VS2005 on Veronica
REM Changes were for where the MFC help map file (afxhelp.hm) is found
REM the BCG help map file (BCGControlBar.hm) and where the release
REM version of HexEdit.exe is found (now in D:\Andrew\cpp_out\HexEdit\).

REM It creates the help map files used by RoboHelp to do context
REM help and What's this help using HexEdit.chm.
REM It also replaces the icon in the release version of HexEdit.exe.

ECHO Command IDs
echo // MAKEHELP.BAT generated Help Map file. >"HTMLHELP\CmdIdMap.h"
echo // Commands (ID_* and IDM_*) >>"HTMLHELP\CmdIdMap.h"
makehm ID_,HID_,0x10000 IDM_,HIDM_,0x10000 resource.h >"CmdIdMap.tmp"
"C:\Program Files\Utilities\sed"  "s/^HID/#define HID/"  <"CmdIdMap.tmp" >>"HTMLHELP\CmdIdMap.h"
del "CmdIdMap.tmp"

ECHO MFC Command IDs
rem copy /y I:\Micros~1\vc98\mfc\include\afxhelp.hm  AfxIdMap.tmp
rem copy /y "C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include\afxhelp.hm"  AfxIdMap.tmp
rem copy /y "C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afxhelp.hm"  AfxIdMap.tmp
rem copy /y "C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afxhelp.hm"  AfxIdMap.tmp
copy /y "C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxhelp.hm"  AfxIdMap.tmp
"C:\Program Files\Utilities\sed"  "s/^HID/#define HID/"  <AfxIdMap.tmp >AfxId2.tmp
"C:\Program Files\Utilities\sed"  "s/^AFX_HID/#define AFX_HID/"  <AfxId2.tmp   >"HTMLHELP\AfxIdMap.h"
del AfxIdMap.tmp
del AfxId2.tmp

ECHO Dialog IDs
echo // MAKEHELP.BAT generated Help Map file. >"HTMLHELP\DlgIdMap.h"
echo // Dialogs (IDD_*) >>"HTMLHELP\DlgIdMap.h"
makehm IDD_,HIDD_,0x20000 resource.h >"DlgIdMap.tmp"
"C:\Program Files\Utilities\sed"  "s/^HID/#define HID/"  <"DlgIdMap.tmp" >>"HTMLHELP\DlgIdMap.h"
del "DlgIdMap.tmp"

ECHO Control IDs (for What's This help)
copy /y helpid.hm+resource.hm  HTMLHelp\CtlIdMap.h

rem ECHO BCG Control IDs
rem copy /y "D:\Devel\BCG6_2\BCGControlBar\Help\BCGControlBar.hm" BcgIdMap.tmp
rem "C:\Program Files\Utilities\sed"  "s/^HID/#define HID/"  <BcgIdMap.tmp >"HTMLHELP\BcgIdMap.h"
rem del BcgIdMap.tmp

ECHO Fix up hexedit.exe icon since the resource compiler cannot handle the new icon format
rem ReplaceVistaIcon  D:\Andrew\cpp_out\HexEdit\ReleaseVS2005\hexedit.exe   res\hexedit2.ico
"C:\Program Files\Utilities\ReplaceVistaIcon"  "C:\andrew\cpp_out\HexEdit\ReleaseVS2010\HexEditPro.exe"   res\hexedit2.ico

Update post-build batch file to work properly
- fix path to commands (sed.exe and ReplaceVistaIcon.exe)
- fix path to afxhelp.hm for VS2010
- fix path to output HexEditPro.exe (for icon replacement)

git-svn-id: c806da28ca781a1e2f2d0b1fde2a9d9a144b325a@1210 295070fd-a27b-da4f-a32e-77c6a882a0e3


SET AIR_SDK=%USERPROFILE%\Documents\AdobeAIRSDK
set FLEX_SDK=%ProgramFiles(x86)%\FlashDevelop\Tools\flexsdk
set UNZIP_DIR=%ProgramFiles(x86)%\GnuWin32\bin

"%FLEX_SDK%\bin\compc" +configname=air -source-path ..\src -optimize ^
                       -include-classes com.amanitadesign.steam.FRESteamWorks ^
                                        com.amanitadesign.steam.SteamConstants ^
                       -swf-version=11 -output FRESteamWorksLib.swc

"%UNZIP_DIR%\unzip" -o FRESteamWorksLib.swc

call "%AIR_SDK%\bin\adt" -package -target ane FRESteamWorks.ane descriptor.xml ^
                         -swc FRESteamWorksLib.swc ^
                         -platform Windows-x86 library.swf FRESteamWorks.dll ^
                         -platform MacOS-x86 library.swf FRESteamWorks.framework ^
                         -platform default library.swf

del library.swf
del catalog.xml

"%UNZIP_DIR%\unzip" -o FRESteamWorks.ane -d FRESteamWorks.Unpacked.ane

SET AIR_SDK=%USERPROFILE%\Documents\AdobeAIRSDK
set FLEX_SDK=%ProgramFiles(x86)%\FlashDevelop\Tools\flexsdk
set UNZIP_DIR=%ProgramFiles(x86)%\GnuWin32\bin

"%FLEX_SDK%\bin\compc" +configname=air -source-path ..\src -optimize ^
                       -include-sources ..\src\
                       -swf-version=11 -output FRESteamWorksLib.swc

"%UNZIP_DIR%\unzip" -o FRESteamWorksLib.swc

call "%AIR_SDK%\bin\adt" -package -target ane FRESteamWorks.ane descriptor.xml ^
                         -swc FRESteamWorksLib.swc ^
                         -platform Windows-x86 library.swf FRESteamWorks.dll ^
                         -platform MacOS-x86 library.swf FRESteamWorks.framework ^
                         -platform default library.swf

del library.swf
del catalog.xml

"%UNZIP_DIR%\unzip" -o FRESteamWorks.ane -d FRESteamWorks.Unpacked.ane

Fix Windows build script

Fix Windows build script


"c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" JShellOverlayIconHandler.csproj /p:TargetFrameworkVersion=v4.0;Platform=x86;AssemblyName=JShellOverlayIconHandler.net4.x84.dll /tv:15.0

"c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" JShellOverlayIconHandler.csproj /p:TargetFrameworkVersion=v4.0;Platform=x86;AssemblyName=JShellOverlayIconHandler.net4.x86.dll /tv:15.0

Fix typo

Fix typo


copy "index-Before June 2010 Patch.db" index.db
pause

Test index file

Test index file


@echo off
pushd "%~dp0"
for /f "tokens=*" %%f in ('dir /s /b *.tt') do (
    echo>&2 dotnet t4 "%%f"
    dotnet t4 "%%f" || goto :end
)
:end
popd
exit /b %ERRORLEVEL%

Fix error propagation in T4 batch script [ci skip]


lessc less\bootstrap.less > D:\talent_to_fame\ttf\vendor\assets\stylesheets\bootstrap.min.css

lessc less\bootstrap.less > ..\ttf\vendor\assets\stylesheets\bootstrap.min.css

remove old less compiler bat

remove old less compiler bat


@set PATH=C:\Program Files\Java\jdk1.7.0_25\bin;%PATH%
@c:\Windows\system32\cmd.exe /c %USERPROFILE%\Desktop\sh.exe -l

@set PATH=C:\Program Files\Java\jdk1.8.0_77\bin;%PATH%
@c:\Windows\system32\cmd.exe /c %USERPROFILE%\Desktop\sh.exe -l

fix shell java path

fix shell java path


SET _=%~dp0
SET mode=Debug
copy /Y "%_%..\..\Builder\Build\bin\%mode%\Bridge.Build.dll" "%_%"
copy /Y "%_%..\..\Builder\Builder\bin\%mode%\Bridge.Builder.exe" "%_%"
copy /Y "%_%..\Core\CLR\bin\%mode%\Bridge.CLR.dll" "%_%"
copy /Y "%_%..\Core\CLR\bin\%mode%\Bridge.CLR.xml" "%_%"
copy /Y "%_%..\Core\Html5\bin\%mode%\Bridge.Html5.dll" "%_%"
copy /Y "%_%..\Core\Html5\bin\%mode%\Bridge.Html5.xml" "%_%"
copy /Y "%_%..\Core\Plugin\bin\%mode%\Bridge.Plugin.dll" "%_%"
copy /Y "%_%..\Core\Translator\bin\%mode%\AjaxMin.dll" "%_%"
copy /Y "%_%..\Core\Translator\bin\%mode%\Ext.Net.Utilities.dll" "%_%"
copy /Y "%_%..\Core\Translator\bin\%mode%\ICSharpCode.NRefactory.dll" "%_%"
copy /Y "%_%..\Core\Translator\bin\%mode%\ICSharpCode.NRefactory.CSharp.dll" "%_%"
copy /Y "%_%..\Core\Translator\bin\%mode%\ICSharpCode.NRefactory.Cecil.dll" "%_%"
copy /Y "%_%..\Core\Translator\bin\%mode%\Mono.Cecil.dll" "%_%"
copy /Y "%_%..\Core\Translator\bin\%mode%\Mono.Cecil.Mdb.dll" "%_%"
copy /Y "%_%..\Core\Translator\bin\%mode%\Mono.Cecil.Pdb.dll" "%_%"
copy /Y "%_%..\Core\Translator\bin\%mode%\Mono.Cecil.Rocks.dll" "%_%"
copy /Y "%_%..\Core\Translator\bin\%mode%\Newtonsoft.Json.dll" "%_%"
copy /Y "%_%..\Core\Translator\bin\%mode%\Bridge.Translator.dll" "%_%"
if not exist "%_%plugins\" mkdir "%_%plugins\"
copy /Y "%_%..\..\Plugins\Aspects\bin\%mode%\Bridge.Aspects.dll" "%_%plugins\"

[UPDATE] update batch file to copy all required assemblies


@echo off
setlocal enableDelayedExpansion

REM Setup initial vars
set "script_name=%~n0.command"
set "thisDir=%~dp0"
set /a tried=0
set "toask=yes"
set "py2v="
set "py2path="
set "py3v="
set "py3path="
set "pypath="

REM use_py3:
REM   TRUE  = Use if found, use py2 otherwise
REM   FALSE = Use py2
REM   FORCE = Use py3
set "use_py3=TRUE"

goto checkscript

:checkscript
REM Check for our script first
if not exist "!thisDir!\!script_name!" (
    echo Could not find !script_name!.
    echo Please make sure to run this script from the same directory
    echo as !script_name!.
    echo.
    echo Press [enter] to quit.
    pause > nul
    exit /b
)
goto checkpy

:checkpy
for /f "tokens=*" %%x in ('where python') do ( call :checkpyversion "%%x" "py2v" "py2path" "py3v" "py3path" )
set "targetpy=3"
if /i "!use_py3!" == "FALSE" (
    set "targetpy=2"
    set "pypath=!py2path!"
) else if /i "!use_py3!" == "FORCE" (
    set "pypath=!py3path!"
) else if /i "!use_py3!" == "TRUE" (
    set "pypath=!py3path!"
    if "!pypath!" == "" set "pypath=!py2path!"
)
if not "!pypath!" == "" (
    goto runscript
)

if "!pypath!" == "" (
    if %tried% lss 1 (
        if /i "!toask!"=="yes" (
            REM Better ask permission first
            goto askinstall
        ) else (
            goto installpy
        )
    ) else (
        cls
        echo   ###     ###
        echo  # Warning #
        echo ###     ###
        echo.
        REM Couldn't install for whatever reason - give the error message
        echo Python is not installed or not found in your PATH var.
        echo Please install it from https://www.python.org/downloads/windows/
        echo.
        echo Make sure you check the box labeled:
        echo.
        echo "Add Python X.X to PATH"
        echo.
        echo Where X.X is the py version you're installing.
        echo.
        echo Press [enter] to quit.
        pause > nul
        exit /b
    )
)
goto runscript

:checkpyversion <path> <py2v> <py2path> <py3v> <py3path>
set "version="&for /f "tokens=2* USEBACKQ delims= " %%a in (`"%~1" -V 2^>^&1`) do (
    REM Ensure we have a version number
    call :isnumber "%%a"
    if not "!errorlevel!" == "0" goto :EOF
    set "version=%%a"
)
if not defined version goto :EOF
if "!version:~0,1!" == "2" (
    REM Python 2
    call :comparepyversion "!version!" "!%~2!"
    if "!errorlevel!" == "1" (
        set "%~2=!version!"
        set "%~3=%~1"
    )
) else (
    REM Python 3
    call :comparepyversion "!version!" "!%~4!"
    if "!errorlevel!" == "1" (
        set "%~4=!version!"
        set "%~5=%~1"
    )
)
goto :EOF

:isnumber <check>
set "var="&for /f "delims=0123456789." %%i in ("%~1") do set var=%%i
if defined var (exit /b 1)
exit /b 0

:comparepyversion <version1> <version2> <return>
REM Exits with status 0 if equal, 1 if v1 gtr v2, 2 if v1 lss v2
for /f "tokens=1,2,3 delims=." %%a in ("%~1") do (
    set a1=%%a
    set a2=%%b
    set a3=%%c
)
for /f "tokens=1,2,3 delims=." %%a in ("%~2") do (
    set b1=%%a
    set b2=%%b
    set b3=%%c
)
if not defined a1 set a1=0
if not defined a2 set a2=0
if not defined a3 set a3=0
if not defined b1 set b1=0
if not defined b2 set b2=0
if not defined b3 set b3=0
if %a1% gtr %b1% exit /b 1
if %a1% lss %b1% exit /b 2
if %a2% gtr %b2% exit /b 1
if %a2% lss %b2% exit /b 2
if %a3% gtr %b3% exit /b 1
if %a3% lss %b3% exit /b 2
exit /b 0

:askinstall
cls
echo   ###              ###
echo  # Python Not Found #
echo ###              ###
echo.
echo Python !targetpy! was not found on the system or in the PATH var.
echo.
set /p "menu=Would you like to install it now? [y/n]: "
if /i "!menu!"=="y" (
    REM We got the OK - install it
    goto installpy
) else if "!menu!"=="n" (
    REM No OK here...
    set /a tried=%tried%+1
    goto checkpy
)
REM Incorrect answer - go back
goto askinstall

:installpy
REM This will attempt to download and install python
REM First we get the html for the python downloads page for Windows
set /a tried=%tried%+1
cls
echo   ###               ###
echo  # Installing Python #
echo ###               ###
echo.
echo Gathering info from https://www.python.org/downloads/windows/...
powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object System.Net.WebClient).DownloadFile('https://www.python.org/downloads/windows/','%TEMP%\pyurl.txt')"
if not exist "%TEMP%\pyurl.txt" (
    goto checkpy
)

echo Parsing for latest...
pushd "%TEMP%"
:: Version detection code slimmed by LussacZheng (https://github.com/corpnewt/gibMacOS/issues/20)
for /f "tokens=9 delims=< " %%x in ('findstr /i /c:"Latest Python !targetpy! Release" pyurl.txt') do ( set "release=%%x" )
popd

echo Found Python !release! -  Downloading...
REM Let's delete our txt file now - we no longer need it
del "%TEMP%\pyurl.txt"

REM At this point - we should have the version number.
REM We can build the url like so: "https://www.python.org/ftp/python/[version]/python-[version]-amd64.exe"
set "url=https://www.python.org/ftp/python/!release!/python-!release!-amd64.exe"
set "pytype=exe"
if "!targetpy!" == "2" (
    set "url=https://www.python.org/ftp/python/!release!/python-!release!.amd64.msi"
    set "pytype=msi"
)
REM Now we download it with our slick powershell command
powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object System.Net.WebClient).DownloadFile('!url!','%TEMP%\pyinstall.!pytype!')"
REM If it doesn't exist - we bail
if not exist "%TEMP%\pyinstall.!pytype!" (
    goto checkpy
)
REM It should exist at this point - let's run it to install silently
echo Installing...
pushd "%TEMP%"
if /i "!pytype!" == "exe" (
    echo pyinstall.exe /quiet PrependPath=1 Include_test=0 Shortcuts=0 Include_launcher=0
    pyinstall.exe /quiet PrependPath=1 Include_test=0 Shortcuts=0 Include_launcher=0
) else (
    set "foldername=!release:.=!"
    echo msiexec /i pyinstall.msi /qb ADDLOCAL=ALL TARGETDIR="%LocalAppData%\Programs\Python\Python!foldername:~0,2!"
    msiexec /i pyinstall.msi /qb ADDLOCAL=ALL TARGETDIR="%LocalAppData%\Programs\Python\Python!foldername:~0,2!"
)
popd
echo Installer finished with %ERRORLEVEL% status.
REM Now we should be able to delete the installer and check for py again
del "%TEMP%\pyinstall.!pytype!"
REM If it worked, then we should have python in our PATH
REM this does not get updated right away though - let's try
REM manually updating the local PATH var
set "spath="
set "upath="
for /f "tokens=2* delims= " %%i in ('reg.exe query "HKCU\Environment" /v "Path" 2^> nul') do ( if not "%%j" == "" set "upath=%%j" )
for /f "tokens=2* delims= " %%i in ('reg.exe query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "Path" 2^> nul') do ( if not "%%j" == "" set "spath=%%j" )
if not "!spath!" == "" (
    REM We got something in the system path
    set "PATH=!spath!"
    if not "!upath!" == "" (
        REM We also have something in the user path
        set "PATH=!PATH!;!upath!"
    )
) else if not "!upath!" == "" (
    set "PATH=!upath!"
)
goto checkpy
exit /b

:runscript
REM Python found
cls
set "args=%*"
set "args=!args:"=!"
if "!args!"=="" (
    "!pypath!" "!thisDir!!script_name!"
) else (
    "!pypath!" "!thisDir!!script_name!" %*
)
goto :EOF

@echo off
setlocal enableDelayedExpansion

REM Setup initial vars
set "script_name=%~n0.command"
set "thisDir=%~dp0"
set /a tried=0
set "toask=yes"
set "py2v="
set "py2path="
set "py3v="
set "py3path="
set "pypath="

REM use_py3:
REM   TRUE  = Use if found, use py2 otherwise
REM   FALSE = Use py2
REM   FORCE = Use py3
set "use_py3=TRUE"

goto checkscript

:checkscript
REM Check for our script first
if not exist "!thisDir!\!script_name!" (
    echo Could not find !script_name!.
    echo Please make sure to run this script from the same directory
    echo as !script_name!.
    echo.
    echo Press [enter] to quit.
    pause > nul
    exit /b
)
goto checkpy

:updatepath
set "spath="
set "upath="
for /f "tokens=2* delims= " %%i in ('reg.exe query "HKCU\Environment" /v "Path" 2^> nul') do ( if not "%%j" == "" set "upath=%%j" )
for /f "tokens=2* delims= " %%i in ('reg.exe query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "Path" 2^> nul') do ( if not "%%j" == "" set "spath=%%j" )
if not "!spath!" == "" (
    REM We got something in the system path
    set "PATH=!spath!"
    if not "!upath!" == "" (
        REM We also have something in the user path
        set "PATH=!PATH!;!upath!"
    )
) else if not "!upath!" == "" (
    set "PATH=!upath!"
)
goto :EOF

:checkpy
call :updatepath
for /f "tokens=*" %%x in ('where python') do ( call :checkpyversion "%%x" "py2v" "py2path" "py3v" "py3path" )
set "targetpy=3"
if /i "!use_py3!" == "FALSE" (
    set "targetpy=2"
    set "pypath=!py2path!"
) else if /i "!use_py3!" == "FORCE" (
    set "pypath=!py3path!"
) else if /i "!use_py3!" == "TRUE" (
    set "pypath=!py3path!"
    if "!pypath!" == "" set "pypath=!py2path!"
)
if not "!pypath!" == "" (
    goto runscript
)

if "!pypath!" == "" (
    if %tried% lss 1 (
        if /i "!toask!"=="yes" (
            REM Better ask permission first
            goto askinstall
        ) else (
            goto installpy
        )
    ) else (
        cls
        echo   ###     ###
        echo  # Warning #
        echo ###     ###
        echo.
        REM Couldn't install for whatever reason - give the error message
        echo Python is not installed or not found in your PATH var.
        echo Please install it from https://www.python.org/downloads/windows/
        echo.
        echo Make sure you check the box labeled:
        echo.
        echo "Add Python X.X to PATH"
        echo.
        echo Where X.X is the py version you're installing.
        echo.
        echo Press [enter] to quit.
        pause > nul
        exit /b
    )
)
goto runscript

:checkpyversion <path> <py2v> <py2path> <py3v> <py3path>
set "version="&for /f "tokens=2* USEBACKQ delims= " %%a in (`"%~1" -V 2^>^&1`) do (
    REM Ensure we have a version number
    call :isnumber "%%a"
    if not "!errorlevel!" == "0" goto :EOF
    set "version=%%a"
)
if not defined version goto :EOF
if "!version:~0,1!" == "2" (
    REM Python 2
    call :comparepyversion "!version!" "!%~2!"
    if "!errorlevel!" == "1" (
        set "%~2=!version!"
        set "%~3=%~1"
    )
) else (
    REM Python 3
    call :comparepyversion "!version!" "!%~4!"
    if "!errorlevel!" == "1" (
        set "%~4=!version!"
        set "%~5=%~1"
    )
)
goto :EOF

:isnumber <check>
set "var="&for /f "delims=0123456789." %%i in ("%~1") do set var=%%i
if defined var (exit /b 1)
exit /b 0

:comparepyversion <version1> <version2> <return>
REM Exits with status 0 if equal, 1 if v1 gtr v2, 2 if v1 lss v2
for /f "tokens=1,2,3 delims=." %%a in ("%~1") do (
    set a1=%%a
    set a2=%%b
    set a3=%%c
)
for /f "tokens=1,2,3 delims=." %%a in ("%~2") do (
    set b1=%%a
    set b2=%%b
    set b3=%%c
)
if not defined a1 set a1=0
if not defined a2 set a2=0
if not defined a3 set a3=0
if not defined b1 set b1=0
if not defined b2 set b2=0
if not defined b3 set b3=0
if %a1% gtr %b1% exit /b 1
if %a1% lss %b1% exit /b 2
if %a2% gtr %b2% exit /b 1
if %a2% lss %b2% exit /b 2
if %a3% gtr %b3% exit /b 1
if %a3% lss %b3% exit /b 2
exit /b 0

:askinstall
cls
echo   ###              ###
echo  # Python Not Found #
echo ###              ###
echo.
echo Python !targetpy! was not found on the system or in the PATH var.
echo.
set /p "menu=Would you like to install it now? [y/n]: "
if /i "!menu!"=="y" (
    REM We got the OK - install it
    goto installpy
) else if "!menu!"=="n" (
    REM No OK here...
    set /a tried=%tried%+1
    goto checkpy
)
REM Incorrect answer - go back
goto askinstall

:installpy
REM This will attempt to download and install python
REM First we get the html for the python downloads page for Windows
set /a tried=%tried%+1
cls
echo   ###               ###
echo  # Installing Python #
echo ###               ###
echo.
echo Gathering info from https://www.python.org/downloads/windows/...
powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object System.Net.WebClient).DownloadFile('https://www.python.org/downloads/windows/','%TEMP%\pyurl.txt')"
if not exist "%TEMP%\pyurl.txt" (
    goto checkpy
)

echo Parsing for latest...
pushd "%TEMP%"
:: Version detection code slimmed by LussacZheng (https://github.com/corpnewt/gibMacOS/issues/20)
for /f "tokens=9 delims=< " %%x in ('findstr /i /c:"Latest Python !targetpy! Release" pyurl.txt') do ( set "release=%%x" )
popd

echo Found Python !release! -  Downloading...
REM Let's delete our txt file now - we no longer need it
del "%TEMP%\pyurl.txt"

REM At this point - we should have the version number.
REM We can build the url like so: "https://www.python.org/ftp/python/[version]/python-[version]-amd64.exe"
set "url=https://www.python.org/ftp/python/!release!/python-!release!-amd64.exe"
set "pytype=exe"
if "!targetpy!" == "2" (
    set "url=https://www.python.org/ftp/python/!release!/python-!release!.amd64.msi"
    set "pytype=msi"
)
REM Now we download it with our slick powershell command
powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object System.Net.WebClient).DownloadFile('!url!','%TEMP%\pyinstall.!pytype!')"
REM If it doesn't exist - we bail
if not exist "%TEMP%\pyinstall.!pytype!" (
    goto checkpy
)
REM It should exist at this point - let's run it to install silently
echo Installing...
pushd "%TEMP%"
if /i "!pytype!" == "exe" (
    echo pyinstall.exe /quiet PrependPath=1 Include_test=0 Shortcuts=0 Include_launcher=0
    pyinstall.exe /quiet PrependPath=1 Include_test=0 Shortcuts=0 Include_launcher=0
) else (
    set "foldername=!release:.=!"
    echo msiexec /i pyinstall.msi /qb ADDLOCAL=ALL TARGETDIR="%LocalAppData%\Programs\Python\Python!foldername:~0,2!"
    msiexec /i pyinstall.msi /qb ADDLOCAL=ALL TARGETDIR="%LocalAppData%\Programs\Python\Python!foldername:~0,2!"
)
popd
echo Installer finished with %ERRORLEVEL% status.
REM Now we should be able to delete the installer and check for py again
del "%TEMP%\pyinstall.!pytype!"
REM If it worked, then we should have python in our PATH
REM this does not get updated right away though - let's try
REM manually updating the local PATH var
call :updatepath
goto checkpy
exit /b

:runscript
REM Python found
cls
set "args=%*"
set "args=!args:"=!"
if "!args!"=="" (
    "!pypath!" "!thisDir!!script_name!"
) else (
    "!pypath!" "!thisDir!!script_name!" %*
)
goto :EOF

Update local PATH var before checking py version


Fix Batchfile && operator position

Fix Batchfile && operator position


@set mesa=%cd%\
@set abi=x86
@set /p x64=Do you want to build for x64?(y/n) Otherwise build for x86:
@if /I %x64%==y @set abi=x64
@set longabi=%abi%
@if %abi%==x64 @set longabi=x86_64
@set altabi=i686
@if %abi%==x64 @set altabi=%longabi%
@set minabi=32
@if %abi%==x64 set minabi=64
@set vsenv="%ProgramFiles%
@if NOT "%ProgramW6432%"=="" set vsenv=%vsenv% (x86)
@set vsenv15=%vsenv%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%minabi%.bat"
@set vsenv14="%VS140COMNTOOLS%..\..\VC\bin\vcvars%minabi%.bat"
@set gcc=%mesa%mingw-w64-%abi%\mingw%minabi%\bin
@set vsenvloaded=0
@set dxtnbuilt=0
@set toolset=14
@if EXIST %vsenv15% set toolset=15
@if EXIST toolset-%abi%.ini set /p toolset=<toolset-%abi%.ini
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%

:build_llvm
@set /p buildllvm=Begin LLVM build. Only needs to run once for each ABI and version. Proceed (y/n):
@if /I NOT %buildllvm%==y GOTO build_dxtn
@echo.
@cd "%mesa%llvm"
@if EXIST %abi% RD /S /Q %abi%
@if EXIST cmake-%abi% RD /S /Q cmake-%abi%
@md cmake-%abi%
@cd cmake-%abi%
@set toolchain=Visual Studio 14
@set toolset=14
@if EXIST %vsenv15% set toolchain=Visual Studio 15 2017
@if EXIST %vsenv15% set toolset=15
@set ninja=n
@set oldtoolset=n
@if EXIST "%mesa%ninja" set ninja=1
@if EXIST %vsenv15% set ninja=%ninja%2
@if %ninja%==12 set /p oldtoolset=Build with MSVC 2015 backward compatibility toolset, alternative solution for LLVM 3.9.1 build with Visual Studio 2017 (y/n):
@if %ninja%==12 echo.
@if /I %oldtoolset%==y set ninja=y
@if /I %oldtoolset%==y set toolset=14
@if %ninja%==12 set ninja=2
@if %ninja%==1 set ninja=2
@if %ninja%==2 set /p ninja=Use Ninja build system instead of MsBuild, there is no requirement to do this with the primary toolset though (y/n):
@echo.
@if %ninja%==y set toolchain=Ninja
@if "%toolchain%"=="Ninja" set PATH=%mesa%ninja\;%PATH%
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@call %vsenv%
@set vsenvloaded=1
@set PATH=%mesa%cmake\%abi%\bin\;%PATH%
@echo.
@set modtoolchainabi=0
@if NOT "%toolchain%"=="Ninja" set modtoolchainabi=1
@if %abi%==x64 set modtoolchainabi=%modtoolchainabi%2
@if %modtoolchainabi%==12 set toolchain=%toolchain% Win64
@cmake -G "%toolchain%" -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_RTTI=1 -DLLVM_ENABLE_TERMINFO=OFF -DCMAKE_INSTALL_PREFIX=../%abi% ..
@echo.
@pause
@echo.
@if NOT "%toolchain%"=="Ninja" msbuild /p:Configuration=Release INSTALL.vcxproj
@if "%toolchain%"=="Ninja" ninja install
@echo.
@echo %toolset% > "%mesa%toolset-%abi%.ini"

:build_dxtn
@if NOT EXIST "%gcc%" GOTO build_mesa
@if NOT EXIST "%mesa%dxtn" GOTO build_mesa
@set /p builddxtn=Do you want to build S3 texture compression library? (y/n):
@if /i NOT %builddxtn%==y GOTO build_mesa
@set PATH=%gcc%\;%PATH%
@cd "%mesa%dxtn"
@echo.
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@set dxtn=gcc -shared
@if %abi%==x86 set dxtn=%dxtn% -m32
@set dxtn=%dxtn% -v *.c *.h -I ..\mesa\include -Wl,--dll,--dynamicbase,--enable-auto-image-base,--nxcompat -o %abi%\dxtn.dll
@%dxtn%
@echo.
@set dxtnbuilt=1

:build_mesa
@set /p buildmesa=Begin mesa build. Proceed (y/n):
@if /i NOT %buildmesa%==y GOTO exit
@echo.
@set LLVM=%mesa%llvm\%abi%
@if NOT EXIST "%LLVM%" (
@echo Could not find LLVM, aborting mesa build.
@echo.
@pause
@GOTO exit
)
@cd "%mesa%mesa"
@set /p openswr=Do you want to build OpenSWR drivers? (y=yes):
@set buildswr=0
@if /i %openswr%==y @set buildswr=1
@set mesatoolchain=default
@echo.
@GOTO build_with_vs

:build_with_mingw
@set mingw=n
@set mingwtest=0
@if EXIST "%gcc%" @set mingwtest=1
@set msys2=%mesa%msys64\msys2_shell.cmd
@if EXIST "%msys2%" @set mingwtest=%mingwtest%2
@if %mingwtest%==12 @set /p mingw=Do you want to build with MinGW-W64 instead of Visual Studio (y=yes):
@if %dxtnbuilt%==0 @set PATH=%gcc%\;%PATH%
@set mesatoolchain=crossmingw
@copy "%gcc%\%altabi%-w64-mingw32-gcc-ar.exe" "%gcc%\%altabi%-w64-mingw32-ar.exe"
@copy "%gcc%\%altabi%-w64-mingw32-gcc-ranlib.exe" "%gcc%\%altabi%-w64-mingw32-ranlib.exe"
@call "%msys2%" -use-full-path
pacman -Syu
pacman -S python2
wget https://bootstrap.pypa.io/get-pip.py
python2 get-pip.py
pip install -U mako
pip install -U scons
pip freeze > requirements.txt
pip install -r requirements.txt --upgrade
cd $mesa
cd mesa

:build_with_vs
@if EXIST build\windows-%longabi% RD /S /Q build\windows-%longabi%
@set PATH=%mesa%Python\%abi%\;%mesa%Python\%abi%\Scripts\;%mesa%flexbison\;%mesa%m4\%abi%\usr\bin\;%PATH%
@python -m pip install -U mako
@python -m pip freeze > requirements.txt
@python -m pip install -r requirements.txt --upgrade
@del requirements.txt
@echo.
@if %vsenvloaded%==0 (
@call %vsenv%
@echo.
)

:build_mesa_exec
@python "%mesa%Python\%abi%\Scripts\scons.py" build=release platform=windows machine=%longabi% toolchain=%mesatoolchain% swr=%buildswr% libgl-gdi
@echo.
@pause

:exit
exit

@set mesa=%cd%\
@set abi=x86
@set /p x64=Do you want to build for x64?(y/n) Otherwise build for x86:
@if /I %x64%==y set abi=x64
@set longabi=%abi%
@if %abi%==x64 set longabi=x86_64
@set altabi=i686
@if %abi%==x64 set altabi=%longabi%
@set minabi=32
@if %abi%==x64 set minabi=64
@set vsenv="%ProgramFiles%
@if NOT "%ProgramW6432%"=="" set vsenv=%vsenv% (x86)
@set vsenv15=%vsenv%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%minabi%.bat"
@set vsenv14="%VS140COMNTOOLS%..\..\VC\bin\vcvars%minabi%.bat"
@set gcc=%mesa%mingw-w64-%abi%\mingw%minabi%\bin
@set vsenvloaded=0
@set dxtnbuilt=0
@set toolset=14
@if EXIST %vsenv15% set toolset=15
@if EXIST toolset-%abi%.ini set /p toolset=<toolset-%abi%.ini
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%

:build_llvm
@set /p buildllvm=Begin LLVM build. Only needs to run once for each ABI and version. Proceed (y/n):
@if /I NOT %buildllvm%==y GOTO build_dxtn
@echo.
@cd "%mesa%llvm"
@if EXIST %abi% RD /S /Q %abi%
@if EXIST cmake-%abi% RD /S /Q cmake-%abi%
@md cmake-%abi%
@cd cmake-%abi%
@set toolchain=Visual Studio 14
@set toolset=14
@if EXIST %vsenv15% set toolchain=Visual Studio 15 2017
@if EXIST %vsenv15% set toolset=15
@set ninja=n
@set oldtoolset=n
@if EXIST "%mesa%ninja" set ninja=1
@if EXIST %vsenv15% set ninja=%ninja%2
@if %ninja%==12 set /p oldtoolset=Build with MSVC 2015 backward compatibility toolset, alternative solution for LLVM 3.9.1 build with Visual Studio 2017 (y/n):
@if %ninja%==12 echo.
@if /I %oldtoolset%==y set ninja=y
@if /I %oldtoolset%==y set toolset=14
@if %ninja%==12 set ninja=2
@if %ninja%==1 set ninja=2
@if %ninja%==2 set /p ninja=Use Ninja build system instead of MsBuild, there is no requirement to do this with the primary toolset though (y/n):
@echo.
@if %ninja%==y set toolchain=Ninja
@if "%toolchain%"=="Ninja" set PATH=%mesa%ninja\;%PATH%
@set vsenv=%vsenv14%
@if %toolset%==15 set vsenv=%vsenv15%
@call %vsenv%
@set vsenvloaded=1
@set PATH=%mesa%cmake\%abi%\bin\;%PATH%
@echo.
@set modtoolchainabi=0
@if NOT "%toolchain%"=="Ninja" set modtoolchainabi=1
@if %abi%==x64 set modtoolchainabi=%modtoolchainabi%2
@if %modtoolchainabi%==12 set toolchain=%toolchain% Win64
@cmake -G "%toolchain%" -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_RTTI=1 -DLLVM_ENABLE_TERMINFO=OFF -DCMAKE_INSTALL_PREFIX=../%abi% ..
@echo.
@pause
@echo.
@if NOT "%toolchain%"=="Ninja" msbuild /p:Configuration=Release INSTALL.vcxproj
@if "%toolchain%"=="Ninja" ninja install
@echo.
@echo %toolset% > "%mesa%toolset-%abi%.ini"

:build_dxtn
@if NOT EXIST "%gcc%" GOTO build_mesa
@if NOT EXIST "%mesa%dxtn" GOTO build_mesa
@set /p builddxtn=Do you want to build S3 texture compression library? (y/n):
@if /i NOT %builddxtn%==y GOTO build_mesa
@set PATH=%gcc%\;%PATH%
@cd "%mesa%dxtn"
@echo.
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@set dxtn=gcc -shared
@if %abi%==x86 set dxtn=%dxtn% -m32
@set dxtn=%dxtn% -v *.c *.h -I ..\mesa\include -Wl,--dll,--dynamicbase,--enable-auto-image-base,--nxcompat -o %abi%\dxtn.dll
@%dxtn%
@echo.
@set dxtnbuilt=1

:build_mesa
@set /p buildmesa=Begin mesa build. Proceed (y/n):
@if /i NOT %buildmesa%==y GOTO exit
@echo.
@set LLVM=%mesa%llvm\%abi%
@if NOT EXIST "%LLVM%" (
@echo Could not find LLVM, aborting mesa build.
@echo.
@pause
@GOTO exit
)
@cd "%mesa%mesa"
@set /p openswr=Do you want to build OpenSWR drivers? (y=yes):
@set buildswr=0
@if /i %openswr%==y @set buildswr=1
@set mesatoolchain=default
@echo.
@GOTO build_with_vs

:build_with_mingw
@set mingw=n
@set mingwtest=0
@if EXIST "%gcc%" @set mingwtest=1
@set msys2=%mesa%msys64\msys2_shell.cmd
@if EXIST "%msys2%" @set mingwtest=%mingwtest%2
@if %mingwtest%==12 @set /p mingw=Do you want to build with MinGW-W64 instead of Visual Studio (y=yes):
@if %dxtnbuilt%==0 @set PATH=%gcc%\;%PATH%
@set mesatoolchain=crossmingw
@copy "%gcc%\%altabi%-w64-mingw32-gcc-ar.exe" "%gcc%\%altabi%-w64-mingw32-ar.exe"
@copy "%gcc%\%altabi%-w64-mingw32-gcc-ranlib.exe" "%gcc%\%altabi%-w64-mingw32-ranlib.exe"
@call "%msys2%" -use-full-path
pacman -Syu
pacman -S python2
wget https://bootstrap.pypa.io/get-pip.py
python2 get-pip.py
pip install -U mako
pip install -U scons
pip freeze > requirements.txt
pip install -r requirements.txt --upgrade
cd $mesa
cd mesa

:build_with_vs
@if EXIST build\windows-%longabi% RD /S /Q build\windows-%longabi%
@set PATH=%mesa%Python\%abi%\;%mesa%Python\%abi%\Scripts\;%mesa%flexbison\;%mesa%m4\%abi%\usr\bin\;%PATH%
@python -m pip install -U mako
@python -m pip freeze > requirements.txt
@python -m pip install -r requirements.txt --upgrade
@del requirements.txt
@echo.
@if %vsenvloaded%==0 (
@call %vsenv%
@echo.
)

:build_mesa_exec
@python "%mesa%Python\%abi%\Scripts\scons.py" build=release platform=windows machine=%longabi% toolchain=%mesatoolchain% swr=%buildswr% libgl-gdi
@echo.
@pause

:exit
exit

Remove unneded @s.

Buildscript: Remove unneded @s.


@set mesa=%cd%\
@set abi=x86
@set /p x64=Do you want to build for x64?(y/n) Otherwise build for x86:
@if /I %x64%==y @set abi=x64
@set longabi=%abi%
@if %abi%==x64 @set longabi=x86_64
@set altabi=i686
@if %abi%==x64 @set altabi=%longabi%
@set minabi=32
@if %abi%==x64 set minabi=64
@set vsenv="%ProgramFiles%
@if NOT "%ProgramW6432%"=="" set vsenv=%vsenv% (x86)
@set vsenv15=%vsenv%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%minabi%.bat"
@set vsenv14="%VS140COMNTOOLS%..\..\VC\bin\vcvars%minabi%.bat"
@set gcc=%mesa%mingw-w64-%abi%\mingw%minabi%\bin
@set vsenvloaded=0
@set dxtnbuilt=0
@set toolset=14
@set /p toolset=<toolset.ini
@echo.
@set vsenv=%vsenv14%
@if %toolset%==15 @set vsenv=%vsenv15%

:build_llvm
@set /p buildllvm=Begin LLVM build. Only needs to run once for each ABI and version. Proceed (y/n):
@if /I NOT %buildllvm%==y GOTO build_dxtn
@echo.
@cd "%mesa%llvm"
@RD /S /Q %abi%
@echo.
@RD /S /Q cmake-%abi%
@echo.
@md cmake-%abi%
@cd cmake-%abi%
@set toolchain=Visual Studio 14
@set vs2017toolset=n
@if EXIST %vsenv15% @set /p vs2017toolset=Build with MSVC 2017 toolset, not recommended (y/n):
@echo.
@if /I %vs2017toolset%==y (
@set toolchain=Visual Studio 15 2017
@set toolset=15
)
@if %abi%==x64 @set toolchain=%toolchain% Win64
@set ninja=n
@if EXIST "%mesa%ninja" set ninja=1
@if EXIST "%mesa%ninja" set PATH=%mesa%ninja\;%PATH%
@if %ninja%==1 set /p ninja=Use Ninja build system, required if building LLVM with MSVC 2015 toolset on Visual Studio 2017 (y/n):
@echo.
@if /I NOT %ninja%==n set toolchain=Ninja
@set vsenv=%vsenv14%
@if %toolset%==15 @set vsenv=%vsenv15%
@call %vsenv%
@set vsenvloaded=1
@set PATH=%mesa%cmake\%abi%\bin\;%PATH%
@echo.
@cmake -G "%toolchain%" -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_RTTI=1 -DLLVM_ENABLE_TERMINFO=OFF -DCMAKE_INSTALL_PREFIX=%mesa:\=/%llvm/%abi% ..
@echo.
@pause
@echo.
@if NOT %toolchain%==Ninja msbuild /p:Configuration=Release INSTALL.vcxproj
@if %toolchain%==Ninja ninja install
@echo.
@echo %toolset% > "%mesa%toolset.ini"

:build_dxtn
@if NOT EXIST "%gcc%" GOTO build_mesa
@if NOT EXIST "%mesa%dxtn" GOTO build_mesa
@set /p builddxtn=Do you want to build S3 texture compression library? (y/n):
@if /i NOT %builddxtn%==y GOTO build_mesa
@set PATH=%gcc%\;%PATH%
@cd "%mesa%dxtn"
@echo.
@RD /S /Q %abi%
@echo.
@MD %abi%
@set dxtn=gcc -shared
@if %abi%==x86 set dxtn=%dxtn% -m32
@set dxtn=%dxtn% -v *.c *.h -I ..\mesa\include -Wl,--dll,--dynamicbase,--enable-auto-image-base,--nxcompat -o %abi%\dxtn.dll
@%dxtn%
@echo.
@set dxtnbuilt=1

:build_mesa
@set /p buildmesa=Begin mesa build. Proceed (y/n):
@if /i NOT %buildmesa%==y GOTO exit
@set LLVM=%mesa:\=/%llvm/%abi%
@cd "%mesa%mesa"
@set /p openswr=Do you want to build OpenSWR drivers? (y=yes):
@set buildswr=0
@if /i %openswr%==y @set buildswr=1
@set mesatoolchain=default
@echo.
@GOTO build_with_vs

:build_with_mingw
@set mingw=n
@set mingwtest=0
@if EXIST "%gcc%" @set mingwtest=1
@set msys2=%mesa%msys64\msys2_shell.cmd
@if EXIST "%msys2%" @set mingwtest=%mingwtest%2
@if %mingwtest%==12 @set /p mingw=Do you want to build with MinGW-W64 instead of Visual Studio (y=yes):
@if %dxtnbuilt%==0 @set PATH=%gcc%\;%PATH%
@set mesatoolchain=crossmingw
@copy "%gcc%\%altabi%-w64-mingw32-gcc-ar.exe" "%gcc%\%altabi%-w64-mingw32-ar.exe"
@copy "%gcc%\%altabi%-w64-mingw32-gcc-ranlib.exe" "%gcc%\%altabi%-w64-mingw32-ranlib.exe"
@call "%msys2%" -use-full-path
pacman -Syu
pacman -S python2
wget https://bootstrap.pypa.io/get-pip.py
python2 get-pip.py
pip install -U mako
pip install -U scons
pip freeze > requirements.txt
pip install -r requirements.txt --upgrade
cd $mesa
cd mesa

:build_with_vs
@RD /S /Q build\windows-%longabi%
@echo.
@set PATH=%mesa%Python\%abi%\;%mesa%Python\%abi%\Scripts\;%mesa%flexbison\;%mesa%m4\%abi%\usr\bin\;%PATH%
@pip install -U mako
@pip freeze > requirements.txt
@pip install -r requirements.txt --upgrade
@del requirements.txt
@echo.
@if %vsenvloaded%==0 (
@call %vsenv%
@echo.
)

:build_mesa_exec
@python "%mesa%Python\%abi%\Scripts\scons.py" build=release platform=windows machine=%longabi% toolchain=%mesatoolchain% swr=%buildswr% libgl-gdi
@echo.
@pause

:exit
exit

@set mesa=%cd%\
@set abi=x86
@set /p x64=Do you want to build for x64?(y/n) Otherwise build for x86:
@if /I %x64%==y @set abi=x64
@set longabi=%abi%
@if %abi%==x64 @set longabi=x86_64
@set altabi=i686
@if %abi%==x64 @set altabi=%longabi%
@set minabi=32
@if %abi%==x64 set minabi=64
@set vsenv="%ProgramFiles%
@if NOT "%ProgramW6432%"=="" set vsenv=%vsenv% (x86)
@set vsenv15=%vsenv%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars%minabi%.bat"
@set vsenv14="%VS140COMNTOOLS%..\..\VC\bin\vcvars%minabi%.bat"
@set gcc=%mesa%mingw-w64-%abi%\mingw%minabi%\bin
@set vsenvloaded=0
@set dxtnbuilt=0
@set toolset=14
@if EXIST toolset.ini set /p toolset=<toolset.ini
@set vsenv=%vsenv14%
@if %toolset%==15 @set vsenv=%vsenv15%

:build_llvm
@set /p buildllvm=Begin LLVM build. Only needs to run once for each ABI and version. Proceed (y/n):
@if /I NOT %buildllvm%==y GOTO build_dxtn
@echo.
@cd "%mesa%llvm"
@if EXIST %abi% RD /S /Q %abi%
@if EXIST cmake-%abi% RD /S /Q cmake-%abi%
@md cmake-%abi%
@cd cmake-%abi%
@set toolchain=Visual Studio 14
@set vs2017toolset=n
@if EXIST %vsenv15% @set /p vs2017toolset=Build with MSVC 2017 toolset, not recommended (y/n):
@echo.
@if /I %vs2017toolset%==y (
@set toolchain=Visual Studio 15 2017
@set toolset=15
)
@if %abi%==x64 @set toolchain=%toolchain% Win64
@set ninja=n
@if EXIST "%mesa%ninja" set ninja=1
@if EXIST "%mesa%ninja" set PATH=%mesa%ninja\;%PATH%
@if %ninja%==1 set /p ninja=Use Ninja build system, required if building LLVM with MSVC 2015 toolset on Visual Studio 2017 (y/n):
@echo.
@if /I NOT %ninja%==n set toolchain=Ninja
@set vsenv=%vsenv14%
@if %toolset%==15 @set vsenv=%vsenv15%
@call %vsenv%
@set vsenvloaded=1
@set PATH=%mesa%cmake\%abi%\bin\;%PATH%
@echo.
@cmake -G "%toolchain%" -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_RTTI=1 -DLLVM_ENABLE_TERMINFO=OFF -DCMAKE_INSTALL_PREFIX=%mesa:\=/%llvm/%abi% ..
@echo.
@pause
@echo.
@if NOT %toolchain%==Ninja msbuild /p:Configuration=Release INSTALL.vcxproj
@if %toolchain%==Ninja ninja install
@echo.
@echo %toolset% > "%mesa%toolset.ini"

:build_dxtn
@if NOT EXIST "%gcc%" GOTO build_mesa
@if NOT EXIST "%mesa%dxtn" GOTO build_mesa
@set /p builddxtn=Do you want to build S3 texture compression library? (y/n):
@if /i NOT %builddxtn%==y GOTO build_mesa
@set PATH=%gcc%\;%PATH%
@cd "%mesa%dxtn"
@echo.
@if EXIST %abi% RD /S /Q %abi%
@MD %abi%
@set dxtn=gcc -shared
@if %abi%==x86 set dxtn=%dxtn% -m32
@set dxtn=%dxtn% -v *.c *.h -I ..\mesa\include -Wl,--dll,--dynamicbase,--enable-auto-image-base,--nxcompat -o %abi%\dxtn.dll
@%dxtn%
@echo.
@set dxtnbuilt=1

:build_mesa
@set /p buildmesa=Begin mesa build. Proceed (y/n):
@if /i NOT %buildmesa%==y GOTO exit
@set LLVM=%mesa:\=/%llvm/%abi%
@cd "%mesa%mesa"
@set /p openswr=Do you want to build OpenSWR drivers? (y=yes):
@set buildswr=0
@if /i %openswr%==y @set buildswr=1
@set mesatoolchain=default
@echo.
@GOTO build_with_vs

:build_with_mingw
@set mingw=n
@set mingwtest=0
@if EXIST "%gcc%" @set mingwtest=1
@set msys2=%mesa%msys64\msys2_shell.cmd
@if EXIST "%msys2%" @set mingwtest=%mingwtest%2
@if %mingwtest%==12 @set /p mingw=Do you want to build with MinGW-W64 instead of Visual Studio (y=yes):
@if %dxtnbuilt%==0 @set PATH=%gcc%\;%PATH%
@set mesatoolchain=crossmingw
@copy "%gcc%\%altabi%-w64-mingw32-gcc-ar.exe" "%gcc%\%altabi%-w64-mingw32-ar.exe"
@copy "%gcc%\%altabi%-w64-mingw32-gcc-ranlib.exe" "%gcc%\%altabi%-w64-mingw32-ranlib.exe"
@call "%msys2%" -use-full-path
pacman -Syu
pacman -S python2
wget https://bootstrap.pypa.io/get-pip.py
python2 get-pip.py
pip install -U mako
pip install -U scons
pip freeze > requirements.txt
pip install -r requirements.txt --upgrade
cd $mesa
cd mesa

:build_with_vs
@if EXIST build\windows-%longabi% RD /S /Q build\windows-%longabi%
@set PATH=%mesa%Python\%abi%\;%mesa%Python\%abi%\Scripts\;%mesa%flexbison\;%mesa%m4\%abi%\usr\bin\;%PATH%
@pip install -U mako
@pip freeze > requirements.txt
@pip install -r requirements.txt --upgrade
@del requirements.txt
@echo.
@if %vsenvloaded%==0 (
@call %vsenv%
@echo.
)

:build_mesa_exec
@python "%mesa%Python\%abi%\Scripts\scons.py" build=release platform=windows machine=%longabi% toolchain=%mesatoolchain% swr=%buildswr% libgl-gdi
@echo.
@pause

:exit
exit

Buildscript: Validate files and folders existence on removal and access


git flow version > NUL
if %ERRORLEVEL% GEQ 1 (
  copy gitflow-windows-dependencies\* "C:\Program Files (x86)\Git\bin"
  cd gitflow
  contrib\msysgit-install.cmd "C:\Program Files (x86)\Git"
)

echo "Installing..."
copy git-release "C:\Program Files (x86)\Git\bin"
echo "Done!"

git flow version > NUL
if %ERRORLEVEL% GEQ 1 (
  copy gitflow-windows-dependencies\* "C:\Program Files (x86)\Git\bin"
  pushd gitflow
  contrib\msysgit-install.cmd "C:\Program Files (x86)\Git"
  popd
)

echo "Installing..."
copy git-release "C:\Program Files (x86)\Git\bin"
echo "Done!"

Use pushd instead of cd

Use pushd instead of cd


set current=%~dp0
cd ..
cd ..
cd actuariat_python
git pull
cd ..
cd teachpyx
git pull
cd ..
cd ensae_projects
git pull
cd ..
cd ensae_teaching_cs
git pull
cd ..
cd jyquickhelper
git pull
cd ..
cd mlstatpy
git pull
cd ..
cd pyensae
git pull
cd ..
cd pymmails
git pull
cd ..
cd pymyinstall
git pull
cd ..
cd pyquickhelper
git pull
cd ..
cd pyrsslocal
git pull
cd ..
cd python3_module_template
git pull
cd ..
cd jupytalk
git pull
cd ..
cd tkinterquickhelper
git pull
cd ..
cd %current%

set current=%~dp0
cd ..
cd ..
cd actuariat_python
git pull
cd ..
cd teachpyx
git pull
cd ..
cd ensae_projects
git pull
cd ..
cd ensae_teaching_cs
git pull
cd ..
cd jyquickhelper
git pull
cd ..
cd mlstatpy
git pull
cd ..
cd pyensae
git pull
cd ..
cd pymmails
git pull
cd ..
cd pymyinstall
git pull
cd ..
cd pyquickhelper
git pull
cd ..
cd pyrsslocal
git pull
cd ..
cd python3_module_template
git pull
cd ..
cd jupytalk
git pull
cd ..
cd tkinterquickhelper
git pull
cd ..
cd code_beatrix
git pull
cd ..
cd %current%

update script

update script


Build 79

Build 79