@echo off
rem This file makes your life easier.
rem Running this file will automatically pick appropriate cmake project generator
rem and they will be forwarded to cmake.

setlocal enabledelayedexpansion

set "CMAKE_ARGS=%*"

IF NOT EXIST build (
    mkdir build
)

if EXIST build\environment.cmd (
    call build\environment.cmd
    goto process
)

:prepare
if "!PROCESSOR_ARCHITECTURE!" == "AMD64" (
    set /P "PLATFORM=Platform (x86/_x64_): " || set "PLATFORM=x64"
) else (
    set "PLATFORM=x86"
)
echo set "PLATFORM=!PLATFORM!" > build\environment.cmd

set /P "VS=Visual Studio (2015/_2017_): " || set "VS=2017"
echo set "VS=!VS!" >> build\environment.cmd

:process

set "CMAKE_GENRATOR=Visual Studio"
if "!VS!" == "2015" (
    set "CMAKE_GENRATOR=!CMAKE_GENRATOR! 14"
    call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" !PLATFORM!
) else if "!VS!" == "2017" (
    set "CMAKE_GENRATOR=!CMAKE_GENRATOR! 15"
    call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" !PLATFORM!
) else (
    echo Unknown Visual Studio version
    goto quit
)
set "CMAKE_GENRATOR=!CMAKE_GENRATOR! !vs!"

if "!PLATFORM!" == "x64" (
    set "CMAKE_GENRATOR=!CMAKE_GENRATOR! Win64"
) else if NOT "!PLATFORM!" == "x86" (
    echo Unknown platform
    goto quit
)

echo Using !CMAKE_GENRATOR! on !PLATFORM!

:build
pushd build
echo cmake.exe -G "!CMAKE_GENRATOR!" !CMAKE_ARGS! ..
cmake.exe -G "!CMAKE_GENRATOR!" !CMAKE_ARGS! ..
msbuild Urho3D.sln /r
popd

:quit
@pause

@echo off
rem This file makes your life easier.
rem Running this file will automatically pick appropriate cmake project generator
rem and they will be forwarded to cmake.

setlocal enabledelayedexpansion

set "CMAKE_ARGS=%*"

IF NOT EXIST build (
    mkdir build
)

if EXIST build\environment.cmd (
    call build\environment.cmd
    goto process
)

:prepare
if "!PROCESSOR_ARCHITECTURE!" == "AMD64" (
    set /P "PLATFORM=Platform (x86/_x64_): " || set "PLATFORM=x64"
) else (
    set "PLATFORM=x86"
)
echo set "PLATFORM=!PLATFORM!" > build\environment.cmd

set /P "VS=Visual Studio (2015/_2017_): " || set "VS=2017"
echo set "VS=!VS!" >> build\environment.cmd

:process

set "CMAKE_GENRATOR=Visual Studio"
if "!VS!" == "2015" (
    set "CMAKE_GENRATOR=!CMAKE_GENRATOR! 14"
    call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" !PLATFORM!
) else if "!VS!" == "2017" (
    set "CMAKE_GENRATOR=!CMAKE_GENRATOR! 15"
    call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" !PLATFORM!
) else (
    echo Unknown Visual Studio version
    goto quit
)
set "CMAKE_GENRATOR=!CMAKE_GENRATOR! !vs!"

if "!PLATFORM!" == "x64" (
    set "CMAKE_GENRATOR=!CMAKE_GENRATOR! Win64"
) else if NOT "!PLATFORM!" == "x86" (
    echo Unknown platform
    goto quit
)

echo Using !CMAKE_GENRATOR! on !PLATFORM!

:build
pushd build
echo cmake.exe -G "!CMAKE_GENRATOR!" !CMAKE_ARGS! ..
cmake.exe -G "!CMAKE_GENRATOR!" !CMAKE_ARGS! ..
msbuild Urho3D.sln /t:restore
popd

:quit
@pause

Build: Fix Makefile.cmd to properly trigger only restore target after build cache generation.


copy *.py ..\..\..\..\Bin\DarunGrim3
pause

Set correct install path

Set correct install path


:<<"::CMDLITERAL"
@echo off
goto :CMDSCRIPT
::CMDLITERAL
#!/bin/bash
set -euo pipefail
IFS=$$'\n\t'

script_dir=$$(cd $$(dirname $$0); pwd -P)
repo_dir=$$(dirname $$script_dir)
build_dir=$$repo_dir/_build

cmake --build $$build_dir --target test

exit $$?

:CMDSCRIPT
@echo off
setlocal
call :Main "%~f0" "%~dp0" "%~dp0.."
goto :eof

:Main
set script_path=%~f1
set script_dir=%~f2
set repo_dir=%~f3
set build_dir=%repo_dir%\_build

cmake --build "%build_dir%" --target test

:<<"::CMDLITERAL"
@echo off
goto :CMDSCRIPT
::CMDLITERAL
#!/bin/bash
set -euo pipefail
IFS=$$'\n\t'

script_dir=$$(cd $$(dirname $$0); pwd -P)
repo_dir=$$(dirname $$script_dir)
build_dir=$$repo_dir/_build

cmake --build $$build_dir --target test

exit $$?

:CMDSCRIPT
@echo off
setlocal
call :Main "%~f0" "%~dp0" "%~dp0.."
goto :eof

:Main
set script_path=%~f1
set script_dir=%~f2
set repo_dir=%~f3
set build_dir=%repo_dir%\_build

cmake --build "%build_dir%" --target RUN_TESTS

Use RUN_TESTS target with Visual Studio generator


@echo off

REM ################################################################################
REM ##
REM ##  Licensed to the Apache Software Foundation (ASF) under one or more
REM ##  contributor license agreements.  See the NOTICE file distributed with
REM ##  this work for additional information regarding copyright ownership.
REM ##  The ASF licenses this file to You under the Apache License, Version 2.0
REM ##  (the "License"); you may not use this file except in compliance with
REM ##  the License.  You may obtain a copy of the License at
REM ##
REM ##      http://www.apache.org/licenses/LICENSE-2.0
REM ##
REM ##  Unless required by applicable law or agreed to in writing, software
REM ##  distributed under the License is distributed on an "AS IS" BASIS,
REM ##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM ##  See the License for the specific language governing permissions and
REM ##  limitations under the License.
REM ##
REM ################################################################################

REM    This script should be used to create an Apache Flex SDK for Microsoft Windows that
REM    has the directory structure that the an IDE that supports Flex, such as Adobe
REM    Flash Builder or JetBrains IntelliJ expects.
REM
REM    This script can be used with either an Apache Flex binary package or an Apache Flex
REM    source package.  In either case you must unzip the package.  If you use the source
REM    package you must build the binaries files before running this script.  See the
REM    "Building the Source in the Source Distribution" section in the README at the root
REM    for build instructions.
REM
REM    The Adobe AIR SDK for Windows and the Adobe Flash Player playerglobal.swc are
REM    copied into the Apache Flex directory.  The paths in the framework
REM    configuration files are modified to reflect this.  You do not need to set
REM    up any of the environment variables mentioned in the README because the locations
REM    of all the software is known in this configuration.
REM
REM    TextLayoutFormat (TLF), OSMF, swobject, the Adobe embedded font support,
REM    and Adobe BlazeDS integration all come from the Adobe Flex 4.6 SDK.  You should
REM    be aware that these components have their own licenses that may or may not be
REM    compatible with the Apache v2 license.  See the "Software Dependencies" section
REM    in the README for more license information.
REM
REM    The Adobe Flex 4.6 SDK is available here:
REM         http://www.adobe.com/devnet/flex/flex-sdk-download.html
REM
REM    Usage: constructFlexForIDE "Apache Flex dir" [Adobe Flex 4.6 dir]
REM

REM
REM     If the Adobe Flex SDK 4.6 directory is not specified this script will look for it
REM     in the following places:
REM
REM     %ProgramFiles%\\Adobe\Adobe Flash Builder %ver%\sdks
REM         where %ProgramFiles% expands correctly for 32-bit and 64-bit
REM         and %ver% looks in 4.6, 4.5, and 4.7

:getApacheFlexDir
set IDE_SDK_DIR=%~f1
if not ["%IDE_SDK_DIR%"] == [] goto getAdobeFlexDir
echo Usage: %0 "Apache Flex dir" [Adobe Flex SDK 4.6 dir]
goto :eof

:getAdobeFlexDir
if not [%2] == [] (
    set ADOBE_FLEX_SDK_DIR=%~f2
    goto gotAdobeFlexSDK
)

REM
REM     Look for FlashBuilder versions 4.5, 4.7 and 4.6.  End with 4.6 so
REM     ADOBE_FLEX_SDK_DIR will be 4.6 if no SDK is found and an error is printed.
REM
for %%V in (4.6 4.5 4.7) do (
        if exist "%ProgramFiles%\Adobe\Adobe Flash Builder %%V\sdks\4.6.0" (
            set ADOBE_FLASHBUILDER_VERSION=%ProgramFiles%\Adobe\Adobe Flash Builder %%V\sdks\4.6.0
            goto gotAdobeFlexSDK
        )
)

REM
REM     Couldn't find default Adobe Flex SDK so ask for it.
REM
echo "Enter directory of Adobe Flex SDK 4.6:"
set /p ADOBE_FLEX_SDK_DIR=

:gotAdobeFlexSDK
echo The Apache Flex for IDE directory is "%IDE_SDK_DIR%"
echo The Adobe Flex directory is "%ADOBE_FLEX_SDK_DIR%"
echo.

REM
REM     If this is an Apache Flex dir then there should be a NOTICE file.
REM
:checkApacheFlexDir
if exist "%IDE_SDK_DIR%\NOTICE" goto checkApacheFlexBinaries
echo "%IDE_SDK_DIR%" does not appear to be a Apache Flex distribution.
goto :eof

REM
REM     Quick check to see if there are binaries in the Apache distribution.
REM
:checkApacheFlexBinaries
if exist "%IDE_SDK_DIR%\lib\mxmlc.jar" goto checkAdobeFlexSDK
echo "%IDE_SDK_DIR%" does not appear to be a Apache Flex distribution with binaries.
echo If it is a source distribution you must build the binaries first.  See the README.
goto :eof

REM
REM     Quick check to see if it is a Flex SDK.
REM
:checkAdobeFlexSDK
if exist "%ADOBE_FLEX_SDK_DIR%\license-adobesdk.htm" goto copyAdobeAIRSDK
echo "%ADOBE_FLEX_SDK_DIR%" does not appear to be an Adobe Flex SDK
goto :eof

REM
REM     Copy all the AIR SDK files to the IDE SDK.
REM     Copy files first, then directories with (/s).
REM
:copyAdobeAIRSDK
echo Copying the AIR SDK files to "%IDE_SDK_DIR%"

for %%G in (
    AIR SDK license.pdf
    AIR SDK Readme.txt
    bin\adl.exe
    bin\adt.bat
    lib\adt.jar
    samples\descriptor-sample.xml) do (

    if exist "%ADOBE_FLEX_SDK_DIR%"\%%G (
        copy /y "%ADOBE_FLEX_SDK_DIR%"\%%G "%IDE_SDK_DIR%"\%%G
    )
)

for %%G in (
    frameworks\libs\air
    frameworks\projects\air
    include
    install\android
    lib\android
    lib\aot
    lib\nai
    lib\win
    runtimes\air\android
    runtimes\air\win
    runtimes\air-captive\win
    samples\badge
    samples\icons
    templates\air
    templates\extensions) do (

    if exist "%ADOBE_FLEX_SDK_DIR%"\%%G (
        REM Make the directory so it won't prompt for file or directory.
        if not exist "%IDE_SDK_DIR%"\%%G mkdir "%IDE_SDK_DIR%"\%%G
        xcopy /q /y /e /i /c /r "%ADOBE_FLEX_SDK_DIR%"\%%G "%IDE_SDK_DIR%"\%%G
        if %errorlevel% NEQ 0 GOTO errorExit
    )
)

REM
REM     Copy all the third-party files from the Adobe Flex SDK to the IDE SDK.
REM
echo Copying the third-party files to "%IDE_SDK_DIR%"

for %%G in (
    frameworks\libs\player\11.1
    frameworks\javascript\fabridge\samples\fabridge\swfobject) do (

    if not exist "%IDE_SDK_DIR%"\%%G mkdir "%IDE_SDK_DIR%"\%%G
    if %errorlevel% NEQ 0 GOTO errorExit
)

for %%G in (
    frameworks\libs\osmf.swc
    frameworks\libs\textLayout.swc
    frameworks\libs\player\11.1\playerglobal.swc
    frameworks\javascript\FABridge\samples\fabridge\swfobject\swfobject.js
    lib\flex-messaging-common.jar
    lib\afe.jar
    lib\aglj40.jar
    lib\flex-fontkit.jar
    lib\rideau.jar
    templates\swfobject\swfobject.js) do (

    copy /y "%ADOBE_FLEX_SDK_DIR%"\%%G "%IDE_SDK_DIR%"\%%G
)

REM
REM     Copy config files formatted for IDE to frameworks.
REM
echo Copying frameworks config files configured for use without environment variables
copy /y "%IDE_SDK_DIR%"\ide\flashbuilder\config\*-config.xml "%IDE_SDK_DIR%\frameworks"

goto :eof

:errorExit
echo Exiting: error %errorlevel%
exit /b %errorlevel%

@echo off

REM ################################################################################
REM ##
REM ##  Licensed to the Apache Software Foundation (ASF) under one or more
REM ##  contributor license agreements.  See the NOTICE file distributed with
REM ##  this work for additional information regarding copyright ownership.
REM ##  The ASF licenses this file to You under the Apache License, Version 2.0
REM ##  (the "License"); you may not use this file except in compliance with
REM ##  the License.  You may obtain a copy of the License at
REM ##
REM ##      http://www.apache.org/licenses/LICENSE-2.0
REM ##
REM ##  Unless required by applicable law or agreed to in writing, software
REM ##  distributed under the License is distributed on an "AS IS" BASIS,
REM ##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM ##  See the License for the specific language governing permissions and
REM ##  limitations under the License.
REM ##
REM ################################################################################

REM    This script should be used to create an Apache Flex SDK that has the directory
REM    structure that the an IDE that supports Flex, such as Adobe Flash Builder or
REM    JetBrains IntelliJ expects.
REM
REM    This script can be used with either an Apache Flex binary package or an Apache Flex
REM    source package.  In either case you must unzip the package.  If you use the source
REM    package you must build the binaries files before running this script.  See the
REM    "Building the Source in the Source Distribution" section in the README at the root
REM    for build instructions.
REM
REM    The Adobe AIR SDK for Windows and the Adobe Flash Player playerglobal.swc are
REM    copied into the Apache Flex directory.  The paths in the framework
REM    configuration files are modified to reflect this.  You do not need to set
REM    up any of the environment variables mentioned in the README because the locations
REM    of all the software is known in this configuration.
REM
REM    TextLayoutFormat (TLF), OSMF, swobject, the Adobe embedded font support,
REM    and Adobe BlazeDS integration all come from the Adobe Flex 4.6 SDK.  You should
REM    be aware that these components have their own licenses that may or may not be
REM    compatible with the Apache v2 license.  See the "Software Dependencies" section
REM    in the README for more license information.
REM
REM    The Adobe Flex 4.6 SDK is available here:
REM         http://www.adobe.com/devnet/flex/flex-sdk-download.html
REM
REM    Usage: constructFlexForIDE "Apache Flex dir" [Adobe Flex 4.6 dir]
REM

REM
REM     If the Adobe Flex SDK 4.6 directory is not specified this script will look for it
REM     in the following places:
REM
REM     %ProgramFiles%\\Adobe\Adobe Flash Builder %ver%\sdks
REM         where %ProgramFiles% expands correctly for 32-bit and 64-bit
REM         and %ver% looks in 4.6, 4.5, and 4.7

:getApacheFlexDir
set IDE_SDK_DIR=%~f1
if not ["%IDE_SDK_DIR%"] == [] goto getAdobeFlexDir
echo Usage: %0 "Apache Flex dir" [Adobe Flex SDK 4.6 dir]
goto :eof

:getAdobeFlexDir
if not [%2] == [] (
    set ADOBE_FLEX_SDK_DIR=%~f2
    goto gotAdobeFlexSDK
)

REM
REM     Look for FlashBuilder versions 4.5, 4.7 and 4.6.  End with 4.6 so
REM     ADOBE_FLEX_SDK_DIR will be 4.6 if no SDK is found and an error is printed.
REM
for %%V in (4.6 4.5 4.7) do (
        if exist "%ProgramFiles%\Adobe\Adobe Flash Builder %%V\sdks\4.6.0" (
            set ADOBE_FLASHBUILDER_VERSION=%ProgramFiles%\Adobe\Adobe Flash Builder %%V\sdks\4.6.0
            goto gotAdobeFlexSDK
        )
)

REM
REM     Couldn't find default Adobe Flex SDK so ask for it.
REM
echo "Enter directory of Adobe Flex SDK 4.6:"
set /p ADOBE_FLEX_SDK_DIR=

:gotAdobeFlexSDK
echo The Apache Flex for IDE directory is "%IDE_SDK_DIR%"
echo The Adobe Flex directory is "%ADOBE_FLEX_SDK_DIR%"
echo.

REM
REM     If this is an Apache Flex dir then there should be a NOTICE file.
REM
:checkApacheFlexDir
if exist "%IDE_SDK_DIR%\NOTICE" goto checkApacheFlexBinaries
echo "%IDE_SDK_DIR%" does not appear to be a Apache Flex distribution.
goto :eof

REM
REM     Quick check to see if there are binaries in the Apache distribution.
REM
:checkApacheFlexBinaries
if exist "%IDE_SDK_DIR%\lib\mxmlc.jar" goto checkAdobeFlexSDK
echo "%IDE_SDK_DIR%" does not appear to be a Apache Flex distribution with binaries.
echo If it is a source distribution you must build the binaries first.  See the README.
goto :eof

REM
REM     Quick check to see if it is a Flex SDK.
REM
:checkAdobeFlexSDK
if exist "%ADOBE_FLEX_SDK_DIR%\license-adobesdk.htm" goto copyAdobeAIRSDK
echo "%ADOBE_FLEX_SDK_DIR%" does not appear to be an Adobe Flex SDK
goto :eof

REM
REM     Copy all the AIR SDK files to the IDE SDK.
REM     Copy files first, then directories with (/s).
REM
:copyAdobeAIRSDK
echo Copying the AIR SDK files to "%IDE_SDK_DIR%"

for %%G in (
    "AIR SDK license.pdf"
    "AIR SDK Readme.txt"
    bin\adl.exe
    bin\adt.bat
    lib\adt.jar
    samples\descriptor-sample.xml) do (

    if exist "%ADOBE_FLEX_SDK_DIR%"\%%G (
        copy /y "%ADOBE_FLEX_SDK_DIR%"\%%G "%IDE_SDK_DIR%"\%%G
    )
)

for %%G in (
    frameworks\libs\air
    frameworks\projects\air
    include
    install\android
    lib\android
    lib\aot
    lib\nai
    lib\win
    runtimes\air\android
    runtimes\air\mac
    runtimes\air\win
    runtimes\air-captive\mac
    runtimes\air-captive\win
    samples\badge
    samples\icons
    templates\air
    templates\extensions) do (

    if exist "%ADOBE_FLEX_SDK_DIR%"\%%G (
        REM    Make the directory so it won't prompt for file or directory.
        if not exist "%IDE_SDK_DIR%"\%%G mkdir "%IDE_SDK_DIR%"\%%G
        xcopy /q /y /e /i /c /r "%ADOBE_FLEX_SDK_DIR%"\%%G "%IDE_SDK_DIR%"\%%G
        if %errorlevel% NEQ 0 GOTO errorExit
    )
)

REM
REM     Copy all the third-party files from the Adobe Flex SDK to the IDE SDK.
REM
echo Copying the third-party files to "%IDE_SDK_DIR%"

for %%G in (
    frameworks\libs\player\11.1
    frameworks\javascript\fabridge\samples\fabridge\swfobject
    runtimes\player\11.1\lnx
    runtimes\player\11.1\mac
    runtimes\player\11.1\win) do (

    if not exist "%IDE_SDK_DIR%"\%%G mkdir "%IDE_SDK_DIR%"\%%G
    if %errorlevel% NEQ 0 GOTO errorExit
)

for %%G in (
    frameworks\libs\osmf.swc
    frameworks\libs\textLayout.swc
    frameworks\libs\player\11.1\playerglobal.swc
    frameworks\javascript\FABridge\samples\fabridge\swfobject\swfobject.js
    lib\flex-messaging-common.jar
    lib\afe.jar
    lib\aglj40.jar
    lib\flex-fontkit.jar
    lib\rideau.jar
    templates\swfobject\swfobject.js
    runtimes\player\11.1\lnx
    runtimes\player\11.1\mac
    runtimes\player\11.1\win) do (

    copy /y "%ADOBE_FLEX_SDK_DIR%"\%%G "%IDE_SDK_DIR%"\%%G
)

REM
REM     Copy config files formatted for IDE to frameworks.
REM
echo Copying frameworks config files configured for use without environment variables
copy /y "%IDE_SDK_DIR%"\ide\flashbuilder\config\*-config.xml "%IDE_SDK_DIR%\frameworks"

goto :eof

:errorExit
echo Exiting: error %errorlevel%
exit /b %errorlevel%

Include the mac and lnx files as well.

Include the mac and lnx files as well.

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1367179 13f79535-47bb-0310-9956-ffa450edef68


@echo off
setlocal

set SCRIPTDIR=%~dp0
set PROJDIR=%SCRIPTDIR%..\..\
set MSBUILDBIN="C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe"
set ORIGPATH=%PATH%

cd %PROJDIR%

@echo on
set BUILDDIR=%PROJDIR%build_win32\
set OUTPUTDIR=%PROJDIR%output\win32\
rmdir /S/Q %BUILDDIR%
mkdir %BUILDDIR%
cd %BUILDDIR%
cmake %PROJDIR% -G"Visual Studio 14 2015" -DBUILD_SHARED_LIBS=ON -DCMAKE_CONFIGURATION_TYPES=Release
%MSBUILDBIN% ALL_BUILD.vcxproj /property:Configuration=Release
set PATH=%PROJDIR%build_win32/Release;%PATH%
ctest .
cd ..

set BUILDDIR=%PROJDIR%build_win64\
set OUTPUTDIR=%PROJDIR%output\win64\
rmdir /S/Q %BUILDDIR%
mkdir %BUILDDIR%
cd %BUILDDIR%
cmake %PROJDIR% -G"Visual Studio 14 2015 Win64" -DBUILD_SHARED_LIBS=ON -DCMAKE_CONFIGURATION_TYPES=Release
%MSBUILDBIN% ALL_BUILD.vcxproj /property:Configuration=Release
set PATH=%PROJDIR%build_win64/Release;%PATH%
ctest .
cd ..

@echo off
setlocal

set SCRIPTDIR=%~dp0
set PROJDIR=%SCRIPTDIR%..\..\
set MSBUILDBIN="C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe"
set ORIGPATH=%PATH%

cd %PROJDIR%

@echo on
set BUILDDIR=%PROJDIR%build_win32\
set OUTPUTDIR=%PROJDIR%output\win32\
rmdir /S/Q %BUILDDIR%
mkdir %BUILDDIR%
cd %BUILDDIR%
cmake %PROJDIR% -G"Visual Studio 14 2015" -DENABLE_TESTING=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CONFIGURATION_TYPES=Release
%MSBUILDBIN% ALL_BUILD.vcxproj /property:Configuration=Release
set PATH=%PROJDIR%build_win32/Release;%PATH%
ctest .
cd ..

set BUILDDIR=%PROJDIR%build_win64\
set OUTPUTDIR=%PROJDIR%output\win64\
rmdir /S/Q %BUILDDIR%
mkdir %BUILDDIR%
cd %BUILDDIR%
cmake %PROJDIR% -G"Visual Studio 14 2015 Win64" -DENABLE_TESTING=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CONFIGURATION_TYPES=Release
%MSBUILDBIN% ALL_BUILD.vcxproj /property:Configuration=Release
set PATH=%PROJDIR%build_win64/Release;%PATH%
ctest .
cd ..

enable testing

enable testing


echo "Upgrading Codebrag 1.2 to 2.0"
java -Dconfig.file=codebrag.conf -cp codebrag.jar com.softwaremill.codebrag.dao.sql.MigrateV1_2ToV2_0

Add upgrade script for windows

Add upgrade script for windows


@echo off
echo.

:: If this file fails to find git.exe add it Git install
:: directorys 'bin' folder path to your PATH env variable

:update_vs2008_dependency_submodule
echo -- Updatating git submodule path deps/vs2008
git.exe submodule init deps/vs2008
git.exe submodule init deps/vs2008
if exist "deps\vs2008\README" (
    goto :remove_all_dlls_from_bin
) else (
    echo ERROR: Could not find 'deps\vs2008\README', assuming git submodule init/update failed!
    goto :end
)

:remove_all_dlls_from_bin
echo -- Removing all .dll files from /bin
del bin\*.dll /q
echo -- Removing CMakeCache.txt to get rid of cached dependency paths
del CMakeCache.txt /q
goto :copy_new_dlls_to_bin

:copy_new_dlls_to_bin
echo -- Copying new vs2008 dependencies to /bin
xcopy deps\vs2008\runtime_deps\*.* bin /S /C /Y /Q
goto :end

:end
echo.
pause

@echo off
echo.

:: If this file fails to find git.exe add it Git install
:: directorys 'bin' folder path to your PATH env variable

:update_vs2008_dependency_submodule
echo -- Updatating git submodule path deps/vs2008
git.exe submodule init deps/vs2008
git.exe submodule update deps/vs2008
if exist "deps\vs2008\README" (
    goto :remove_all_dlls_from_bin
) else (
    echo ERROR: Could not find 'deps\vs2008\README', assuming git submodule init/update failed!
    goto :end
)

:remove_all_dlls_from_bin
echo -- Removing all .dll files from /bin
del bin\*.dll /q
echo -- Removing CMakeCache.txt to get rid of cached dependency paths
del CMakeCache.txt /q
goto :copy_new_dlls_to_bin

:copy_new_dlls_to_bin
echo -- Copying new vs2008 dependencies to /bin
xcopy deps\vs2008\runtime_deps\*.* bin /S /C /Y /Q
goto :end

:end
echo.
pause

Fix typo in submodle fetch.

Fix typo in submodle fetch.


@echo on

set PATH=%PATH%;C:\Program Files\Git\cmd
set PATH=%PATH%;C:\Program Files\CMake\bin
set PATH=%PATH%;C:\Program Files\Git\mingw64\bin
set "VSCMD_START_DIR=%CD%"
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"

cd tests

rem set build_root=build_windows_x86_msvc
call :compile "build_windows_x86_msvc_nointr"   "-DMIPP_NO_INTRINSICS"
call :compile "build_windows_x86_msvc_sse2"     "/arch:SSE2"
call :compile "build_windows_x86_msvc_sse3"     "/arch:SSE3"
call :compile "build_windows_x86_msvc_ssse3"    "/arch:SSSE3"
call :compile "build_windows_x86_msvc_sse4_1"   "/arch:SSE4.1"
call :compile "build_windows_x86_msvc_sse4_2"   "/arch:SSE4.2"
call :compile "build_windows_x86_msvc_avx"      "/arch:AVX"
call :compile "build_windows_x86_msvc_avx2_fma" "/arch:AVX2"
rem call :compile "build_windows_x86_msvc_avx512f"  "/arch:AVX512"

exit /B %ERRORLEVEL%

:compile
set build=%~1%
set params=%~2%
mkdir %build%
cd %build%
cmake .. -G"Visual Studio 15 2017 Win64" -DCMAKE_CXX_FLAGS="-D_CRT_SECURE_NO_DEPRECATE /EHsc %params%"
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%
devenv /build Release MIPP_tests.sln
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%
move bin\Release\* bin\
rmdir bin\Release\
cd ..
exit /B 0

@echo on

set PATH=%PATH%;C:\Program Files\Git\cmd
set PATH=%PATH%;C:\Program Files\CMake\bin
set PATH=%PATH%;C:\Program Files\Git\mingw64\bin
set "VSCMD_START_DIR=%CD%"
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"

cd tests

rem set build_root=build_windows_x86_msvc
call :compile "build_windows_x86_msvc_nointr"   "-DMIPP_NO_INTRINSICS"
call :compile "build_windows_x86_msvc_sse2"     "/arch:SSE2   -D__SSE__ -D__SSE2__"
call :compile "build_windows_x86_msvc_sse3"     "/arch:SSE3   -D__SSE__ -D__SSE2__ -D__SSE3__"
call :compile "build_windows_x86_msvc_ssse3"    "/arch:SSSE3  -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__"
call :compile "build_windows_x86_msvc_sse4_1"   "/arch:SSE4.1 -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__"
call :compile "build_windows_x86_msvc_sse4_2"   "/arch:SSE4.2 -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__"
call :compile "build_windows_x86_msvc_avx"      "/arch:AVX    -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AVX__"
call :compile "build_windows_x86_msvc_avx2_fma" "/arch:AVX2   -D__SSE__ -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AVX__ -D__AVX2__ -D__FMA__"
rem call :compile "build_windows_x86_msvc_avx512f"  "/arch:AVX512"

exit /B %ERRORLEVEL%

:compile
set build=%~1%
set params=%~2%
mkdir %build%
cd %build%
cmake .. -G"Visual Studio 15 2017 Win64" -DCMAKE_CXX_FLAGS="-D_CRT_SECURE_NO_DEPRECATE /EHsc %params%"
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%
devenv /build Release MIPP_tests.sln
if %ERRORLEVEL% neq 0 exit /B %ERRORLEVEL%
move bin\Release\* bin\
rmdir bin\Release\
cd ..
exit /B 0

Fix MSVC cmd lines.

Fix MSVC cmd lines.


@rem This file is part of C++-Builtem <http://github.com/ufal/cpp_builtem/>.
@rem
@rem Copyright 2014 Institute of Formal and Applied Linguistics, Faculty of
@rem Mathematics and Physics, Charles University in Prague, Czech Republic.
@rem
@rem This Source Code Form is subject to the terms of the Mozilla Public
@rem License, v. 2.0. If a copy of the MPL was not distributed with this
@rem file, You can obtain one at http://mozilla.org/MPL/2.0/.

@set PATH=%~dp0tdm-gcc-4.9.2\bin;%PATH%
@%~dp0mingw32-make\mingw32-make.exe %*

@rem This file is part of C++-Builtem <http://github.com/ufal/cpp_builtem/>.
@rem
@rem Copyright 2014 Institute of Formal and Applied Linguistics, Faculty of
@rem Mathematics and Physics, Charles University in Prague, Czech Republic.
@rem
@rem This Source Code Form is subject to the terms of the Mozilla Public
@rem License, v. 2.0. If a copy of the MPL was not distributed with this
@rem file, You can obtain one at http://mozilla.org/MPL/2.0/.

@set PATH=%~dp0tdm-gcc\bin;%PATH%
@%~dp0mingw32-make\mingw32-make.exe %*

Use tdm-gcc symlink instead of tdm-gcc-4.9.2.


setlocal
cd %~dp0
set CONDA_BLD_PATH=%cd%\..\conda-bld
set ANACONDA_API_TOKEN=%ANACONDA_AUTH_TOKEN%

call:cb %* .\motionless || exit /B 1
call:cb %* .\salem || exit /B 1
call:cb %* .\pytest-mpl || exit /B 1
call:cb %* .\oggm-deps || exit /B 1
call:cb %* .\oggm || exit /B 1

exit /B %ERRORLEVEL%

:cb
if DEFINED CONDA_BUILD_PY (
conda build --python %CONDA_BUILD_PY% --channel conda-forge --channel defaults --override-channels %* || exit /B 1
) else (
conda build --python 3.6 --channel conda-forge --channel defaults --override-channels %* || exit /B 1
)
exit /B 0

setlocal
cd %~dp0
set CONDA_BLD_PATH=%cd%\..\conda-bld
set ANACONDA_API_TOKEN=%ANACONDA_AUTH_TOKEN%

call:cb %* .\pytest-mpl || exit /B 1
call:cb %* .\motionless || exit /B 1
call:cb %* .\salem || exit /B 1
call:cb %* .\oggm-deps || exit /B 1
call:cb %* .\oggm || exit /B 1

exit /B %ERRORLEVEL%

:cb
if DEFINED CONDA_BUILD_PY (
conda build --python %CONDA_BUILD_PY% --channel conda-forge --channel defaults --override-channels %* || exit /B 1
) else (
conda build --python 3.6 --channel conda-forge --channel defaults --override-channels %* || exit /B 1
)
exit /B 0

Build pytest-mpl first

Build pytest-mpl first


@echo off
setlocal

rem location and packages to install
if not defined chocoRoot set chocoRoot=%~d0\Choco
set chocoPackagesWork=fiddler4 ilspy NugetPackageExplorer redis-desktop-manager slack microsoftazurestorageexplorer
set chocoPackagesUtil=7zip.install conemu git.install googlechrome keepass.install "mobaxterm --allowEmptyChecksums" notepadplusplus.install nuget.commandline "paint.net --allow-empty-checksums" sourcetree visualstudiocode
set chocoPackagesHome="calibre --allow-empty-checksums" python sumatrapdf.commandline vlc
if not defined chocoPackages set chocoPackages=%chocoPackagesUtil% %chocoPackagesHome% %chocoPackagesWork%
rem
rem sysinternals atom nodejs powershell windirstat spybot ccleaner
if not defined chocoExe set chocoExe=choco.exe

where "%chocoExe%" > NUL 2>&1

if %errorlevel% equ 0 (
	echo ERROR: choco already installed
	exit /b 1
)

:createFolder
	if exist %chocoRoot% goto :createEnvVar
	mkdir %chocoRoot%
	if exist %chocoRoot% goto :createEnvVar
	echo ERROR: Unable to create %chocoRoot%
	exit /b 1

:createEnvVar
	setx ChocolateyInstall %chocoRoot% /m > NUL 2>&1
	if ERRORLEVEL 1 (
		echo ERROR: Unable to create create system environment variable. Run script as admin.
		exit /b 1
	)

:installChoco
	set ChocolateyInstall=%chocoRoot%
	pushd "%~dp0"
	set ps=%systemroot%\System32\WindowsPowerShell\v1.0\powershell.exe
	set setup=choco_install.ps1

	if exist %setup% del /f %setup%

	"%ps%" -NoProfile -ExecutionPolicy Bypass -Command "((new-object net.webclient).DownloadFile('https://chocolatey.org/install.ps1','%setup%'))"
	if not exist %setup% (
		echo ERROR: Unable to download setup script
		exit /b 1
	)

	"%ps%" -NoProfile -ExecutionPolicy Bypass -Command "& '%cd%\%setup%' %*"
	del /f %setup%
	popd

	set path=%chocoRoot%\bin;%path%

:installPackages
	echo Enabling chocolatey source
	rem Azure install disables choco's default source
	"%chocoExe%" source enable --name=chocolatey

	for %%X in ( %chocoPackages% ) do call :installPackage %%X

	echo Start a new command prompt to be able to use choco.

	goto :eof

:installPackage
	echo Installing %~1
	"%chocoExe%" install %~1 -y
	goto :eof

@echo off
setlocal

rem location and packages to install
if not defined chocoRoot set chocoRoot=%~d0\Choco
set chocoPackagesWork=fiddler4 ilspy NugetPackageExplorer redis-desktop-manager slack microsoftazurestorageexplorer armclient
set chocoPackagesUtil=7zip.install conemu git.install googlechrome keepass.install "mobaxterm --allowEmptyChecksums" notepadplusplus.install nuget.commandline "paint.net --allow-empty-checksums" sourcetree visualstudiocode
set chocoPackagesHome="calibre --allow-empty-checksums" python sumatrapdf.commandline vlc
if not defined chocoPackages set chocoPackages=%chocoPackagesUtil% %chocoPackagesHome% %chocoPackagesWork%
rem
rem sysinternals atom nodejs powershell windirstat spybot ccleaner
if not defined chocoExe set chocoExe=choco.exe

where "%chocoExe%" > NUL 2>&1

if %errorlevel% equ 0 (
	echo ERROR: choco already installed
	exit /b 1
)

:createFolder
	if exist %chocoRoot% goto :createEnvVar
	mkdir %chocoRoot%
	if exist %chocoRoot% goto :createEnvVar
	echo ERROR: Unable to create %chocoRoot%
	exit /b 1

:createEnvVar
	setx ChocolateyInstall %chocoRoot% /m > NUL 2>&1
	if ERRORLEVEL 1 (
		echo ERROR: Unable to create create system environment variable. Run script as admin.
		exit /b 1
	)

:installChoco
	set ChocolateyInstall=%chocoRoot%
	pushd "%~dp0"
	set ps=%systemroot%\System32\WindowsPowerShell\v1.0\powershell.exe
	set setup=choco_install.ps1

	if exist %setup% del /f %setup%

	"%ps%" -NoProfile -ExecutionPolicy Bypass -Command "((new-object net.webclient).DownloadFile('https://chocolatey.org/install.ps1','%setup%'))"
	if not exist %setup% (
		echo ERROR: Unable to download setup script
		exit /b 1
	)

	"%ps%" -NoProfile -ExecutionPolicy Bypass -Command "& '%cd%\%setup%' %*"
	del /f %setup%
	popd

	set path=%chocoRoot%\bin;%path%

:installPackages
	echo Enabling chocolatey source
	rem Azure install disables choco's default source
	"%chocoExe%" source enable --name=chocolatey

	for %%X in ( %chocoPackages% ) do call :installPackage %%X

	echo Start a new command prompt to be able to use choco.

	goto :eof

:installPackage
	echo Installing %~1
	"%chocoExe%" install %~1 -y
	goto :eof

add choco armclient

add choco armclient


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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@latest || goto :error
call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

@rem The image we're currently running has a broken version of Node.js enabled
@rem by nvm (v10.15.3), which has no npm bin. This hack uses the functional
@rem Node v8.9.1 to install npm@latest, it then uses this version of npm to
@rem install npm for v10.15.3.
call nvm use v8.9.1 || goto :error
call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm-bootstrap\bin\npm-cli.js i npm -g || goto :error
call nvm use v10.15.3 || goto :error
call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm\bin\npm-cli.js i npm -g || goto :error

call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

build: patch Windows container, fixing Node 10 (#173)


@echo off

if /i "%1" == "debug" goto :ok
if /i "%1" == "release" goto :ok
if /i "%1" == "vsdebug" goto :ok
if /i "%1" == "vsrelease" goto :ok

echo Builds a few test tools using latest compiler and runtime
echo Usage:
echo    BuildTestTools.cmd debug
echo    BuildTestTools.cmd release
echo    BuildTestTools.cmd vsdebug
echo    BuildTestTools.cmd vsrelease
exit /b 1

:ok

:: Check prerequisites
if not '%VisualStudioVersion%' == '' goto vsversionset
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
if exist "%ProgramFiles%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
if not '%VisualStudioVersion%' == '' goto vsversionset
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0
if exist "%ProgramFiles%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0

:vsversionset
if '%VisualStudioVersion%' == '' echo Error: Could not find an installation of Visual Studio && goto :eof

if exist "%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe" set _msbuildexe="%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
if exist "%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"      set _msbuildexe="%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. && goto :eof

if not exist "%~dp0\fsharpqa\testenv\bin" mkdir "%~dp0\fsharpqa\testenv\bin"  || goto :error
%_msbuildexe% %~dp0\fsharpqa\testenv\src\ILComparer\ILComparer.fsproj /p:Configuration=%1 /t:Build  || goto :error
xcopy /Y %~dp0\fsharpqa\testenv\src\ILComparer\bin\%1\* %~dp0\fsharpqa\testenv\bin  || goto :error

%_msbuildexe% %~dp0\fsharpqa\testenv\src\diff\diff.fsproj /p:Configuration=%1 /t:Build  || goto :error
xcopy /Y %~dp0\fsharpqa\testenv\src\diff\bin\%1\* %~dp0\fsharpqa\testenv\bin  || goto :error

%_msbuildexe% %~dp0\fsharpqa\testenv\src\HostedCompilerServer\HostedCompilerServer.fsproj /p:Configuration=%1 /t:Build  || goto :error
xcopy /Y %~dp0\fsharpqa\testenv\src\HostedCompilerServer\bin\%1\* %~dp0\fsharpqa\testenv\bin  || goto :error

if exist %~dp0\..\%1\net40\bin (
    xcopy /Y %~dp0\..\%1\net40\bin\FSharp.Core.sigdata %~dp0\fsharpqa\testenv\bin  || goto :error
    xcopy /Y %~dp0\..\%1\net40\bin\FSharp.Core.optdata %~dp0\fsharpqa\testenv\bin  || goto :error
)

goto :EOF

:error
echo Failed with error %errorlevel%.
exit /b %errorlevel%

@echo off

if /i "%1" == "debug" goto :ok
if /i "%1" == "release" goto :ok
if /i "%1" == "vsdebug" goto :ok
if /i "%1" == "vsrelease" goto :ok

echo Builds a few test tools using latest compiler and runtime
echo Usage:
echo    BuildTestTools.cmd debug
echo    BuildTestTools.cmd release
echo    BuildTestTools.cmd vsdebug
echo    BuildTestTools.cmd vsrelease
exit /b 1

:ok

:: Check prerequisites
if not '%VisualStudioVersion%' == '' goto vsversionset
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
if exist "%ProgramFiles%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
if exist "%VS140COMNTOOLS%" set VisualStudioVersion=14.0
if not '%VisualStudioVersion%' == '' goto vsversionset
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0
if exist "%ProgramFiles%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0
if exist "%VS120COMNTOOLS%" set VisualStudioVersion=12.0

:vsversionset
if '%VisualStudioVersion%' == '' echo Error: Could not find an installation of Visual Studio && goto :eof

if exist "%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe" set _msbuildexe="%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
if exist "%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"      set _msbuildexe="%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. && goto :eof

if not exist "%~dp0\fsharpqa\testenv\bin" mkdir "%~dp0\fsharpqa\testenv\bin"  || goto :error
%_msbuildexe% %~dp0\fsharpqa\testenv\src\ILComparer\ILComparer.fsproj /p:Configuration=%1 /t:Build  || goto :error
xcopy /Y %~dp0\fsharpqa\testenv\src\ILComparer\bin\%1\* %~dp0\fsharpqa\testenv\bin  || goto :error

%_msbuildexe% %~dp0\fsharpqa\testenv\src\diff\diff.fsproj /p:Configuration=%1 /t:Build  || goto :error
xcopy /Y %~dp0\fsharpqa\testenv\src\diff\bin\%1\* %~dp0\fsharpqa\testenv\bin  || goto :error

%_msbuildexe% %~dp0\fsharpqa\testenv\src\HostedCompilerServer\HostedCompilerServer.fsproj /p:Configuration=%1 /t:Build  || goto :error
xcopy /Y %~dp0\fsharpqa\testenv\src\HostedCompilerServer\bin\%1\* %~dp0\fsharpqa\testenv\bin  || goto :error

if exist %~dp0\..\%1\net40\bin (
    xcopy /Y %~dp0\..\%1\net40\bin\FSharp.Core.sigdata %~dp0\fsharpqa\testenv\bin  || goto :error
    xcopy /Y %~dp0\..\%1\net40\bin\FSharp.Core.optdata %~dp0\fsharpqa\testenv\bin  || goto :error
)

goto :EOF

:error
echo Failed with error %errorlevel%.
exit /b %errorlevel%

Fix test build when VS is not installed on the root drive

closes #344


cd build\html
start index.html
cd..
cd..

Add file run.bat

Add file run.bat


# example setup script for ant build environment.
# optional stuff may be omitted by prefixing every
# line between the brackets with rem.

# look for additional information in build.dependencies.

rem -- java builds --

set TOOLS_DIR=C:\wks\tools
set ANT_HOME=%TOOLS_DIR%\apache-ant\1.7.0
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_06
rem optional
rem set CLOVER_HOME=%TOOLS_DIR%\clover-ant\2.3.2
rem /optional
PATH %ANT_HOME%\bin;%JAVA_HOME%\bin;%PATH%

rem -- dotnet builds --

rem optional
set DOTNET_HOME=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
set NUNIT_HOME=%TOOLS_DIR%\NUnit\2.4.7
PATH %DOTNET_HOME%;%NUNIT_HOME%\bin;%PATH%
rem /optional

rem -- mono builds --

rem optional
rem set MONO_HOME=...
rem /optional

rem -- installer builds --

rem optional
set NSIS_HOME=%TOOLS_DIR%\nsis\2.23
rem /optional

rem -- standalone example builds --

rem set ETCH_HOME=...

# example setup script for ant build environment.
# optional stuff may be omitted by prefixing every
# line between the brackets with rem.

# look for additional information in build.dependencies.

rem -- java builds --

set TOOLS_DIR=C:\wks\tools
set ANT_HOME=%TOOLS_DIR%\apache-ant\1.7.0
ren set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_06
rem optional
rem set CLOVER_HOME=%TOOLS_DIR%\clover-ant\2.3.2
rem /optional
PATH %ANT_HOME%\bin;%JAVA_HOME%\bin;%PATH%

rem -- dotnet builds --

rem optional
set DOTNET_HOME=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
set NUNIT_HOME=%TOOLS_DIR%\NUnit\2.4.7
PATH %DOTNET_HOME%;%NUNIT_HOME%\bin;%PATH%
rem /optional

rem -- mono builds --

rem optional
rem set MONO_HOME=...
rem /optional

rem -- installer builds --

rem optional
set NSIS_HOME=%TOOLS_DIR%\nsis\2.23
rem /optional

rem -- standalone example builds --

rem set ETCH_HOME=...

comment out conflicting assignment of JAVA_HOME

git-svn-id: fadc92a2e5f700a5cbf547f810915d7a82a23cf8@736725 13f79535-47bb-0310-9956-ffa450edef68


update ChromeDriver to v44

RUN-1594: update ChromeDriver to v44


### application.bat - 2015 - gandubert ###
version = "2.0.0"
build_hour = "11H00"

update major version

update major version


if "%1"=="" goto default_value_python:
set pythonexe="%1"
%pythonexe% setup.py write_version
goto custom_python:

:default_value_python:
set pythonexe="c:\Python34_x64\python"
:custom_python:
%pythonexe% -u setup.py build_script
if %errorlevel% neq 0 exit /b %errorlevel%

if "%1"=="" goto default_value_python:
set pythonexe="%1"
%pythonexe% setup.py write_version
goto custom_python:

:default_value_python:
set pythonexe="c:\Python35_x64\python"
:custom_python:
%pythonexe% -u setup.py build_script
if %errorlevel% neq 0 exit /b %errorlevel%

update to python 3.5

update to python 3.5


call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"

call update_deps.bat

git reset --hard
python build\replace_versions.py
if %errorlevel% neq 0 exit /b %errorlevel%

copy /Y "%~dp0server-license.txt" "%~dp0urbackupserver_installer_win\data_common\server-license.txt"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration=Release /p:Platform="win32"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration=Release /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration="Release Service" /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration="Release Service" /p:Platform="win32"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild urbackupserver\urbackupserver.vcxproj /p:Configuration="Release Server" /p:Platform="win32"
if %errorlevel% neq 0 exit /b %errorlevel%

mkdir "Release Server"
copy /Y "urbackupserver\Release Server\*" "Release Server\"

msbuild urbackupserver\urbackupserver.vcxproj /p:Configuration="Release Server" /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%

mkdir "x64\Release Server"
copy /Y "urbackupserver\x64\Release Server\*" "x64\Release Server\"

call "%~dp0urbackupserver_installer_win/generate_msi.bat"
if %errorlevel% neq 0 exit /b %errorlevel%

"C:\Program Files (x86)\NSIS\Unicode\makensis.exe" "%~dp0urbackupserver_installer_win/urbackup_server.nsi"
if %errorlevel% neq 0 exit /b %errorlevel%

if NOT "%STORE_SYMBOLS%" == "true" GOTO skip_symbols

echo|set /p="set build_revision=" > "build_revision.bat"
git rev-parse HEAD >> "build_revision.bat"
call build_revision.bat

cd "%~dp0"
FOR /F "tokens=*" %%G IN (pdb_dirs_server.txt) DO symstore add /compress /r /f "%~dp0%%G" /s "C:\symstore" /t "UrBackup Server /v "%build_revision%" /c "Release"

:skip_symbols

exit /b 0

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat"

call update_deps.bat

git reset --hard
python build\replace_versions.py
if %errorlevel% neq 0 exit /b %errorlevel%

copy /Y "%~dp0server-license.txt" "%~dp0urbackupserver_installer_win\data_common\server-license.txt"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration=Release /p:Platform="win32"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration=Release /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration="Release Service" /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild UrBackupBackend.sln /p:Configuration="Release Service" /p:Platform="win32"
if %errorlevel% neq 0 exit /b %errorlevel%

msbuild urbackupserver\urbackupserver.vcxproj /p:Configuration="Release Server" /p:Platform="win32"
if %errorlevel% neq 0 exit /b %errorlevel%

mkdir "Release Server"
copy /Y "urbackupserver\Release Server\*" "Release Server\"

msbuild urbackupserver\urbackupserver.vcxproj /p:Configuration="Release Server" /p:Platform="x64"
if %errorlevel% neq 0 exit /b %errorlevel%

mkdir "x64\Release Server"
copy /Y "urbackupserver\x64\Release Server\*" "x64\Release Server\"

call "%~dp0urbackupserver_installer_win/generate_msi.bat"
if %errorlevel% neq 0 exit /b %errorlevel%

"C:\Program Files (x86)\NSIS\Unicode\makensis.exe" "%~dp0urbackupserver_installer_win/urbackup_server.nsi"
if %errorlevel% neq 0 exit /b %errorlevel%

if NOT "%STORE_SYMBOLS%" == "true" GOTO skip_symbols

echo|set /p="set build_revision=" > "build_revision.bat"
git rev-parse HEAD >> "build_revision.bat"
call build_revision.bat

cd "%~dp0"
FOR /F "tokens=*" %%G IN (pdb_dirs_server.txt) DO symstore add /compress /r /f "%~dp0%%G" /s "C:\symstore" /t "UrBackup Server /v "%build_revision%" /c "Release"

:skip_symbols

exit /b 0

Upgrade to Visual Studio 2019

Upgrade to Visual Studio 2019


mingw32-make
call PSX_EXPORT_OVERLAYS.bat
call PSX_MOVE_OVERLAYS.bat
call PSX_CREATE_GAMEWAD.bat
cd DISC
CPE2X MAIN.CPE
call MAKEISO.bat
cd ../

mingw32-make
call PSX_EXPORT_OVERLAYS.bat
call PSX_MOVE_OVERLAYS.bat
call PSX_CREATE_CODEWAD.bat
call PSX_CREATE_GAMEWAD.bat
cd DISC
CPE2X MAIN.CPE
call MAKEISO.bat
cd ../

Add CODEWAD export to PSX_BUILD

Add CODEWAD export to PSX_BUILD


@echo off

set CoreRT_TestRoot=%~dp0
set CoreRT_CliDir=%CoreRT_TestRoot%../Tools/dotnetcli
set CoreRT_BuildArch=x64
set CoreRT_BuildType=Debug
set CoreRT_BuildOS=Windows_NT
set CoreRT_TestRun=true
set CoreRT_TestCompileMode=ryujit
set CoreRT_RunCoreCLRTests=

:ArgLoop
if "%1" == "" goto :ArgsDone
if /i "%1" == "/?" goto :Usage
if /i "%1" == "x64"    (set CoreRT_BuildArch=x64&&shift&goto ArgLoop)
if /i "%1" == "x86"    (set CoreRT_BuildArch=x86&&shift&goto ArgLoop)
if /i "%1" == "arm"    (set CoreRT_BuildArch=arm&&shift&goto ArgLoop)

if /i "%1" == "debug"    (set CoreRT_BuildType=Debug&shift&goto ArgLoop)
if /i "%1" == "release"  (set CoreRT_BuildType=Release&shift&goto ArgLoop)
if /i "%1" == "/coreclr"  (set CoreRT_RunCoreCLRTests=true&shift&goto ArgLoop)
if /i "%1" == "/mode" (set CoreRT_TestCompileMode=%2&shift&shift&goto ArgLoop)
if /i "%1" == "/runtest" (set CoreRT_TestRun=%2&shift&shift&goto ArgLoop)
if /i "%1" == "/dotnetclipath" (set CoreRT_CliDir=%2&shift&shift&goto ArgLoop)

echo Invalid command line argument: %1
goto :Usage

:Usage
echo %0 [OS] [arch] [flavor] [/extrepo] [/mode] [/runtest]
echo     /mode         : Compilation mode. Specify cpp/ryujit. Default: ryujit
echo     /runtest      : Should just compile or run compiled binary? Specify: true/false. Default: true.
echo     /coreclr      : Download and run the CoreCLR repo tests
exit /b 2

:ArgsDone

call %CoreRT_TestRoot%testenv.cmd

set CoreRT_RspTemplateDir=%CoreRT_TestRoot%..\bin\obj\%CoreRT_BuildOS%.%CoreRT_BuildArch%.%CoreRT_BuildType%

setlocal EnableDelayedExpansion
set __BuildStr=%CoreRT_BuildOS%.%CoreRT_BuildArch%.%CoreRT_BuildType%
set __CoreRTTestBinDir=%CoreRT_TestRoot%..\bin\tests
set __LogDir=%CoreRT_TestRoot%\..\bin\Logs\%__BuildStr%\tests

call "!VS140COMNTOOLS!\..\..\VC\vcvarsall.bat" %CoreRT_BuildArch%

if "%CoreRT_RunCoreCLRTests%"=="true" goto :TestExtRepo

if /i "%__BuildType%"=="Debug" (
    set __LinkLibs=msvcrtd.lib
) else (
    set __LinkLibs=msvcrt.lib
)

echo. > %__CoreRTTestBinDir%\testResults.tmp

set /a __CppTotalTests=0
set /a __CppPassedTests=0
set /a __JitTotalTests=0
set /a __JitPassedTests=0
for /f "delims=" %%a in ('dir /s /aD /b src\*') do (
    set __SourceFolder=%%a
    set __SourceFileName=%%~na
    set __RelativePath=!__SourceFolder:%CoreRT_TestRoot%=!
    if exist "!__SourceFolder!\!__SourceFileName!.csproj" (

        set __Mode=Jit
        call :CompileFile !__SourceFolder! !__SourceFileName! %__LogDir%\!__RelativePath!
        set /a __JitTotalTests=!__JitTotalTests!+1

        if not exist "!__SourceFolder!\no_cpp" (
            set __Mode=Cpp
            call :CompileFile !__SourceFolder! !__SourceFileName! %__LogDir%\!__RelativePath!
            set /a __CppTotalTests=!__CppTotalTests!+1
        )
    )
)
set /a __CppFailedTests=%__CppTotalTests%-%__CppPassedTests%
set /a __JitFailedTests=%__JitTotalTests%-%__JitPassedTests%
set /a __TotalTests=%__JitTotalTests%+%__CppTotalTests%
set /a __PassedTests=%__JitPassedTests%+%__CppPassedTests%
set /a __FailedTests=%__JitFailedTests%+%__CppFailedTests%

echo ^<?xml version="1.0" encoding="utf-8"?^> > %__CoreRTTestBinDir%\testResults.xml
echo ^<assemblies^>  >> %__CoreRTTestBinDir%\testResults.xml
echo ^<assembly name="ILCompiler" total="%__TotalTests%" passed="%__PassedTests%" failed="%__FailedTests%" skipped="0"^>  >> %__CoreRTTestBinDir%\testResults.xml
echo ^<collection total="%__TotalTests%" passed="%__PassedTests%" failed="%__FailedTests%" skipped="0"^>  >> %__CoreRTTestBinDir%\testResults.xml
type %__CoreRTTestBinDir%\testResults.tmp >> %__CoreRTTestBinDir%\testResults.xml
echo ^</collection^>  >> %__CoreRTTestBinDir%\testResults.xml
echo ^</assembly^>  >> %__CoreRTTestBinDir%\testResults.xml
echo ^</assemblies^>  >> %__CoreRTTestBinDir%\testResults.xml

echo.
set __JitStatusPassed=0
if %__JitTotalTests% EQU %__JitPassedTests% (set __JitStatusPassed=1)
if %__JitTotalTests% EQU 0 (set __JitStatusPassed=0)
call :PassFail %__JitStatusPassed% "JIT - TOTAL: %__JitTotalTests% PASSED: %__JitPassedTests%"

set __CppStatusPassed=0
if %__CppTotalTests% EQU %__CppPassedTests% (set __CppStatusPassed=1)
if %__CppTotalTests% EQU 0 (set __CppStatusPassed=0)
call :PassFail %__CppStatusPassed% "CPP - TOTAL: %__CppTotalTests% PASSED: %__CppPassedTests%"

if not %__JitStatusPassed% EQU 1 (exit /b 1)
if not %__CppStatusPassed% EQU 1 (exit /b 1)
exit /b 0

:PassFail
set __Green=%~1
set __OutStr=%~2
if "%__Green%"=="1" (
    powershell -Command Write-Host %__OutStr% -foreground "Black" -background "Green"
) else (
    powershell -Command Write-Host %__OutStr% -foreground "White" -background "Red"
)
goto :eof

:CompileFile
    echo.
    set __SourceFolder=%~1
    set __SourceFileName=%~2
    set __CompileLogPath=%~3

    echo Compiling directory !__SourceFolder! !__Mode!
    echo.

    if not exist "!__CompileLogPath!" (mkdir !__CompileLogPath!)
    set __SourceFile=!__SourceFolder!\!__SourceFileName!

    if exist "!__SourceFolder!\bin" rmdir /s /q !__SourceFolder!\bin
    if exist "!__SourceFolder!\obj" rmdir /s /q !__SourceFolder!\obj

    setlocal
    set extraArgs=
    if /i "%__Mode%" == "cpp" (
        set extraArgs=!extraArgs! /p:NativeCodeGen=cpp
        if /i "%CoreRT_BuildType%" == "debug" (
            set extraArgs=!extraArgs! /p:AdditionalCppCompilerFlags=/MTd
        )
    )

    echo msbuild /ConsoleLoggerParameters:ForceNoAlign "/p:IlcPath=%CoreRT_ToolchainDir%" "/p:Configuration=%CoreRT_BuildType%" !extraArgs! !__SourceFile!.csproj
    echo.
    msbuild /ConsoleLoggerParameters:ForceNoAlign "/p:IlcPath=%CoreRT_ToolchainDir%" "/p:Configuration=%CoreRT_BuildType%" !extraArgs! !__SourceFile!.csproj
    endlocal

    set __SavedErrorLevel=%ErrorLevel%
    if "%CoreRT_TestRun%"=="false" (goto :SkipTestRun)

    if "%__SavedErrorLevel%"=="0" (
        echo.
        echo Running test !__SourceFileName!
        call !__SourceFile!.cmd !__SourceFolder!\bin\%CoreRT_BuildType%\native !__SourceFileName!.exe
        set __SavedErrorLevel=!ErrorLevel!
    )

:SkipTestRun
    if "%__SavedErrorLevel%"=="0" (
        set /a __%__Mode%PassedTests=!__%__Mode%PassedTests!+1
        echo ^<test name="!__SourceFile!" type="!__SourceFileName!:%__Mode%" method="Main" result="Pass" /^> >> %__CoreRTTestBinDir%\testResults.tmp
    ) ELSE (
        echo ^<test name="!__SourceFile!" type="!__SourceFileName!:%__Mode%" method="Main" result="Fail"^> >> %__CoreRTTestBinDir%\testResults.tmp
        echo ^<failure exception-type="Exit code: %ERRORLEVEL%" ^> >> %__CoreRTTestBinDir%\testResults.tmp
        echo     ^<message^>See !__SourceFile! \bin or \obj for logs ^</message^> >> %__CoreRTTestBinDir%\testResults.tmp
        echo ^</failure^> >> %__CoreRTTestBinDir%\testResults.tmp
        echo ^</test^> >> %__CoreRTTestBinDir%\testResults.tmp
    )
    goto :eof

:DeleteFile
    if exist %1 del %1
    goto :eof

:Fail
    echo.
    powershell -Command Write-Host %1 -foreground "red"
    exit /b -1

:RestoreCoreCLRTests

    set TESTS_SEMAPHORE=%CoreRT_TestExtRepo%\init-tests.completed

    :: If sempahore exists do nothing
    if exist "%TESTS_SEMAPHORE%" (
      echo Tests are already initialized.
      goto :EOF
    )

    if exist "%CoreRT_TestExtRepo%" rmdir /S /Q "%CoreRT_TestExtRepo%"
    mkdir "%CoreRT_TestExtRepo%"

    set /p TESTS_REMOTE_URL=< "%~dp0..\CoreCLRTestsURL.txt"
    set TESTS_LOCAL_ZIP=%CoreRT_TestExtRepo%\tests.zip
    set INIT_TESTS_LOG=%~dp0..\init-tests.log
    echo Restoring tests (this may take a few minutes)..
    echo Installing '%TESTS_REMOTE_URL%' to '%TESTS_LOCAL_ZIP%' >> "%INIT_TESTS_LOG%"
    powershell -NoProfile -ExecutionPolicy unrestricted -Command "$retryCount = 0; $success = $false; do { try { (New-Object Net.WebClient).DownloadFile('%TESTS_REMOTE_URL%', '%TESTS_LOCAL_ZIP%'); $success = $true; } catch { if ($retryCount -ge 6) { throw; } else { $retryCount++; Start-Sleep -Seconds (5 * $retryCount); } } } while ($success -eq $false); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%TESTS_LOCAL_ZIP%', '%CoreRT_TestExtRepo%') } else { (New-Object -com shell.application).namespace('%CoreRT_TestExtRepo%').CopyHere((new-object -com shell.application).namespace('%TESTS_LOCAL_ZIP%').Items(),16) }" >> "%INIT_TESTS_LOG%"
    if errorlevel 1 (
      echo ERROR: Could not download CoreCLR tests correctly. See '%INIT_TESTS_LOG%' for more details. 1>&2
      exit /b 1
    )

    echo Tests restored.
    echo CoreCLR tests restored from %TESTS_REMOTE_URL% > %TESTS_SEMAPHORE%
    exit /b 0

:TestExtRepo
    echo Running external tests
    if "%CoreRT_TestExtRepo%" == "" (
        set CoreRT_TestExtRepo=%CoreRT_TestRoot%\..\tests_downloaded\CoreCLR
        call :RestoreCoreCLRTests
        if errorlevel 1 (
            exit /b 1
        )
    )

    if not exist "%CoreRT_TestExtRepo%" ((call :Fail "%CoreRT_TestExtRepo% does not exist") & exit /b 1)

    echo.
    set CLRCustomTestLauncher=%CoreRT_TestRoot%\CoreCLR\build-and-run-test.cmd
    set XunitTestBinBase=!CoreRT_TestExtRepo!
    set CORE_ROOT=C:\git\corert\Tools\dotnetcli\shared\Microsoft.NETCore.App\1.0.0
    echo CORE_ROOT IS NOW %CORE_ROOT%
    pushd %CoreRT_TestRoot%\CoreCLR\runtest

    msbuild src\TestWrappersConfig\XUnitTooling.depproj
    if errorlevel 1 (
        exit /b 1
    )

    call runtest.cmd %CoreRT_BuildArch% %CoreRT_BuildType% exclude %CoreRT_TestRoot%\Top100Tests.issues.targets
    set __SavedErrorLevel=%ErrorLevel%
    popd
    exit /b %__SavedErrorLevel%

@echo off

set CoreRT_TestRoot=%~dp0
set CoreRT_CliDir=%CoreRT_TestRoot%../Tools/dotnetcli
set CoreRT_BuildArch=x64
set CoreRT_BuildType=Debug
set CoreRT_BuildOS=Windows_NT
set CoreRT_TestRun=true
set CoreRT_TestCompileMode=ryujit
set CoreRT_RunCoreCLRTests=

:ArgLoop
if "%1" == "" goto :ArgsDone
if /i "%1" == "/?" goto :Usage
if /i "%1" == "x64"    (set CoreRT_BuildArch=x64&&shift&goto ArgLoop)
if /i "%1" == "x86"    (set CoreRT_BuildArch=x86&&shift&goto ArgLoop)
if /i "%1" == "arm"    (set CoreRT_BuildArch=arm&&shift&goto ArgLoop)

if /i "%1" == "debug"    (set CoreRT_BuildType=Debug&shift&goto ArgLoop)
if /i "%1" == "release"  (set CoreRT_BuildType=Release&shift&goto ArgLoop)
if /i "%1" == "/coreclr"  (set CoreRT_RunCoreCLRTests=true&shift&goto ArgLoop)
if /i "%1" == "/mode" (set CoreRT_TestCompileMode=%2&shift&shift&goto ArgLoop)
if /i "%1" == "/runtest" (set CoreRT_TestRun=%2&shift&shift&goto ArgLoop)
if /i "%1" == "/dotnetclipath" (set CoreRT_CliDir=%2&shift&shift&goto ArgLoop)

echo Invalid command line argument: %1
goto :Usage

:Usage
echo %0 [OS] [arch] [flavor] [/extrepo] [/mode] [/runtest]
echo     /mode         : Compilation mode. Specify cpp/ryujit. Default: ryujit
echo     /runtest      : Should just compile or run compiled binary? Specify: true/false. Default: true.
echo     /coreclr      : Download and run the CoreCLR repo tests
exit /b 2

:ArgsDone

call %CoreRT_TestRoot%testenv.cmd

set CoreRT_RspTemplateDir=%CoreRT_TestRoot%..\bin\obj\%CoreRT_BuildOS%.%CoreRT_BuildArch%.%CoreRT_BuildType%

setlocal EnableDelayedExpansion
set __BuildStr=%CoreRT_BuildOS%.%CoreRT_BuildArch%.%CoreRT_BuildType%
set __CoreRTTestBinDir=%CoreRT_TestRoot%..\bin\tests
set __LogDir=%CoreRT_TestRoot%\..\bin\Logs\%__BuildStr%\tests

call "!VS140COMNTOOLS!\..\..\VC\vcvarsall.bat" %CoreRT_BuildArch%

if "%CoreRT_RunCoreCLRTests%"=="true" goto :TestExtRepo

if /i "%__BuildType%"=="Debug" (
    set __LinkLibs=msvcrtd.lib
) else (
    set __LinkLibs=msvcrt.lib
)

echo. > %__CoreRTTestBinDir%\testResults.tmp

set /a __CppTotalTests=0
set /a __CppPassedTests=0
set /a __JitTotalTests=0
set /a __JitPassedTests=0
for /f "delims=" %%a in ('dir /s /aD /b src\*') do (
    set __SourceFolder=%%a
    set __SourceFileName=%%~na
    set __RelativePath=!__SourceFolder:%CoreRT_TestRoot%=!
    if exist "!__SourceFolder!\!__SourceFileName!.csproj" (

        set __Mode=Jit
        call :CompileFile !__SourceFolder! !__SourceFileName! %__LogDir%\!__RelativePath!
        set /a __JitTotalTests=!__JitTotalTests!+1

        if not exist "!__SourceFolder!\no_cpp" (
            set __Mode=Cpp
            call :CompileFile !__SourceFolder! !__SourceFileName! %__LogDir%\!__RelativePath!
            set /a __CppTotalTests=!__CppTotalTests!+1
        )
    )
)
set /a __CppFailedTests=%__CppTotalTests%-%__CppPassedTests%
set /a __JitFailedTests=%__JitTotalTests%-%__JitPassedTests%
set /a __TotalTests=%__JitTotalTests%+%__CppTotalTests%
set /a __PassedTests=%__JitPassedTests%+%__CppPassedTests%
set /a __FailedTests=%__JitFailedTests%+%__CppFailedTests%

echo ^<?xml version="1.0" encoding="utf-8"?^> > %__CoreRTTestBinDir%\testResults.xml
echo ^<assemblies^>  >> %__CoreRTTestBinDir%\testResults.xml
echo ^<assembly name="ILCompiler" total="%__TotalTests%" passed="%__PassedTests%" failed="%__FailedTests%" skipped="0"^>  >> %__CoreRTTestBinDir%\testResults.xml
echo ^<collection total="%__TotalTests%" passed="%__PassedTests%" failed="%__FailedTests%" skipped="0"^>  >> %__CoreRTTestBinDir%\testResults.xml
type %__CoreRTTestBinDir%\testResults.tmp >> %__CoreRTTestBinDir%\testResults.xml
echo ^</collection^>  >> %__CoreRTTestBinDir%\testResults.xml
echo ^</assembly^>  >> %__CoreRTTestBinDir%\testResults.xml
echo ^</assemblies^>  >> %__CoreRTTestBinDir%\testResults.xml

echo.
set __JitStatusPassed=0
if %__JitTotalTests% EQU %__JitPassedTests% (set __JitStatusPassed=1)
if %__JitTotalTests% EQU 0 (set __JitStatusPassed=0)
call :PassFail %__JitStatusPassed% "JIT - TOTAL: %__JitTotalTests% PASSED: %__JitPassedTests%"

set __CppStatusPassed=0
if %__CppTotalTests% EQU %__CppPassedTests% (set __CppStatusPassed=1)
if %__CppTotalTests% EQU 0 (set __CppStatusPassed=0)
call :PassFail %__CppStatusPassed% "CPP - TOTAL: %__CppTotalTests% PASSED: %__CppPassedTests%"

if not %__JitStatusPassed% EQU 1 (exit /b 1)
if not %__CppStatusPassed% EQU 1 (exit /b 1)
exit /b 0

:PassFail
set __Green=%~1
set __OutStr=%~2
if "%__Green%"=="1" (
    powershell -Command Write-Host %__OutStr% -foreground "Black" -background "Green"
) else (
    powershell -Command Write-Host %__OutStr% -foreground "White" -background "Red"
)
goto :eof

:CompileFile
    echo.
    set __SourceFolder=%~1
    set __SourceFileName=%~2
    set __CompileLogPath=%~3

    echo Compiling directory !__SourceFolder! !__Mode!
    echo.

    if not exist "!__CompileLogPath!" (mkdir !__CompileLogPath!)
    set __SourceFile=!__SourceFolder!\!__SourceFileName!

    if exist "!__SourceFolder!\bin" rmdir /s /q !__SourceFolder!\bin
    if exist "!__SourceFolder!\obj" rmdir /s /q !__SourceFolder!\obj

    setlocal
    set extraArgs=
    if /i "%__Mode%" == "cpp" (
        set extraArgs=!extraArgs! /p:NativeCodeGen=cpp
        if /i "%CoreRT_BuildType%" == "debug" (
            set extraArgs=!extraArgs! /p:AdditionalCppCompilerFlags=/MTd
        )
    )

    echo msbuild /ConsoleLoggerParameters:ForceNoAlign "/p:IlcPath=%CoreRT_ToolchainDir%" "/p:Configuration=%CoreRT_BuildType%" !extraArgs! !__SourceFile!.csproj
    echo.
    msbuild /ConsoleLoggerParameters:ForceNoAlign "/p:IlcPath=%CoreRT_ToolchainDir%" "/p:Configuration=%CoreRT_BuildType%" !extraArgs! !__SourceFile!.csproj
    endlocal

    set __SavedErrorLevel=%ErrorLevel%
    if "%CoreRT_TestRun%"=="false" (goto :SkipTestRun)

    if "%__SavedErrorLevel%"=="0" (
        echo.
        echo Running test !__SourceFileName!
        call !__SourceFile!.cmd !__SourceFolder!\bin\%CoreRT_BuildType%\native !__SourceFileName!.exe
        set __SavedErrorLevel=!ErrorLevel!
    )

:SkipTestRun
    if "%__SavedErrorLevel%"=="0" (
        set /a __%__Mode%PassedTests=!__%__Mode%PassedTests!+1
        echo ^<test name="!__SourceFile!" type="!__SourceFileName!:%__Mode%" method="Main" result="Pass" /^> >> %__CoreRTTestBinDir%\testResults.tmp
    ) ELSE (
        echo ^<test name="!__SourceFile!" type="!__SourceFileName!:%__Mode%" method="Main" result="Fail"^> >> %__CoreRTTestBinDir%\testResults.tmp
        echo ^<failure exception-type="Exit code: %ERRORLEVEL%" ^> >> %__CoreRTTestBinDir%\testResults.tmp
        echo     ^<message^>See !__SourceFile! \bin or \obj for logs ^</message^> >> %__CoreRTTestBinDir%\testResults.tmp
        echo ^</failure^> >> %__CoreRTTestBinDir%\testResults.tmp
        echo ^</test^> >> %__CoreRTTestBinDir%\testResults.tmp
    )
    goto :eof

:DeleteFile
    if exist %1 del %1
    goto :eof

:Fail
    echo.
    powershell -Command Write-Host %1 -foreground "red"
    exit /b -1

:RestoreCoreCLRTests

    set TESTS_SEMAPHORE=%CoreRT_TestExtRepo%\init-tests.completed

    :: If sempahore exists do nothing
    if exist "%TESTS_SEMAPHORE%" (
      echo Tests are already initialized.
      goto :EOF
    )

    if exist "%CoreRT_TestExtRepo%" rmdir /S /Q "%CoreRT_TestExtRepo%"
    mkdir "%CoreRT_TestExtRepo%"

    set /p TESTS_REMOTE_URL=< "%~dp0..\CoreCLRTestsURL.txt"
    set TESTS_LOCAL_ZIP=%CoreRT_TestExtRepo%\tests.zip
    set INIT_TESTS_LOG=%~dp0..\init-tests.log
    echo Restoring tests (this may take a few minutes)..
    echo Installing '%TESTS_REMOTE_URL%' to '%TESTS_LOCAL_ZIP%' >> "%INIT_TESTS_LOG%"
    powershell -NoProfile -ExecutionPolicy unrestricted -Command "$retryCount = 0; $success = $false; do { try { (New-Object Net.WebClient).DownloadFile('%TESTS_REMOTE_URL%', '%TESTS_LOCAL_ZIP%'); $success = $true; } catch { if ($retryCount -ge 6) { throw; } else { $retryCount++; Start-Sleep -Seconds (5 * $retryCount); } } } while ($success -eq $false); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%TESTS_LOCAL_ZIP%', '%CoreRT_TestExtRepo%') } else { (New-Object -com shell.application).namespace('%CoreRT_TestExtRepo%').CopyHere((new-object -com shell.application).namespace('%TESTS_LOCAL_ZIP%').Items(),16) }" >> "%INIT_TESTS_LOG%"
    if errorlevel 1 (
      echo ERROR: Could not download CoreCLR tests correctly. See '%INIT_TESTS_LOG%' for more details. 1>&2
      exit /b 1
    )

    echo Tests restored.
    echo CoreCLR tests restored from %TESTS_REMOTE_URL% > %TESTS_SEMAPHORE%
    exit /b 0

:TestExtRepo
    echo Running external tests
    if "%CoreRT_TestExtRepo%" == "" (
        set CoreRT_TestExtRepo=%CoreRT_TestRoot%\..\tests_downloaded\CoreCLR
        call :RestoreCoreCLRTests
        if errorlevel 1 (
            exit /b 1
        )
    )

    if not exist "%CoreRT_TestExtRepo%" ((call :Fail "%CoreRT_TestExtRepo% does not exist") & exit /b 1)

    echo.
    set CLRCustomTestLauncher=%CoreRT_TestRoot%\CoreCLR\build-and-run-test.cmd
    set XunitTestBinBase=!CoreRT_TestExtRepo!
    set CORE_ROOT=%CoreRT_TestRoot%\..\Tools\dotnetcli\shared\Microsoft.NETCore.App\1.0.0
    echo CORE_ROOT IS NOW %CORE_ROOT%
    pushd %CoreRT_TestRoot%\CoreCLR\runtest

    msbuild src\TestWrappersConfig\XUnitTooling.depproj
    if errorlevel 1 (
        exit /b 1
    )

    call runtest.cmd %CoreRT_BuildArch% %CoreRT_BuildType% exclude %CoreRT_TestRoot%\Top100Tests.issues.targets
    set __SavedErrorLevel=%ErrorLevel%
    popd
    exit /b %__SavedErrorLevel%

Remove absolute path from test script

Remove absolute path from test script


@echo off

echo Generating C-style Win32 APIs and tests
call dart %~dp0win32\win32api.dart
call dart %~dp0metadata\win32.dart %~dp0..\lib\src\generated
call dart %~dp0win32\generate_win32_tests.dart
echo.

echo Temporarily reset bthprops.dart (https://github.com/microsoft/win32metadata/issues/296)
git restore %~dp0..\lib\src\bthprops.dart
echo.

echo Generating COM classes and tests from Windows metadata
call dart %~dp0metadata\generate_com_apis.dart
echo.

echo Temporarily reset IProvideClassInfo_test.dart (https://github.com/microsoft/win32metadata/issues/290)
git restore %~dp0..\test\com\IProvideClassInfo_test.dart
echo.

echo Generating Windows Runtime classes from Windows metadata
call dart %~dp0metadata\winrt.dart %~dp0..\lib\src\generated
echo.

echo Formatting generated source code
call dart format %~dp0..\lib\src
call dart format %~dp0..\test\api_test.dart
call dart format %~dp0..\test\struct_test.dart
call dart format %~dp0..\test\com
echo.

echo Running tests
if "%1"=="--use-dart-test" goto dart_test
call flutter test
goto end

:dart_test
call dart test

:end

@echo off

echo Generating C-style Win32 APIs and tests
call dart %~dp0win32\win32api.dart
call dart %~dp0metadata\win32.dart %~dp0..\lib\src\generated
echo.

echo Temporarily reset bthprops.dart (https://github.com/microsoft/win32metadata/issues/296)
git restore %~dp0..\lib\src\bthprops.dart
echo.

echo Generating COM classes and tests from Windows metadata
call dart %~dp0metadata\generate_com_apis.dart
echo.

echo Temporarily reset IProvideClassInfo_test.dart (https://github.com/microsoft/win32metadata/issues/290)
git restore %~dp0..\test\com\IProvideClassInfo_test.dart
echo.

echo Generating Windows Runtime classes from Windows metadata
call dart %~dp0metadata\winrt.dart %~dp0..\lib\src\generated
echo.

echo Formatting generated source code
call dart format %~dp0..\lib\src
call dart format %~dp0..\test\api_test.dart
call dart format %~dp0..\test\struct_test.dart
call dart format %~dp0..\test\com
echo.

echo Running tests
if "%1"=="--use-dart-test" goto dart_test
call flutter test
goto end

:dart_test
call dart test

:end

Remove old test generator

Remove old test generator


echo OFF

set UPLOAD_TARGETS=python-parse python-pkgtk

if "%ANACONDA_USERNAME%" == "" (
  set /p ANACONDA_USERNAME="Username: "
) else (
  echo Username: %ANACONDA_USERNAME%;
)

if "%ANACONDA_PASSWORD%" == "" (
  set /p ANACONDA_USERNAME=%ANACONDA_USERNAME%%"'s password: "
) else (
  echo %ANACONDA_USERNAME%'s password: [secure];
)

set ANACONDA_UPLOAD_FLAGS=-c conda-forge %ANACONDA_UPLOAD_FLAGS%
if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=statiskit
) else (
    echo Using anaconda channel: %ANACONDA_CHANNEL%
    set ANACONDA_UPLOAD_FLAGS=-c statiskit %ANACONDA_UPLOAD_FLAGS%
)

echo ON

conda install -n root anaconda-client
if %errorlevel% neq 0 (
  exit /b %errorlevel%
)

echo OFF

echo y|anaconda login --username %ANACONDA_USERNAME% --password %ANACONDA_PASSWORD%
if %errorlevel% neq 0 (
  exit /b %errorlevel%
)

echo ON

git clone https://gist.github.com/c491cb08d570beeba2c417826a50a9c3.git toolchain
if %errorlevel% neq 0 (
  anaconda logout
  exit /b %errorlevel%
)
cd toolchain
call config.bat
if %errorlevel% neq 0 (
  cd ..
  anaconda logout
  rmdir toolchain /s /q
  exit /b %errorlevel%
)
cd ..
rmdir toolchain /s /q

for %%x in (%UPLOAD_TARGETS%) do (
  <nul set /p="for /f %%%%i in ('conda build " >> _upload.bat
  <nul set /p=%%x >> _upload.bat
  <nul set /p=" -c " >> _upload.bat
  <nul set /p=%ANACONDA_CHANNEL% >> _upload.bat
  <nul set /p=" " >> _upload.bat
  <nul set /p=%ANACONDA_UPLOAD_FLAGS% >> _upload.bat
  <nul set /p=" --output') set UPLOAD_FILE=%%%%i" >> _upload.bat
  echo. >> _upload.bat
  <nul set /p="anaconda upload --user " >> _upload.bat
  <nul set /p=%ANACONDA_CHANNEL% >> _upload.bat
  <nul set /p=" %%UPLOAD_FILE%%" >> _upload.bat
  echo. >> _upload.bat
  <nul set /p="if %%errorlevel%% neq 0 " >> _upload.bat
  echo echo upload failed >> _upload.bat
  more _upload.bat
  call _upload.bat
  del _upload.bat
)

anaconda logout

echo OFF

set UPLOAD_TARGETS=python-parse python-pkgtk

if "%ANACONDA_USERNAME%" == "" (
  set /p ANACONDA_USERNAME="Username: "
) else (
  echo Username: %ANACONDA_USERNAME%;
)

if "%ANACONDA_PASSWORD%" == "" (
  set /p ANACONDA_USERNAME=%ANACONDA_USERNAME%%"'s password: "
) else (
  echo %ANACONDA_USERNAME%'s password: [secure];
)

set ANACONDA_UPLOAD_FLAGS=-c conda-forge %ANACONDA_UPLOAD_FLAGS%
if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=statiskit
) else (
    echo Using anaconda channel: %ANACONDA_CHANNEL%
    set ANACONDA_UPLOAD_FLAGS=-c statiskit %ANACONDA_UPLOAD_FLAGS%
)

echo ON

conda install -n root anaconda-client
if %errorlevel% neq 0 (
  exit /b %errorlevel%
)

echo OFF

echo y|anaconda login --username %ANACONDA_USERNAME% --password %ANACONDA_PASSWORD%
if %errorlevel% neq 0 (
  exit /b %errorlevel%
)

echo ON

git clone https://gist.github.com/c491cb08d570beeba2c417826a50a9c3.git toolchain
if %errorlevel% neq 0 (
  anaconda logout
  exit /b %errorlevel%
)
cd toolchain
call config.bat
if %errorlevel% neq 0 (
  cd ..
  anaconda logout
  rmdir toolchain /s /q
  exit /b %errorlevel%
)
cd ..
rmdir toolchain /s /q

for %%x in (%UPLOAD_TARGETS%) do (
  <nul set /p="for /f \"delims=\" %%%%i in ('conda build " >> _upload.bat
  <nul set /p=%%x >> _upload.bat
  <nul set /p=" -c " >> _upload.bat
  <nul set /p=%ANACONDA_CHANNEL% >> _upload.bat
  <nul set /p=" " >> _upload.bat
  <nul set /p=%ANACONDA_UPLOAD_FLAGS% >> _upload.bat
  <nul set /p=" --output') set UPLOAD_FILE=%%%%i" >> _upload.bat
  echo. >> _upload.bat
  <nul set /p="anaconda upload --user " >> _upload.bat
  <nul set /p=%ANACONDA_CHANNEL% >> _upload.bat
  <nul set /p=" %%UPLOAD_FILE%%" >> _upload.bat
  echo. >> _upload.bat
  <nul set /p="if %%errorlevel%% neq 0 " >> _upload.bat
  echo echo upload failed >> _upload.bat
  more _upload.bat
  call _upload.bat
  del _upload.bat
)

anaconda logout

Update upload.bat

Update upload.bat


REM copies from an existing build to a nuget package creation area (so that *.MakeNuget.bat works)
REM
REM *** This is mostly a template for doing the copy.      ****
REM *** Most likey you want this to be the current version ****
REM *** PLEASE MODIFY THE VERSION NUMBER TO BE CURRENT!    ****
xcopy /s %HOMEDRIVE%%HOMEPATH%\.nuget\packages\Microsoft.Diagnostics.Tracing.TraceEvent.SupportFiles\1.0.12\*.dll Microsoft.Diagnostics.Tracing.TraceEvent.SupportFiles

@REM These are the binary files we need from somewhere to for the support package
@REM lib\native\amd64\KernelTraceControl.dll
@REM lib\native\amd64\msdia140.dll
@REM lib\native\arm\KernelTraceControl.dll
@REM lib\native\x86\KernelTraceControl.dll
@REM lib\native\x86\KernelTraceControl.Win61.dll
@REM lib\native\x86\msdia140.dll
@REM lib\net45\Dia2Lib.dll
@REM lib\net45\OSExtensions.dll
@REM lib\net45\TraceReloggerLib.dll
@REM lib\netstandard1.6\Dia2Lib.dll
@REM lib\netstandard1.6\OSExtensions.dll
@REM lib\netstandard1.6\TraceReloggerLib.dll

REM copies from an existing build to a nuget package creation area (so that *.MakeNuget.bat works)
REM
REM *** This is mostly a template for doing the copy.      ****
REM *** Most likey you want this to be the current version ****
REM *** PLEASE MODIFY THE VERSION NUMBER TO BE CURRENT!    ****
xcopy /s /Y %HOMEDRIVE%%HOMEPATH%\.nuget\packages\Microsoft.Diagnostics.Tracing.TraceEvent.SupportFiles\1.0.12\*.dll Microsoft.Diagnostics.Tracing.TraceEvent.SupportFiles

REM Overwrite OSExtensions.dll with the latest built versions.
xcopy /s /Y ..\OSExtensions\bin\Release\net45\OSExtensions.dll Microsoft.Diagnostics.Tracing.TraceEvent.SupportFiles\lib\net45
xcopy /s /Y ..\OSExtensions\bin\Release\netstandard1.6\OSExtensions.dll Microsoft.Diagnostics.Tracing.TraceEvent.SupportFiles\lib\netstandard1.6

@REM These are the binary files we need from somewhere to for the support package
@REM lib\native\amd64\KernelTraceControl.dll
@REM lib\native\amd64\msdia140.dll
@REM lib\native\arm\KernelTraceControl.dll
@REM lib\native\x86\KernelTraceControl.dll
@REM lib\native\x86\KernelTraceControl.Win61.dll
@REM lib\native\x86\msdia140.dll
@REM lib\net45\Dia2Lib.dll
@REM lib\net45\OSExtensions.dll
@REM lib\net45\TraceReloggerLib.dll
@REM lib\netstandard1.6\Dia2Lib.dll
@REM lib\netstandard1.6\OSExtensions.dll
@REM lib\netstandard1.6\TraceReloggerLib.dll

Update TraceEvent SupportFiles populate script to copy OSExtensions.dll from its built location.


@echo off
setlocal

set target_root=f:\apps\bin
call :ensure_target || exit /b 1
set cmd_args=

call :set_link false git		"%ProgramFiles%\Git\cmd\git.exe" "%ProgramFiles%\Git\mingw64\bin\git.exe" "%ProgramFiles%\Git\bin\git.exe" "%ProgramFiles(x86)%\Git\bin\git.exe"
call :set_link false py			"%ProgramFiles(x86)%\Python 3.5\python.exe" "%ProgramFiles(x86)%\Python35-32\python.exe"
call :set_link false pip		"%ProgramFiles(x86)%\Python 3.5\Scripts\pip.exe" "%ProgramFiles(x86)%\Python35-32\Scripts\pip.exe"
call :set_link true npp			"%ProgramFiles%\Notepad++\notepad++.exe" "%ProgramFiles(x86)%\Notepad++\notepad++.exe" "%windir%\system32\notepad.exe" "%windir%\notepad.exe"
call :set_link true windbg		"%SystemDrive%\debuggers\windbg.exe"
call :set_link true ewseditor	"%~d0\Apps\EWSEditor 1.17 - bin\EWSEditor.exe" "%~d0\Apps\EWSEditor 1.13 - bin\EWSEditor.exe"
call :set_link true ie			"%ProgramFiles%\Internet Explorer\iexplore.exe"
call :set_link true stylecopeditor "%ProgramFiles(x86)%\StyleCop 4.7\StyleCopSettingsEditor.exe"
call :set_link true snip			"%WINDIR%\system32\snippingtool.exe"
call :set_link true fiddler		"%ProgramFiles(x86)%\Fiddler2\Fiddler.exe"
call :set_link true ilspy		"%~d0\Apps\ILSpy\ILSpy.exe"
call :set_link true xts			"%~d0\Apps\xts\xts.exe"
call :set_link true chrome		"%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe"
call :set_link true paint		"%ProgramFiles%\Paint.NET\PaintDotNet.exe" "%windir%\system32\mspaint.exe"
call :set_link true rdm			"%ProgramFiles(x86)%\RedisDesktopManager\rdm.exe"
call :set_link true sourcetree		"%ProgramFiles(x86)%\Atlassian\SourceTree\SourceTree.exe"
call :set_link true azexplore		"%ProgramFiles(x86)%\Microsoft Azure Storage Explorer\StorageExplorer.exe"
call :set_link true moba		"%ProgramFiles(x86)%\Mobatek\MobaXterm Personal Edition\MobaXterm.exe"

set cmd_args=--processStart "slack.exe"
call :set_link true slack "%LOCALAPPDATA%\slack\Update.exe"
set cmd_args=

goto :eof

:ensure_target
	if exist "%target_root%" exit /b 0
	mkdir "%target_root%"
	if not exist "%target_root%" exit /b 1
	exit /b 0

:set_link
	set is_ui=%~1
	shift
	set link_name=%target_root%\%~1.cmd
	shift

	:loop_dest
	set link_dest=%~1
	if not defined link_dest goto :eof
	rem echo Checking: %link_dest%

	shift
	if not exist "%link_dest%" goto :loop_dest

	echo Creating link %link_dest% =^> %link_name%
	if /i "%is_ui%" equ "true" echo @start "" "%link_dest%" %cmd_args% %%^* > "%link_name%"
	if /i "%is_ui%" neq "true" echo @"%link_dest%" %cmd_args% %%^* > "%link_name%"

	goto :eof

@echo off
setlocal

set target_root=f:\apps\bin
call :ensure_target || exit /b 1
set cmd_args=

call :set_link false git		"%ProgramFiles%\Git\cmd\git.exe" "%ProgramFiles%\Git\mingw64\bin\git.exe" "%ProgramFiles%\Git\bin\git.exe" "%ProgramFiles(x86)%\Git\bin\git.exe"
call :set_link false py			"%ProgramFiles(x86)%\Python 3.5\python.exe" "%ProgramFiles(x86)%\Python35-32\python.exe"
call :set_link false pip		"%ProgramFiles(x86)%\Python 3.5\Scripts\pip.exe" "%ProgramFiles(x86)%\Python35-32\Scripts\pip.exe"
call :set_link true npp			"%ProgramFiles%\Notepad++\notepad++.exe" "%ProgramFiles(x86)%\Notepad++\notepad++.exe" "%windir%\system32\notepad.exe" "%windir%\notepad.exe"
call :set_link true windbg		"%SystemDrive%\debuggers\windbg.exe"
call :set_link true ewseditor	"%~d0\Apps\EWSEditor 1.17 - bin\EWSEditor.exe" "%~d0\Apps\EWSEditor 1.13 - bin\EWSEditor.exe"
call :set_link true ie			"%ProgramFiles%\Internet Explorer\iexplore.exe"
call :set_link true stylecopeditor "%ProgramFiles(x86)%\StyleCop 4.7\StyleCopSettingsEditor.exe"
call :set_link true snip			"%WINDIR%\system32\snippingtool.exe"
call :set_link true fiddler		"%ProgramFiles(x86)%\Fiddler2\Fiddler.exe"
call :set_link true ilspy		"%~d0\Apps\ILSpy\ILSpy.exe"
call :set_link true xts			"%~d0\Apps\xts\xts.exe"
call :set_link true chrome		"%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe"
call :set_link true paint		"%ProgramFiles%\Paint.NET\PaintDotNet.exe" "%windir%\system32\mspaint.exe"
call :set_link true rdm			"%ProgramFiles(x86)%\RedisDesktopManager\rdm.exe"
call :set_link true sourcetree		"%ProgramFiles(x86)%\Atlassian\SourceTree\SourceTree.exe"
call :set_link true azexplore		"%ProgramFiles(x86)%\Microsoft Azure Storage Explorer\StorageExplorer.exe"
call :set_link true moba		"%ProgramFiles(x86)%\Mobatek\MobaXterm Personal Edition\MobaXterm.exe"
call :set_link true pdf			"%~d0\Choco\bin\SumatraPDF.exe"

set cmd_args=--processStart "slack.exe"
call :set_link true slack "%LOCALAPPDATA%\slack\Update.exe"
set cmd_args=

goto :eof

:ensure_target
	if exist "%target_root%" exit /b 0
	mkdir "%target_root%"
	if not exist "%target_root%" exit /b 1
	exit /b 0

:set_link
	set is_ui=%~1
	shift
	set link_name=%target_root%\%~1.cmd
	shift

	:loop_dest
	set link_dest=%~1
	if not defined link_dest goto :eof
	rem echo Checking: %link_dest%

	shift
	if not exist "%link_dest%" goto :loop_dest

	echo Creating link %link_dest% =^> %link_name%
	if /i "%is_ui%" equ "true" echo @start "" "%link_dest%" %cmd_args% %%^* > "%link_name%"
	if /i "%is_ui%" neq "true" echo @"%link_dest%" %cmd_args% %%^* > "%link_name%"

	goto :eof

add sumatra pdf

add sumatra pdf


javapackager -deploy -native exe -outdir package -outfile Nightcode -srcdir target -appclass nightcode.core -name "Nightcode" -title "Nightcode" -Bicon=package/windows/Nightcode.ico -BappVersion=%1

jpackage --type exe --name Nightcode --app-version %1 --input target --main-jar Nightcode-%1.jar --icon package/windows/Nightcode.ico --win-menu --win-per-user-install

Update windows package script

Update windows package script


@REM @file
@REM   Windows batch file to setup a WORKSPACE environment
@REM
@REM Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.

@REM (C) Copyright 2016 Hewlett Packard Enterprise Development LP

@REM This program and the accompanying materials
@REM are licensed and made available under the terms and conditions of the BSD License
@REM which accompanies this distribution.  The full text of the license may be found at
@REM http://opensource.org/licenses/bsd-license.php
@REM
@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@REM

@REM set CYGWIN_HOME=C:\cygwin

@REM usage:
@REM   edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]
@REM if the argument, skip is present, only the paths and the
@REM test and set of environment settings are performed.

@REM ##############################################################
@REM # You should not have to modify anything below this line
@REM #

@echo off

@REM
@REM Set the WORKSPACE to the current working directory
@REM
pushd .
cd %~dp0

if not defined WORKSPACE (
  goto SetWorkSpace
)

if %WORKSPACE% == %CD% (
  @REM Workspace is not changed.
  goto ParseArgs
)

:SetWorkSpace
@REM set new workspace
@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace
if not defined WORKSPACE (
  set WORKSPACE=%CD%
  set EFI_SOURCE=
  set EDK_SOURCE=
)

:ParseArgs
if /I "%1"=="-h" goto Usage
if /I "%1"=="-help" goto Usage
if /I "%1"=="--help" goto Usage
if /I "%1"=="/h" goto Usage
if /I "%1"=="/?" goto Usage
if /I "%1"=="/help" goto Usage

if /I "%1"=="NewBuild" shift
if not defined EDK_TOOLS_PATH (
  if exist %WORKSPACE%\BaseTools (
    set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
  ) else (
    if defined PACKAGES_PATH (
      for %%i IN (%PACKAGES_PATH%) DO (
        if exist %%~fi\BaseTools (
          set EDK_TOOLS_PATH=%%~fi\BaseTools
          goto checkNt32Flag
        )
      )
    ) else (
      echo.
      echo !!! ERROR !!! Cannot find BaseTools !!!
      echo.
      goto BadBaseTools
    )
  )
)

:checkNt32Flag
if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%

@REM The Nt32 Emluation Platform requires Microsoft Libraries
@REM and headers to interface with Windows.
if /I "%1"=="--nt32" (
  if /I "%2"=="X64" (
    shift
    call "%BASE_TOOLS_PATH%\Scripts\SetVisualStudio.bat"
  ) else (
    call "%BASE_TOOLS_PATH%\get_vsvars.bat"
  )
  shift
)

:checkBaseTools
IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools
call %EDK_TOOLS_PATH%\toolsetup.bat %*
if /I "%1"=="Reconfig" shift
goto check_NASM
goto check_cygwin

:BadBaseTools
  @REM
  REM Need the BaseTools Package in order to build
  @REM
  @echo.
  @echo !!! ERROR !!! The BaseTools Package was not found !!!
  @echo.
  @echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,
  @echo For example,
  @echo   set EDK_TOOLS_PATH=C:\MyTools\BaseTools
  @echo The setup script, toolsetup.bat must reside in this folder.
  @echo.
  goto end

:check_NASM
if not defined NASM_PREFIX (
    @echo.
    @echo !!! WARNING !!! NASM_PREFIX environment variable is not set
    @if exist "C:\nasm\nasm.exe" @set "NASM_PREFIX=C:\nasm\"
    @if exist "C:\nasm\nasm.exe" @echo   Found nasm.exe, setting the environment variable to C:\nasm\
    @if not exist "C:\nasm\nasm.exe" echo   Attempting to build modules that require NASM will fail.
)

:check_cygwin
if defined CYGWIN_HOME (
  if not exist "%CYGWIN_HOME%" (
    @echo.
    @echo !!! WARNING !!! CYGWIN_HOME not found, gcc build may not be used !!!
    @echo.
  )
) else (
  if exist c:\cygwin (
    set CYGWIN_HOME=c:\cygwin
  ) else (
    @echo.
    @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!
    @echo.
  )
)

:cygwin_done
if /I "%1"=="Rebuild" shift
if /I "%1"=="ForceRebuild" shift
if "%1"=="" goto end

:Usage
  @echo.
  @echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32 [X64]] [Reconfig] [Rebuild] [ForceRebuild]"
  @echo         --nt32 [X64]   If a compiler tool chain is not available in the
  @echo                        environment, call a script to attempt to set one up.
  @echo                        This flag is only required if building the
  @echo                        Nt32Pkg/Nt32Pkg.dsc system emulator.
  @echo                        If the X64 argument is set, and a compiler tool chain is
  @echo                        not available, attempt to set up a tool chain that will
  @echo                        create X64 binaries. Setting these two options have the
  @echo                        potential side effect of changing tool chains used for a
  @echo                        rebuild.
  @echo.
  @echo         Reconfig       Reinstall target.txt, tools_def.txt and build_rule.txt.
  @echo         Rebuild        Perform incremental rebuild of BaseTools binaries.
  @echo         ForceRebuild   Force a full rebuild of BaseTools binaries.
  @echo.
  @echo  Note that target.template, tools_def.template and build_rules.template
  @echo  will only be copied to target.txt, tools_def.txt and build_rule.txt
  @echo  respectively if they do not exist. Use option [Reconfig] to force the copy.
  @echo.
  goto end

:end
  popd

@REM @file
@REM   Windows batch file to setup a WORKSPACE environment
@REM
@REM Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.

@REM (C) Copyright 2016 Hewlett Packard Enterprise Development LP

@REM This program and the accompanying materials
@REM are licensed and made available under the terms and conditions of the BSD License
@REM which accompanies this distribution.  The full text of the license may be found at
@REM http://opensource.org/licenses/bsd-license.php
@REM
@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@REM

@REM set CYGWIN_HOME=C:\cygwin

@REM usage:
@REM   edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]
@REM if the argument, skip is present, only the paths and the
@REM test and set of environment settings are performed.

@REM ##############################################################
@REM # You should not have to modify anything below this line
@REM #

@echo off

@REM
@REM Set the WORKSPACE to the current working directory
@REM
pushd .
cd %~dp0

if not defined WORKSPACE (
  goto SetWorkSpace
)

if %WORKSPACE% == %CD% (
  @REM Workspace is not changed.
  goto ParseArgs
)

:SetWorkSpace
@REM set new workspace
@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace
if not defined WORKSPACE (
  set WORKSPACE=%CD%
  set EFI_SOURCE=
  set EDK_SOURCE=
)

:ParseArgs
if /I "%1"=="-h" goto Usage
if /I "%1"=="-help" goto Usage
if /I "%1"=="--help" goto Usage
if /I "%1"=="/h" goto Usage
if /I "%1"=="/?" goto Usage
if /I "%1"=="/help" goto Usage

if /I "%1"=="NewBuild" shift
if not defined EDK_TOOLS_PATH (
  goto SetEdkToolsPath
) else (
  goto checkNt32Flag
)

:SetEdkToolsPath
if %WORKSPACE:~-1% EQU \ (
  @set EDK_BASETOOLS=%WORKSPACE%BaseTools
) else (
  @set EDK_BASETOOLS=%WORKSPACE%\BaseTools
)
if exist %EDK_BASETOOLS% (
  set EDK_TOOLS_PATH=%EDK_BASETOOLS%
  set EDK_BASETOOLS=
) else (
  if defined PACKAGES_PATH (
    for %%i IN (%PACKAGES_PATH%) DO (
      if exist %%~fi\BaseTools (
        set EDK_TOOLS_PATH=%%~fi\BaseTools
        goto checkNt32Flag
      )
    )
  ) else (
    echo.
    echo !!! ERROR !!! Cannot find BaseTools !!!
    echo.
    goto BadBaseTools
  )
)

:checkNt32Flag
if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%

@REM The Nt32 Emluation Platform requires Microsoft Libraries
@REM and headers to interface with Windows.
if /I "%1"=="--nt32" (
  if /I "%2"=="X64" (
    shift
    call "%BASE_TOOLS_PATH%\Scripts\SetVisualStudio.bat"
  ) else (
    call "%BASE_TOOLS_PATH%\get_vsvars.bat"
  )
  shift
)

:checkBaseTools
IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools
call %EDK_TOOLS_PATH%\toolsetup.bat %*
if /I "%1"=="Reconfig" shift
goto check_NASM
goto check_cygwin

:BadBaseTools
  @REM
  REM Need the BaseTools Package in order to build
  @REM
  @echo.
  @echo !!! ERROR !!! The BaseTools Package was not found !!!
  @echo.
  @echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,
  @echo For example,
  @echo   set EDK_TOOLS_PATH=C:\MyTools\BaseTools
  @echo The setup script, toolsetup.bat must reside in this folder.
  @echo.
  goto end

:check_NASM
if not defined NASM_PREFIX (
    @echo.
    @echo !!! WARNING !!! NASM_PREFIX environment variable is not set
    @if exist "C:\nasm\nasm.exe" @set "NASM_PREFIX=C:\nasm\"
    @if exist "C:\nasm\nasm.exe" @echo   Found nasm.exe, setting the environment variable to C:\nasm\
    @if not exist "C:\nasm\nasm.exe" echo   Attempting to build modules that require NASM will fail.
)

:check_cygwin
if defined CYGWIN_HOME (
  if not exist "%CYGWIN_HOME%" (
    @echo.
    @echo !!! WARNING !!! CYGWIN_HOME not found, gcc build may not be used !!!
    @echo.
  )
) else (
  if exist c:\cygwin (
    set CYGWIN_HOME=c:\cygwin
  ) else (
    @echo.
    @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!
    @echo.
  )
)

:cygwin_done
if /I "%1"=="Rebuild" shift
if /I "%1"=="ForceRebuild" shift
if "%1"=="" goto end

:Usage
  @echo.
  @echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32 [X64]] [Reconfig] [Rebuild] [ForceRebuild]"
  @echo         --nt32 [X64]   If a compiler tool chain is not available in the
  @echo                        environment, call a script to attempt to set one up.
  @echo                        This flag is only required if building the
  @echo                        Nt32Pkg/Nt32Pkg.dsc system emulator.
  @echo                        If the X64 argument is set, and a compiler tool chain is
  @echo                        not available, attempt to set up a tool chain that will
  @echo                        create X64 binaries. Setting these two options have the
  @echo                        potential side effect of changing tool chains used for a
  @echo                        rebuild.
  @echo.
  @echo         Reconfig       Reinstall target.txt, tools_def.txt and build_rule.txt.
  @echo         Rebuild        Perform incremental rebuild of BaseTools binaries.
  @echo         ForceRebuild   Force a full rebuild of BaseTools binaries.
  @echo.
  @echo  Note that target.template, tools_def.template and build_rules.template
  @echo  will only be copied to target.txt, tools_def.txt and build_rule.txt
  @echo  respectively if they do not exist. Use option [Reconfig] to force the copy.
  @echo.
  goto end

:end
  popd

Fix incorrect %EDK_TOOLS_PATH%

BaseTools: Fix incorrect %EDK_TOOLS_PATH%

For non-root folder, such as "X:\test", the EDK_TOOLS_PATH will
resolve to "X:\test\edk2\BaseTools". This is OK.

But if WORKSPACE is at a root folder, such as "X:\", the EDK_TOOLS_PATH
will look like "X:\\BaseTools". The *double backslash* can fail the command
like "del" and thus affect the %ERRORLEVEL% variable, which may break
subsequent build processing.

Cc: Liming Gao <6480311aeeb4b006862f6d13ebabddc03f51e507@intel.com>
Cc: Yonghong Zhu <78d981fe33a016071af5222c56d5cf77f30fb0b2@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <30f155ac2c906e2f65128830f2d4e1131c71dfbf@intel.com>
Reviewed-by: Liming Gao <6480311aeeb4b006862f6d13ebabddc03f51e507@intel.com>


@echo off

if "%aliases%" == "" (
  set ALIASES=%CMDER_ROOT%\config\user-aliases.cmd
)

setlocal enabledelayedexpansion

if "%~1" == "" echo Use /? for help & echo. & goto :p_show

:: check command usage

rem #region parseargument
goto parseargument

:do_shift
  shift

:parseargument
  set currentarg=%~1

  if /i "%currentarg%" equ "/f" (
    set aliases=%~2
    shift
    goto :do_shift
  ) else if /i "%currentarg%" == "/reload" (
    goto :p_reload
  ) else if "%currentarg%" equ "/?" (
    goto :p_help
  ) else if /i "%currentarg%" equ "/d" (
    if "%~2" neq "" (
      if "%~3" equ "" (
        :: /d flag for delete existing alias
        call :p_del %~2
        shift
        goto :eof
      )
    )
  ) else if "%currentarg%" neq "" (
    if "%~2" equ "" (
      :: Show the specified alias
      doskey /macros | findstr /b %currentarg%= && exit /b
      echo insufficient parameters.
      goto :p_help
    ) else (
      :: handle quotes within command definition, e.g. quoted long file names
      set _x=%*
    )
  )
rem #endregion parseargument

if "%aliases%" neq "%CMDER_ROOT%\config\user-aliases.cmd" (
  set _x=!_x:/f %aliases% =!

  if not exist "%aliases%" (
    echo ;= @echo off>"%aliases%"
    echo ;= rem Call DOSKEY and use this file as the macrofile>>"%aliases%"
    echo ;= %%SystemRoot%%\system32\doskey /listsize=1000 /macrofile=%%0%%>>"%aliases%"
    echo ;= rem In batch mode, jump to the end of the file>>"%aliases%"
    echo ;= goto:eof>>"%aliases%"
    echo ;= Add aliases below here>>"%aliases%"
  )
)

:: validate alias
for /f "delims== tokens=1,2 usebackq" %%G in (`echo "%_x%"`) do (
  set alias_name=%%G
  set alias_value=%%H
)

:: leading quotes added while validating
set alias_name=%alias_name:~1%

:: trailing quotes added while validating
set alias_value=%alias_value:~0,-1%

::remove spaces
set _temp=%alias_name: =%

if not ["%_temp%"] == ["%alias_name%"] (
	echo Your alias name can not contain a space
	endlocal
	exit /b
)

:: replace already defined alias
findstr /b /v /i "%alias_name%=" "%ALIASES%" >> "%ALIASES%.tmp"
echo %alias_name%=%alias_value% >> "%ALIASES%.tmp" && type "%ALIASES%.tmp" > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
doskey /macrofile="%ALIASES%"
endlocal
exit /b

:p_del
set del_alias=%~1
findstr /b /v /i "%del_alias%=" "%ALIASES%" >> "%ALIASES%.tmp"
type "%ALIASES%".tmp > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
doskey %del_alias%=
doskey /macrofile=%ALIASES%
goto:eof

:p_reload
doskey /macrofile="%ALIASES%"
echo Aliases reloaded
exit /b

:p_show
doskey /macros|findstr /v /r "^;=" | sort
exit /b

:p_help
echo.Usage:
echo.
echo.	alias [options] [alias=full command]
echo.
echo.Options:
echo.
echo.     /d [alias]     Delete an [alias].
echo.     /f [macrofile] Path to the [macrofile] you want to store the new alias in.
echo.                    Default: %cmder_root%\config\user-aliases.cmd
echo.     /reload        Reload the aliases file.  Can be used with /f argument.
echo.                    Default: %cmder_root%\config\user-aliases.cmd
echo.
echo.	If alias is called with no parameters, it will display the list of existing aliases.
echo.
echo.	In the command, you can use the following notations:
echo.	$* allows the alias to assume all the parameters of the supplied command.
echo.	$1-$9 Allows you to seperate parameter by number, much like %%1 in batch.
echo.	$T is the command seperator, allowing you to string several commands together into one alias.
echo.	For more information, read DOSKEY/?
exit /b

@echo off

if "%aliases%" == "" (
  set ALIASES=%CMDER_ROOT%\config\user-aliases.cmd
)

setlocal enabledelayedexpansion

if "%~1" == "" echo Use /? for help & echo. & goto :p_show

:: check command usage

rem #region parseargument
goto parseargument

:do_shift
  shift

:parseargument
  set currentarg=%~1

  if /i "%currentarg%" equ "/f" (
    set aliases=%~2
    shift
    goto :do_shift
  ) else if /i "%currentarg%" == "/reload" (
    goto :p_reload
  ) else if "%currentarg%" equ "/?" (
    goto :p_help
  ) else if /i "%currentarg%" equ "/d" (
    if "%~2" neq "" (
      if "%~3" equ "" (
        :: /d flag for delete existing alias
        call :p_del %~2
        shift
        goto :eof
      )
    )
  ) else if "%currentarg%" neq "" (
    if "%~2" equ "" (
      :: Show the specified alias
      doskey /macros | findstr /b %currentarg%= && exit /b
      echo insufficient parameters.
      goto :p_help
    ) else (
      :: handle quotes within command definition, e.g. quoted long file names
      set _x=%*
    )
  )
rem #endregion parseargument

if "%aliases%" neq "%CMDER_ROOT%\config\user-aliases.cmd" (
  set _x=!_x:/f %aliases% =!

  if not exist "%aliases%" (
    echo ;= @echo off>"%aliases%"
    echo ;= rem Call DOSKEY and use this file as the macrofile>>"%aliases%"
    echo ;= %%SystemRoot%%\system32\doskey /listsize=1000 /macrofile=%%0%%>>"%aliases%"
    echo ;= rem In batch mode, jump to the end of the file>>"%aliases%"
    echo ;= goto:eof>>"%aliases%"
    echo ;= Add aliases below here>>"%aliases%"
  )
)

:: validate alias
for /f "delims== tokens=1,* usebackq" %%G in (`echo "%_x%"`) do (
  set alias_name=%%G
  set alias_value=%%H
)

:: leading quotes added while validating
set alias_name=%alias_name:~1%

:: trailing quotes added while validating
set alias_value=%alias_value:~0,-1%

::remove spaces
set _temp=%alias_name: =%

if not ["%_temp%"] == ["%alias_name%"] (
	echo Your alias name can not contain a space
	endlocal
	exit /b
)

:: replace already defined alias
findstr /b /v /i "%alias_name%=" "%ALIASES%" >> "%ALIASES%.tmp"
echo %alias_name%=%alias_value% >> "%ALIASES%.tmp" && type "%ALIASES%.tmp" > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
doskey /macrofile="%ALIASES%"
endlocal
exit /b

:p_del
set del_alias=%~1
findstr /b /v /i "%del_alias%=" "%ALIASES%" >> "%ALIASES%.tmp"
type "%ALIASES%".tmp > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
doskey %del_alias%=
doskey /macrofile=%ALIASES%
goto:eof

:p_reload
doskey /macrofile="%ALIASES%"
echo Aliases reloaded
exit /b

:p_show
doskey /macros|findstr /v /r "^;=" | sort
exit /b

:p_help
echo.Usage:
echo.
echo.	alias [options] [alias=full command]
echo.
echo.Options:
echo.
echo.     /d [alias]     Delete an [alias].
echo.     /f [macrofile] Path to the [macrofile] you want to store the new alias in.
echo.                    Default: %cmder_root%\config\user-aliases.cmd
echo.     /reload        Reload the aliases file.  Can be used with /f argument.
echo.                    Default: %cmder_root%\config\user-aliases.cmd
echo.
echo.	If alias is called with no parameters, it will display the list of existing aliases.
echo.
echo.	In the command, you can use the following notations:
echo.	$* allows the alias to assume all the parameters of the supplied command.
echo.	$1-$9 Allows you to seperate parameter by number, much like %%1 in batch.
echo.	$T is the command seperator, allowing you to string several commands together into one alias.
echo.	For more information, read DOSKEY/?
exit /b

Fix #1245: Allow alias value to contain '=' characters


:: This script will create in first running backup of ORIGINAL/CURRENT hosts file in hosts.skel file.
:: If hosts.skel file exists, then NEW copy with customized unified hosts file will be copied to proper path.
:: Next DNS Cache will be refreshed.
:: YOU NEED RUNNING THIS BAT FILE IN COMMAND LINE PROMPT WITH ADMINISTRATOR PRIVILIGES
@ECHO OFF
if not exist "%WINDIR%\System32\drivers\etc\hosts.skel" (
	COPY %WINDIR%\System32\drivers\etc\hosts %WINDIR%\System32\drivers\etc\hosts.skel
	GOTO :CLEARDNS
)
:CLEARDNS
	COPY hosts %WINDIR%\System32\drivers\etc\
	ipconfig /flushdns
	GOTO END
:END

add file

updateHostsWindows.bat: add file

This script will create in first running backup of ORIGINAL/CURRENT
hosts file in hosts.skel file if file does not exists.
If hosts.skel file exists, then NEW copy with customized unified hosts
file will be copied to proper path.
Next DNS Cache will be refreshed.