@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 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 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

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"

"%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 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"

"%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


PUSHD "%~dp0"
call collectTrace.bat viostor "{194051B2-14C7-4987-A0E9-154377C58882}"
POPD

PUSHD "%~dp0"
call collectTrace.bat vioscsi "{194051B2-14C7-4987-A0E9-154377C58882}"
POPD

fix typo in vioscsi trace batch file

fix typo in vioscsi trace batch file


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

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

set GOBUILDFAIL=0

:: we disallow local import for non-local packages, if %GOROOT% happens
:: to be under %GOPATH%, then some tests below will fail
set GOPATH=

rem TODO avoid rebuild if possible

if x%1==x--no-rebuild goto norebuild
echo # Building packages and commands.
go install -a -v std
if errorlevel 1 goto fail
echo.
:norebuild

:: we must unset GOROOT_FINAL before tests, because runtime/debug requires
:: correct access to source code, so if we have GOROOT_FINAL in effect,
:: at least runtime/debug test will fail.
set GOROOT_FINAL=

:: get CGO_ENABLED
go env > env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

echo # Testing packages.
go test std -short -timeout=120s
if errorlevel 1 goto fail
echo.

echo # runtime -cpu=1,2,4
go test runtime -short -timeout=120s -cpu=1,2,4
if errorlevel 1 goto fail
echo.

echo # sync -cpu=10
go test sync -short -timeout=120s -cpu=10
if errorlevel 1 goto fail
echo.

echo # ..\misc\dashboard\builder ..\misc\goplay
go build ..\misc\dashboard\builder ..\misc\goplay
if errorlevel 1 goto fail
echo.

echo # ..\test\bench\go1
go test ..\test\bench\go1
if errorlevel 1 goto fail
echo.

:: cgo tests
if x%CGO_ENABLED% == x0 goto nocgo
echo # ..\misc\cgo\life
go run %GOROOT%\test\run.go - ..\misc\cgo\life
if errorlevel 1 goto fail
echo.

echo # ..\misc\cgo\stdio
go run %GOROOT%\test\run.go - ..\misc\cgo\stdio
if errorlevel 1 goto fail
echo.

echo # ..\misc\cgo\test
go test ..\misc\cgo\test
if errorlevel 1 goto fail
echo.
:nocgo

echo # ..\doc\progs
go run %GOROOT%\test\run.go - ..\doc\progs
if errorlevel 1 goto fail
echo.

:: TODO: The other tests in run.bash.

echo # test
cd ..\test
set FAIL=0
go run run.go
if errorlevel 1 set FAIL=1
cd ..\src
echo.
if %FAIL%==1 goto fail

echo # Checking API compatibility.
go tool api -c ..\api\go1.txt -next ..\api\next.txt -except ..\api\except.txt
if errorlevel 1 goto fail
echo.

echo ALL TESTS PASSED
goto end

:fail
set GOBUILDFAIL=1

:end

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

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

set GOBUILDFAIL=0

:: we disallow local import for non-local packages, if %GOROOT% happens
:: to be under %GOPATH%, then some tests below will fail
set GOPATH=

rem TODO avoid rebuild if possible

if x%1==x--no-rebuild goto norebuild
echo # Building packages and commands.
go install -a -v std
if errorlevel 1 goto fail
echo.
:norebuild

:: we must unset GOROOT_FINAL before tests, because runtime/debug requires
:: correct access to source code, so if we have GOROOT_FINAL in effect,
:: at least runtime/debug test will fail.
set GOROOT_FINAL=

:: get CGO_ENABLED
go env > env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

echo # Testing packages.
go test std -short -timeout=120s
if errorlevel 1 goto fail
echo.

echo # runtime -cpu=1,2,4
go test runtime -short -timeout=120s -cpu=1,2,4
if errorlevel 1 goto fail
echo.

echo # sync -cpu=10
go test sync -short -timeout=120s -cpu=10
if errorlevel 1 goto fail
echo.

echo # ..\misc\dashboard\builder ..\misc\goplay
go build ..\misc\dashboard\builder ..\misc\goplay
if errorlevel 1 goto fail
echo.

echo # ..\test\bench\go1
go test ..\test\bench\go1
if errorlevel 1 goto fail
echo.

:: cgo tests
if x%CGO_ENABLED% == x0 goto nocgo
echo # ..\misc\cgo\life
go run %GOROOT%\test\run.go - ..\misc\cgo\life
if errorlevel 1 goto fail
echo.

echo # ..\misc\cgo\stdio
go run %GOROOT%\test\run.go - ..\misc\cgo\stdio
if errorlevel 1 goto fail
echo.

echo # ..\misc\cgo\test
go test ..\misc\cgo\test
if errorlevel 1 goto fail
echo.
:nocgo

echo # ..\doc\progs
go run %GOROOT%\test\run.go - ..\doc\progs
if errorlevel 1 goto fail
echo.

:: TODO: The other tests in run.bash.

echo # ..\test
cd ..\test
set FAIL=0
go run run.go
if errorlevel 1 set FAIL=1
cd ..\src
echo.
if %FAIL%==1 goto fail

echo # Checking API compatibility.
go tool api -c ..\api\go1.txt -next ..\api\next.txt -except ..\api\except.txt
if errorlevel 1 goto fail
echo.

echo ALL TESTS PASSED
goto end

:fail
set GOBUILDFAIL=1

:end

make output consistent

run.bat: make output consistent

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6811059


@ECHO OFF
SETLOCAL
SET EL=0

ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SET PATH=%CD%;%PATH%
SET msvs_version=2013
IF /I "%msvs_toolset%"=="14" SET msvs_version=2015

IF /I "%platform%"=="x64" SET PATH=C:\Python27-x64;%PATH%

::make commit message env var shorter
::SET CM="%APPVEYOR_REPO_COMMIT_MESSAGE%"

for /F "tokens=1 usebackq" %%i in (`powershell .\scripts\parse-commit-message.ps1`) DO ECHO %%i && set PUBLISH=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF %PUBLISH% EQU 1 SET ENABLE_LOGGING=--enable-logging=true
SET "IS_PR="&FOR /f "delims=0123456789" %%i IN ("%APPVEYOR_PULL_REQUEST_NUMBER%") DO SET IS_PR=%%i

ECHO APPVEYOR^: %APPVEYOR%
ECHO commit message^: %APPVEYOR_REPO_COMMIT_MESSAGE%
ECHO pull request^: %APPVEYOR_PULL_REQUEST_NUMBER%
ECHO branch^: %APPVEYOR_REPO_BRANCH%
ECHO IS_PR^: %IS_PR%
ECHO PUBLISH^: %PUBLISH%
ECHO ENABLE_LOGGING^: %ENABLE_LOGGING%

ECHO nodejs_version^: %nodejs_version%
ECHO platform^: %platform%
ECHO msvs_toolset^: %msvs_toolset%
ECHO msvs_version^: %msvs_version%
ECHO TOOLSET_ARGS^: %TOOLSET_ARGS%

ECHO activating VS command prompt
IF /I "%platform%"=="x64" ECHO x64 && CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" amd64
IF /I "%platform%"=="x86" ECHO x86 && CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" x86
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO using compiler^: && cl
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO using MSBuild^: && msbuild /version && ECHO.
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::activating VS command prompt seems to uppercase PLATFORM, but only for x64 not x86
::with X64 AppVeyor cannot install node
ECHO platform^: %platform%
IF /I "%PLATFORM%"=="x64" ECHO lowercasing platform && SET PLATFORM=x64
ECHO platform^: %platform%

ECHO downloading/installing node
::only use Install-Product when using VS2013
::IF /I "%APPVEYOR%"=="True" IF /I "%msvs_toolset%"=="12" powershell Install-Product node $env:nodejs_version $env:Platform
::TESTING:
::always install (get npm matching node), but delete installed programfiles node.exe afterwards for VS2015 (using custom node.exe)
IF /I "%APPVEYOR%"=="True" IF /I NOT "%nodejs_version%"=="3.3.1" powershell Install-Product node $env:nodejs_version $env:Platform
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::Skip downloads from mapbox for VS2013
IF /I "%msvs_toolset%"=="12" ECHO VS2013^: skipping custom node.exe download && GOTO NODE_INSTALLED

::Skip downloads for node>=3.x
SET NODE_MAJOR=%nodejs_version:~0,1%
IF %NODE_MAJOR% GTR 3 ECHO skipping custom node.exe download, node version greater than zero && GOTO NODE_INSTALLED

::custom node for VS2015
SET ARCHPATH=
IF /I "%platform%"=="x64" (SET ARCHPATH=x64/)
SET NODE_URL=https://mapbox.s3.amazonaws.com/node-cpp11/v%nodejs_version%/%ARCHPATH%node.exe
::special case node 3.3.1
IF /I "%nodejs_version%"=="3.3.1" SET NODE_URL=https://mapbox.s3.amazonaws.com/windows-builds/windows-deps/node-v3.3.1/win-%platform%/iojs.exe
ECHO downloading node^: %NODE_URL%
powershell Invoke-WebRequest "${env:NODE_URL}" -OutFile node.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO deleting node ...
SET NODE_EXE_PRG=%ProgramFiles%\nodejs\node.exe
IF EXIST "%NODE_EXE_PRG%" ECHO found %NODE_EXE_PRG%, deleting... && DEL /F "%NODE_EXE_PRG%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET NODE_EXE_PRG=%ProgramFiles(x86)%\nodejs\node.exe
IF EXIST "%NODE_EXE_PRG%" ECHO found %NODE_EXE_PRG%, deleting... && DEL /F "%NODE_EXE_PRG%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::copy our own node.exe into ProgramFiles, that new npm puts everything in the right place
ECHO copying node.exe ...
SET NODE_EXE_PRG=%ProgramFiles%\nodejs
IF EXIST "%NODE_EXE_PRG%" ECHO found %NODE_EXE_PRG%, copying... && COPY node.exe "%NODE_EXE_PRG%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET NODE_EXE_PRG=%ProgramFiles(x86)%\nodejs
IF EXIST "%NODE_EXE_PRG%" ECHO found %NODE_EXE_PRG%, copying... && COPY node.exe "%NODE_EXE_PRG%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:NODE_INSTALLED

ECHO elevating powershell script execution
powershell Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO installing npm-windows-upgrade... && CALL npm install -g npm-windows-upgrade
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO upgrading npm... && CALL npm-windows-upgrade --npm-version 2.15.9 --no-dns-check --no-prompt
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:: attempt to workaround https://github.com/mapbox/node-pre-gyp/issues/209
npm config set -g cafile=package.json
npm config set -g strict-ssl=false

ECHO available node.exe^:
where node
ECHO available npm^:
where npm

ECHO node^: && node -v
node -e "console.log(process.argv,process.execPath)"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO npm^: && CALL npm -v
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO ===== where npm puts stuff START ============
ECHO npm root && CALL npm root
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm root -g && CALL npm root -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO npm bin && CALL npm bin
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm bin -g && CALL npm bin -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET NPM_BIN_DIR=
FOR /F "tokens=*" %%i in ('CALL npm bin -g') DO SET NPM_BIN_DIR=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF /I "%NPM_BIN_DIR%"=="%CD%" ECHO ERROR npm bin -g equals local directory && SET ERRORLEVEL=1 && GOTO ERROR
ECHO ===== where npm puts stuff END ============

ECHO installing node-gyp...
CALL npm install -g node-gyp@3.2.1
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::ERRORLEVEL 0: string found
::ERRORLEVEL 1: string not found
ECHO.%nodejs_version%  | FINDSTR /C:"0.10" 1>nul
IF %ERRORLEVEL% EQU 0 ECHO installing mocha fix for node 0.10 && CALL npm install https://github.com/naturalatlas/mocha/archive/fix/333.tar.gz

SET NODEARCH=x64
IF /I "%platform%"=="x86" SET NODEARCH=ia32
SET DIST_URL=--dist-url=https://s3.amazonaws.com/mapbox/node-cpp11
IF /I "%msvs_toolset%"=="12" SET DIST_URL=

SET BUILD_CMD=npm install ^
--build-from-source ^
--target=%nodejs_version% ^
--target_arch=%NODEARCH% ^
--msvs_version=%msvs_version% ^
--loglevel=http %TOOLSET_ARGS% %ENABLE_LOGGING%
::add TOOLSET_ARGS last and on same line as this can be empty
ECHO calling BUILD_CMD^: %BUILD_CMD%
SET NODE_GDAL_BUILD_START_TIME=%TIME%
CALL %BUILD_CMD%
SET NODE_GDAL_BUILD_FINISH_TIME=%TIME%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO build started^: %NODE_GDAL_BUILD_START_TIME%
ECHO build finished^: %NODE_GDAL_BUILD_FINISH_TIME%

::ECHO installing node-pre-gyp ...
::CALL npm install node-pre-gyp
::IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::CALL node_modules\.bin\node-pre-gyp.cmd ^
::--target=%nodejs_version% rebuild ^
::--target_arch=%NODEARCH% ^
::--build-from-source ^
::--msvs_version=%msvs_version% ^
::--toolset=v%msvs_toolset%0 ^
::--enable-logging=true ^
::--loglevel=http %DIST_URL%
::add DIST_URL last and on same line as this can be empty
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

FOR /F "tokens=*" %%i in ('CALL node_modules\.bin\node-pre-gyp reveal module --silent') DO SET MODULE=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
FOR /F "tokens=*" %%i in ('node -e "console.log(process.execPath)"') DO SET NODE_EXE=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

dumpbin /DEPENDENTS "%NODE_EXE%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
dumpbin /DEPENDENTS "%MODULE%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO calling npm test
CALL npm test
ECHO after tests
IF %ERRORLEVEL% NEQ 0 (ECHO ERRORLEVEL^: %ERRORLEVEL% && SET HAD_ERROR=1)

IF DEFINED APPVEYOR IF %PUBLISH% EQU 1 (appveyor PushArtifact test/artifacts/log.txt)

IF DEFINED HAD_ERROR SET ERRORLEVEL=1 && GOTO ERROR

ECHO commit message^: %APPVEYOR_REPO_COMMIT_MESSAGE%
ECHO pull request^: %APPVEYOR_PULL_REQUEST_NUMBER%
ECHO branch^: %APPVEYOR_REPO_BRANCH%
ECHO IS_PR^: %IS_PR%
ECHO PUBLISH^: %PUBLISH%

::IF %PUBLISH% EQU 1 (IF NOT DEFINED IS_PR (IF "%APPVEYOR_REPO_BRANCH%"=="master" node_modules\.bin\node-pre-gyp unpublish publish))
IF %PUBLISH% NEQ 1 ECHO not publishing && GOTO DONE
IF DEFINED IS_PR ECHO IS_PR^: not publishing && GOTO DONE
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" ECHO not publishing^: not on master branch && GOTO DONE
::IF NOT "%APPVEYOR_REPO_BRANCH%"=="visual-studio-2015" ECHO not publishing^: not on visual-studio-2015 branch && GOTO DONE

ECHO packaging, unpublishing, publishing ...
CALL node_modules\.bin\node-pre-gyp.cmd ^
package unpublish publish ^
--target=%nodejs_version% ^
--target_arch=%NODEARCH% ^
--msvs_version=%msvs_version% ^
--loglevel=http %TOOLSET_ARGS% %ENABLE_LOGGING%
IF %ERRORLEVEL% EQU 0 GOTO DONE

GOTO DONE

:ERROR
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO ERRORLEVEL^: %ERRORLEVEL%
SET EL=%ERRORLEVEL%

:DONE
ECHO ~~~~~~~~~~~~~~~~~~~~~~ DONE %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO build started^: %NODE_GDAL_BUILD_START_TIME%
ECHO build finished^: %NODE_GDAL_BUILD_FINISH_TIME%

EXIT /b %EL%

@ECHO OFF
SETLOCAL
SET EL=0

ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SET PATH=%CD%;%PATH%
SET msvs_version=2013
IF /I "%msvs_toolset%"=="14" SET msvs_version=2015

IF /I "%platform%"=="x64" SET PATH=C:\Python27-x64;%PATH%

::make commit message env var shorter
::SET CM="%APPVEYOR_REPO_COMMIT_MESSAGE%"

for /F "tokens=1 usebackq" %%i in (`powershell .\scripts\parse-commit-message.ps1`) DO ECHO %%i && set PUBLISH=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF %PUBLISH% EQU 1 SET ENABLE_LOGGING=--enable-logging=true
SET "IS_PR="&FOR /f "delims=0123456789" %%i IN ("%APPVEYOR_PULL_REQUEST_NUMBER%") DO SET IS_PR=%%i

ECHO APPVEYOR^: %APPVEYOR%
ECHO commit message^: %APPVEYOR_REPO_COMMIT_MESSAGE%
ECHO pull request^: %APPVEYOR_PULL_REQUEST_NUMBER%
ECHO branch^: %APPVEYOR_REPO_BRANCH%
ECHO IS_PR^: %IS_PR%
ECHO PUBLISH^: %PUBLISH%
ECHO ENABLE_LOGGING^: %ENABLE_LOGGING%

ECHO nodejs_version^: %nodejs_version%
ECHO platform^: %platform%
ECHO msvs_toolset^: %msvs_toolset%
ECHO msvs_version^: %msvs_version%
ECHO TOOLSET_ARGS^: %TOOLSET_ARGS%

ECHO activating VS command prompt
IF /I "%platform%"=="x64" ECHO x64 && CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" amd64
IF /I "%platform%"=="x86" ECHO x86 && CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" x86
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO using compiler^: && cl
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO using MSBuild^: && msbuild /version && ECHO.
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::activating VS command prompt seems to uppercase PLATFORM, but only for x64 not x86
::with X64 AppVeyor cannot install node
ECHO platform^: %platform%
IF /I "%PLATFORM%"=="x64" ECHO lowercasing platform && SET PLATFORM=x64
ECHO platform^: %platform%

ECHO downloading/installing node
::only use Install-Product when using VS2013
::IF /I "%APPVEYOR%"=="True" IF /I "%msvs_toolset%"=="12" powershell Install-Product node $env:nodejs_version $env:Platform
::TESTING:
::always install (get npm matching node), but delete installed programfiles node.exe afterwards for VS2015 (using custom node.exe)
IF /I "%APPVEYOR%"=="True" IF /I NOT "%nodejs_version%"=="3.3.1" powershell Install-Product node $env:nodejs_version $env:Platform
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::Skip downloads from mapbox for VS2013
IF /I "%msvs_toolset%"=="12" ECHO VS2013^: skipping custom node.exe download && GOTO NODE_INSTALLED

::Skip downloads for node>=3.x
SET NODE_MAJOR=%nodejs_version:~0,1%
IF %NODE_MAJOR% GTR 3 ECHO skipping custom node.exe download, node version greater than zero && GOTO NODE_INSTALLED

::custom node for VS2015
SET ARCHPATH=
IF /I "%platform%"=="x64" (SET ARCHPATH=x64/)
SET NODE_URL=https://mapbox.s3.amazonaws.com/node-cpp11/v%nodejs_version%/%ARCHPATH%node.exe
::special case node 3.3.1
IF /I "%nodejs_version%"=="3.3.1" SET NODE_URL=https://mapbox.s3.amazonaws.com/windows-builds/windows-deps/node-v3.3.1/win-%platform%/iojs.exe
ECHO downloading node^: %NODE_URL%
powershell Invoke-WebRequest "${env:NODE_URL}" -OutFile node.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO deleting node ...
SET NODE_EXE_PRG=%ProgramFiles%\nodejs\node.exe
IF EXIST "%NODE_EXE_PRG%" ECHO found %NODE_EXE_PRG%, deleting... && DEL /F "%NODE_EXE_PRG%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET NODE_EXE_PRG=%ProgramFiles(x86)%\nodejs\node.exe
IF EXIST "%NODE_EXE_PRG%" ECHO found %NODE_EXE_PRG%, deleting... && DEL /F "%NODE_EXE_PRG%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::copy our own node.exe into ProgramFiles, that new npm puts everything in the right place
ECHO copying node.exe ...
SET NODE_EXE_PRG=%ProgramFiles%\nodejs
IF EXIST "%NODE_EXE_PRG%" ECHO found %NODE_EXE_PRG%, copying... && COPY node.exe "%NODE_EXE_PRG%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET NODE_EXE_PRG=%ProgramFiles(x86)%\nodejs
IF EXIST "%NODE_EXE_PRG%" ECHO found %NODE_EXE_PRG%, copying... && COPY node.exe "%NODE_EXE_PRG%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:NODE_INSTALLED

ECHO elevating powershell script execution
powershell Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO installing npm-windows-upgrade... && CALL npm install -g npm-windows-upgrade
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO upgrading npm... && CALL npm-windows-upgrade --npm-version 2.15.9 --no-dns-check --no-prompt
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:: attempt to workaround https://github.com/mapbox/node-pre-gyp/issues/209
CALL npm config set -g cafile=package.json
CALL npm config set -g strict-ssl=false

ECHO available node.exe^:
where node
ECHO available npm^:
where npm

ECHO node^: && node -v
node -e "console.log(process.argv,process.execPath)"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO npm^: && CALL npm -v
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO ===== where npm puts stuff START ============
ECHO npm root && CALL npm root
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm root -g && CALL npm root -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO npm bin && CALL npm bin
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm bin -g && CALL npm bin -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET NPM_BIN_DIR=
FOR /F "tokens=*" %%i in ('CALL npm bin -g') DO SET NPM_BIN_DIR=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF /I "%NPM_BIN_DIR%"=="%CD%" ECHO ERROR npm bin -g equals local directory && SET ERRORLEVEL=1 && GOTO ERROR
ECHO ===== where npm puts stuff END ============

ECHO installing node-gyp...
CALL npm install -g node-gyp@3.2.1
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::ERRORLEVEL 0: string found
::ERRORLEVEL 1: string not found
ECHO.%nodejs_version%  | FINDSTR /C:"0.10" 1>nul
IF %ERRORLEVEL% EQU 0 ECHO installing mocha fix for node 0.10 && CALL npm install https://github.com/naturalatlas/mocha/archive/fix/333.tar.gz

SET NODEARCH=x64
IF /I "%platform%"=="x86" SET NODEARCH=ia32
SET DIST_URL=--dist-url=https://s3.amazonaws.com/mapbox/node-cpp11
IF /I "%msvs_toolset%"=="12" SET DIST_URL=

SET BUILD_CMD=npm install ^
--build-from-source ^
--target=%nodejs_version% ^
--target_arch=%NODEARCH% ^
--msvs_version=%msvs_version% ^
--loglevel=http %TOOLSET_ARGS% %ENABLE_LOGGING%
::add TOOLSET_ARGS last and on same line as this can be empty
ECHO calling BUILD_CMD^: %BUILD_CMD%
SET NODE_GDAL_BUILD_START_TIME=%TIME%
CALL %BUILD_CMD%
SET NODE_GDAL_BUILD_FINISH_TIME=%TIME%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO build started^: %NODE_GDAL_BUILD_START_TIME%
ECHO build finished^: %NODE_GDAL_BUILD_FINISH_TIME%

::ECHO installing node-pre-gyp ...
::CALL npm install node-pre-gyp
::IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::CALL node_modules\.bin\node-pre-gyp.cmd ^
::--target=%nodejs_version% rebuild ^
::--target_arch=%NODEARCH% ^
::--build-from-source ^
::--msvs_version=%msvs_version% ^
::--toolset=v%msvs_toolset%0 ^
::--enable-logging=true ^
::--loglevel=http %DIST_URL%
::add DIST_URL last and on same line as this can be empty
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

FOR /F "tokens=*" %%i in ('CALL node_modules\.bin\node-pre-gyp reveal module --silent') DO SET MODULE=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
FOR /F "tokens=*" %%i in ('node -e "console.log(process.execPath)"') DO SET NODE_EXE=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

dumpbin /DEPENDENTS "%NODE_EXE%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
dumpbin /DEPENDENTS "%MODULE%"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO calling npm test
CALL npm test
ECHO after tests
IF %ERRORLEVEL% NEQ 0 (ECHO ERRORLEVEL^: %ERRORLEVEL% && SET HAD_ERROR=1)

IF DEFINED APPVEYOR IF %PUBLISH% EQU 1 (appveyor PushArtifact test/artifacts/log.txt)

IF DEFINED HAD_ERROR SET ERRORLEVEL=1 && GOTO ERROR

ECHO commit message^: %APPVEYOR_REPO_COMMIT_MESSAGE%
ECHO pull request^: %APPVEYOR_PULL_REQUEST_NUMBER%
ECHO branch^: %APPVEYOR_REPO_BRANCH%
ECHO IS_PR^: %IS_PR%
ECHO PUBLISH^: %PUBLISH%

IF %PUBLISH% NEQ 1 ECHO not publishing && GOTO DONE
IF DEFINED IS_PR ECHO IS_PR^: not publishing && GOTO DONE
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" ECHO not publishing^: not on master branch && GOTO DONE

SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE%
IF NOT "%CM%" == "%CM:[publish binary]=%" (ECHO publishing... && CALL node_modules\.bin\node-pre-gyp --target=%nodejs_version% --target_arch=%NODEARCH% --msvs_version=%msvs_version% --loglevel=http publish %TOOLSET_ARGS% %ENABLE_LOGGING%) ELSE (ECHO not publishing)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF NOT "%CM%" == "%CM:[republish binary]=%" (ECHO republishing ... && CALL node_modules\.bin\node-pre-gyp --target=%nodejs_version% --target_arch=%NODEARCH% --msvs_version=%msvs_version% --loglevel=http unpublish publish %TOOLSET_ARGS% %ENABLE_LOGGING%) ELSE (ECHO not republishing)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

GOTO DONE

:ERROR
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO ERRORLEVEL^: %ERRORLEVEL%
SET EL=%ERRORLEVEL%

:DONE
ECHO ~~~~~~~~~~~~~~~~~~~~~~ DONE %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO build started^: %NODE_GDAL_BUILD_START_TIME%
ECHO build finished^: %NODE_GDAL_BUILD_FINISH_TIME%

EXIT /b %EL%

fix appveyor build v0.9.3 [publish binary]


@ECHO OFF

cd ..\picklesdoc.github.com
rmdir Output /s /q
echo D | xcopy ..\pickles\Output Output /e
powershell -Command "(gc index_template.md) -replace 'VERSION_PLACEHOLDER', '%1' | Out-File -encoding ASCII index.md"
git add -A
git commit -m "Version %1"
git push origin master
cd ..\pickles

@ECHO OFF

cd ..\picklesdoc.github.com
rmdir Output /s /q
echo D | xcopy ..\pickles\Output Output /e
powershell -Command "(gc index_template.html) -replace 'VERSION_PLACEHOLDER', '%1' | Out-File -encoding ASCII index.html"

git add -A
git commit -m "Version %1"
git push origin master
cd ..\pickles

Update deploy output scripts

Update deploy output scripts


@echo off
REM Update source for glslang, spirv-tools, and shaderc

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

setlocal EnableDelayedExpansion
set errorCode=0
set ANDROID_BUILD_DIR=%~dp0
set BUILD_DIR=%ANDROID_BUILD_DIR%..
set BASE_DIR=%BUILD_DIR%\external
set GLSLANG_DIR=%BASE_DIR%\glslang
set SPIRV_TOOLS_DIR=%BASE_DIR%\spirv-tools
set SHADERC_DIR=%BASE_DIR%\shaderc

for %%X in (where.exe) do (set FOUND=%%~$PATH:X)
if not defined FOUND (
   echo Dependency check failed:
   echo   where.exe not found
   echo   This script requires Windows Vista or later, which includes where.exe.
   set errorCode=1
)

where /q git.exe
if %ERRORLEVEL% equ 1 (
   echo Dependency check failed:
   echo   git.exe not found
   echo   Git for Windows can be downloaded here:  https://git-scm.com/download/win
   echo   Install and ensure git.exe makes it into your PATH
   set errorCode=1
)

where /q ndk-build.cmd
if %ERRORLEVEL% equ 1 (
   echo Dependency check failed:
   echo   ndk-build.cmd not found
   echo   Android NDK can be downloaded here:  http://developer.android.com/ndk/guides/setup.html
   echo   Install and ensure ndk-build.cmd makes it into your PATH
   set errorCode=1
)

REM ensure where is working with below false test
REM where /q foo
REM if %ERRORLEVEL% equ 1 (
REM echo foo
REM )

:main

if %errorCode% neq 0 (goto:error)

REM Read the target versions from external file, which is shared with Linux script

if not exist %ANDROID_BUILD_DIR%\glslang_revision_android (
   echo.
   echo Missing glslang_revision_android file. Place it in %ANDROID_BUILD_DIR%
   goto:error
)

if not exist %ANDROID_BUILD_DIR%\spirv-tools_revision_android (
   echo.
   echo Missing spirv-tools_revision_android file. Place it in %ANDROID_BUILD_DIR%
   set errorCode=1
   goto:error
)

if not exist %ANDROID_BUILD_DIR%\shaderc_revision_android (
   echo.
   echo Missing shaderc_revision_android file. Place it in %ANDROID_BUILD_DIR%
   set errorCode=1
   goto:error
)

set /p GLSLANG_REVISION= < glslang_revision_android
set /p SPIRV_TOOLS_REVISION= < spirv-tools_revision_android
set /p SHADERC_REVISION= < shaderc_revision_android
echo GLSLANG_REVISION=%GLSLANG_REVISION%
echo SPIRV_TOOLS_REVISION=%SPIRV_TOOLS_REVISION%
echo SHADERC_REVISION=%SHADERC_REVISION%

echo Creating and/or updating glslang, spirv-tools, shaderc in %BASE_DIR%

set sync-glslang=1
set sync-spirv-tools=1
set sync-shaderc=1
set build-shaderc=1

if %sync-glslang% equ 1 (
   if exist %GLSLANG_DIR% (
      rd /S /Q %GLSLANG_DIR%
   )
   if not exist %GLSLANG_DIR% (
      call:create_glslang
   )
   if %errorCode% neq 0 (goto:error)
   call:update_glslang
   if %errorCode% neq 0 (goto:error)
)

if %sync-spirv-tools% equ 1 (
   if exist %SPIRV_TOOLS_DIR% (
      rd /S /Q %SPIRV_TOOLS_DIR%
   )
   if %ERRORLEVEL% neq 0 (goto:error)
   if not exist %SPIRV_TOOLS_DIR% (
      call:create_spirv-tools
   )
   if %errorCode% neq 0 (goto:error)
   call:update_spirv-tools
   if %errorCode% neq 0 (goto:error)
)

if %sync-shaderc% equ 1 (
   if exist %SHADERC_DIR% (
      rd /S /Q %SHADERC_DIR%
   )
   if not exist %SHADERC_DIR% (
      call:create_shaderc
   )
   if %errorCode% neq 0 (goto:error)
   call:update_shaderc
   if %errorCode% neq 0 (goto:error)
)

if %build-shaderc% equ 1 (
   call:build_shaderc
   if %errorCode% neq 0 (goto:error)
)

echo.
echo Exiting
goto:finish

:error
echo.
echo Halting due to error
goto:finish

:finish
if not "%cd%\" == "%BUILD_DIR%" ( cd %BUILD_DIR% )
endlocal
goto:eof

REM // ======== Functions ======== //

:create_glslang
   echo.
   echo Creating local glslang repository %GLSLANG_DIR%
   mkdir %GLSLANG_DIR%
   cd %GLSLANG_DIR%
   git clone https://github.com/KhronosGroup/glslang.git .
   git checkout %GLSLANG_REVISION%
   if not exist %GLSLANG_DIR%\SPIRV (
      echo glslang source download failed!
      set errorCode=1
   )
goto:eof

:update_glslang
   echo.
   echo Updating %GLSLANG_DIR%
   cd %GLSLANG_DIR%
   git fetch --all
   git checkout %GLSLANG_REVISION%
   if not exist %GLSLANG_DIR%\SPIRV (
      echo glslang source update failed!
      set errorCode=1
   )
goto:eof

:create_spirv-tools
   echo.
   echo Creating local spirv-tools repository %SPIRV_TOOLS_DIR%
   mkdir %SPIRV_TOOLS_DIR%
   cd %SPIRV_TOOLS_DIR%
   git clone https://github.com/KhronosGroup/SPIRV-Tools.git .
   git checkout %SPIRV_TOOLS_REVISION%
   if not exist %SPIRV_TOOLS_DIR%\source (
      echo spirv-tools source download failed!
      set errorCode=1
   )
goto:eof

:update_spirv-tools
   echo.
   echo Updating %SPIRV_TOOLS_DIR%
   cd %SPIRV_TOOLS_DIR%
   git fetch --all
   git checkout %SPIRV_TOOLS_REVISION%
   if not exist %SPIRV_TOOLS_DIR%\source (
      echo spirv-tools source update failed!
      set errorCode=1
   )
goto:eof

:create_shaderc
   echo.
   echo Creating local shaderc repository %SHADERC_DIR%)
   mkdir %SHADERC_DIR%
   cd %SHADERC_DIR%
   git clone git@github.com:google/shaderc.git .
   git checkout %SHADERC_REVISION%
   if not exist %SHADERC_DIR%\libshaderc (
      echo shaderc source download failed!
      set errorCode=1
   )
goto:eof

:update_shaderc
   echo.
   echo Updating %SHADERC_DIR%
   cd %SHADERC_DIR%
   git fetch --all
   git checkout %SHADERC_REVISION%
   if not exist %SHADERC_DIR%\libshaderc (
      echo shaderc source update failed!
      set errorCode=1
   )
goto:eof

:build_shaderc
   echo.
   echo Building %SHADERC_DIR%
   cd %SHADERC_DIR%\android_test
   echo Building shaderc with Android NDK
   call ndk-build THIRD_PARTY_PATH=../.. -j 4
   REM Check for existence of one lib, even though we should check for all results
   if not exist %SHADERC_DIR%\android_test\obj\local\x86\libshaderc.a (
      echo.
      echo shaderc build failed!
      set errorCode=1
   )
goto:eof

@echo off
REM Update source for glslang, spirv-tools, and shaderc

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

setlocal EnableDelayedExpansion
set errorCode=0
set ANDROID_BUILD_DIR=%~dp0
set BUILD_DIR=%ANDROID_BUILD_DIR%..
set BASE_DIR=%BUILD_DIR%\external
set GLSLANG_DIR=%BASE_DIR%\glslang
set SPIRV_TOOLS_DIR=%BASE_DIR%\spirv-tools
set SHADERC_DIR=%BASE_DIR%\shaderc

for %%X in (where.exe) do (set FOUND=%%~$PATH:X)
if not defined FOUND (
   echo Dependency check failed:
   echo   where.exe not found
   echo   This script requires Windows Vista or later, which includes where.exe.
   set errorCode=1
)

where /q git.exe
if %ERRORLEVEL% equ 1 (
   echo Dependency check failed:
   echo   git.exe not found
   echo   Git for Windows can be downloaded here:  https://git-scm.com/download/win
   echo   Install and ensure git.exe makes it into your PATH
   set errorCode=1
)

where /q ndk-build.cmd
if %ERRORLEVEL% equ 1 (
   echo Dependency check failed:
   echo   ndk-build.cmd not found
   echo   Android NDK can be downloaded here:  http://developer.android.com/ndk/guides/setup.html
   echo   Install and ensure ndk-build.cmd makes it into your PATH
   set errorCode=1
)

REM ensure where is working with below false test
REM where /q foo
REM if %ERRORLEVEL% equ 1 (
REM echo foo
REM )

:main

if %errorCode% neq 0 (goto:error)

REM Read the target versions from external file, which is shared with Linux script

if not exist %ANDROID_BUILD_DIR%\glslang_revision_android (
   echo.
   echo Missing glslang_revision_android file. Place it in %ANDROID_BUILD_DIR%
   goto:error
)

if not exist %ANDROID_BUILD_DIR%\spirv-tools_revision_android (
   echo.
   echo Missing spirv-tools_revision_android file. Place it in %ANDROID_BUILD_DIR%
   set errorCode=1
   goto:error
)

if not exist %ANDROID_BUILD_DIR%\shaderc_revision_android (
   echo.
   echo Missing shaderc_revision_android file. Place it in %ANDROID_BUILD_DIR%
   set errorCode=1
   goto:error
)

set /p GLSLANG_REVISION= < glslang_revision_android
set /p SPIRV_TOOLS_REVISION= < spirv-tools_revision_android
set /p SHADERC_REVISION= < shaderc_revision_android
echo GLSLANG_REVISION=%GLSLANG_REVISION%
echo SPIRV_TOOLS_REVISION=%SPIRV_TOOLS_REVISION%
echo SHADERC_REVISION=%SHADERC_REVISION%

echo Creating and/or updating glslang, spirv-tools, shaderc in %BASE_DIR%

set sync-glslang=1
set sync-spirv-tools=1
set sync-shaderc=1
set build-shaderc=1

if %sync-glslang% equ 1 (
   if exist %GLSLANG_DIR% (
      rd /S /Q %GLSLANG_DIR%
   )
   if not exist %GLSLANG_DIR% (
      call:create_glslang
   )
   if %errorCode% neq 0 (goto:error)
   call:update_glslang
   if %errorCode% neq 0 (goto:error)
)

if %sync-spirv-tools% equ 1 (
   if exist %SPIRV_TOOLS_DIR% (
      rd /S /Q %SPIRV_TOOLS_DIR%
   )
   if %ERRORLEVEL% neq 0 (goto:error)
   if not exist %SPIRV_TOOLS_DIR% (
      call:create_spirv-tools
   )
   if %errorCode% neq 0 (goto:error)
   call:update_spirv-tools
   if %errorCode% neq 0 (goto:error)
)

if %sync-shaderc% equ 1 (
   if exist %SHADERC_DIR% (
      rd /S /Q %SHADERC_DIR%
   )
   if not exist %SHADERC_DIR% (
      call:create_shaderc
   )
   if %errorCode% neq 0 (goto:error)
   call:update_shaderc
   if %errorCode% neq 0 (goto:error)
)

if %build-shaderc% equ 1 (
   call:build_shaderc
   if %errorCode% neq 0 (goto:error)
)

echo.
echo Exiting
goto:finish

:error
echo.
echo Halting due to error
goto:finish

:finish
if not "%cd%\" == "%BUILD_DIR%" ( cd %BUILD_DIR% )
endlocal
goto:eof

REM // ======== Functions ======== //

:create_glslang
   echo.
   echo Creating local glslang repository %GLSLANG_DIR%
   mkdir %GLSLANG_DIR%
   cd %GLSLANG_DIR%
   git clone https://github.com/KhronosGroup/glslang.git .
   git checkout %GLSLANG_REVISION%
   if not exist %GLSLANG_DIR%\SPIRV (
      echo glslang source download failed!
      set errorCode=1
   )
goto:eof

:update_glslang
   echo.
   echo Updating %GLSLANG_DIR%
   cd %GLSLANG_DIR%
   git fetch --all
   git checkout %GLSLANG_REVISION%
   if not exist %GLSLANG_DIR%\SPIRV (
      echo glslang source update failed!
      set errorCode=1
   )
goto:eof

:create_spirv-tools
   echo.
   echo Creating local spirv-tools repository %SPIRV_TOOLS_DIR%
   mkdir %SPIRV_TOOLS_DIR%
   cd %SPIRV_TOOLS_DIR%
   git clone https://github.com/KhronosGroup/SPIRV-Tools.git .
   git checkout %SPIRV_TOOLS_REVISION%
   if not exist %SPIRV_TOOLS_DIR%\source (
      echo spirv-tools source download failed!
      set errorCode=1
   )
goto:eof

:update_spirv-tools
   echo.
   echo Updating %SPIRV_TOOLS_DIR%
   cd %SPIRV_TOOLS_DIR%
   git fetch --all
   git checkout %SPIRV_TOOLS_REVISION%
   if not exist %SPIRV_TOOLS_DIR%\source (
      echo spirv-tools source update failed!
      set errorCode=1
   )
goto:eof

:create_shaderc
   echo.
   echo Creating local shaderc repository %SHADERC_DIR%
   mkdir %SHADERC_DIR%
   cd %SHADERC_DIR%
   git clone git@github.com:google/shaderc.git .
   git checkout %SHADERC_REVISION%
   if not exist %SHADERC_DIR%\libshaderc (
      echo shaderc source download failed!
      set errorCode=1
   )
goto:eof

:update_shaderc
   echo.
   echo Updating %SHADERC_DIR%
   cd %SHADERC_DIR%
   git fetch --all
   git checkout %SHADERC_REVISION%
   if not exist %SHADERC_DIR%\libshaderc (
      echo shaderc source update failed!
      set errorCode=1
   )
goto:eof

:build_shaderc
   echo.
   echo Building %SHADERC_DIR%
   cd %SHADERC_DIR%\android_test
   echo Building shaderc with Android NDK
   call ndk-build THIRD_PARTY_PATH=../.. -j 4
   REM Check for existence of one lib, even though we should check for all results
   if not exist %SHADERC_DIR%\android_test\obj\local\x86\libshaderc.a (
      echo.
      echo shaderc build failed!
      set errorCode=1
   )
goto:eof

layers: Remove output paren from android update script


:: Terminal API
::
:: This file is called whenever a user enters a shell.
::
:: Dependencies:
::  - pyblish-base
::  - pyblish-maya
::  - pyblish-nuke
::  - pyblish-houdini
::  - pyblish-lite
::  - pyblish-qml
::  - pyblish-mindbender
::
:: Usage:
:: 	1. Create a local `mb.bat` file and set the required environment variables
::  2. Call your `mb.bat`
::
:: Example:
::   $ mb

@echo off

if "%1"=="" goto :usage

:: External Dependencies
if "%PYBLISH_BASE%"=="" goto :missing
if "%PYBLISH_MAYA%"=="" goto :missing
if "%PYBLISH_NUKE%"=="" goto :missing
if "%PYBLISH_LITE%"=="" goto :missing
if "%PYBLISH_QML%"=="" goto :missing
if "%PYBLISH_MINDBENDER%"=="" goto :missing

set PYTHONPATH=%PYBLISH_BASE%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_MAYA%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_NUKE%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_LITE%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_QML%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_MINDBENDER%;%PYTHONPATH%

set PROJECTS=%1

:: Expose pipeline executables
set PATH=%PYBLISH_MINDBENDER%\bin;%PATH%

:: --------------------
:: User interface
:: --------------------

:: Use $ as prefix to prompt commands
:: The default PROMPT is the current working directory,
:: which can make it look a little daunting due to its length.
set PROMPT=$$

:: Go to projects directory
pushd %PROJECTS%

:: Clear screen
title Mindbender Launcher
cls

:: Print intro
echo+
echo  MEINDBENDER START ---------------------------
echo+
echo+
echo                 _,--,
echo              .-'---./_    __
echo             /o \\     '-.' /
echo             \  //    _.-'._\
echo              `"\)--"`
echo+
echo+
echo   Welcome %USERNAME%!
echo+
echo   1. Type first characters of a project, e.g. "p999_"
echo   2. Press TAB to cycle through matching projects
echo+
echo  ---------------------------------------------
echo+

:: Clearing old Variables
SET PROJECTDIR=
SET ASSET=

:: Open a persistent shell
cmd.exe /K

goto :eof

:usage
	echo Not enough arguments
	echo Example: mb.bat c:\path\to\projects

:missing
	echo ERROR: Missing environment variables.
	if "%PYBLISH_BASE%"=="" echo   - %%PYBLISH_BASE%%
	if "%PYBLISH_MAYA%"=="" echo   - %%PYBLISH_MAYA%%
	if "%PYBLISH_NUKE%"=="" echo   - %%PYBLISH_NUKE%%
	if "%PYBLISH_LITE%"=="" echo   - %%PYBLISH_LITE%%
	if "%PYBLISH_QML%"=="" echo   - %%PYBLISH_QML%%
	if "%PYBLISH_MINDBENDER%"=="" echo   - %%PYBLISH_MINDBENDER%%

	exit /b

:: Terminal API
::
:: This file is called whenever a user enters a shell.
::
:: Dependencies:
::  - pyblish-base
::  - pyblish-maya
::  - pyblish-nuke
::  - pyblish-houdini
::  - pyblish-lite
::  - pyblish-qml
::  - pyblish-mindbender
::
:: Usage:
:: 	1. Create a local `mb.bat` file and set the required environment variables
::  2. Call your `mb.bat`
::
:: Example:
::   $ mb

@echo off

if "%1"=="" goto :usage

:: External Dependencies
if "%PYBLISH_BASE%"=="" goto :missing
if "%PYBLISH_MAYA%"=="" goto :missing
if "%PYBLISH_NUKE%"=="" goto :missing
if "%PYBLISH_LITE%"=="" goto :missing
if "%PYBLISH_QML%"=="" goto :missing
if "%MINDBENDER_CORE%"=="" goto :missing

set PYTHONPATH=%PYBLISH_BASE%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_MAYA%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_NUKE%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_LITE%;%PYTHONPATH%
set PYTHONPATH=%PYBLISH_QML%;%PYTHONPATH%
set PYTHONPATH=%MINDBENDER_CORE%;%PYTHONPATH%

set PROJECTS=%1

:: Expose pipeline executables
set PATH=%MINDBENDER_CORE%\bin;%PATH%

:: --------------------
:: User interface
:: --------------------

:: Use $ as prefix to prompt commands
:: The default PROMPT is the current working directory,
:: which can make it look a little daunting due to its length.
set PROMPT=$$

:: Go to projects directory
pushd %PROJECTS%

:: Clear screen
title Mindbender Launcher
cls

:: Print intro
echo+
echo  MEINDBENDER START ---------------------------
echo+
echo+
echo                 _,--,
echo              .-'---./_    __
echo             /o \\     '-.' /
echo             \  //    _.-'._\
echo              `"\)--"`
echo+
echo+
echo   Welcome %USERNAME%!
echo+
echo   1. Type first characters of a project, e.g. "p999_"
echo   2. Press TAB to cycle through matching projects
echo+
echo  ---------------------------------------------
echo+

:: Clearing old Variables
SET PROJECTDIR=
SET ASSET=

:: Open a persistent shell
cmd.exe /K

goto :eof

:usage
	echo Not enough arguments
	echo Example: mb.bat c:\path\to\projects

:missing
	echo ERROR: Missing environment variables.
	if "%PYBLISH_BASE%"=="" echo   - %%PYBLISH_BASE%%
	if "%PYBLISH_MAYA%"=="" echo   - %%PYBLISH_MAYA%%
	if "%PYBLISH_NUKE%"=="" echo   - %%PYBLISH_NUKE%%
	if "%PYBLISH_LITE%"=="" echo   - %%PYBLISH_LITE%%
	if "%PYBLISH_QML%"=="" echo   - %%PYBLISH_QML%%
	if "%MINDBENDER_CORE%"=="" echo   - %%MINDBENDER_CORE%%

	exit /b

Update repository name for pyblish-mindbender


rem Usage: build <java_file_name_without_extension>
@Echo off
set jname=%1
if [%1]==[] set jname=RESTupServer
if NOT exist .\classes\ md .\classes
del .\classes\*.* /Q
if NOT exist .\classes\source\ md .\classes\source
del .\classes\source\*.* /Q
rem copy %jname%.java .\classes\source\
copy Help.txt .\classes\source\
javac -Xstdout .\compile.log -Xlint:unchecked -cp .\ -d .\classes -encoding Cp1251  %jname%.java
if %ERRORLEVEL% EQU 0 (
  cd .\classes
  jar cvfe ..\..\%jname%.jar %jname% *.class  .\source\*.txt
  cd ..
)
more < .\compile.log

build script (Windows)

build script (Windows)


REM Add other things if could be automated, RUN THIS AS ADMIN

REM Everything is added, including PowerShell command execution and "wget" lol

REM Admin checking...

@echo off
echo Checking if script contains Administrative rights...
net sessions
if %errorlevel%==0 (
echo Success!
) else (
echo No admin, please run with Administrative rights...
pause
exit
)

:MENU

echo Choose An option:
echo 1. Windows Defender Scan
echo 2. List Processes
echo 3. Changing Password Policies
echo 4. Enable UAC
echo 5. Disable Remote Desktop
echo 6. Enable Auto-Update
echo 7. Disable Weak services
echo 8. System Integrity Scan
echo 9. Powershell rootkit detection

CHOICE /C 123456789 /M "Enter your choice:"
if ERRORLEVEL 9 goto Nine
if ERRORLEVEL 8 goto Eight
if ERRORLEVEL 7 goto Seven
if ERRORLEVEL 6 goto Six
if ERRORLEVEL 5 goto Five
if ERRORLEVEL 4 goto Four
if ERRORLEVEL 3 goto Three
if ERRORLEVEL 2 goto Two
if ERRORLEVEL 1 goto One

:One
REM Windows Defender scan
echo "SCANNING WITH DEFAULT WINDOWS DEFENDER!"
cd C:\Program Files\Windows Defender\
MpCmdRun.exe -Scan 2
cd C:\
goto MENU

:Two
REM Listing possible penetrations
cd C:\
echo "STARTING TO OUTPUT PROCESS FILES DIRECTLY TO THE C:\ DRIVE!"
wmic process list brief > BriefProcesses.txt
if %errorlevel%==1 echo Brief Processes failed to write
wmic process list full >FullProcesses.txt
if %errorlevel%==1 echo Full Processes failed to write
wmic startup list full > StartupLists.txt
if %errorlevel%==1 echo Startup Processes failed to write
net start > StartedProcesses.txt
if %errorlevel%==1 echo Started processes failed to write
reg export HKLM\Software\Microsoft\Windows\CurrentVersion\Run  Run.reg
if %errorlevel%==1 echo Run processes failed to write
goto MENU

:Three
echo "OUTPUT DONE, CHANGING PASSWORD POLICIES!"
REM Passwords must be 10 digits
net accounts /minpwlen:10
REM Passwords must be changed every 30 days
net accounts /maxpwage:30
REM Passwords can only be changed after 1 day has passed
net accounts /minpwage:1
REM Display current password policy
net accounts
goto MENU

:Four
REM Turn on UAC
echo "TURNING ON UAC"
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f
goto MENU

:Five
REM No Remote Desktop
echo "DISABLING REMOTE DESKTOP"
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f
goto MENU

:Six
REM Windows auomatic updates
echo "ENABLING AUTO-UPDATES"
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 3 /f
goto MENU

:Seven
REM Removing good ol' insecure stuff
echo "DISABLING WEAK SERVICES"
dism /online /disable-feature /featurename:IIS-WebServerRole >NUL
dism /online /disable-feature /featurename:IIS-WebServer >NUL
dism /online /disable-feature /featurename:IIS-CommonHttpFeatures >NUL
dism /online /disable-feature /featurename:IIS-HttpErrors >NUL
dism /online /disable-feature /featurename:IIS-HttpRedirect >NUL
dism /online /disable-feature /featurename:IIS-ApplicationDevelopment >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility45 >NUL
dism /online /disable-feature /featurename:IIS-HealthAndDiagnostics >NUL
dism /online /disable-feature /featurename:IIS-HttpLogging >NUL
dism /online /disable-feature /featurename:IIS-LoggingLibraries >NUL
dism /online /disable-feature /featurename:IIS-RequestMonitor >NUL
dism /online /disable-feature /featurename:IIS-HttpTracing >NUL
dism /online /disable-feature /featurename:IIS-Security >NUL
dism /online /disable-feature /featurename:IIS-URLAuthorization >NUL
dism /online /disable-feature /featurename:IIS-RequestFiltering >NUL
dism /online /disable-feature /featurename:IIS-IPSecurity >NUL
dism /online /disable-feature /featurename:IIS-Performance >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionDynamic >NUL
dism /online /disable-feature /featurename:IIS-WebServerManagementTools >NUL
dism /online /disable-feature /featurename:IIS-ManagementScriptingTools >NUL
dism /online /disable-feature /featurename:IIS-IIS6ManagementCompatibility >NUL
dism /online /disable-feature /featurename:IIS-Metabase >NUL
dism /online /disable-feature /featurename:IIS-HostableWebCore >NUL
dism /online /disable-feature /featurename:IIS-StaticContent >NUL
dism /online /disable-feature /featurename:IIS-DefaultDocument >NUL
dism /online /disable-feature /featurename:IIS-DirectoryBrowsing >NUL
dism /online /disable-feature /featurename:IIS-WebDAV >NUL
dism /online /disable-feature /featurename:IIS-WebSockets >NUL
dism /online /disable-feature /featurename:IIS-ApplicationInit >NUL
dism /online /disable-feature /featurename:IIS-ASPNET >NUL
dism /online /disable-feature /featurename:IIS-ASPNET45 >NUL
dism /online /disable-feature /featurename:IIS-ASP >NUL
dism /online /disable-feature /featurename:IIS-CGI >NUL
dism /online /disable-feature /featurename:IIS-ISAPIExtensions >NUL
dism /online /disable-feature /featurename:IIS-ISAPIFilter >NUL
dism /online /disable-feature /featurename:IIS-ServerSideIncludes >NUL
dism /online /disable-feature /featurename:IIS-CustomLogging >NUL
dism /online /disable-feature /featurename:IIS-BasicAuthentication >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionStatic >NUL
dism /online /disable-feature /featurename:IIS-ManagementConsole >NUL
dism /online /disable-feature /featurename:IIS-ManagementService >NUL
dism /online /disable-feature /featurename:IIS-WMICompatibility >NUL
dism /online /disable-feature /featurename:IIS-LegacyScripts >NUL
dism /online /disable-feature /featurename:IIS-LegacySnapIn >NUL
dism /online /disable-feature /featurename:IIS-FTPServer >NUL
dism /online /disable-feature /featurename:IIS-FTPSvc >NUL
dism /online /disable-feature /featurename:IIS-FTPExtensibility >NUL
dism /online /disable-feature /featurename:TFTP >NUL
dism /online /disable-feature /featurename:TelnetClient >NUL
dism /online /disable-feature /featurename:TelnetServer >NUL
goto MENU

:Eight
REM START SYS INTEG SCAN!
echo "STARTING SYSTEM INTERGRITY SCAN"
Sfc.exe /scannow
goto MENU

:Nine
REM PowerShell RootKit detection start
echo "POWERSHELL ROOTKIT DETECTION WITH MALWAREBYTES ROOTKIT BETA"
powershell Invoke-WebRequest -OutFile MBRTKit.exe https://data-cdn.mbamupdates.com/web/mbar-1.09.3.1001.exe
MBRTKit.exe
goto MENU

PAUSE

REM Add other things if could be automated, RUN THIS AS ADMIN

REM Everything is added, including PowerShell command execution and "wget" lol

REM Admin checking...

@echo off
echo Checking if script contains Administrative rights...
net sessions
if %errorlevel%==0 (
echo Success!
) else (
echo No admin, please run with Administrative rights...
pause
exit
)

:MENU

echo Choose An option:
echo 1. Windows Defender Scan
echo 2. List Processes
echo 3. Changing Password Policies
echo 4. Enable UAC
echo 5. Disable Remote Desktop
echo 6. Enable Auto-Update
echo 7. Disable Weak services
echo 8. System Integrity Scan
echo 9. Powershell rootkit detection

CHOICE /C 123456789 /M "Enter your choice:"
echo ""
if ERRORLEVEL 9 goto Nine
if ERRORLEVEL 8 goto Eight
if ERRORLEVEL 7 goto Seven
if ERRORLEVEL 6 goto Six
if ERRORLEVEL 5 goto Five
if ERRORLEVEL 4 goto Four
if ERRORLEVEL 3 goto Three
if ERRORLEVEL 2 goto Two
if ERRORLEVEL 1 goto One

:One
REM Windows Defender scan
echo "SCANNING WITH DEFAULT WINDOWS DEFENDER!"
cd C:\Program Files\Windows Defender\
MpCmdRun.exe -Scan 2
cd C:\
goto MENU

:Two
REM Listing possible penetrations
cd C:\
echo "STARTING TO OUTPUT PROCESS FILES DIRECTLY TO THE C:\ DRIVE!"
wmic process list brief > BriefProcesses.txt
if %errorlevel%==1 echo Brief Processes failed to write
wmic process list full >FullProcesses.txt
if %errorlevel%==1 echo Full Processes failed to write
wmic startup list full > StartupLists.txt
if %errorlevel%==1 echo Startup Processes failed to write
net start > StartedProcesses.txt
if %errorlevel%==1 echo Started processes failed to write
reg export HKLM\Software\Microsoft\Windows\CurrentVersion\Run  Run.reg
if %errorlevel%==1 echo Run processes failed to write
goto MENU

:Three
echo "OUTPUT DONE, CHANGING PASSWORD POLICIES!"
REM Passwords must be 10 digits
net accounts /minpwlen:10
REM Passwords must be changed every 30 days
net accounts /maxpwage:30
REM Passwords can only be changed after 1 day has passed
net accounts /minpwage:1
REM Display current password policy
net accounts
goto MENU

:Four
REM Turn on UAC
echo "TURNING ON UAC"
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f
goto MENU

:Five
REM No Remote Desktop
echo "DISABLING REMOTE DESKTOP"
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f
goto MENU

:Six
REM Windows auomatic updates
echo "ENABLING AUTO-UPDATES"
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 3 /f
goto MENU

:Seven
REM Removing good ol' insecure stuff
echo "DISABLING WEAK SERVICES"
dism /online /disable-feature /featurename:IIS-WebServerRole >NUL
dism /online /disable-feature /featurename:IIS-WebServer >NUL
dism /online /disable-feature /featurename:IIS-CommonHttpFeatures >NUL
dism /online /disable-feature /featurename:IIS-HttpErrors >NUL
dism /online /disable-feature /featurename:IIS-HttpRedirect >NUL
dism /online /disable-feature /featurename:IIS-ApplicationDevelopment >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility45 >NUL
dism /online /disable-feature /featurename:IIS-HealthAndDiagnostics >NUL
dism /online /disable-feature /featurename:IIS-HttpLogging >NUL
dism /online /disable-feature /featurename:IIS-LoggingLibraries >NUL
dism /online /disable-feature /featurename:IIS-RequestMonitor >NUL
dism /online /disable-feature /featurename:IIS-HttpTracing >NUL
dism /online /disable-feature /featurename:IIS-Security >NUL
dism /online /disable-feature /featurename:IIS-URLAuthorization >NUL
dism /online /disable-feature /featurename:IIS-RequestFiltering >NUL
dism /online /disable-feature /featurename:IIS-IPSecurity >NUL
dism /online /disable-feature /featurename:IIS-Performance >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionDynamic >NUL
dism /online /disable-feature /featurename:IIS-WebServerManagementTools >NUL
dism /online /disable-feature /featurename:IIS-ManagementScriptingTools >NUL
dism /online /disable-feature /featurename:IIS-IIS6ManagementCompatibility >NUL
dism /online /disable-feature /featurename:IIS-Metabase >NUL
dism /online /disable-feature /featurename:IIS-HostableWebCore >NUL
dism /online /disable-feature /featurename:IIS-StaticContent >NUL
dism /online /disable-feature /featurename:IIS-DefaultDocument >NUL
dism /online /disable-feature /featurename:IIS-DirectoryBrowsing >NUL
dism /online /disable-feature /featurename:IIS-WebDAV >NUL
dism /online /disable-feature /featurename:IIS-WebSockets >NUL
dism /online /disable-feature /featurename:IIS-ApplicationInit >NUL
dism /online /disable-feature /featurename:IIS-ASPNET >NUL
dism /online /disable-feature /featurename:IIS-ASPNET45 >NUL
dism /online /disable-feature /featurename:IIS-ASP >NUL
dism /online /disable-feature /featurename:IIS-CGI >NUL
dism /online /disable-feature /featurename:IIS-ISAPIExtensions >NUL
dism /online /disable-feature /featurename:IIS-ISAPIFilter >NUL
dism /online /disable-feature /featurename:IIS-ServerSideIncludes >NUL
dism /online /disable-feature /featurename:IIS-CustomLogging >NUL
dism /online /disable-feature /featurename:IIS-BasicAuthentication >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionStatic >NUL
dism /online /disable-feature /featurename:IIS-ManagementConsole >NUL
dism /online /disable-feature /featurename:IIS-ManagementService >NUL
dism /online /disable-feature /featurename:IIS-WMICompatibility >NUL
dism /online /disable-feature /featurename:IIS-LegacyScripts >NUL
dism /online /disable-feature /featurename:IIS-LegacySnapIn >NUL
dism /online /disable-feature /featurename:IIS-FTPServer >NUL
dism /online /disable-feature /featurename:IIS-FTPSvc >NUL
dism /online /disable-feature /featurename:IIS-FTPExtensibility >NUL
dism /online /disable-feature /featurename:TFTP >NUL
dism /online /disable-feature /featurename:TelnetClient >NUL
dism /online /disable-feature /featurename:TelnetServer >NUL
goto MENU

:Eight
REM START SYS INTEG SCAN!
echo "STARTING SYSTEM INTERGRITY SCAN"
Sfc.exe /scannow
goto MENU

:Nine
REM PowerShell RootKit detection start
echo "POWERSHELL ROOTKIT DETECTION WITH MALWAREBYTES ROOTKIT BETA"
powershell Invoke-WebRequest -OutFile MBRTKit.exe https://data-cdn.mbamupdates.com/web/mbar-1.09.3.1001.exe
MBRTKit.exe
goto MENU

PAUSE

Update Main.bat

Update Main.bat


@setlocal enabledelayedexpansion

REM Parse Arguments.

set NugetZipUrlRoot=https://dotnetci.blob.core.windows.net/roslyn
set NugetZipUrl=%NuGetZipUrlRoot%/nuget.35.zip
set RoslynRoot=%~dp0
set BuildConfiguration=Debug
set BuildRestore=false

REM Because override the C#/VB toolset to build against our LKG package, it is important
REM that we do not reuse MSBuild nodes from other jobs/builds on the machine. Otherwise,
REM we'll run into issues such as https://github.com/dotnet/roslyn/issues/6211.
set MSBuildAdditionalCommandLineArgs=/nologo /m /nodeReuse:false /consoleloggerparameters:Verbosity=minimal /filelogger /fileloggerparameters:Verbosity=normal

:ParseArguments
if "%1" == "" goto :DoneParsing
if /I "%1" == "/?" call :Usage && exit /b 1
if /I "%1" == "/debug" set BuildConfiguration=Debug&&shift&& goto :ParseArguments
if /I "%1" == "/release" set BuildConfiguration=Release&&shift&& goto :ParseArguments
if /I "%1" == "/test32" set Test64=false&&shift&& goto :ParseArguments
if /I "%1" == "/test64" set Test64=true&&shift&& goto :ParseArguments
if /I "%1" == "/perf" set Perf=true&&shift&& goto :ParseArguments
if /I "%1" == "/restore" set BuildRestore=true&&shift&& goto :ParseArguments
call :Usage && exit /b 1
:DoneParsing

if defined Perf (
  if defined Test64 (
    echo ERROR: Cannot combine /perf with either /test32 or /test64
    call :Usage && exit /b 1
  )

  if "%BuildConfiguration%" == "Debug" (
    echo Warning: Running perf tests on a Debug build is not recommended. Use /release for a Release build.
  )
)

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" || goto :BuildFailed

powershell -noprofile -executionPolicy RemoteSigned -command "%RoslynRoot%\build\scripts\check-branch.ps1" || goto :BuildFailed

REM Restore the NuGet packages
if "%BuildRestore%" == "true" (
    call "%RoslynRoot%\Restore.cmd" || goto :BuildFailed
) else (
    powershell -noprofile -executionPolicy RemoteSigned -command "%RoslynRoot%\build\scripts\restore.ps1 %NugetZipUrl%" || goto :BuildFailed
)

REM Set the build version only so the assembly version is set to the semantic version,
REM which allows analyzers to laod because the compiler has binding redirects to the
REM semantic version
msbuild %MSBuildAdditionalCommandLineArgs% /p:BuildVersion=0.0.0.0 %RoslynRoot%build/Toolset.sln /p:NuGetRestorePackages=false /p:Configuration=%BuildConfiguration% /fileloggerparameters:LogFile=%RoslynRoot%Binaries\Bootstrap.log || goto :BuildFailed

if not exist "%RoslynRoot%Binaries\Bootstrap" mkdir "%RoslynRoot%Binaries\Bootstrap" || goto :BuildFailed
move "Binaries\%BuildConfiguration%\*" "%RoslynRoot%Binaries\Bootstrap" || goto :BuildFailed
copy "build\scripts\*" "%RoslynRoot%Binaries\Bootstrap" || goto :BuildFailed

REM Clean the previous build
msbuild %MSBuildAdditionalCommandLineArgs% /t:Clean build/Toolset.sln /p:Configuration=%BuildConfiguration%  /fileloggerparameters:LogFile=%RoslynRoot%Binaries\BootstrapClean.log || goto :BuildFailed

call :TerminateCompilerServer

if defined Perf (
  set Target=Build
) else (
  set Target=BuildAndTest
)

msbuild %MSBuildAdditionalCommandLineArgs% /p:BootstrapBuildPath=%RoslynRoot%Binaries\Bootstrap BuildAndTest.proj /t:%Target% /p:Configuration=%BuildConfiguration% /p:Test64=%Test64% /fileloggerparameters:LogFile=%RoslynRoot%Binaries\Build.log || goto :BuildFailed

call :TerminateCompilerServer

REM Verify that our project.lock.json files didn't change as a result of
REM restore.  If they do then the commit changed the dependencies without
REM updating the lock files.
REM git diff --exit-code --quiet
REM if ERRORLEVEL 1 (
REM    echo Commit changed dependencies without updating project.lock.json
REM    git diff --exit-code
REM    exit /b 1
REM )

if defined Perf (
  if DEFINED JenkinsCIPerfCredentials (
    powershell .\ciperf.ps1 -BinariesDirectory %RoslynRoot%Binaries\%BuildConfiguration% %JenkinsCIPerfCredentials% || goto :BuildFailed
  ) else (
    powershell .\ciperf.ps1 -BinariesDirectory %RoslynRoot%Binaries\%BuildConfiguration% -StorageAccountName roslynscratch -StorageContainer drops -SCRAMScope 'Roslyn\Azure' || goto :BuildFailed
  )
)

REM Ensure caller sees successful exit.
exit /b 0

:Usage
@echo Usage: cibuild.cmd [/debug^|/release] [/test32^|/test64^|/perf]
@echo   /debug   Perform debug build.  This is the default.
@echo   /release Perform release build.
@echo   /test32  Run unit tests in the 32-bit runner.  This is the default.
@echo   /test64  Run units tests in the 64-bit runner.
@echo   /perf    Submit a job to the performance test system. Usually combined
@echo            with /release. May not be combined with /test32 or /test64.
@echo.
@goto :eof

:BuildFailed
echo Build failed with ERRORLEVEL %ERRORLEVEL%
call :TerminateCompilerServer
exit /b 1

:TerminateCompilerServer
@REM Kill any instances VBCSCompiler.exe to release locked files, ignoring stderr if process is not open
@REM This prevents future CI runs from failing hile trying to delete those files.

taskkill /F /IM vbcscompiler.exe 2> nul

@setlocal enabledelayedexpansion

REM Parse Arguments.

set NugetZipUrlRoot=https://dotnetci.blob.core.windows.net/roslyn
set NugetZipUrl=%NuGetZipUrlRoot%/nuget.35.zip
set RoslynRoot=%~dp0
set BuildConfiguration=Debug
set BuildRestore=false

REM Because override the C#/VB toolset to build against our LKG package, it is important
REM that we do not reuse MSBuild nodes from other jobs/builds on the machine. Otherwise,
REM we'll run into issues such as https://github.com/dotnet/roslyn/issues/6211.
set MSBuildAdditionalCommandLineArgs=/nologo /m /nodeReuse:false /consoleloggerparameters:Verbosity=minimal /filelogger /fileloggerparameters:Verbosity=normal

:ParseArguments
if "%1" == "" goto :DoneParsing
if /I "%1" == "/?" call :Usage && exit /b 1
if /I "%1" == "/debug" set BuildConfiguration=Debug&&shift&& goto :ParseArguments
if /I "%1" == "/release" set BuildConfiguration=Release&&shift&& goto :ParseArguments
if /I "%1" == "/test32" set Test64=false&&shift&& goto :ParseArguments
if /I "%1" == "/test64" set Test64=true&&shift&& goto :ParseArguments
if /I "%1" == "/perf" set Perf=true&&shift&& goto :ParseArguments
if /I "%1" == "/restore" set BuildRestore=true&&shift&& goto :ParseArguments
call :Usage && exit /b 1
:DoneParsing

if defined Perf (
  if defined Test64 (
    echo ERROR: Cannot combine /perf with either /test32 or /test64
    call :Usage && exit /b 1
  )

  if "%BuildConfiguration%" == "Debug" (
    echo Warning: Running perf tests on a Debug build is not recommended. Use /release for a Release build.
  )
)

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" || goto :BuildFailed

powershell -noprofile -executionPolicy RemoteSigned -command "%RoslynRoot%\build\scripts\check-branch.ps1" || goto :BuildFailed

REM Restore the NuGet packages
if "%BuildRestore%" == "true" (
    call "%RoslynRoot%\Restore.cmd" || goto :BuildFailed
) else (
    powershell -noprofile -executionPolicy RemoteSigned -command "%RoslynRoot%\build\scripts\restore.ps1 %NugetZipUrl%" || goto :BuildFailed
)

REM Set the build version only so the assembly version is set to the semantic version,
REM which allows analyzers to laod because the compiler has binding redirects to the
REM semantic version
msbuild %MSBuildAdditionalCommandLineArgs% /p:BuildVersion=0.0.0.0 %RoslynRoot%build/Toolset.sln /p:NuGetRestorePackages=false /p:Configuration=%BuildConfiguration% /fileloggerparameters:LogFile=%RoslynRoot%Binaries\Bootstrap.log || goto :BuildFailed

if not exist "%RoslynRoot%Binaries\Bootstrap" mkdir "%RoslynRoot%Binaries\Bootstrap" || goto :BuildFailed
move "Binaries\%BuildConfiguration%\*" "%RoslynRoot%Binaries\Bootstrap" || goto :BuildFailed
copy "build\scripts\*" "%RoslynRoot%Binaries\Bootstrap" || goto :BuildFailed

REM Clean the previous build
msbuild %MSBuildAdditionalCommandLineArgs% /t:Clean build/Toolset.sln /p:Configuration=%BuildConfiguration%  /fileloggerparameters:LogFile=%RoslynRoot%Binaries\BootstrapClean.log || goto :BuildFailed

call :TerminateCompilerServer

if defined Perf (
  set Target=Build
) else (
  set Target=BuildAndTest
)

msbuild %MSBuildAdditionalCommandLineArgs% /p:BootstrapBuildPath=%RoslynRoot%Binaries\Bootstrap BuildAndTest.proj /t:%Target% /p:Configuration=%BuildConfiguration% /p:Test64=%Test64% /fileloggerparameters:LogFile=%RoslynRoot%Binaries\Build.log || goto :BuildFailed

call :TerminateCompilerServer

REM Verify that our project.lock.json files didn't change as a result of
REM restore.  If they do then the commit changed the dependencies without
REM updating the lock files.
REM git diff --exit-code --quiet
REM if ERRORLEVEL 1 (
REM    echo Commit changed dependencies without updating project.lock.json
REM    git diff --exit-code
REM    exit /b 1
REM )

if defined Perf (
  if DEFINED JenkinsCIPerfCredentials (
    powershell .\ciperf.ps1 -BinariesDirectory %RoslynRoot%Binaries\%BuildConfiguration% %JenkinsCIPerfCredentials% || goto :BuildFailed
  ) else (
    powershell .\ciperf.ps1 -BinariesDirectory %RoslynRoot%Binaries\%BuildConfiguration% -StorageAccountName roslynscratch -StorageContainer drops -SCRAMScope 'Roslyn\Azure' || goto :BuildFailed
  )
)

REM Ensure caller sees successful exit.
exit /b 0

:Usage
@echo Usage: cibuild.cmd [/debug^|/release] [/test32^|/test64^|/perf]
@echo   /debug   Perform debug build.  This is the default.
@echo   /release Perform release build.
@echo   /test32  Run unit tests in the 32-bit runner.  This is the default.
@echo   /test64  Run units tests in the 64-bit runner.
@echo   /perf    Submit a job to the performance test system. Usually combined
@echo            with /release. May not be combined with /test32 or /test64.
@echo.
@goto :eof

:BuildFailed
echo Build failed with ERRORLEVEL %ERRORLEVEL%
call :TerminateCompilerServer
exit /b 1

:TerminateCompilerServer
@REM Kill any instances VBCSCompiler.exe to release locked files, ignoring stderr if process is not open
@REM This prevents future CI runs from failing while trying to delete those files.

taskkill /F /IM vbcscompiler.exe 2> nul

Fix spelling mistake in CIBuild

Fix spelling mistake in CIBuild


:: Save source for C code and remove compiled libraries
copy "%SRC_DIR%\goodvibes\share\symmetry.c" symmetry.c
rd /S /Q "%SRC_DIR%\goodvibes\share\"

:: Install Python
"%PYTHON%" -m pip install . -vv

:: Compile C code and move to expected destination
md %SP_DIR%\goodvibes\share\
"%CC%" /LD symmetry.c /F "%SP_DIR%\goodvibes\share\symmetry_win.dll"

:: Save source for C code and remove compiled libraries
copy "%SRC_DIR%\goodvibes\share\symmetry.c" symmetry.c
rd /S /Q "%SRC_DIR%\goodvibes\share\"

:: Install Python
"%PYTHON%" -m pip install . -vv

:: Compile C code and move to expected destination
md %SP_DIR%\goodvibes\share\
"%CC%" /LD symmetry.c /OUT:"%SP_DIR%\goodvibes\share\symmetry_win.dll"

Update bld.bat

Update bld.bat


@REM __COPYRIGHT__
@REM __FILE__ __REVISION__ __DATE__ __DEVELOPER__
@echo off
set SCONS_ERRORLEVEL=
if "%OS%" == "Windows_NT" goto WinNT

@REM for 9x/Me you better not have more than 9 args
python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-__VERSION__'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-__VERSION__'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9
@REM no way to set exit status of this script for 9x/Me
goto endscons

@REM Credit where credit is due:  we return the exit code despite our
@REM use of setlocal+endlocal using a technique from Bear's Journal:
@REM http://code-bear.com/bearlog/2007/06/01/getting-the-exit-code-from-a-batch-file-that-is-run-from-a-python-program/

:WinNT
setlocal
@REM ensure the script will be executed with the Python it was installed for
set path=%~dp0;%~dp0..;%path%
python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-__VERSION__'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-__VERSION__'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %*
endlocal & set SCONS_ERRORLEVEL=%ERRORLEVEL%

if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto returncode
if errorlevel 9009 echo you do not have python in your PATH
goto endscons

:returncode
exit /B %SCONS_ERRORLEVEL%

:endscons
call :returncode %SCONS_ERRORLEVEL%

@REM __COPYRIGHT__
@REM __FILE__ __REVISION__ __DATE__ __DEVELOPER__
@echo off
set SCONS_ERRORLEVEL=
if "%OS%" == "Windows_NT" goto WinNT

@REM for 9x/Me you better not have more than 9 args
python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-__VERSION__'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-__VERSION__'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9
@REM no way to set exit status of this script for 9x/Me
goto endscons

@REM Credit where credit is due:  we return the exit code despite our
@REM use of setlocal+endlocal using a technique from Bear's Journal:
@REM http://code-bear.com/bearlog/2007/06/01/getting-the-exit-code-from-a-batch-file-that-is-run-from-a-python-program/

:WinNT
setlocal
@REM ensure the script will be executed with the Python it was installed for
set path=%~dp0;%~dp0..;%path%
@REM try the script named as the .bat file in current dir, then in Scripts subdir
set scriptname=%~dp0%~n0.py
if not exist %scriptname% set scriptname=%~dp0Scripts\%~n0.py
python "%scriptname%" %*
endlocal & set SCONS_ERRORLEVEL=%ERRORLEVEL%

if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto returncode
if errorlevel 9009 echo you do not have python in your PATH
goto endscons

:returncode
exit /B %SCONS_ERRORLEVEL%

:endscons
call :returncode %SCONS_ERRORLEVEL%

make .bat files execute .py script with the same name instead of trying to set sys.path inline it is a final fix for issue #2051 to make SCons easy_installable on Windows


echo ON

set DEFAULT_ANACONDA_BUILD_RECIPES=libboost python-scons python-gitpython
set DEFAULT_ANACONDA_CHANNELS=statiskit conda-forge
set DEFAULT_ANACONDA_CHANNEL=statiskit

if "%ANACONDA_CHANNELS%" == "" (
    set ANACONDA_CHANNELS=%DEFAULT_ANACONDA_CHANNELS%
) else (
    echo Channels used: %ANACONDA_CHANNELS%
)

if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=%DEFAULT_ANACONDA_CHANNEL%
) else (
    echo Channel used: %ANACONDA_CHANNEL%
)

set ANACONDA_CHANNEL_FLAGS=
for %%i in (%ANACONDA_CHANNELS%) do (
    set "ANACONDA_CHANNEL_FLAGS=!ANACONDA_CHANNEL_FLAGS! -c %%i"
)

if "%ANACONDA_BUILD_RECIPES%" == "" (
    set ANACONDA_BUILD_RECIPES=%DEFAULT_ANACONDA_BUILD_RECIPES%
) else (
    echo Recipes to build: %ANACONDA_BUILD_RECIPES%
)

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

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

echo ON

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

echo OFF

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

echo ON

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

set ANACONDA_BUILD_FLAGS=%ANACONDA_CHANNEL_FLAGS% %ANACONDA_BUILD_FLAGS%
for %%i in (%ANACONDA_BUILD_RECIPES%) do (
    for /f %%j in ('conda build %%i %ANACONDA_BUILD_FLAGS% --output') do anaconda upload %%i --user %ANACONDA_CHANNEL% %ANACONDA_UPLOAD_FLAGS%
)

anaconda logout

ECHO OFF

echo ON

set DEFAULT_ANACONDA_BUILD_RECIPES=libboost python-scons python-gitpython
set DEFAULT_ANACONDA_CHANNELS=statiskit conda-forge
set DEFAULT_ANACONDA_CHANNEL=statiskit

if "%ANACONDA_CHANNELS%" == "" (
    set ANACONDA_CHANNELS=%DEFAULT_ANACONDA_CHANNELS%
) else (
    echo Channels used: %ANACONDA_CHANNELS%
)

if "%ANACONDA_CHANNEL%" == "" (
    set ANACONDA_CHANNEL=%DEFAULT_ANACONDA_CHANNEL%
) else (
    echo Channel used: %ANACONDA_CHANNEL%
)

set ANACONDA_CHANNEL_FLAGS=
for %%i in (%ANACONDA_CHANNELS%) do (
    set "ANACONDA_CHANNEL_FLAGS=!ANACONDA_CHANNEL_FLAGS! -c %%i"
)

if "%ANACONDA_BUILD_RECIPES%" == "" (
    set ANACONDA_BUILD_RECIPES=%DEFAULT_ANACONDA_BUILD_RECIPES%
) else (
    echo Recipes to build: %ANACONDA_BUILD_RECIPES%
)

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

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

echo ON

conda install -n root anaconda-client
if errorlevel 1 (
    exit /b 1
)

echo OFF

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

echo ON

if "%TOOLCHAIN%" == "" (
    git clone https://gist.github.com/c491cb08d570beeba2c417826a50a9c3.git toolchain
    if errorlevel 1 (
        anaconda logout
        exit /b 1
    )

    cd toolchain
    call config.bat
    if errorlevel 1 (
        cd ..
        anaconda logout
        rmdir toolchain /s /q
        exit /b 1
    )
    cd ..
    rmdir toolchain /s /q
)

set ANACONDA_BUILD_FLAGS=%ANACONDA_CHANNEL_FLAGS% %ANACONDA_BUILD_FLAGS%
for %%i in (%ANACONDA_BUILD_RECIPES%) do (
    for /f %%j in ('conda build %%i %ANACONDA_BUILD_FLAGS% --output') do anaconda upload %%j --user %ANACONDA_CHANNEL% %ANACONDA_UPLOAD_FLAGS%
)

anaconda logout

ECHO OFF

Test errorlevel 1

Test errorlevel 1


@echo "mkDistribution v1.3"

if exist current (
	rmdir /s /q current
)

mkdir current

mkdir current\netcf-10
nant -t:netcf-1.0 -D:build.output.dir=current\netcf-10 -buildfile:sharpZLib.build build

mkdir current\netcf-20
nant -t:netcf-2.0 -D:build.output.dir=current\netcf-20 -buildfile:sharpZLib.build build

mkdir current\net-11
nant -t:net-1.1 -D:build.output.dir=current\net-11 -buildfile:sharpZLib.build build

mkdir current\net-20
nant -t:net-2.0 -D:build.output.dir=current\net-20 -buildfile:sharpZLib.build build

mkdir current\doc
copy doc\readme.rtf current\doc
copy doc\Changes.txt current\doc
copy doc\Copying.txt current\doc
copy SharpZipLib.chm current\doc
copy installGAC.bat current
copy uninstallGAC.bat current

"c:\Program Files\EWSoftware\Sandcastle Help File Builder\SandcastleBuilderConsole.exe" .\SharpZipLib.shfb

samples\cs\bin\sz -rc current\SharpZipLib.zip current\*.dll

@echo TODO Compress source to SharpZipLib_SourceSamples.zip
@echo TODO Build Bin Zip files

@echo "mkDistribution v1.4"

if exist current (
	rmdir /s /q current
)

mkdir current

mkdir current\netcf-10
nant -t:netcf-1.0 -D:build.output.dir=current\netcf-10 -buildfile:sharpZLib.build build

mkdir current\netcf-20
nant -t:netcf-2.0 -D:build.output.dir=current\netcf-20 -buildfile:sharpZLib.build build

mkdir current\net-11
nant -t:net-1.1 -D:build.output.dir=current\net-11 -buildfile:sharpZLib.build build

mkdir current\net-20
nant -t:net-2.0 -D:build.output.dir=current\net-20 -buildfile:sharpZLib.build build

"c:\Program Files\EWSoftware\Sandcastle Help File Builder\SandcastleBuilderConsole.exe" .\SharpZipLib.shfb

mkdir current\doc
copy doc\readme.rtf current\doc
copy doc\Changes.txt current\doc
copy doc\Copying.txt current\doc
copy SharpZipLib.chm current\doc
copy installGAC.bat current
copy uninstallGAC.bat current

samples\cs\bin\sz -rc current\SharpZipLib.zip current\*.dll

@echo TODO Compress source to SharpZipLib_SourceSamples.zip
@echo TODO Build Bin Zip files

Build help file before copying it!

Build help file before copying it!


:: Copyright (c) 2011 The Native Client Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.

@echo off
setlocal
set HERMETIC_CYGWIN=hermetic_cygwin_1_7_15-0_1-with-20120816-cygwin
if exist "%~dp0..\cygwin\%HERMETIC_CYGWIN%.installed" goto :skip_cygwin_install
if exist "%~dp0..\tools\BUILD\.gcc-extras-version" del "%~dp0..\tools\BUILD\.gcc-extras-version"
if exist "%~dp0..\tools\BACKPORTS\binutils" rmdir /s /q "%~dp0..\tools\BACKPORTS\binutils"
if exist "%~dp0..\tools\BACKPORTS\gcc" rmdir /s /q "%~dp0..\tools\BACKPORTS\gcc"
if exist "%~dp0..\tools\BACKPORTS\gdb" rmdir /s /q "%~dp0..\tools\BACKPORTS\gdb"
if exist "%~dp0..\tools\BACKPORTS\glibc" rmdir /s /q "%~dp0..\tools\BACKPORTS\glibc"
if exist "%~dp0..\tools\BACKPORTS\linux-headers-for-nacl" rmdir /s /q "%~dp0..\tools\BACKPORTS\linux-headers-for-nacl"
if exist "%~dp0..\tools\BACKPORTS\newlib" rmdir /s /q "%~dp0..\tools\BACKPORTS\newlib"
if not exist "%~dp0..\cygwin" goto :dont_remove_cygwin
rmdir /s /q "%~dp0..\cygwin"
if errorlevel 1 goto :rmdir_fail
mkdir "%~dp0..\cygwin"
:dont_remove_cygwin
cscript //nologo //e:jscript "%~dp0get_file.js" https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/cygwin_mirror/%HERMETIC_CYGWIN%.exe "%~dp0%HERMETIC_CYGWIN%.exe"
if errorlevel 1 goto :download_fail
:download_success
start /WAIT %~dp0%HERMETIC_CYGWIN%.exe /DEVEL /S /D=%~dp0..\cygwin
if errorlevel 1 goto :install_fail
set CYGWIN=nodosfilewarning
"%~dp0..\cygwin\bin\touch" "%~dp0..\cygwin\%HERMETIC_CYGWIN%.installed"
if errorlevel 1 goto :install_fail
del /f /q "%~dp0%HERMETIC_CYGWIN%.exe"
:skip_cygwin_install
endlocal
set "PATH=%~dp0..\cygwin\bin;%PATH%"
goto :end
:rmdir_fail
endlocal
echo Failed to remove old version of cygwin
set ERRORLEVEL=1
goto :end
:download_fail
:: TODO(bradnelson): Check certs when this issue is resolved.
::     http://code.google.com/p/nativeclient/issues/detail?id=2931
c:\cygwin\bin\wget --no-check-certificate https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/cygwin_mirror/%HERMETIC_CYGWIN%.exe -O "%~dp0%HERMETIC_CYGWIN%.exe"
if errorlevel 1 goto :wget_fail
goto download_success
:wget_fail
c:\cygwin\bin\wget --no-check-certificate https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/cygwin_mirror/%HERMETIC_CYGWIN%.exe -O "%~dp0%HERMETIC_CYGWIN%.exe"
if errorlevel 1 goto :cygwin_wget_fail
goto download_success
:cygwin_wget_fail
endlocal
echo Failed to download cygwin
set ERRORLEVEL=1
goto :end
:install_fail
endlocal
echo Failed to install cygwin
set ERRORLEVEL=1
goto :end
:end

:: Copyright (c) 2011 The Native Client Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.

@echo off
setlocal
set HERMETIC_CYGWIN=hermetic_cygwin_1_7_15-0_1-with-20120817-cygwin
if exist "%~dp0..\cygwin\%HERMETIC_CYGWIN%.installed" goto :skip_cygwin_install
if exist "%~dp0..\tools\BUILD\.gcc-extras-version" del "%~dp0..\tools\BUILD\.gcc-extras-version"
if exist "%~dp0..\tools\BACKPORTS\binutils" rmdir /s /q "%~dp0..\tools\BACKPORTS\binutils"
if exist "%~dp0..\tools\BACKPORTS\gcc" rmdir /s /q "%~dp0..\tools\BACKPORTS\gcc"
if exist "%~dp0..\tools\BACKPORTS\gdb" rmdir /s /q "%~dp0..\tools\BACKPORTS\gdb"
if exist "%~dp0..\tools\BACKPORTS\glibc" rmdir /s /q "%~dp0..\tools\BACKPORTS\glibc"
if exist "%~dp0..\tools\BACKPORTS\linux-headers-for-nacl" rmdir /s /q "%~dp0..\tools\BACKPORTS\linux-headers-for-nacl"
if exist "%~dp0..\tools\BACKPORTS\newlib" rmdir /s /q "%~dp0..\tools\BACKPORTS\newlib"
if not exist "%~dp0..\cygwin" goto :dont_remove_cygwin
rmdir /s /q "%~dp0..\cygwin"
if errorlevel 1 goto :rmdir_fail
mkdir "%~dp0..\cygwin"
:dont_remove_cygwin
cscript //nologo //e:jscript "%~dp0get_file.js" https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/cygwin_mirror/%HERMETIC_CYGWIN%.exe "%~dp0%HERMETIC_CYGWIN%.exe"
if errorlevel 1 goto :download_fail
:download_success
start /WAIT %~dp0%HERMETIC_CYGWIN%.exe /DEVEL /S /D=%~dp0..\cygwin
if errorlevel 1 goto :install_fail
set CYGWIN=nodosfilewarning
"%~dp0..\cygwin\bin\touch" "%~dp0..\cygwin\%HERMETIC_CYGWIN%.installed"
if errorlevel 1 goto :install_fail
del /f /q "%~dp0%HERMETIC_CYGWIN%.exe"
:skip_cygwin_install
endlocal
set "PATH=%~dp0..\cygwin\bin;%PATH%"
goto :end
:rmdir_fail
endlocal
echo Failed to remove old version of cygwin
set ERRORLEVEL=1
goto :end
:download_fail
:: TODO(bradnelson): Check certs when this issue is resolved.
::     http://code.google.com/p/nativeclient/issues/detail?id=2931
c:\cygwin\bin\wget --no-check-certificate https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/cygwin_mirror/%HERMETIC_CYGWIN%.exe -O "%~dp0%HERMETIC_CYGWIN%.exe"
if errorlevel 1 goto :wget_fail
goto download_success
:wget_fail
c:\cygwin\bin\wget --no-check-certificate https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/cygwin_mirror/%HERMETIC_CYGWIN%.exe -O "%~dp0%HERMETIC_CYGWIN%.exe"
if errorlevel 1 goto :cygwin_wget_fail
goto download_success
:cygwin_wget_fail
endlocal
echo Failed to download cygwin
set ERRORLEVEL=1
goto :end
:install_fail
endlocal
echo Failed to install cygwin
set ERRORLEVEL=1
goto :end
:end

Remove optimization in cygwin that leads to race conditions.
This version is based on 20120817 cygwin snapshot.

BUG= http://code.google.com/p/nativeclient/issues/detail?id=1918
TEST= win bots
Review URL: https://chromiumcodereview.appspot.com/10870065

git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@9558 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2


Update integration-tests.bat

Update integration-tests.bat


python -m venv env
CALL env\Scripts\activate.bat
python -m pip install -U pip
powershell -Command "(New-Object Net.WebClient).DownloadFile('http://ftp.esrf.eu/pub/scisoft/silx/wheelhouse/lxml-3.6.0-cp35-cp35m-win_amd64.whl', 'lxml-3.6.0-cp35-cp35m-win_amd64.whl')"
pip install lxml-3.6.0-cp35-cp35m-win_amd64.whl
del lxml-3.6.0-cp35-cp35m-win_amd64.whl
pip install -r requirements.txt
python create_local_settings.py
python manage.py migrate

Create initial windows install/setup script


rem https://gist.github.com/nimaid/a7d6d793f2eba4020135208a57f5c532
@echo off

set ORIGDIR="%CD%"

set MINICONDAPATH=%USERPROFILE%\Miniconda3
set CONDAEXE=%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%-condainstall.exe
set "OS="
set "MCLINK="

where conda >nul 2>nul
if %ERRORLEVEL% EQU 0 goto CONDAFOUND

:INSTALLCONDA
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT
if %OS%==32BIT set MCLINK=https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86.exe
if %OS%==64BIT set MCLINK=https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe

echo Downloading Miniconda3 (This will take while, please wait)...
powershell -Command "(New-Object Net.WebClient).DownloadFile('%MCLINK%', '%CONDAEXE%')" >nul 2>nul
if errorlevel 1 goto CONDAERROR

echo Installing Miniconda3 (This will also take a while, please wait)...
start /wait /min "Installing Miniconda3..." "%CONDAEXE%" /InstallationType=JustMe /S /D="%MINICONDAPATH%"
del "%CONDAEXE%"
if not exist "%MINICONDAPATH%\" (goto CONDAERROR)

"%MINICONDAPATH%\Scripts\conda.exe" init
if errorlevel 1 goto CONDAERROR

echo Miniconda3 has been installed!
goto END

:CONDAERROR
echo Miniconda3 install failed!
exit /B 1

:CONDAFOUND
echo Conda is already installed!
goto END

:END
exit /B 0

rem https://gist.github.com/maximlt/531419545b039fa33f8845e5bc92edd6
call conda create -f environment.yml
call conda activate gdsfactory

git clone https://github.com/gdsfactory/gdslib.git -b data
pre-commit install
gf tool install

rem ensures conda is installed and installs gdsfactory package
rem https://gist.github.com/nimaid/a7d6d793f2eba4020135208a57f5c532
@echo off

set ORIGDIR="%CD%"

set MINICONDAPATH=%USERPROFILE%\Miniconda3
set CONDAEXE=%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%-condainstall.exe
set "OS="
set "MCLINK="

where conda >nul 2>nul
if %ERRORLEVEL% EQU 0 goto CONDAFOUND

:INSTALLCONDA
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT
if %OS%==32BIT set MCLINK=https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86.exe
if %OS%==64BIT set MCLINK=https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe

echo Downloading Miniconda3 (This will take while, please wait)...
powershell -Command "(New-Object Net.WebClient).DownloadFile('%MCLINK%', '%CONDAEXE%')" >nul 2>nul
if errorlevel 1 goto CONDAERROR

echo Installing Miniconda3 (This will also take a while, please wait)...
start /wait /min "Installing Miniconda3..." "%CONDAEXE%" /InstallationType=JustMe /S /D="%MINICONDAPATH%"
del "%CONDAEXE%"
if not exist "%MINICONDAPATH%\" (goto CONDAERROR)

"%MINICONDAPATH%\Scripts\conda.exe" init
if errorlevel 1 goto CONDAERROR

echo Miniconda3 has been installed!
goto END

:CONDAERROR
echo Miniconda3 install failed!
exit /B 1

:CONDAFOUND
echo Conda is already installed!
goto END

rem https://gist.github.com/maximlt/531419545b039fa33f8845e5bc92edd6
call conda create -f environment.yml
call conda activate gdsfactory

git clone https://github.com/gdsfactory/gdslib.git -b data
pre-commit install
gf tool install

:END
exit /B 0

fix install.bat

fix install.bat


@echo off

NET SESSION >nul 2>&1
IF %ERRORLEVEL% NEQ 0 (
    ECHO Not an admin, exiting.
    EXIT /B 1
)

setlocal EnableDelayedExpansion

:: ############################
:: # Create symlinks from the home directory to any desired dotfiles directory.
:: ############################

:: dotfiles directory
set dotfilesdir=%~dp0

:: backup directory
set backupdir=%USERPROFILE%\dotfiles_backup

:: list of files/folders to symlink in homedir
set dotfiles=bashrc bash_profile bash dir_colors inputrc minttyrc gitconfig

for %%A in (%dotfiles%) DO (
  set target=%dotfilesdir%%%A
  set link=%USERPROFILE%\.%%A
  set linkExists="0"

  if exist "!link!" (
    set Z=&& for %%B in ("!link!") do set Z=%%~aB
    if "!Z:~8,1!" == "l" (
      set linkExists="1"
    ) else (
      if not exist "%backupdir%" (
        mkdir "%backupdir%"
      )
      echo Moving existing !link! to %backupdir%
      move "!link!" "%backupdir%"
    )
  )

  if !linkExists! == "0" (
    if exist "!target!\" (
      mklink /d "!link!" "!target!"
    ) else (
      mklink "!link!" "!target!"
    )
    attrib /L "!link!" +h
  )
)

set sublime=%USERPROFILE%\AppData\Roaming\Sublime Text 2

if exist "%sublime%" (
  mkdir "%sublime%\Backup"
  move "%sublime%\Installed Packages" "%sublime%\Backup"
  move "%sublime%\Packages" "%sublime%\Backup"
  move "%sublime%\Pristine Packages" "%sublime%\Backup"
  mklink /D "%sublime%\Installed Packages" "%~dp0sublime\Installed Packages"
  mklink /D "%sublime%\Packages" "%~dp0sublime\Packages"
  mklink /D "%sublime%\Pristine Packages" "%~dp0sublime\Pristine Packages"
)

mklink %USERPROFILE%\init.bat "%dotfilesdir%\init.bat"

@echo off

NET SESSION >nul 2>&1
IF %ERRORLEVEL% NEQ 0 (
    ECHO Not an admin, exiting.
    EXIT /B 1
)

setlocal EnableDelayedExpansion

:: ############################
:: # Create symlinks from the home directory to any desired dotfiles directory.
:: ############################

:: dotfiles directory
set dotfilesdir=%~dp0

:: backup directory
set backupdir=%USERPROFILE%\dotfiles_backup

:: list of files/folders to symlink in homedir
set dotfiles=bashrc bash_profile bash dir_colors inputrc minttyrc gitconfig

for %%A in (%dotfiles%) DO (
  set target=%dotfilesdir%%%A
  set link=%USERPROFILE%\.%%A
  set linkExists="0"

  if exist "!link!" (
    set Z=&& for %%B in ("!link!") do set Z=%%~aB
    if "!Z:~8,1!" == "l" (
      set linkExists="1"
    ) else (
      if not exist "%backupdir%" (
        mkdir "%backupdir%"
      )
      echo Moving existing !link! to %backupdir%
      move "!link!" "%backupdir%"
    )
  )

  if !linkExists! == "0" (
    if exist "!target!\" (
      mklink /d "!link!" "!target!"
    ) else (
      mklink "!link!" "!target!"
    )
    attrib /L "!link!" +h
  )
)

set sublime=%USERPROFILE%\AppData\Roaming\Sublime Text 2

if exist "%sublime%" (
  mkdir "%sublime%\Backup"
  move "%sublime%\Installed Packages" "%sublime%\Backup"
  move "%sublime%\Packages" "%sublime%\Backup"
  move "%sublime%\Pristine Packages" "%sublime%\Backup"
  mklink /d "%sublime%\Installed Packages" "%~dp0sublime\Installed Packages"
  mklink /d "%sublime%\Packages" "%~dp0sublime\Packages"
  mklink /d "%sublime%\Pristine Packages" "%~dp0sublime\Pristine Packages"
)

mklink %USERPROFILE%\init.bat "%dotfilesdir%\init.bat"

Use lowercase parameters

Use lowercase parameters


echo "Testing Ant Now"

IF NOT DEFINED RUBY_HOME (
	echo "%%RUBY_HOME%% is missing"
	exit 1
)

IF NOT EXIST %RUBY_HOME%\bin\ruby.exe(
	echo "%RUBY_HOME%\bin\ruby.exe didn't exit"
	exit 2
)

gem install haml
IF %ERRORLEVEL% NEQ 0 (
	echo "gem command doesn't work"
	exit %ERRORLEVEL%
)
ruby hello-world.rb
IF %ERRORLEVEL% NEQ 0 (
	echo "ruby command doesn't work"
	exit %ERRORLEVEL%
)

echo "Testing Ant Now"

IF NOT DEFINED ANT_HOME (
	echo "%%ANT_HOME%% is missing"
	exit 1
)

IF NOT EXIST %ANT_HOME%\bin\ant.bat (
	echo "%%ANT_HOME%%\bin\ant.bat"
	exit 2
)

ant -f hello-ant.xml
IF %ERRORLEVEL% NEQ 0 exit %ERRORLEVEL%

Fix ant test

Fix ant test


@echo off
for /R %%x in (bin) do if exist "%%x" rmdir /s /q "%%x" 1>NUL 2>NUL
for /R %%x in (obj) do if exist "%%x" rmdir /s /q "%%x" 1>NUL 2>NUL

rmdir /s /q .vs 1>NUL 2>NUL
rmdir /s /q packages 1>NUL 2>NUL
rmdir /s /q coverage 1>NUL 2>NUL

del /f /s /q *.user 1>NUL 2>NUL

@echo off
for /R .. %%x in (bin) do if exist "%%x" rmdir /s /q "%%x" 1>NUL 2>NUL
for /R .. %%x in (obj) do if exist "%%x" rmdir /s /q "%%x" 1>NUL 2>NUL

rmdir /s /q .vs 1>NUL 2>NUL
rmdir /s /q packages 1>NUL 2>NUL
rmdir /s /q coverage 1>NUL 2>NUL

del /f /s /q *.user 1>NUL 2>NUL

clean ..\bin directory

Fixed: clean ..\bin directory


@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega

Convert line-endings from CRLF to LF.

Convert line-endings from CRLF to LF.


:: setup variables which are used in Visual Studio project.
@echo off
call setup_environment.bat > nul

set BOOST_DIR=c:\libraries\boost\boost_1_52_0
set FREEIMAGELIB_DIR=c:\libraries\FreeImage\%FreeImage_VERSION%
::set AIMP_PLUGINS_DIR=%ProgramFiles%\AIMP3\Plugins
set AIMP_PLUGINS_DIR=c:\AIMP\AIMP3.55.1332\Plugins

:: setup variables which are used in Visual Studio project.
@echo off
call setup_environment.bat > nul

set BOOST_DIR=c:\libraries\boost\boost_1_52_0
set FREEIMAGELIB_DIR=c:\libraries\FreeImage\%FreeImage_VERSION%
::set AIMP_PLUGINS_DIR=%ProgramFiles%\AIMP3\Plugins
set AIMP_PLUGINS_DIR=c:\AIMP\AIMP3.55.1338\Plugins

use AIMP 3.55.1338 by default.

use AIMP 3.55.1338 by default.