@if "%_echo%" neq "on" echo off
setlocal

REM Workaround https://github.com/dotnet/coreclr/issues/2153
set ComPlus_ReadyToRun=0

set INIT_TOOLS_LOG=%~dp0init-tools.log
if [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages\
if [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
if [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%dotnet.exe
if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json
set /P BUILDTOOLS_VERSION=< %~dp0BuildToolsVersion.txt
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" }, "frameworks": { "dnxcore50": { } } }
set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed

:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
if [%1]==[force] (
  if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
  if exist "%PACKAGES_DIR%Microsoft.DotNet.BuildTools" rmdir /S /Q "%PACKAGES_DIR%Microsoft.DotNet.BuildTools"
)

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

if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"

if NOT exist "%PROJECT_JSON_PATH%" mkdir "%PROJECT_JSON_PATH%"
echo %PROJECT_JSON_CONTENTS% > %PROJECT_JSON_FILE%
echo Running %0 > %INIT_TOOLS_LOG%

if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
set /p DOTNET_VERSION=< %~dp0DotnetCLIVersion.txt
set DOTNET_ZIP_NAME=dotnet-dev-win-x64.%DOTNET_VERSION%.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> %INIT_TOOLS_LOG%
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> %INIT_TOOLS_LOG%
if NOT exist "%DOTNET_LOCAL_PATH%" (
  echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterdotnetrestore

if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
  echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterbuildtoolsrestore

echo Initializing BuildTools ...
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%

:: Create sempahore file
echo Done initializing tools.
echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%"

@if "%_echo%" neq "on" echo off
setlocal

set INIT_TOOLS_LOG=%~dp0init-tools.log
if [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages\
if [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
if [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%dotnet.exe
if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json
set /P BUILDTOOLS_VERSION=< %~dp0BuildToolsVersion.txt
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" }, "frameworks": { "dnxcore50": { } } }
set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed

:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
if [%1]==[force] (
  if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
  if exist "%PACKAGES_DIR%Microsoft.DotNet.BuildTools" rmdir /S /Q "%PACKAGES_DIR%Microsoft.DotNet.BuildTools"
)

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

if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"

if NOT exist "%PROJECT_JSON_PATH%" mkdir "%PROJECT_JSON_PATH%"
echo %PROJECT_JSON_CONTENTS% > %PROJECT_JSON_FILE%
echo Running %0 > %INIT_TOOLS_LOG%

if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
set /p DOTNET_VERSION=< %~dp0DotnetCLIVersion.txt
set DOTNET_ZIP_NAME=dotnet-dev-win-x64.%DOTNET_VERSION%.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> %INIT_TOOLS_LOG%
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> %INIT_TOOLS_LOG%
if NOT exist "%DOTNET_LOCAL_PATH%" (
  echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterdotnetrestore

if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
  echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details.
  goto :EOF
)

:afterbuildtoolsrestore

echo Initializing BuildTools ...
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%

:: Create sempahore file
echo Done initializing tools.
echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%"

Remove ReadyToRun workaround

Remove ReadyToRun workaround


@echo off

setlocal enabledelayedexpansion

set "src=%~1"
if not exist !src! goto :nosuchfile

set "ext=%~x1"
set "ext=!ext:~1!"

if "!ext!" neq "docx" goto :invalid_input_format

set "dst=%~dpn1.md"

pandoc -f docx -t markdown_github !src! -o !dst!
goto :exit

:nosuchfile
echo !src! not found!
goto :eof

:invalid_input_format
echo input format !ext! is not supported.
goto :eof

:exit
endlocal

add docx2md

add docx2md


add unzip boost bat file && 7z.exe

add unzip boost bat file && 7z.exe


rem @echo off

if NOT "%1"=="" SET VERSION="%1"
if NOT "%1"=="" GOTO GOT_VERSION

SET VERSION="08.01.0006"
echo.
echo Version not specified - defaulting to %VERSION%
echo.

:GOT_VERSION

echo.
echo Building psqlODBC merge module...

candle -nologo -dVERSION=%VERSION% -dPROGRAMFILES="%ProgramFiles%" psqlodbcm.wxs
IF ERRORLEVEL 1 GOTO ERR_HANDLER

light -nologo -out psqlodbc.msm psqlodbcm.wixobj
IF ERRORLEVEL 1 GOTO ERR_HANDLER

echo.
echo Building psqlODBC installer database...

candle -nologo -dVERSION=%VERSION% -dPROGRAMFILES="%ProgramFiles%" psqlodbc.wxs
IF ERRORLEVEL 1 GOTO ERR_HANDLER

light -nologo psqlodbc.wixobj
IF ERRORLEVEL 1 GOTO ERR_HANDLER

echo.
echo Done!
GOTO EXIT

:ERR_HANDLER
echo.
echo Aborting build!
GOTO EXIT

:EXIT

Switch off echo

Switch off echo


@echo off

echo PostBuild.bat START ===========

set DIR_SRC=%1
set DIR_OUTPUT=%2
set DIR_DEST=%3

rmdir /S /Q %DIR_DEST% 2>nul
mkdir %DIR_DEST%

echo Creating portable package:
echo ^ ^ Copy files from %DIR_OUTPUT%
FOR %%G IN (HitCounterManager.exe HitCounterManager.exe.config) DO copy %DIR_OUTPUT%\%%G %DIR_DEST%
echo ^ ^ Copy files from %DIR_SRC%
FOR %%G IN (Sources\HitCounterManagerInit.xml Sources\HitCounter.html Sources\HitCounter.template) DO copy %DIR_SRC%\%%G %DIR_DEST%
echo ^ ^ Copy files from %DIR_SRC%\Designs
mkdir %DIR_DEST%\Designs
copy %DIR_SRC%\Designs %DIR_DEST%\Designs

echo PostBuild.bat END ===========

@echo off

REM MIT License

REM Copyright(c) 2016-2018 Peter Kirmeier

REM Permission Is hereby granted, free Of charge, to any person obtaining a copy
REM of this software And associated documentation files (the "Software"), to deal
REM in the Software without restriction, including without limitation the rights
REM to use, copy, modify, merge, publish, distribute, sublicense, And/Or sell
REM copies of the Software, And to permit persons to whom the Software Is
REM furnished to do so, subject to the following conditions:

REM The above copyright notice And this permission notice shall be included In all
REM copies Or substantial portions of the Software.

REM THE SOFTWARE Is PROVIDED "AS IS", WITHOUT WARRANTY Of ANY KIND, EXPRESS Or
REM IMPLIED, INCLUDING BUT Not LIMITED To THE WARRANTIES Of MERCHANTABILITY,
REM FITNESS FOR A PARTICULAR PURPOSE And NONINFRINGEMENT. IN NO EVENT SHALL THE
REM AUTHORS Or COPYRIGHT HOLDERS BE LIABLE For ANY CLAIM, DAMAGES Or OTHER
REM LIABILITY, WHETHER In AN ACTION Of CONTRACT, TORT Or OTHERWISE, ARISING FROM,
REM OUT OF Or IN CONNECTION WITH THE SOFTWARE Or THE USE Or OTHER DEALINGS IN THE
REM SOFTWARE.

echo PostBuild.bat START ===========

set DIR_SRC=%1
set DIR_OUTPUT=%2
set DIR_DEST=%3

rmdir /S /Q %DIR_DEST% 2>nul
mkdir %DIR_DEST%

echo Creating portable package:
echo ^ ^ Copy files from %DIR_OUTPUT%
FOR %%G IN (HitCounterManager.exe HitCounterManager.exe.config) DO copy %DIR_OUTPUT%\%%G %DIR_DEST%
echo ^ ^ Copy files from %DIR_SRC%
FOR %%G IN (Sources\HitCounterManagerInit.xml Sources\HitCounter.html Sources\HitCounter.template) DO copy %DIR_SRC%\%%G %DIR_DEST%
echo ^ ^ Copy files from %DIR_SRC%\Designs
mkdir %DIR_DEST%\Designs
copy %DIR_SRC%\Designs %DIR_DEST%\Designs

echo PostBuild.bat END ===========

Add license text

Add license text


"%R%" CMD INSTALL --build .
if errorlevel 1 exit 1

@rem Add more build steps here, if they are necessary.

@rem See
@rem http://docs.continuum.io/conda/build.html
@rem for a list of environment variables that are set during the build process.

Update bld.bat

Update bld.bat


REM other targets are:
REM 'build'
REM 'test'
REM 'test-integration'

@ECHO OFF
cls

@echo Building from script Common.Logging.build...
@echo .
@echo .
@echo .

rem tools\nant\bin\nant.exe -f:Common.Logging.build build package-zip package-nuget -D:project.sign=true -D:package.version=2.3.0 -D:nuget.version.suffix=RC1 -D:project.releasetype=release > buildlog.txt
tools\nant\bin\nant.exe -f:Common.Logging.build build package-zip package-nuget -D:project.sign=true -D:package.version=2.3.1 -D:project.releasetype=release > buildlog.txt

@echo ...complete!
@echo .
@echo .
@echo .

@echo Launching text file viewer to display buildlog.txt contents...
start "ignored but required placeholder window title argument" buildlog.txt

REM other targets are:
REM 'build'
REM 'test'
REM 'test-integration'

@ECHO OFF
cls

@echo Building from script Common.Logging.build...
@echo .
@echo .
@echo .

tools\nant\bin\nant.exe -f:Common.Logging.build build package-zip package-nuget -D:project.sign=true -D:package.version=3.0.0 -D:nuget.version.suffix=Alpha1 -D:project.releasetype=release > buildlog.txt
rem tools\nant\bin\nant.exe -f:Common.Logging.build build package-zip package-nuget -D:project.sign=true -D:package.version=2.3.1 -D:project.releasetype=release > buildlog.txt

@echo ...complete!
@echo .
@echo .
@echo .

@echo Launching text file viewer to display buildlog.txt contents...
start "ignored but required placeholder window title argument" buildlog.txt

update release build script to reflect 3.0.0-Alpha1


git add .
git commit -a -m "update on %date:~0,10% -%time:~0,20%"
git push http://grasp@github.com/grasp/small_fish_1.git master

add push.bat

add push.bat


cls
call "C:\Program Files\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
cl /c /DEBUG ring_opengl21.c -I "..\..\..\libdepwin\glew\include" -I "..\..\..\libdepwin\freeglut\include" -I"..\..\..\include"
link /DEBUG ring_opengl21.obj  ..\..\..\lib\ring.lib ..\..\..\libdepwin\glew\lib\release\win32\glew32.lib ..\..\..\libdepwin\freeglut\lib\freeglut.lib /DLL /OUT:..\..\..\bin\ring_opengl21.dll /SUBSYSTEM:CONSOLE,"5.01"
del ring_opengl21.obj

cls
call ../../../src/locatevc.bat
cl /c /DEBUG ring_opengl21.c -I "..\..\..\libdepwin\glew\include" -I "..\..\..\libdepwin\freeglut\include" -I"..\..\..\include"
link /DEBUG ring_opengl21.obj  ..\..\..\lib\ring.lib ..\..\..\libdepwin\glew\lib\release\win32\glew32.lib ..\..\..\libdepwin\freeglut\lib\freeglut.lib /DLL /OUT:..\..\..\bin\ring_opengl21.dll /SUBSYSTEM:CONSOLE,"5.01"
del ring_opengl21.obj

Update RingOpenGL 2.1 - buildvc.bat - use locatevc.bat


add test directory

add test directory


copy "C:\Dev\kontrols\src\kontrols\bin\Release\kontrols.dll" "C:\Dev\kontrols\nuget\lib\net45\kontrols.dll"
nuget.exe pack "C:\dev\kontrols\nuget\kontrols.nuspec"

Add convenience build script

Add convenience build script


:: To build extensions for 64 bit Python 3, we need to configure environment
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
::
:: To build extensions for 64 bit Python 2, we need to configure environment
:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
::
:: 32 bit builds do not require specific environment configurations.
::
:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
:: cmd interpreter, at least for (SDK v7.0)
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
:: http://stackoverflow.com/a/13751649/163740
::
:: Author: Olivier Grisel
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/

SET COMMAND_TO_RUN=%*
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows

IF "%PYTHON_ARCH%"=="64" (
    ECHO SDK: %WINDOWS_SDK_VERSION% ARCH: %PYTHON_ARCH%
    SET DISTUTILS_USE_SDK=1
    SET MSSdk=1
    "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
    "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
    ECHO Executing: %COMMAND_TO_RUN%
    call %COMMAND_TO_RUN% || EXIT 1
) ELSE (
    ECHO SDK: %WINDOWS_SDK_VERSION% ARCH: %PYTHON_ARCH%
    ECHO Executing: %COMMAND_TO_RUN%
    call %COMMAND_TO_RUN% || EXIT 1
)

:: To build extensions for 64 bit Python 3, we need to configure environment
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
::
:: To build extensions for 64 bit Python 2, we need to configure environment
:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
::
:: 32 bit builds do not require specific environment configurations.
::
:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
:: cmd interpreter, at least for (SDK v7.0)
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
:: http://stackoverflow.com/a/13751649/163740
::
:: Author: Olivier Grisel
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
@ECHO OFF

SET COMMAND_TO_RUN=%*
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows

IF "%PYTHON_ARCH%"=="64" (
    ECHO SDK: %WINDOWS_SDK_VERSION% ARCH: %PYTHON_ARCH%
    SET DISTUTILS_USE_SDK=1
    SET MSSdk=1
    "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
    "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
    ECHO Executing: %COMMAND_TO_RUN%
    call %COMMAND_TO_RUN% || EXIT 1
) ELSE (
    ECHO SDK: %WINDOWS_SDK_VERSION% ARCH: %PYTHON_ARCH%
    ECHO Executing: %COMMAND_TO_RUN%
    call %COMMAND_TO_RUN% || EXIT 1
)

Revert "Echo everything,"

Revert "Echo everything,"

This reverts commit c6f5f337d19daa07a3af9290f6d611c93e7378f7.


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

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

Add flag

Add flag


@echo off

SETLOCAL EnableExtensions EnableDelayedExpansion

if [%1] EQU [MSIONLY] goto BUILD_MSI
if [%2] EQU [NOSIGN] (SET DEBUG_CFG=Debug_NoSign) ELSE (SET DEBUG_CFG=Debug)

del *.log

for %%x in (Win7, Win8, Win8.1, Win10, XP) do (
  for %%y in (%DEBUG_CFG%, Release) do (
    for %%z in (win32, x64) do (
      call tools\vs_run.bat UsbDk.sln /Rebuild "%%x %%y|%%z" /Out build%%y_%%x_%%z.log
      if !ERRORLEVEL! NEQ 0 exit /B 1
    )
  )
)

if [%1] EQU [NOMSI] goto NOMSI

:BUILD_MSI

pushd Tools\Installer

SET UsbDkVersion="%USBDK_MAJOR_VERSION%.%USBDK_MINOR_VERSION%.%USBDK_BUILD_NUMBER%"
buildmsi.bat %2

popd

:NOMSI

ENDLOCAL

@echo off

SETLOCAL EnableExtensions EnableDelayedExpansion

if [%1] EQU [MSIONLY] goto BUILD_MSI
if [%2] EQU [NOSIGN] (SET DEBUG_CFG=Debug_NoSign) ELSE (SET DEBUG_CFG=Debug)

del *.log

for %%x in (Win7, Win8, Win8.1, Win10, XP) do (
  for %%y in (%DEBUG_CFG%, Release) do (
    for %%z in (win32, x64) do (
      call tools\vs_run.bat UsbDk.sln /Rebuild "%%x %%y|%%z" /Out build%%y_%%x_%%z.log
      if !ERRORLEVEL! NEQ 0 exit /B 1
    )
  )
)

pushd Install
"C:\Program Files (x86)\Windows Kits\10\bin\x86\tracepdb.exe" -s -o .\UsbDk.tmf
if !ERRORLEVEL! NEQ 0 exit /B 1
popd

pushd Install_Debug
"C:\Program Files (x86)\Windows Kits\10\bin\x86\tracepdb.exe" -s -o .\UsbDk.tmf
if !ERRORLEVEL! NEQ 0 exit /B 1
popd

if [%1] EQU [NOMSI] goto NOMSI

:BUILD_MSI

pushd Tools\Installer

SET UsbDkVersion="%USBDK_MAJOR_VERSION%.%USBDK_MINOR_VERSION%.%USBDK_BUILD_NUMBER%"
buildmsi.bat %2

popd

:NOMSI

ENDLOCAL

build: Build TMF files after building all binaries

Signed-off-by: Yuri Benditovich <9668326cb042de5d91fd7679dac7ca5ea402812c@daynix.com>
Signed-off-by: Dmitry Fleytman <f50f56ffad4b379c2a89812e98b14900ef87e9ea@redhat.com>


@echo off
rem dennyhalim.com
rem this will be copied after first reboot and then run after next reboot

#replace defaultlayouts before it gets created
move "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml" "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.dennyhalim"
copy /y "%WINDIR%\Setup\Files\DefaultLayouts.xml" "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml"
move "%SystemRoot%\SysWOW64\OneDriveSetup.exe" "%SystemRoot%\SysWOW64\OneDriveSetup.dennyhalim"
move "%SystemRoot%\System32\OneDriveSetup.exe" "%SystemRoot%\System32\OneDriveSetup.dennyhalim"
rem move "%windir%\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy" "%windir%\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy.dennyhalim"
rem startmenu disabled if shellex disabled
rem move "%windir%\SystemApps\ShellExperienceHost_cw5n1h2txyewy" "%windir%\SystemApps\ShellExperienceHost_cw5n1h2txyewy.dennyhalim"

reg load HKLM\DEFAULT "%Public%\..\default\ntuser.dat"
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_TrackProgs /t REG_DWORD /d 1 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v Enabled /t REG_DWORD /d 0 /f
reg add "HKLM\DEFAULT\Software\MicrosoftMicrosoft\Input\TIPC" /v Enabled /t REG_DWORD /d 0 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v GlobalUserDisabled /t REG_DWORD /d 1 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People /v PeopleBand /t REG_DWORD /d 0 /f
reg delete "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /F
reg unload HKLM\DEFAULT

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferUpgrade /t REG_DWORD /d 1 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v BranchReadinessLevel /t REG_DWORD /d 32 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdates /t REG_DWORD /d 1 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdatesPeriodinDays /t REG_DWORD /d 365 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowCortana /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" /v WiFiSenseCredShared /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" /v WiFiSenseOpen /t REG_DWORD /d 0 /f

cscript "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "Canon LBP2900" -i "%WINDIR%\Setup\Files\CanonLBP2900\CNAB4STD.inf"
cscript "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "Canon G2000 series Printer" -i "%WINDIR%\Setup\Files\CanonG2000\Driver\G2000P6.inf"
rem move "%WINDIR%\Setup\Drivers\*" "%WINDIR%\INF"

schtasks /change /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Application Experience\ProgramDataUpdater" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /DISABLE

"%WINDIR%\Setup\Files\chocolatey.exe" /S
"%WINDIR%\Setup\Files\Firefox Setup 52.6.0esr.exe" -ms
"%WINDIR%\Setup\Files\vlc-3.0.1-win64.exe" /L=1033 /S
"%WINDIR%\Setup\Files\SumatraPDF-3.1.2-64-install.exe" /S
Msiexec /q /I "%WINDIR%\Setup\Files\7z1801-x64.msi"
Msiexec /q /I "%WINDIR%\Setup\Files\GoogleChromeStandaloneEnterprise64.msi"
Msiexec /q /I "%WINDIR%\Setup\Files\LibreOffice_5.4.6_Win_x64.msi"
rem "%WINDIR%\Setup\Files\avira_pc_cleaner_en.exe" /s
"%WINDIR%\Setup\Files\mb3-setup-consumer-3.4.5.2467-1.0.342-1.0.4664.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
"%WINDIR%\Setup\Files\avast_business_antivirus_managed_setup_offline_silent.exe"

mkdir "%Public%\Desktop.dennyhalim"
move "%Public%\Desktop\*.*" "%Public%\Desktop.dennyhalim"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%WINDIR%\Setup\Files\setup.ps1'"

rem "%WINDIR%\Setup-githubbox.exe"
rem rd /q /s "%WINDIR%\Setup\Files"
rem del /q /f "%0"

@echo off
rem dennyhalim.com
rem this will be copied after first reboot and then run after next reboot

#replace defaultlayouts before it gets created
move "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml" "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.dennyhalim"
copy /y "%WINDIR%\Setup\Files\DefaultLayouts.xml" "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml"
move "%SystemRoot%\SysWOW64\OneDriveSetup.exe" "%SystemRoot%\SysWOW64\OneDriveSetup.dennyhalim"
move "%SystemRoot%\System32\OneDriveSetup.exe" "%SystemRoot%\System32\OneDriveSetup.dennyhalim"
rem move "%windir%\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy" "%windir%\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy.dennyhalim"
rem startmenu disabled if shellex disabled
rem move "%windir%\SystemApps\ShellExperienceHost_cw5n1h2txyewy" "%windir%\SystemApps\ShellExperienceHost_cw5n1h2txyewy.dennyhalim"

reg load HKLM\DEFAULT "%Public%\..\default\ntuser.dat"
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_TrackProgs /t REG_DWORD /d 1 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v Enabled /t REG_DWORD /d 0 /f
reg add "HKLM\DEFAULT\Software\MicrosoftMicrosoft\Input\TIPC" /v Enabled /t REG_DWORD /d 0 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v GlobalUserDisabled /t REG_DWORD /d 1 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People /v PeopleBand /t REG_DWORD /d 0 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f
reg delete "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /F
reg unload HKLM\DEFAULT

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferUpgrade /t REG_DWORD /d 1 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v BranchReadinessLevel /t REG_DWORD /d 32 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdates /t REG_DWORD /d 1 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdatesPeriodinDays /t REG_DWORD /d 365 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowCortana /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" /v WiFiSenseCredShared /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" /v WiFiSenseOpen /t REG_DWORD /d 0 /f

cscript "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "Canon LBP2900" -i "%WINDIR%\Setup\Files\CanonLBP2900\CNAB4STD.inf"
cscript "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "Canon G2000 series Printer" -i "%WINDIR%\Setup\Files\CanonG2000\Driver\G2000P6.inf"
rem move "%WINDIR%\Setup\Drivers\*" "%WINDIR%\INF"

schtasks /change /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Application Experience\ProgramDataUpdater" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /DISABLE

"%WINDIR%\Setup\Files\chocolatey.exe" /S
"%WINDIR%\Setup\Files\Firefox Setup 52.6.0esr.exe" -ms
"%WINDIR%\Setup\Files\vlc-3.0.1-win64.exe" /L=1033 /S
"%WINDIR%\Setup\Files\SumatraPDF-3.1.2-64-install.exe" /S
Msiexec /q /I "%WINDIR%\Setup\Files\7z1801-x64.msi"
Msiexec /q /I "%WINDIR%\Setup\Files\GoogleChromeStandaloneEnterprise64.msi"
Msiexec /q /I "%WINDIR%\Setup\Files\LibreOffice_5.4.6_Win_x64.msi"
rem "%WINDIR%\Setup\Files\avira_pc_cleaner_en.exe" /s
"%WINDIR%\Setup\Files\mb3-setup-consumer-3.4.5.2467-1.0.342-1.0.4664.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
"%WINDIR%\Setup\Files\avast_business_antivirus_managed_setup_offline_silent.exe"

mkdir "%Public%\Desktop.dennyhalim"
move "%Public%\Desktop\*.*" "%Public%\Desktop.dennyhalim"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%WINDIR%\Setup\Files\setup.ps1'"

rem "%WINDIR%\Setup-githubbox.exe"
rem rd /q /s "%WINDIR%\Setup\Files"
rem del /q /f "%0"

Update SetupComplete.cmd

Update SetupComplete.cmd


@rem Tune environment:
@set COMPILER_CFG_SCRIPT=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat
@set JAVA_HOME=C:\ws\bin\jdk1.5.0_06
@set ANT_HOME=C:\ws\bin\apache-ant-1.6.5
@set SVN_HOME=C:\ws\bin\svn-win32-1.4.2
@set ANT_OPTS=-XX:MaxPermSize=512m -Xmx1000M -Dhttp.proxyHost=my.proxy.com -Dhttp.proxyPort=1111

@set PATH=%SVN_HOME%/bin;%PATH%;%ANT_HOME%/bin
@set CLASSPATH=./build/classes

@call "%COMPILER_CFG_SCRIPT%"
call ant %* 2>&1

@rem Tune environment:
@set COMPILER_CFG_SCRIPT=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat
@set JAVA_HOME=C:\ws\bin\jdk1.5.0_06
@set ANT_HOME=C:\ws\bin\apache-ant-1.6.5
@set SVN_HOME=C:\ws\bin\svn-win32-1.4.2
@set ANT_OPTS=-XX:MaxPermSize=512m -Xmx1000M -Dhttp.proxyHost=my.proxy.com -Dhttp.proxyPort=1111

@set PATH=%SVN_HOME%\bin;%PATH%;%ANT_HOME%\bin
@set CLASSPATH=%~dp0\build\classes

@call "%COMPILER_CFG_SCRIPT%"
call ant %* 2>&1

Correct path separators for; use working directory expansion to setup classpath

svn path=/harmony/enhanced/buildtest/branches/2.0/; revision=538801


@set MINGWPATH=C:\MinGW
@set PATH=%MINGWPATH%\msys\1.0\bin;%MINGWPATH%\bin

@set LANG=en_US.UTF8
@set LC_ALL=en_US.UTF8

@set OPENSSL=openssl-1.0.1g
@set BERKELEYDB=db-4.8.30.NC
@set BOOST=boost_1_54_0
@set BOOSTVERSION=1.54.0
@rem If you wonder why there is no -s- see: https://github.com/bitcoin/bitcoin/pull/2835#issuecomment-21231694
@set BOOSTSUFFIX=-mgw46-mt-1_54
@set MINIUPNPC=miniupnpc-1.8

@set EWBLIBS=libs

@set EWBPATH=contrib/easywinbuilder
@set ROOTPATH=..\..
@set ROOTPATHSH=%ROOTPATH:\=/%

@rem bootstrap coin name
@for /F %%a in ('dir /b %ROOTPATH%\*.pro') do @set COINNAME=%%a
@set COINNAME=%COINNAME:-qt.pro=%

@set QTPATH=C:\Qt\4.8.5\bin
@set QTDOWNLOADPATH=http://download.qt-project.org/archive/qt/4.8/4.8.5/qt-win-opensource-4.8.5-mingw.exe
@rem Qt5 will need changes in gather_dlls.bat

@set MSYS=%MINGWPATH:\=/%/msys/1.0/bin
@set PERL=%MSYS%/perl.exe

@rem the following will be set as additional CXXFLAGS and CFLAGS for everything - no ' or ", space is ok
@set ADDITIONALCCFLAGS=-fno-guess-branch-probability -frandom-seed=1984 -Wno-unused-variable -Wno-unused-value -Wno-sign-compare -Wno-strict-aliasing

@rem Note: Variables set here can NOT be overwritten in makefiles

@set MINGWPATH=C:\MinGW
@set PATH=%MINGWPATH%\msys\1.0\bin;%MINGWPATH%\bin

@set LANG=en_US.UTF8
@set LC_ALL=en_US.UTF8

@set OPENSSL=openssl-1.0.1h
@set BERKELEYDB=db-4.8.30.NC
@set BOOST=boost_1_54_0
@set BOOSTVERSION=1.54.0
@rem If you wonder why there is no -s- see: https://github.com/bitcoin/bitcoin/pull/2835#issuecomment-21231694
@set BOOSTSUFFIX=-mgw46-mt-1_54
@set MINIUPNPC=miniupnpc-1.8

@set EWBLIBS=libs

@set EWBPATH=contrib/easywinbuilder
@set ROOTPATH=..\..
@set ROOTPATHSH=%ROOTPATH:\=/%

@rem bootstrap coin name
@for /F %%a in ('dir /b %ROOTPATH%\*.pro') do @set COINNAME=%%a
@set COINNAME=%COINNAME:-qt.pro=%

@set QTPATH=C:\Qt\4.8.5\bin
@set QTDOWNLOADPATH=http://download.qt-project.org/archive/qt/4.8/4.8.5/qt-win-opensource-4.8.5-mingw.exe
@rem Qt5 will need changes in gather_dlls.bat

@set MSYS=%MINGWPATH:\=/%/msys/1.0/bin
@set PERL=%MSYS%/perl.exe

@rem the following will be set as additional CXXFLAGS and CFLAGS for everything - no ' or ", space is ok
@set ADDITIONALCCFLAGS=-fno-guess-branch-probability -frandom-seed=1984 -Wno-unused-variable -Wno-unused-value -Wno-sign-compare -Wno-strict-aliasing

@rem Note: Variables set here can NOT be overwritten in makefiles

Update set_vars.bat

Update set_vars.bat

Updated Openssl version '1.0.1h'


:: http://stackoverflow.com/a/21736349/891976

@echo on
:: Declare Outside Scope
setlocal enabledelayedexpansion
:: Declare Inside Scope
setlocal enabledelayedexpansion
:: Build Inside Variables
echo Inside
set "a=hi@%%$<>()[]|*~';,./?:{}+_-=\/ & bye"
set "b=2"
set "c=^^no ^& """g"o"
set "d=hello^!"
:: View Variables Inside Scope
echo(a=!a!
echo(b=!b!
echo(c=!c!
echo(d=!d!
:: Return A C and D
call :return a c d e
::set return
endlocal %return%
:: View Variables Outside Scope
echo Outside
echo(a=!a!
echo(b=!b!
echo(c=!c!
echo(d=!d!
echo(z=!z!
endlocal
exit /b 0

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Build a multi-variable return statement in the variable "return"
:: Usage:
::     call :return var1 var2
::     endlocal %return%
:: Supports all batch special characters. " ^ < > & !
:return [Variables...]
setlocal enabledelayedexpansion
:: set "z=9" &rem scope test
set "return="
:: Loop through parameters
:_return
:: Validate parameters
if "%~1"=="" endlocal & exit /b 1
if not defined %~1 goto __return
:: Escape special characters
set "%~1=!%~1:"=""!"
set "%~1=!%~1:^=^^!"
set "%~1=!%~1:<=^<!"
set "%~1=!%~1:>=^>!"
set "%~1=!%~1:&=^&!"
set "%~1=!%~1:|=^|!"
:: Add to return statement
set "return=!return!^&set ""%~1=!%~1!"""
:__return
if not "%~2"=="" shift & goto _return
::set return
:: Escape the exclamation mark. Seven circumflex equal 3 times escaped.
setlocal disabledelayedexpansion
set "return=%return:!=^^^^^^^!%"
endlocal & endlocal & set "return=%return:""="%"
exit /b 0

:: By David Ruhmann
:: For http://stackoverflow.com/a/21736349/891976

@echo on
:: Declare Outside Scope
setlocal enabledelayedexpansion
:: Declare Inside Scope
setlocal enabledelayedexpansion
:: Build Inside Variables
echo Inside
set "a=hi@%%$<>()[]|*~';,./?:{}+_-=\/ & bye"
set "b=2"
set "c=^^no ^& """g"o"
set "d=hello^!"
:: View Variables Inside Scope
echo(a=!a!
echo(b=!b!
echo(c=!c!
echo(d=!d!
:: Return A C and D
call :return a c d e
::set return
endlocal %return%
:: View Variables Outside Scope
echo Outside
echo(a=!a!
echo(b=!b!
echo(c=!c!
echo(d=!d!
endlocal
exit /b 0

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Build a multi-variable return statement in the variable "return"
:: Supports all batch special characters. " ^ < > & !
:: Usage:
::     call :return var1 var2
::     endlocal %return%
:return [Variables...]
setlocal enabledelayedexpansion
set "return="
:_return
if "%~1"=="" endlocal & exit /b 1
if not defined %~1 goto __return
set "%~1=!%~1:"=""!"
set "%~1=!%~1:^=^^!"
set "%~1=!%~1:<=^<!"
set "%~1=!%~1:>=^>!"
set "%~1=!%~1:&=^&!"
set "%~1=!%~1:|=^|!"
set "return=!return!^&set ""%~1=!%~1!"""
:__return
if not "%~2"=="" shift & goto _return
setlocal disabledelayedexpansion
set "return=%return:!=^^^^^^^!%"
endlocal & endlocal & set "return=%return:""="%"
exit /b 0

Update SO21736349891976.bat

Update SO21736349891976.bat

Cleaned up


REM This script will checkout Banshee from git (and a few submodules that are needed).
REM It will result in a banshee/ directory under where it's launched from.
REM See banshee\build\windows\README.txt for more information
REM (this file is tracked in version control at: http://git.gnome.org/browse/banshee/plain/build/windows/checkout-banshee.bat )

REM for some reason need to put these all on one line w/ && between; as separate commands on separate lines it stops after a given git cmd
git clone git://git.gnome.org/banshee && cd banshee && git submodule update --init && git clone git://gitorious.org/banshee/windows-binaries.git bin && echo "Checkout script finished. Banshee is now checked out into the banshee folder.  Build it with build\windows\build-banshee.bat or your favorite IDE using Banshee.sln" && pause

REM This script will checkout Banshee from git (and a few submodules that are needed).
REM It will result in a banshee/ directory under where it's launched from.
REM See banshee\build\windows\README.txt for more information
REM (this file is tracked in version control at: http://git.gnome.org/browse/banshee/plain/build/windows/checkout-banshee.bat )

call git clone git://git.gnome.org/banshee
if not exist banshee goto failure

cd banshee
call git submodule update --init
call git clone git://gitorious.org/banshee/windows-binaries.git bin
if not exist bin goto failure

echo "Checkout script finished. Banshee is now checked out into the banshee folder.  Build it with build\windows\build-banshee.bat or your favorite IDE using Banshee.sln"
pause

:failure
echo "There was a problem during the checkout. Please see the message above."

windows: Improve readability of the checkout-banshee script

As the git command is itself a batch file on Windows, you need to use
"call" to call it from another batch file.


@echo Off
set config=%1
if "%config%" == "" (
   set config=Release
)

set version=
if not "%BuildCounter%" == "" (
   set version=--version-suffix ci-%BuildCounter%
)

REM (optional) build.bat is in the root of our repo, cd to the correct folder where sources/projects are
echo %cd%

REM Restore
call dotnet restore
if not "%errorlevel%"=="0" goto failure

REM Build
REM - Option 1: Run dotnet build for every source folder in the project
REM   e.g. call dotnet build <path> --configuration %config%
REM - Option 2: Let msbuild handle things and build the solution
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" NugetyCore\NugetyCore.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
REM call dotnet build --configuration %config%
if not "%errorlevel%"=="0" goto failure

REM Unit tests
call dotnet test NugetyCore\src\NugetyCore.Tests --configuration %config%
if not "%errorlevel%"=="0" goto failure

:success
exit 0

:failure
exit -1

@echo Off
set config=%1
if "%config%" == "" (
   set config=Release
)

set version=
if not "%BuildCounter%" == "" (
   set version=--version-suffix ci-%BuildCounter%
)

REM (optional) build.bat is in the root of our repo, cd to the correct folder where sources/projects are
echo %cd%

REM Restore
call dotnet restore
if not "%errorlevel%"=="0" goto failure

REM Build
REM - Option 1: Run dotnet build for every source folder in the project
REM   e.g. call dotnet build <path> --configuration %config%
REM - Option 2: Let msbuild handle things and build the solution
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" NugetyCore\NugetyCore.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
REM call dotnet build --configuration %config%
if not "%errorlevel%"=="0" goto failure

REM Unit tests
REM call dotnet test NugetyCore\src\NugetyCore.Tests --configuration %config%
REM if not "%errorlevel%"=="0" goto failure

:success
exit 0

:failure
exit -1

comment out unit tests initially to test build process


:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
:: cmd interpreter, at least for (SDK v7.0)
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
:: http://stackoverflow.com/a/13751649/163740
::
:: Author: Olivier Grisel
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
@ECHO OFF

SET COMMAND_TO_RUN=%*
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
SET WIN_WDK=c:\Program Files (x86)\Windows Kits\10\Include\wdf

:: Extract the major and minor versions, and allow for the minor version to be
:: more than 9.  This requires the version number to have two dots in it.
SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1%
IF "%PYTHON_VERSION:~3,1%" == "." (
    SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,1%
) ELSE (
    SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,2%
)

:: Modern versions of distutils attempt to guess the toolchain to use based
:: on ``sys.version`` and from inspecting the system (notably the registry).
:: This is somewhat fragile in AppVeyor for some reason. So, we instead set
:: ``DISTUTILS_USE_SDK`` and ``MSSdk`` along with some other environment
:: variables (some set by ``vcvarsall.bat``) to force distutils to use a
:: specific toolchain and SDK.

IF %MAJOR_PYTHON_VERSION% == 2 (
    SET WINDOWS_SDK_VERSION="v7.0"
    SET TOOLS_VERSION="9.0"
    SET VCVARS=vcvars64.bat
) ELSE (
    IF %MAJOR_PYTHON_VERSION% == 3 (
        SET WINDOWS_SDK_VERSION="v7.1"
        IF %MINOR_PYTHON_VERSION% LEQ 2 (
            ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%.%MINOR_PYTHON_VERSION%"
            EXIT 1
        ) ELSE (
            IF %MINOR_PYTHON_VERSION% LEQ 4 (
                SET WINDOWS_SDK_VERSION="v7.1"
                SET TOOLS_VERSION="10.0"
                SET VCVARS=amd64\vcvars64.bat
            ) ELSE (
                IF %MINOR_PYTHON_VERSION% LEQ 6 (
                    SET WINDOWS_SDK_VERSION="v7.1"
                    SET TOOLS_VERSION="14.0"
                    SET VCVARS=amd64\vcvars64.bat
                ) ELSE (
                    ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%.%MINOR_PYTHON_VERSION%"
                    EXIT 1
                )
            )
        )

        IF EXIST "%WIN_WDK%" (
            :: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/
            REN "%WIN_WDK%" 0wdf
        )
    )
)

SET DISTUTILS_USE_SDK=1
SET MSSdk=1
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%

if %PYTHON_ARCH% == 64 (
    CALL "C:\Program Files (x86)\Microsoft Visual Studio %TOOLS_VERSION%\VC\bin\%VCVARS%" || EXIT 1
    ECHO Executing: %COMMAND_TO_RUN%
    CALL %COMMAND_TO_RUN% || EXIT 1
) ELSE (
    CALL "C:\Program Files (x86)\Microsoft Visual Studio %TOOLS_VERSION%\VC\vcvarsall.bat" x86 || EXIT 1
    ECHO Executing: %COMMAND_TO_RUN%
    CALL %COMMAND_TO_RUN% || EXIT 1
)

:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
:: cmd interpreter, at least for (SDK v7.0)
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
:: http://stackoverflow.com/a/13751649/163740
::
:: Author: Olivier Grisel
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
@ECHO OFF

SET COMMAND_TO_RUN=%*
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
SET WIN_WDK=c:\Program Files (x86)\Windows Kits\10\Include\wdf

:: Extract the major and minor versions, and allow for the minor version to be
:: more than 9.  This requires the version number to have two dots in it.
SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1%
IF "%PYTHON_VERSION:~3,1%" == "." (
    SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,1%
) ELSE (
    SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,2%
)

:: Modern versions of distutils attempt to guess the toolchain to use based
:: on ``sys.version`` and from inspecting the system (notably the registry).
:: This is somewhat fragile in AppVeyor for some reason. So, we instead set
:: ``DISTUTILS_USE_SDK`` and ``MSSdk`` along with some other environment
:: variables (some set by ``vcvarsall.bat``) to force distutils to use a
:: specific toolchain and SDK.

IF %MAJOR_PYTHON_VERSION% == 2 (
    SET WINDOWS_SDK_VERSION="v7.0"
    SET TOOLS_VERSION="9.0"
    SET VCVARS=vcvars64.bat
) ELSE (
    IF %MAJOR_PYTHON_VERSION% == 3 (
        SET WINDOWS_SDK_VERSION="v7.1"

        IF %MINOR_PYTHON_VERSION% LEQ 4 (
            SET WINDOWS_SDK_VERSION="v7.1"
            SET TOOLS_VERSION="10.0"
            SET VCVARS=amd64\vcvars64.bat
        ) ELSE (
            SET WINDOWS_SDK_VERSION="v7.1"
            SET TOOLS_VERSION="14.0"
            SET VCVARS=amd64\vcvars64.bat
        )

        IF EXIST "%WIN_WDK%" (
            :: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/
            REN "%WIN_WDK%" 0wdf
        )
    )
)

SET DISTUTILS_USE_SDK=1
SET MSSdk=1
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%

if %PYTHON_ARCH% == 64 (
    CALL "C:\Program Files (x86)\Microsoft Visual Studio %TOOLS_VERSION%\VC\bin\%VCVARS%" || EXIT 1
    ECHO Executing: %COMMAND_TO_RUN%
    CALL %COMMAND_TO_RUN% || EXIT 1
) ELSE (
    CALL "C:\Program Files (x86)\Microsoft Visual Studio %TOOLS_VERSION%\VC\vcvarsall.bat" x86 || EXIT 1
    ECHO Executing: %COMMAND_TO_RUN%
    CALL %COMMAND_TO_RUN% || EXIT 1
)

adjust msvc version in appveyor

ci: adjust msvc version in appveyor

We now default to 14.0 unless we're compiling for Python <=3.4.


@echo off

setlocal
cd %~dp0..
set Path=C:\Python27;C:\Program Files\Git\cmd;%Path%

call "%VS140COMNTOOLS%\VsDevCmd.bat"

rmdir /s/q build-libpty 2>NUL
mkdir build-libpty\win
mkdir build-libpty\win\x86
mkdir build-libpty\win\x86_64
mkdir build-libpty\win\xp

rmdir /s/q src\Release  2>NUL
rmdir /s/q src\.vs      2>NUL
del src\*.vcxproj src\*.vcxproj.filters src\*.sln src\*.sdf 2>NUL

call vcbuild.bat --msvc-platform Win32 --gyp-msvs-version 2015 --toolset v140_xp || goto :fail
copy src\Release\Win32\winpty.dll           build-libpty\win\xp || goto :fail
copy src\Release\Win32\winpty-agent.exe     build-libpty\win\xp || goto :fail

call vcbuild.bat --msvc-platform Win32 --gyp-msvs-version 2015 || goto :fail
copy src\Release\Win32\winpty.dll           build-libpty\win\x86 || goto :fail
copy src\Release\Win32\winpty-agent.exe     build-libpty\win\x86 || goto :fail

call vcbuild.bat --msvc-platform x64 --gyp-msvs-version 2015 || goto :fail
copy src\Release\x64\winpty.dll             build-libpty\win\x86_64 || goto :fail
copy src\Release\x64\winpty-agent.exe       build-libpty\win\x86_64 || goto :fail

echo success
goto :EOF

:fail
echo error: build failed
exit /b 1

@echo off

setlocal
cd %~dp0..
set Path=C:\Python27;C:\Program Files\Git\cmd;%Path%

call "%VS140COMNTOOLS%\VsDevCmd.bat" || goto :fail

rmdir /s/q build-libpty 2>NUL
mkdir build-libpty\win
mkdir build-libpty\win\x86
mkdir build-libpty\win\x86_64
mkdir build-libpty\win\xp

rmdir /s/q src\Release  2>NUL
rmdir /s/q src\.vs      2>NUL
del src\*.vcxproj src\*.vcxproj.filters src\*.sln src\*.sdf 2>NUL

call vcbuild.bat --msvc-platform Win32 --gyp-msvs-version 2015 --toolset v140_xp || goto :fail
copy src\Release\Win32\winpty.dll           build-libpty\win\xp || goto :fail
copy src\Release\Win32\winpty-agent.exe     build-libpty\win\xp || goto :fail

call vcbuild.bat --msvc-platform Win32 --gyp-msvs-version 2015 || goto :fail
copy src\Release\Win32\winpty.dll           build-libpty\win\x86 || goto :fail
copy src\Release\Win32\winpty-agent.exe     build-libpty\win\x86 || goto :fail

call vcbuild.bat --msvc-platform x64 --gyp-msvs-version 2015 || goto :fail
copy src\Release\x64\winpty.dll             build-libpty\win\x86_64 || goto :fail
copy src\Release\x64\winpty-agent.exe       build-libpty\win\x86_64 || goto :fail

echo success
goto :EOF

:fail
echo error: build failed
exit /b 1

build-pty4j-libpty.bat: abort if VsDevCmd.bat fails (or doesn't exist)


@ECHO OFF
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 %~dp0 is the expanded pathname of the current script under NT
set LOCAL_FOP_HOME=
if "%OS%"=="Windows_NT" set LOCAL_FOP_HOME=%~dp0

rem Code from Apache Ant project
rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).
rem Could also do a "shift" and "%*" for all params, but apparently doesn't work
rem with Win9x.
set FOP_CMD_LINE_ARGS=%1
if ""%1""=="""" goto doneStart
shift
:setupArgs
if ""%1""=="""" goto doneStart
set FOP_CMD_LINE_ARGS=%FOP_CMD_LINE_ARGS% %1
shift
goto setupArgs
rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.
:doneStart

set LOGCHOICE=
rem The default commons logger for JDK1.4 is JDK1.4Logger.
rem To use a different logger, uncomment the one desired below
rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog
rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

set LOGLEVEL=
rem Logging levels
rem Below option is only if you are using SimpleLog instead of the default JDK1.4 Logger.
rem To set logging levels for JDK 1.4 Logger, edit the %JAVA_HOME%\JRE\LIB\logging.properties
rem file instead.
rem Possible SimpleLog values:  "trace", "debug", "info" (default), "warn", "error", or "fatal".
rem set LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=INFO

set LIBDIR=%LOCAL_FOP_HOME%lib

set LOCALCLASSPATH=%LOCAL_FOP_HOME%build\fop.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LOCAL_FOP_HOME%build\fop-sandbox.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LOCAL_FOP_HOME%build\fop-hyph.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis-1.3.02.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl-2.7.1.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.7.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\serializer-2.7.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\batik-all-1.6.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xmlgraphics-commons-1.1.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\avalon-framework-4.2.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-io-1.1.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-logging-1.0.4.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jimi-1.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_core.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_codec.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\fop-hyph.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%FOP_HYPHENATION_PATH%

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if "%JAVACMD%" == "" set JAVACMD=%JAVA_HOME%\bin\java
goto runFop

:noJavaHome
if "%JAVACMD%" == "" set JAVACMD=java

:runFop
rem ECHO "%JAVACMD%"
"%JAVACMD%" %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%

@ECHO OFF
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 %~dp0 is the expanded pathname of the current script under NT
set LOCAL_FOP_HOME=
if "%OS%"=="Windows_NT" set LOCAL_FOP_HOME=%~dp0

rem Code from Apache Ant project
rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).
rem Could also do a "shift" and "%*" for all params, but apparently doesn't work
rem with Win9x.
set FOP_CMD_LINE_ARGS=%1
if ""%1""=="""" goto doneStart
shift
:setupArgs
if ""%1""=="""" goto doneStart
set FOP_CMD_LINE_ARGS=%FOP_CMD_LINE_ARGS% %1
shift
goto setupArgs
rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.
:doneStart

set LOGCHOICE=
rem The default commons logger for JDK1.4 is JDK1.4Logger.
rem To use a different logger, uncomment the one desired below
rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog
rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
rem set LOGCHOICE=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

set LOGLEVEL=
rem Logging levels
rem Below option is only if you are using SimpleLog instead of the default JDK1.4 Logger.
rem To set logging levels for JDK 1.4 Logger, edit the %JAVA_HOME%\JRE\LIB\logging.properties
rem file instead.
rem Possible SimpleLog values:  "trace", "debug", "info" (default), "warn", "error", or "fatal".
rem set LOGLEVEL=-Dorg.apache.commons.logging.simplelog.defaultlog=INFO

set LIBDIR=%LOCAL_FOP_HOME%lib

set LOCALCLASSPATH=%LOCAL_FOP_HOME%build\fop.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LOCAL_FOP_HOME%build\fop-sandbox.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LOCAL_FOP_HOME%build\fop-hyph.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis-1.3.02.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl-2.7.1.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.7.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\serializer-2.7.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\batik-all-1.6.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xmlgraphics-commons-1.2svn.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\avalon-framework-4.2.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-io-1.1.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-logging-1.0.4.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jimi-1.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_core.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_codec.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\fop-hyph.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%FOP_HYPHENATION_PATH%

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if "%JAVACMD%" == "" set JAVACMD=%JAVA_HOME%\bin\java
goto runFop

:noJavaHome
if "%JAVACMD%" == "" set JAVACMD=java

:runFop
rem ECHO "%JAVACMD%"
"%JAVACMD%" %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%

Update fop.bat to use the latest XML Graphics Commons library
Submitted by: Adrian cumiskey (fop-dev AT cumiskey DOT com)

git-svn-id: 102839466c3b40dd9c7e25c0a1a6d26afc40150a@515520 13f79535-47bb-0310-9956-ffa450edef68


@echo off
setlocal EnableExtensions EnableDelayedExpansion

rem ==========================================
rem            PARSE ARGUMENTS
rem ==========================================

set CTAGS_EXE=ctags
set CTAGS_ARGS=
set TAGS_FILE=tags
set PROJECT_ROOT=
set FILE_LIST_CMD=
set FILE_LIST_CMD_IS_ABSOLUTE=0
set UPDATED_SOURCE=
set POST_PROCESS_CMD=
set PAUSE_BEFORE_EXIT=0
set LOG_FILE=

:ParseArgs
if [%1]==[] goto :DoneParseArgs
if [%1]==[-e] (
    set CTAGS_EXE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-x] (
    set CTAGS_ARGS=%CTAGS_ARGS% --exclude=%2
    shift
    goto :LoopParseArgs
)
if [%1]==[-t] (
    set TAGS_FILE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-p] (
    set PROJECT_ROOT=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-L] (
    set FILE_LIST_CMD=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-A] (
    set FILE_LIST_CMD_IS_ABSOLUTE=1
    goto :LoopParseArgs
)
if [%1]==[-s] (
    set UPDATED_SOURCE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-c] (
    set PAUSE_BEFORE_EXIT=1
    goto :LoopParseArgs
)
if [%1]==[-l] (
    set LOG_FILE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-o] (
    set CTAGS_ARGS=%CTAGS_ARGS% --options=%2
    shift
    goto :LoopParseArgs
)
if [%1]==[-O] (
    set CTAGS_ARGS=%CTAGS_ARGS% %~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-P] (
    set POST_PROCESS_CMD=%~2
    shift
    goto :LoopParseArgs
)
echo Invalid Argument: %1
goto :Usage

:LoopParseArgs
shift
goto :ParseArgs

:DoneParseArgs

rem ==========================================
rem               GENERATE TAGS
rem ==========================================

if [%LOG_FILE%]==[] set LOG_FILE=CON

echo Locking tags file... > %LOG_FILE%
echo locked > "%TAGS_FILE%.lock"

set INDEX_WHOLE_PROJECT=1
if exist "%TAGS_FILE%" (
    if not ["%UPDATED_SOURCE%"]==[""] (
        echo Removing references to: %UPDATED_SOURCE% >> %LOG_FILE%
        echo findstr /V /C:"%UPDATED_SOURCE%" "%TAGS_FILE%" ^> "%TAGS_FILE%.temp" >> %LOG_FILE%
        findstr /V /C:"%UPDATED_SOURCE%" "%TAGS_FILE%" > "%TAGS_FILE%.temp"
        set CTAGS_ARGS=%CTAGS_ARGS% --append "%UPDATED_SOURCE%"
        set INDEX_WHOLE_PROJECT=0
    )
)
if ["%INDEX_WHOLE_PROJECT%"]==["1"] (
    set CTAGS_ARGS=%CTAGS_ARGS% "%PROJECT_ROOT%"
    if not ["%FILE_LIST_CMD%"]==[""] (
        echo Running custom file lister >> %LOG_FILE%
        set use_raw_list=0
        if ["%PROJECT_ROOT%"]==["."] set use_raw_list=1
        if ["%FILE_LIST_CMD_IS_ABSOLUTE%"]==["1"] set use_raw_list=1
        rem No idea why we need to use delayed expansion here to make it work :(
        if ["!use_raw_list!"]==["1"] (
            echo call %FILE_LIST_CMD% ^> %TAGS_FILE%.files >> %LOG_FILE%
            call %FILE_LIST_CMD% > %TAGS_FILE%.files
        ) else (
            rem Potentially useful:
            rem http://stackoverflow.com/questions/9749071/cmd-iterate-stdin-piped-from-another-command
            echo call %FILE_LIST_CMD% -- with loop for prepending project root >> %LOG_FILE%
            type NUL > %TAGS_FILE%.files
            for /F "usebackq delims=" %%F in (`%FILE_LIST_CMD%`) do @echo %PROJECT_ROOT%\%%F >> %TAGS_FILE%.files
        )
        set CTAGS_ARGS=%CTAGS_ARGS% -L %TAGS_FILE%.files
    )
)

echo Running ctags >> %LOG_FILE%
echo call "%CTAGS_EXE%" -f "%TAGS_FILE%.temp" %CTAGS_ARGS% >> %LOG_FILE%
call "%CTAGS_EXE%" -f "%TAGS_FILE%.temp" %CTAGS_ARGS% >> %LOG_FILE% 2>&1
if ERRORLEVEL 1 (
    echo ERROR: Ctags executable returned non-zero code. >> %LOG_FILE%
    goto :Unlock
)

if not ["%POST_PROCESS_CMD%"]==[""] (
    echo Running post process >> %LOG_FILE%
    echo call %POST_PROCESS_CMD% %TAGS_FILE%.temp >> %LOG_FILE%
    call %POST_PROCESS_CMD% %TAGS_FILE%.temp >> %LOG_FILE% 2>&1
    if ERRORLEVEL 1 (
        echo ERROR: Post process returned non-zero code. >> %LOG_FILE%
        goto :Unlock
    )
)

echo Replacing tags file >> %LOG_FILE%
echo move /Y "%TAGS_FILE%.temp" "%TAGS_FILE%" >> %LOG_FILE%
move /Y "%TAGS_FILE%.temp" "%TAGS_FILE%" >> %LOG_FILE% 2>&1
if ERRORLEVEL 1 (
    echo ERROR: Unable to rename temp tags file into actual tags file. >> %LOG_FILE%
    goto :Unlock
)

:Unlock
echo Unlocking tags file... >> %LOG_FILE%
del /F "%TAGS_FILE%.files" "%TAGS_FILE%.lock"
if ERRORLEVEL 1 (
    echo ERROR: Unable to remove file lock. >> %LOG_FILE%
)

echo Done. >> %LOG_FILE%
if [%PAUSE_BEFORE_EXIT%]==[1] (
    pause
)

goto :EOF

rem ==========================================
rem                 USAGE
rem ==========================================

:Usage
echo Usage:
echo    %~n0 ^<options^>
echo.
echo    -e [exe=ctags]: The ctags executable to run
echo    -t [file=tags]: The path to the ctags file to update
echo    -p [dir=]:      The path to the project root
echo    -L [cmd=]:      The file list command to run
echo    -A:             Specifies that the file list command returns
echo                    absolute paths
echo    -s [file=]:     The path to the source file that needs updating
echo    -l [log=]:      The log file to output to
echo    -o [options=]:  An options file to read additional options from
echo    -c:             Ask for confirmation before exiting
echo.

@echo off
setlocal EnableExtensions EnableDelayedExpansion

rem ==========================================
rem            PARSE ARGUMENTS
rem ==========================================

set CTAGS_EXE=ctags
set CTAGS_ARGS=
set TAGS_FILE=tags
set PROJECT_ROOT=
set FILE_LIST_CMD=
set FILE_LIST_CMD_IS_ABSOLUTE=0
set UPDATED_SOURCE=
set POST_PROCESS_CMD=
set PAUSE_BEFORE_EXIT=0
set LOG_FILE=

:ParseArgs
if [%1]==[] goto :DoneParseArgs
if [%1]==[-e] (
    set CTAGS_EXE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-x] (
    set CTAGS_ARGS=%CTAGS_ARGS% --exclude=%2
    shift
    goto :LoopParseArgs
)
if [%1]==[-t] (
    set TAGS_FILE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-p] (
    set PROJECT_ROOT=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-L] (
    set FILE_LIST_CMD=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-A] (
    set FILE_LIST_CMD_IS_ABSOLUTE=1
    goto :LoopParseArgs
)
if [%1]==[-s] (
    set UPDATED_SOURCE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-c] (
    set PAUSE_BEFORE_EXIT=1
    goto :LoopParseArgs
)
if [%1]==[-l] (
    set LOG_FILE=%~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-o] (
    set CTAGS_ARGS=%CTAGS_ARGS% --options=%2
    shift
    goto :LoopParseArgs
)
if [%1]==[-O] (
    set CTAGS_ARGS=%CTAGS_ARGS% %~2
    shift
    goto :LoopParseArgs
)
if [%1]==[-P] (
    set POST_PROCESS_CMD=%~2
    shift
    goto :LoopParseArgs
)
echo Invalid Argument: %1
goto :Usage

:LoopParseArgs
shift
goto :ParseArgs

:DoneParseArgs

rem ==========================================
rem               GENERATE TAGS
rem ==========================================

if [%LOG_FILE%]==[] set LOG_FILE=CON

echo Locking tags file... > %LOG_FILE%
echo locked > "%TAGS_FILE%.lock"

set INDEX_WHOLE_PROJECT=1
if exist "%TAGS_FILE%" (
    if not ["%UPDATED_SOURCE%"]==[""] (
        echo Removing references to: %UPDATED_SOURCE% >> %LOG_FILE%
        echo findstr /V /C:"%UPDATED_SOURCE%" "%TAGS_FILE%" ^> "%TAGS_FILE%.temp" >> %LOG_FILE%
        findstr /V /C:"%UPDATED_SOURCE%" "%TAGS_FILE%" > "%TAGS_FILE%.temp"
        set CTAGS_ARGS=%CTAGS_ARGS% --append "%UPDATED_SOURCE%"
        set INDEX_WHOLE_PROJECT=0
    )
)
if ["%INDEX_WHOLE_PROJECT%"]==["1"] (
    if not ["%FILE_LIST_CMD%"]==[""] (
        echo Running custom file lister >> %LOG_FILE%
        set use_raw_list=0
        if ["%PROJECT_ROOT%"]==["."] set use_raw_list=1
        if ["%FILE_LIST_CMD_IS_ABSOLUTE%"]==["1"] set use_raw_list=1
        rem No idea why we need to use delayed expansion here to make it work :(
        if ["!use_raw_list!"]==["1"] (
            echo call %FILE_LIST_CMD% ^> %TAGS_FILE%.files >> %LOG_FILE%
            call %FILE_LIST_CMD% > %TAGS_FILE%.files
        ) else (
            rem Potentially useful:
            rem http://stackoverflow.com/questions/9749071/cmd-iterate-stdin-piped-from-another-command
            echo call %FILE_LIST_CMD% -- with loop for prepending project root >> %LOG_FILE%
            type NUL > %TAGS_FILE%.files
            for /F "usebackq delims=" %%F in (`%FILE_LIST_CMD%`) do @echo %PROJECT_ROOT%\%%F >> %TAGS_FILE%.files
        )
        set CTAGS_ARGS=%CTAGS_ARGS% -L %TAGS_FILE%.files
    ) else (
        set CTAGS_ARGS=%CTAGS_ARGS% "%PROJECT_ROOT%"
    )
)

echo Running ctags >> %LOG_FILE%
echo call "%CTAGS_EXE%" -f "%TAGS_FILE%.temp" %CTAGS_ARGS% >> %LOG_FILE%
call "%CTAGS_EXE%" -f "%TAGS_FILE%.temp" %CTAGS_ARGS% >> %LOG_FILE% 2>&1
if ERRORLEVEL 1 (
    echo ERROR: Ctags executable returned non-zero code. >> %LOG_FILE%
    goto :Unlock
)

if not ["%POST_PROCESS_CMD%"]==[""] (
    echo Running post process >> %LOG_FILE%
    echo call %POST_PROCESS_CMD% %TAGS_FILE%.temp >> %LOG_FILE%
    call %POST_PROCESS_CMD% %TAGS_FILE%.temp >> %LOG_FILE% 2>&1
    if ERRORLEVEL 1 (
        echo ERROR: Post process returned non-zero code. >> %LOG_FILE%
        goto :Unlock
    )
)

echo Replacing tags file >> %LOG_FILE%
echo move /Y "%TAGS_FILE%.temp" "%TAGS_FILE%" >> %LOG_FILE%
move /Y "%TAGS_FILE%.temp" "%TAGS_FILE%" >> %LOG_FILE% 2>&1
if ERRORLEVEL 1 (
    echo ERROR: Unable to rename temp tags file into actual tags file. >> %LOG_FILE%
    goto :Unlock
)

:Unlock
echo Unlocking tags file... >> %LOG_FILE%
del /F "%TAGS_FILE%.files" "%TAGS_FILE%.lock"
if ERRORLEVEL 1 (
    echo ERROR: Unable to remove file lock. >> %LOG_FILE%
)

echo Done. >> %LOG_FILE%
if [%PAUSE_BEFORE_EXIT%]==[1] (
    pause
)

goto :EOF

rem ==========================================
rem                 USAGE
rem ==========================================

:Usage
echo Usage:
echo    %~n0 ^<options^>
echo.
echo    -e [exe=ctags]: The ctags executable to run
echo    -t [file=tags]: The path to the ctags file to update
echo    -p [dir=]:      The path to the project root
echo    -L [cmd=]:      The file list command to run
echo    -A:             Specifies that the file list command returns
echo                    absolute paths
echo    -s [file=]:     The path to the source file that needs updating
echo    -l [log=]:      The log file to output to
echo    -o [options=]:  An options file to read additional options from
echo    -c:             Ask for confirmation before exiting
echo.

Fix gutentags_file_list_command for Windows.


@echo off
rem dennyhalim.com
rem this will be copied after first reboot and then run after next reboot

#replace defaultlayouts before it gets created
move "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml" "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.dennyhalim"
copy /y "%WINDIR%\Setup\Files\DefaultLayouts.xml" "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml"
move "%SystemRoot%\SysWOW64\OneDriveSetup.exe" "%SystemRoot%\SysWOW64\OneDriveSetup.dennyhalim"
move "%SystemRoot%\System32\OneDriveSetup.exe" "%SystemRoot%\System32\OneDriveSetup.dennyhalim"
rem move "%windir%\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy" "%windir%\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy.dennyhalim"
rem startmenu disabled if shellex disabled
rem move "%windir%\SystemApps\ShellExperienceHost_cw5n1h2txyewy" "%windir%\SystemApps\ShellExperienceHost_cw5n1h2txyewy.dennyhalim"

sc.exe config wuauserv start= demand
sc.exe config DiagTrack start= disabled
sc.exe config dmwappushservice start= disabled
sc.exe config RetailDemo start= disabled
sc.exe config lfsvc start= disabled

reg load HKLM\DEFAULT "%Public%\..\default\ntuser.dat"
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People /v PeopleBand /t REG_DWORD /d 0 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_TrackProgs /t REG_DWORD /d 1 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v Enabled /t REG_DWORD /d 0 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Input\TIPC" /v Enabled /t REG_DWORD /d 0 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v GlobalUserDisabled /t REG_DWORD /d 1 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{A8804298-2D5F-42E3-9531-9C8C39EB29CE}" /v Value /d Deny /f
reg delete "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /F
reg unload HKLM\DEFAULT

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v LetAppsRunInBackground /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v AllowTelemetry /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferUpgrade /t REG_DWORD /d 1 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v BranchReadinessLevel /t REG_DWORD /d 32 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdates /t REG_DWORD /d 1 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdatesPeriodinDays /t REG_DWORD /d 365 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowCortana /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" /v WiFiSenseCredShared /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" /v WiFiSenseOpen /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers" /v 1 /t REG_SZ /d pool.ntp.org /f

cscript "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "Canon LBP2900" -i "%WINDIR%\Setup\Files\CanonLBP2900\CNAB4STD.inf"
cscript "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "Canon G2000 series Printer" -i "%WINDIR%\Setup\Files\CanonG2000\Driver\G2000P6.inf"
rem move "%WINDIR%\Setup\Drivers\*" "%WINDIR%\INF"

schtasks /change /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Application Experience\ProgramDataUpdater" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /DISABLE

"%WINDIR%\Setup\Files\chocolatey.exe" /S
"%WINDIR%\Setup\Files\Firefox Setup 52.6.0esr.exe" -ms
"%WINDIR%\Setup\Files\vlc-3.0.1-win64.exe" /L=1033 /S
"%WINDIR%\Setup\Files\SumatraPDF-3.1.2-64-install.exe" /S
Msiexec /q /I "%WINDIR%\Setup\Files\7z1801-x64.msi"
Msiexec /q /I "%WINDIR%\Setup\Files\GoogleChromeStandaloneEnterprise64.msi"
Msiexec /q /I "%WINDIR%\Setup\Files\LibreOffice_5.4.6_Win_x64.msi"
rem "%WINDIR%\Setup\Files\avira_pc_cleaner_en.exe" /s
"%WINDIR%\Setup\Files\mb3-setup-consumer-3.4.5.2467-1.0.342-1.0.4664.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
"%WINDIR%\Setup\Files\avast_business_antivirus_managed_setup_offline_silent.exe"

mkdir "%Public%\Desktop.dennyhalim"
move "%Public%\Desktop\*.*" "%Public%\Desktop.dennyhalim"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%WINDIR%\Setup\Files\setup.ps1'"

rem "%WINDIR%\Setup-githubbox.exe"

@echo off
rem dennyhalim.com
rem this will be copied after first reboot and then run after next reboot

#replace defaultlayouts before it gets created
move "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml" "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.dennyhalim"
copy /y "%WINDIR%\Setup\Files\DefaultLayouts.xml" "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml"
move "%SystemRoot%\SysWOW64\OneDriveSetup.exe" "%SystemRoot%\SysWOW64\OneDriveSetup.dennyhalim"
move "%SystemRoot%\System32\OneDriveSetup.exe" "%SystemRoot%\System32\OneDriveSetup.dennyhalim"
rem move "%windir%\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy" "%windir%\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy.dennyhalim"
rem startmenu disabled if shellex disabled
rem move "%windir%\SystemApps\ShellExperienceHost_cw5n1h2txyewy" "%windir%\SystemApps\ShellExperienceHost_cw5n1h2txyewy.dennyhalim"

sc.exe config wuauserv start= demand
sc.exe config DiagTrack start= disabled
sc.exe config dmwappushservice start= disabled
sc.exe config RetailDemo start= disabled
sc.exe config lfsvc start= disabled

reg load HKLM\DEFAULT "%Public%\..\default\ntuser.dat"
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People /v PeopleBand /t REG_DWORD /d 0 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_TrackProgs /t REG_DWORD /d 1 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v Enabled /t REG_DWORD /d 0 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Input\TIPC" /v Enabled /t REG_DWORD /d 0 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v GlobalUserDisabled /t REG_DWORD /d 1 /f
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{A8804298-2D5F-42E3-9531-9C8C39EB29CE}" /v Value /d Deny /f
reg delete "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /F
reg unload HKLM\DEFAULT

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v LetAppsRunInBackground /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v AllowTelemetry /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferUpgrade /t REG_DWORD /d 1 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v BranchReadinessLevel /t REG_DWORD /d 32 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdates /t REG_DWORD /d 1 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdatesPeriodinDays /t REG_DWORD /d 365 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowCortana /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" /v WiFiSenseCredShared /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" /v WiFiSenseOpen /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers" /v 1 /t REG_SZ /d pool.ntp.org /f

cscript "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "Canon LBP2900" -i "%WINDIR%\Setup\Drivers\CanonLBP2900\CNAB4STD.inf"
cscript "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "Canon G2000 series Printer" -i "%WINDIR%\Setup\Drivers\CanonG2000\Driver\G2000P6.inf"
rem move "%WINDIR%\Setup\Drivers\*" "%WINDIR%\INF"

schtasks /change /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Application Experience\ProgramDataUpdater" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /DISABLE
schtasks /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /DISABLE

"%WINDIR%\Setup\Files\chocolatey.exe" /S
"%WINDIR%\Setup\Files\Firefox Setup 52.6.0esr.exe" -ms
"%WINDIR%\Setup\Files\vlc-3.0.1-win64.exe" /L=1033 /S
"%WINDIR%\Setup\Files\SumatraPDF-3.1.2-64-install.exe" /S
Msiexec /q /I "%WINDIR%\Setup\Files\7z1801-x64.msi"
Msiexec /q /I "%WINDIR%\Setup\Files\GoogleChromeStandaloneEnterprise64.msi"
Msiexec /q /I "%WINDIR%\Setup\Files\LibreOffice_5.4.6_Win_x64.msi"
rem "%WINDIR%\Setup\Files\avira_pc_cleaner_en.exe" /s
"%WINDIR%\Setup\Files\mb3-setup-consumer-3.4.5.2467-1.0.342-1.0.4664.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
"%WINDIR%\Setup\Files\avast_business_antivirus_managed_setup_offline_silent.exe"

mkdir "%Public%\Desktop.dennyhalim"
move "%Public%\Desktop\*.*" "%Public%\Desktop.dennyhalim"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%WINDIR%\Setup\Files\setup.ps1'"

rem "%WINDIR%\Setup-githubbox.exe"

Update SetupComplete.cmd

Update SetupComplete.cmd


:: A one-shot, first-time Windows configuration script that disables some
:: Windows misfeatures and sets paths to my usual preferences. I wish this
:: script could do more, especially to disable Windows' built-in adware and
:: spyware, but following Microsoft's usual mediocrity, Windows remains a
:: toy operating system with most configuration inaccessible to scripts.

:: Annoyances
set key="HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
reg add "%key%" /f /v TaskbarGlomLevel         /t REG_DWORD /d 2
reg add "%key%" /f /v HideFileExt              /t REG_DWORD /d 0
reg add "%key%" /f /v ShowCortanaButton        /t REG_DWORD /d 0
reg add "%key%" /f /v ShowTaskViewButton       /t REG_DWORD /d 0
reg add "%key%" /f /v StoreAppsOnTaskbar       /t REG_DWORD /d 0
reg add "%key%" /f /v MultiTaskingAltTabFilter /t REG_DWORD /d 3
reg add "%key%" /f /v JointResize              /t REG_DWORD /d 0
reg add "%key%" /f /v SnapFill                 /t REG_DWORD /d 0
reg add "%key%" /f /v SnapAssist               /t REG_DWORD /d 0
set key="HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds"
reg add "%key%" /f /v ShellFeedsTaskbarViewMode /t REG_DWORD /d 2

:: Paths
setx GOBIN "%USERPROFILE%\bin"
setx GOPATH "%TEMP%\go"
setx PATH "%PATH%;%USERPROFILE%\bin;%USERPROFILE%\go\bin"

:: Reload
taskkill /f /im explorer.exe
start explorer.exe

Add a one-shot, first-time Windows setup script

Microsoft may be the king of garbage, but at least I can automate
cleaning up some of the stink.


REM To build extensions for 64 bit Python 3, we need to configure environment
REM variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
REM MS Windows SDK for Windows 7 and .NET Framework 4
REM
REM More details at:
REM https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows

@ECHO OFF
setlocal EnableDelayedExpansion
SET PYTHONHOME=
SET PYTHONPATH=

SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
ECHO Major Python version is %MAJOR_PYTHON_VERSION%
IF %MAJOR_PYTHON_VERSION% == "2" (
    SET WINDOWS_SDK_VERSION=v7.0
) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
    SET WINDOWS_SDK_VERSION=v7.1
) ELSE (
    ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
    EXIT 1
)

IF "%PLATFORM%"=="x64" (
    ECHO Configuring environment to build with MSVC on a 64bit architecture
    ECHO Using Windows SDK %WINDOWS_SDK_VERSION%
    ECHO "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /Release /x64
    CMD /E:ON /V:ON /C "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /Release /x64
    ECHO Windows SDK enabled.
    SET DISTUTILS_USE_SDK=1
    SET MSSdk=1
    REM Alias the x64 miniconda file
    SET MINICONDA=Miniconda-3.6.0-Windows-x86_64.exe
) ELSE (
    ECHO Using Windows SDK %WINDOWS_SDK_VERSION%
    CALL "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x86 /release
    REM Alias the x86 miniconda file
    SET MINICONDA=Miniconda-3.6.0-Windows-x86.exe
    REM TODO Ask continuum to use a "latest" URL for the most recent miniconda
)

REM Download the miniconda distribution using the system python 2.7
IF NOT EXIST %MINICONDA% (
    ECHO "Downloading %MINICONDA%..."
    python.exe appveyor/dlfile.py http://repo.continuum.io/miniconda/%MINICONDA%
    ECHO "Done."
)
REM Perform a silent install of miniconda
ECHO Perform a silent install of miniconda
%MINICONDA% /InstallationType=AllUsers /S /AddToPath=1 /RegisterPython=0 /D=%PYDIR%
ECHO "Done."
ECHO
ECHO Path:
ECHO %PATH%
REM Alias conda
SET PATH=%PYDIR%;%PYDIR%\Scripts;%PATH%
SET PYTHONHOME=%PYDIR%
SET PYTHONPATH=%PYDIR%\Lib
SET CONDACMD=%PYDIR%\Scripts\conda.exe
REM Create required conda env
ECHO Create required conda env
%CONDACMD% create --quiet --yes -f -n testenv python=%PYTHON_VERSION% numpy cython pip py pytest setuptools
ECHO "Done."
IF "%PYTHON_VERSION%"== "2.6" (
    %CONDACMD% install --quiet --yes -f -p %PYDIR%\envs\testenv argparse py
)

REM To build extensions for 64 bit Python 3, we need to configure environment
REM variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
REM MS Windows SDK for Windows 7 and .NET Framework 4
REM
REM More details at:
REM https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows

@ECHO OFF
setlocal EnableDelayedExpansion
SET PYTHONHOME=
SET PYTHONPATH=

SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
ECHO Major Python version is %MAJOR_PYTHON_VERSION%
IF %MAJOR_PYTHON_VERSION% == "2" (
    SET WINDOWS_SDK_VERSION=v7.0
) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
    SET WINDOWS_SDK_VERSION=v7.1
) ELSE (
    ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
    EXIT 1
)

IF "%PLATFORM%"=="x64" (
    ECHO Configuring environment to build with MSVC on a 64bit architecture
    ECHO Using Windows SDK %WINDOWS_SDK_VERSION%
    ECHO "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /Release /x64
    CALL "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /Release /x64
    ECHO Windows SDK enabled.
    SET DISTUTILS_USE_SDK=1
    SET MSSdk=1
    REM Alias the x64 miniconda file
    SET MINICONDA=Miniconda-3.6.0-Windows-x86_64.exe
) ELSE (
    ECHO Using Windows SDK %WINDOWS_SDK_VERSION%
    CALL "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /Release /x86
    REM Alias the x86 miniconda file
    SET MINICONDA=Miniconda-3.6.0-Windows-x86.exe
    REM TODO Ask continuum to use a "latest" URL for the most recent miniconda
)

REM Download the miniconda distribution using the system python 2.7
IF NOT EXIST %MINICONDA% (
    ECHO "Downloading %MINICONDA%..."
    python.exe appveyor/dlfile.py http://repo.continuum.io/miniconda/%MINICONDA%
    ECHO "Done."
)
REM Perform a silent install of miniconda
ECHO Perform a silent install of miniconda
%MINICONDA% /InstallationType=AllUsers /S /AddToPath=1 /RegisterPython=0 /D=%PYDIR%
ECHO "Done."
ECHO
ECHO Path:
ECHO %PATH%
REM Alias conda
SET PATH=%PYDIR%;%PYDIR%\Scripts;%PATH%
SET PYTHONHOME=%PYDIR%
SET PYTHONPATH=%PYDIR%\Lib
SET CONDACMD=%PYDIR%\Scripts\conda.exe
REM Create required conda env
ECHO Create required conda env
%CONDACMD% create --quiet --yes -f -n testenv python=%PYTHON_VERSION% numpy cython pip py pytest setuptools
ECHO "Done."
IF "%PYTHON_VERSION%"== "2.6" (
    %CONDACMD% install --quiet --yes -f -p %PYDIR%\envs\testenv argparse py
)

CALL works, as long as the SetDelayedExpansion flag is on.


echo on
cd /d "%~dp0"

xcopy "%1" ..\..\OSVR-Unity\Assets\Plugins\%3\ /Y
xcopy "%2osvr*.dll" ..\..\OSVR-Unity\Assets\Plugins\%3\ /Y
xcopy "%2msvc*.dll" ..\..\OSVR-Unity\Assets\Plugins\%3\ /Y

Copy the redist files with the Managed-OSVR wrapper.


call mvn dependency:get -DrepoUrl=https://oss.sonatype.org/content/repositories/snapshots -Dartifact=com.hazelcast:hazelcast:3.4-SNAPSHOT -Ddest=hazelcast.jar
start "hazelcast" java -cp hazelcast.jar -Dhazelcast.config=script\hazelcast.xml com.hazelcast.core.server.StartServer
ping -n 10 127.0.0.1 >nul
nunit-console /xml:"console-text.xml" "Hazelcast.Test/Hazelcast.Test.nunit"
ping -n 10 127.0.0.1 >nul
taskkill /F /FI "WINDOWTITLE eq hazelcast"

call mvn dependency:get -DrepoUrl=https://oss.sonatype.org/content/repositories/snapshots -Dartifact=com.hazelcast:hazelcast:3.4.1-SNAPSHOT -Ddest=hazelcast.jar
start "hazelcast" java -cp hazelcast.jar -Dhazelcast.config=script\hazelcast.xml com.hazelcast.core.server.StartServer
ping -n 10 127.0.0.1 >nul
nunit-console /xml:"console-text.xml" "Hazelcast.Test/Hazelcast.Test.nunit"
ping -n 10 127.0.0.1 >nul
taskkill /F /FI "WINDOWTITLE eq hazelcast"

Update csharp.bat

Update csharp.bat


@echo off
REM $Id: phd.bat,v 1.3 2008-12-02 21:27:09 kalle Exp $

@"@php_bin@" "@bin_dir@\build.php" %*

Add missing @echo off

Add missing @echo off


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

:: Pigweed Windows environment setup.

:: Calls a Powershell script that determines the correct PW_ROOT directory and
:: exports it as an environment variable.
for /F "usebackq tokens=1" %%i in (`powershell %%~dp0..\..\pw_env_setup\env_setup.ps1`) do set PW_ROOT=%%i

set shell_file="%PW_ROOT%\pw_env_setup\.env_setup.bat"

if not exist %shell_file% (
  call python %PW_ROOT%\pw_env_setup\py\pw_env_setup\env_setup.py --pw-root %PW_ROOT% --shell-file %shell_file%
)

call %shell_file%

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

:: Pigweed Windows environment setup.

:: Calls a Powershell script that determines the correct PW_ROOT directory and
:: exports it as an environment variable.
:: LUCI DELETE BEGIN
:: The ~dp0 magic doesn't work when this batch script is launched from another
:: batch script. So when testing on Windows we write a copy of this batch
:: script that assumes PW_ROOT is already set. Then the batch script we run
:: directly sets PW_ROOT, calls the copy of this batch script and runs
:: 'pw presubmit'.
for /F "usebackq tokens=1" %%i in (`powershell %%~dp0..\..\pw_env_setup\env_setup.ps1`) do set PW_ROOT=%%i
:: LUCI DELETE END

set shell_file="%PW_ROOT%\pw_env_setup\.env_setup.bat"

if not exist %shell_file% (
  call python %PW_ROOT%\pw_env_setup\py\pw_env_setup\env_setup.py --pw-root %PW_ROOT% --shell-file %shell_file%
)

call %shell_file%

Add markers for recipe env testing

Add markers for recipe env testing

Bug: 92
Change-Id: I57dfcde96d8b5942a2624d5e5a88f177b304e6bd


@echo off

scoop update
choco upgrade all

@echo off

sudo choco upgrade all
scoop update

Change order and call sudo choco upgrade


@echo off

SETLOCAL

SET EXEC=%~0
SET ISSUE=%1

REM split exec into parts
For %%F IN ("%EXEC%") do (
	Set FOLDER=%%~dpF
	Set NAME=%%~nxF
)

REM test if we have an issue nr
if [%1] == [] GOTO :NoIssue
SET SPECS=%FOLDER%..\sass-spec\spec

if not exist "%ISSUE%.scss" (
	echo input source not found: %ISSUE%.scss
	goto :End
)

SET GITCMD=git -C "%FOLDER%..\sass-spec"

%GITCMD% fetch --all
%GITCMD% checkout -f -B todo/issue_%ISSUE% master

if exist "%SPECS%\libsass-closed-issues\issue_%ISSUE%" GOTO :IsClosed

if not exist "%SPECS%\libsass-todo-issues\issue_%ISSUE%" (
	mkdir "%SPECS%\libsass-todo-issues\issue_%ISSUE%"
)

copy %ISSUE%.scss %SPECS%\libsass-todo-issues\issue_%ISSUE%\input.scss
REM not sure why this is needed, but sass-spec did not create it otherwise
copy %ISSUE%.scss %SPECS%\libsass-todo-issues\issue_%ISSUE%\expected_output.css

ruby %SPECS%\..\sass-spec.rb -g --run-todo --no-cache --root "%SPECS%\libsass-todo-issues\issue_%ISSUE%"

%GITCMD% add %SPECS%\libsass-todo-issues\issue_%ISSUE%\*
%GITCMD% commit -m "Add todo spec test for libsass issue %ISSUE%" ^
	-m "" -m "https://github.com/sass/libsass/issues/%ISSUE%"

echo You may push the branch to your reote repository now
if [%2] == [] GOTO :End
echo Going to push to remote %2
%GITCMD% push %2 todo/issue_%ISSUE%

GOTO :End

:IsClosed

echo Issue seems to be closed already

:NoIssue

echo Please pass an issue number

GOTO :End

:End

@echo off

SETLOCAL

SET EXEC=%~0
SET ISSUE=%1

REM split exec into parts
For %%F IN ("%EXEC%") do (
	Set FOLDER=%%~dpF
	Set NAME=%%~nxF
)

REM test if we have an issue nr
if [%1] == [] GOTO :NoIssue
SET SPECS=%FOLDER%..\sass-spec\spec

if not exist "%ISSUE%.scss" (
	echo input source not found: %ISSUE%.scss
	goto :End
)

SET GITCMD=git -C "%FOLDER%..\sass-spec"

%GITCMD% fetch --all
%GITCMD% checkout -f -B todo/issue_%ISSUE% master

if exist "%SPECS%\libsass-closed-issues\issue_%ISSUE%" GOTO :IsClosed

if not exist "%SPECS%\libsass-todo-issues\issue_%ISSUE%" (
	mkdir "%SPECS%\libsass-todo-issues\issue_%ISSUE%"
)

copy %ISSUE%.scss %SPECS%\libsass-todo-issues\issue_%ISSUE%\input.scss
REM not sure why this is needed, but sass-spec did not create it otherwise
copy %ISSUE%.scss %SPECS%\libsass-todo-issues\issue_%ISSUE%\expected_output.css

ruby %SPECS%\..\sass-spec.rb -g --run-todo --root "%SPECS%\libsass-todo-issues\issue_%ISSUE%"

%GITCMD% add %SPECS%\libsass-todo-issues\issue_%ISSUE%\*
%GITCMD% commit -m "Add todo spec test for libsass issue %ISSUE%" ^
	-m "" -m "https://github.com/sass/libsass/issues/%ISSUE%"

echo You may push the branch to your reote repository now
if [%2] == [] GOTO :End
echo Going to push to remote %2
%GITCMD% push %2 todo/issue_%ISSUE%

GOTO :End

:IsClosed

echo Issue seems to be closed already

:NoIssue

echo Please pass an issue number

GOTO :End

:End

Remove wrongly placed command line option


echo off
REM
REM This Windows batch file builds this repository for the following targets:
REM 64/32-bit Release/Debug
REM It uses CMake to genererate the project files and then invokes msbuild
REM to build them.
REM The update_external_sources.bat batch file must be executed before running
REM this batch file
REM
REM Arguments:
REM None: Runs CMake and builds all 4 combinations
REM Argument contains:
REM     cmake (case insensitive): Deletes build and build32 and runs just CMake on both
REM     32: Deletes build32, runs CMake and builds 32-bit versions
REM     64: Deletes build, runs CMake and builds 64-bit versions
REM Example:
REM build_windows_targets.bat 64
REM deletes build, creates build, runs CMake and compiles 64-bit Debug and Release.

set do_cmake=0
set do_32=1
set do_64=1
if "%1"=="" goto no_args
set do_cmake=0
set do_32=0
set do_64=0
for %%a in (%*) do (
    echo.%%a | %WINDIR%\system32\find.exe /I "cmake">Nul && (set do_cmake=1)
    echo.%%a | %WINDIR%\system32\find.exe "32">Nul && (set do_32=1)
    echo.%%a | %WINDIR%\system32\find.exe "64">Nul && (set do_64=1)
)
:no_args
if %do_cmake%==0 (
    if %do_32%==0 (
        if %do_64%==0 (
            echo No valid parameters specified.
            exit /B 1
        )
    )
)

REM Determine the appropriate CMake strings for the current version of Visual Studio
echo Determining VS version
python .\determine_vs_version.py > vsversion.tmp
set /p VS_VERSION=< vsversion.tmp
echo Detected Visual Studio Version as %VS_VERSION%
del /Q /F vsversion.tmp

if %do_cmake%==1 (
    if %do_64%==1 (
        rmdir /Q /S build
        mkdir build
        pushd build
        echo Generating 64-bit CMake files for Visual Studio %VS_VERSION%
        cmake -G "Visual Studio %VS_VERSION% Win64" ..
        popd
    )
    if %do_32%==1 (
        rmdir /Q /S build32
        mkdir build32
        pushd build32
        echo Generating 32-bit CMake files for Visual Studio %VS_VERSION%
        cmake -G "Visual Studio %VS_VERSION%" ..
        popd
    )
)

REM *******************************************
REM 64-bit build
REM *******************************************
if %do_64%==1 (
    pushd build

    echo Building 64-bit Debug
    REM msbuild doesn't seem to see the dependency between the Overlay sample and layer_utils
    pushd layers
    msbuild generate_vk_layer_helpers.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet
    msbuild VkLayer_utils.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet
    popd
    msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet
    if errorlevel 1 (
       echo.
       echo 64-bit Debug build failed!
       popd
       exit /B 1
    )

    echo Building 64-bit Release
    REM msbuild doesn't seem to see the dependency between the Overlay sample and layer_utils
    pushd layers
    msbuild generate_vk_layer_helpers.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet
    msbuild VkLayer_utils.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet
    popd
    msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet
    if errorlevel 1 (
       echo.
       echo 64-bit Release build failed!
       popd
       exit /B 1
    )

    popd
)

REM *******************************************
REM 32-bit build
REM *******************************************
if %do_32%==1 (
    pushd build32

    echo Building 32-bit Debug
    REM msbuild doesn't seem to see the dependency between the Overlay sample and layer_utils
    pushd layers
    msbuild generate_vk_layer_helpers.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet
    msbuild VkLayer_utils.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet
    popd
    msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet
    if errorlevel 1 (
       echo.
       echo 32-bit Debug build failed!
       popd
       exit /B 1
    )

    echo Building 32-bit Release
    REM msbuild doesn't seem to see the dependency between the Overlay sample and layer_utils
    pushd layers
    msbuild generate_vk_layer_helpers.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet
    msbuild VkLayer_utils.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet
    popd
    msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet
    if errorlevel 1 (
       echo.
       echo 32-bit Release build failed!
       popd
       exit /B 1
    )

    popd
)

exit /b 0

echo off
REM
REM This Windows batch file builds this repository for the following targets:
REM 64/32-bit Release/Debug
REM It uses CMake to genererate the project files and then invokes msbuild
REM to build them.
REM The update_external_sources.bat batch file must be executed before running
REM this batch file
REM
REM Arguments:
REM None: Runs CMake and builds all 4 combinations
REM Argument contains:
REM     cmake (case insensitive): Deletes build and build32 and runs just CMake on both
REM     32: Deletes build32, runs CMake and builds 32-bit versions
REM     64: Deletes build, runs CMake and builds 64-bit versions
REM Example:
REM build_windows_targets.bat 64
REM deletes build, creates build, runs CMake and compiles 64-bit Debug and Release.

set do_cmake=1
set do_32=1
set do_64=1
if "%1"=="" goto no_args
set do_cmake=0
set do_32=0
set do_64=0
for %%a in (%*) do (
    echo.%%a | %WINDIR%\system32\find.exe /I "cmake">Nul && (set do_cmake=1)
    echo.%%a | %WINDIR%\system32\find.exe "32">Nul && (set do_32=1)
    echo.%%a | %WINDIR%\system32\find.exe "64">Nul && (set do_64=1)
)
:no_args
if %do_cmake%==0 (
    if %do_32%==0 (
        if %do_64%==0 (
            echo No valid parameters specified.
            exit /B 1
        )
    )
)

REM Determine the appropriate CMake strings for the current version of Visual Studio
echo Determining VS version
python .\determine_vs_version.py > vsversion.tmp
set /p VS_VERSION=< vsversion.tmp
echo Detected Visual Studio Version as %VS_VERSION%
del /Q /F vsversion.tmp

if %do_cmake%==1 (
    if %do_64%==1 (
        rmdir /Q /S build
        mkdir build
        pushd build
        echo Generating 64-bit CMake files for Visual Studio %VS_VERSION%
        cmake -G "Visual Studio %VS_VERSION% Win64" ..
        popd
    )
    if %do_32%==1 (
        rmdir /Q /S build32
        mkdir build32
        pushd build32
        echo Generating 32-bit CMake files for Visual Studio %VS_VERSION%
        cmake -G "Visual Studio %VS_VERSION%" ..
        popd
    )
)

REM *******************************************
REM 64-bit build
REM *******************************************
if %do_64%==1 (
    pushd build

    echo Building 64-bit Debug
    REM msbuild doesn't seem to see the dependency between the Overlay sample and layer_utils
    pushd layers
    msbuild generate_vk_layer_helpers.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet
    msbuild VkLayer_utils.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet
    popd
    msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet
    if errorlevel 1 (
       echo.
       echo 64-bit Debug build failed!
       popd
       exit /B 1
    )

    echo Building 64-bit Release
    REM msbuild doesn't seem to see the dependency between the Overlay sample and layer_utils
    pushd layers
    msbuild generate_vk_layer_helpers.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet
    msbuild VkLayer_utils.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet
    popd
    msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet
    if errorlevel 1 (
       echo.
       echo 64-bit Release build failed!
       popd
       exit /B 1
    )

    popd
)

REM *******************************************
REM 32-bit build
REM *******************************************
if %do_32%==1 (
    pushd build32

    echo Building 32-bit Debug
    REM msbuild doesn't seem to see the dependency between the Overlay sample and layer_utils
    pushd layers
    msbuild generate_vk_layer_helpers.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet
    msbuild VkLayer_utils.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet
    popd
    msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet
    if errorlevel 1 (
       echo.
       echo 32-bit Debug build failed!
       popd
       exit /B 1
    )

    echo Building 32-bit Release
    REM msbuild doesn't seem to see the dependency between the Overlay sample and layer_utils
    pushd layers
    msbuild generate_vk_layer_helpers.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet
    msbuild VkLayer_utils.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet
    popd
    msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet
    if errorlevel 1 (
       echo.
       echo 32-bit Release build failed!
       popd
       exit /B 1
    )

    popd
)

exit /b 0

Samples: Set cmake on by default in build_windows_targets

Change-Id: I16764636a0ae312d4f039fbad4b7ca6b72e28e86