@echo on
choco install -y --allowEmptyChecksum firefox googlechrome wget notepadplusplus sublimetext3 mono monodevelop gtksharp visualstudiocode p4merge dotnet4.5 nodejs.install conemu dejavufonts ag golang
call refreshenv

wget -c https://cygwin.com/setup-x86_64.exe
setup-x86_64.exe -R "C:\cygwin64" -s http://mirror.switch.ch/ftp/mirror/cygwin/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang,cmake,lua,perl,the_silver_searcher,gnupg,patch,zlib-devel,openssl-devel,libyaml-devel,libyaml0_2,sqlite3,make,libtool,autoconf,automake,bison,m4,mingw64-i686-gcc-core,mingw64-x86_64-gcc-core,patch,cygwin32-readline,libcrypt-devel,libcrypt0,ncurses,libncurses-devel

set script_path=%~dp0
set repo_path=%script_path%\..\
set bash=c:\cygwin64\bin\bash.exe --login -c

for /f "delims=" %%A in ('%bash% "cd `cygpath $HOMEPATH`/dev/dotfiles && git rev-parse --abbrev-ref HEAD"') do set "branch=%%A"
%bash% 'echo "branch is $branch"'
%bash% "cp -vr `cygpath $HOMEPATH`/.ssh $HOME/"
%bash% "export OUTER_CLONE=`cygpath $repo_path` && $script_path/build_insider.sh"

@echo on
choco install -y --allowEmptyChecksum firefox googlechrome wget notepadplusplus sublimetext3 mono monodevelop gtksharp visualstudiocode p4merge dotnet4.5 nodejs.install conemu dejavufonts ag golang
call refreshenv

wget -c https://cygwin.com/setup-x86_64.exe
setup-x86_64.exe -R "C:\cygwin64" -s http://mirror.switch.ch/ftp/mirror/cygwin/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang,cmake,lua,perl,the_silver_searcher,gnupg,patch,zlib-devel,openssl-devel,libyaml-devel,libyaml0_2,sqlite3,make,libtool,autoconf,automake,bison,m4,mingw64-i686-gcc-core,mingw64-x86_64-gcc-core,patch,cygwin32-readline,libcrypt-devel,libcrypt0,ncurses,libncurses-devel,python-devel

set script_path=%~dp0
set repo_path=%script_path%\..\
set bash=c:\cygwin64\bin\bash.exe --login -c

for /f "delims=" %%A in ('%bash% "cd `cygpath $HOMEPATH`/dev/dotfiles && git rev-parse --abbrev-ref HEAD"') do set "branch=%%A"
%bash% 'echo "branch is $branch"'
%bash% "cp -vr `cygpath $HOMEPATH`/.ssh $HOME/"
%bash% "export OUTER_CLONE=`cygpath $repo_path` && $script_path/build_insider.sh"

Add python-devel, a Nikola dependency on cygwin


SET RDIR=Effekseer150
SET RDIR_R=EffekseerRuntime150

rmdir %RDIR%
mkdir %RDIR%

rmdir %RDIR_R%
mkdir %RDIR_R%

echo Copy runtime
mkdir %RDIR_R%\RuntimeSample\
mkdir %RDIR_R%\RuntimeSample\lib
mkdir %RDIR_R%\RuntimeSample\include

mkdir %RDIR_R%\src
mkdir %RDIR_R%\src\include
mkdir %RDIR_R%\src\lib

copy Dev\Cpp\Effekseer\Effekseer.h %RDIR_R%\src\include\.
copy Dev\Cpp\EffekseerRendererDX9\EffekseerRendererDX9.h %RDIR_R%\src\include\.
copy Dev\Cpp\EffekseerRendererDX11\EffekseerRendererDX11.h %RDIR_R%\src\include\.
copy Dev\Cpp\EffekseerRendererGL\EffekseerRendererGL.h %RDIR_R%\src\include\.
copy Dev\Cpp\EffekseerSoundXAudio2\EffekseerSoundXAudio2.h %RDIR_R%\src\include\.
copy Dev\Cpp\EffekseerSoundAL\EffekseerSoundAL.h %RDIR_R%\src\include\.

copy Dev\Cpp\EffekseerRendererDX9.sln %RDIR_R%\src\.
copy Dev\Cpp\EffekseerRendererDX11.sln %RDIR_R%\src\.
copy Dev\Cpp\EffekseerRendererGL.sln %RDIR_R%\src\.

mkdir %RDIR_R%\src\Effekseer
robocopy Dev\Cpp\Effekseer %RDIR_R%\src\Effekseer *.h *.cpp *.filters *.vcxproj *.fx /S

mkdir %RDIR_R%\src\EffekseerRendererDX9
robocopy Dev\Cpp\EffekseerRendererDX9 %RDIR_R%\src\EffekseerRendererDX9 *.h *.cpp *.filters *.vcxproj *.fx /S

mkdir %RDIR_R%\src\EffekseerRendererDX11
robocopy Dev\Cpp\EffekseerRendererDX11 %RDIR_R%\src\EffekseerRendererDX11 *.h *.cpp *.filters *.vcxproj *.fx /S

mkdir %RDIR_R%\src\EffekseerRendererGL
robocopy Dev\Cpp\EffekseerRendererGL %RDIR_R%\src\EffekseerRendererGL *.h *.cpp *.filters *.vcxproj *.fx /S

mkdir %RDIR_R%\src\EffekseerRendererCommon
robocopy Dev\Cpp\EffekseerRendererCommon %RDIR_R%\src\EffekseerRendererCommon *.h *.cpp *.filters *.vcxproj *.fx /S

mkdir %RDIR_R%\src\EffekseerSoundXAudio2
robocopy Dev\Cpp\EffekseerSoundXAudio2 %RDIR_R%\src\EffekseerSoundXAudio2 *.h *.cpp *.filters *.vcxproj *.fx /S

mkdir %RDIR_R%\src\EffekseerSoundAL
robocopy Dev\Cpp\EffekseerSoundAL %RDIR_R%\src\EffekseerSoundAL *.h *.cpp *.filters *.vcxproj *.fx /S

echo VS

mkdir %RDIR_R%\Compiled\

echo Compile VS15
rmdir /S /Q VS15
mkdir VS15

cd VS15
call cmake.bat -G "Visual Studio 15"  -D USE_MSVC_RUNTIME_LIBRARY_DLL:BOOL=OFF -D USE_XAUDIO2=ON ../
cmake.exe -G "Visual Studio 15"  -D USE_MSVC_RUNTIME_LIBRARY_DLL:BOOL=OFF -D USE_XAUDIO2=ON ../

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\MSBuild.exe" Effekseer.sln /p:configuration=Debug
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\MSBuild.exe" Effekseer.sln /p:configuration=Release
cd ..

echo Compile VS15WIN64
rmdir /S /Q VS15WIN64
mkdir VS15WIN64

cd VS15WIN64
call cmake.bat -G "Visual Studio 15 Win64"  -D USE_MSVC_RUNTIME_LIBRARY_DLL:BOOL=OFF -D USE_XAUDIO2=ON ../
cmake.exe -G "Visual Studio 15 Win64"  -D USE_MSVC_RUNTIME_LIBRARY_DLL:BOOL=OFF -D USE_XAUDIO2=ON ../

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\MSBuild.exe" Effekseer.sln /p:configuration=Debug
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\MSBuild.exe" Effekseer.sln /p:configuration=Release
cd ..

echo Compile VS16
rmdir /S /Q VS16
mkdir VS16

cd VS16
call cmake.bat -G "Visual Studio 16" -A Win32 -D USE_MSVC_RUNTIME_LIBRARY_DLL:BOOL=OFF -D USE_XAUDIO2=ON ../
cmake.exe -G "Visual Studio 16" -A Win32 -D USE_MSVC_RUNTIME_LIBRARY_DLL:BOOL=OFF -D USE_XAUDIO2=ON ../

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" Effekseer.sln /p:configuration=Debug
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" Effekseer.sln /p:configuration=Release
cd ..

echo Compile VS16WIN64
rmdir /S /Q VS16WIN64
mkdir VS16WIN64

cd VS16WIN64
call cmake.bat -G "Visual Studio 16" -A x64  -D USE_MSVC_RUNTIME_LIBRARY_DLL:BOOL=OFF -D USE_XAUDIO2=ON ../
cmake.exe -G "Visual Studio 16" -A x64  -D USE_MSVC_RUNTIME_LIBRARY_DLL:BOOL=OFF -D USE_XAUDIO2=ON ../

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" Effekseer.sln /p:configuration=Debug
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" Effekseer.sln /p:configuration=Release
cd ..

mkdir %RDIR_R%\Compiled\include\
mkdir %RDIR_R%\Compiled\lib\

mkdir %RDIR_R%\Compiled\lib\VS2017\
mkdir %RDIR_R%\Compiled\lib\VS2017WIN64\

robocopy VS15\Dev\Cpp\Effekseer\Debug %RDIR_R%\Compiled\lib\VS2017\Debug *.lib /S
robocopy VS15\Dev\Cpp\Effekseer\Release %RDIR_R%\Compiled\lib\VS2017\Release *.lib /S

robocopy VS15\Dev\Cpp\EffekseerRendererDX9\Debug %RDIR_R%\Compiled\lib\VS2017\Debug *.lib /S
robocopy VS15\Dev\Cpp\EffekseerRendererDX9\Release %RDIR_R%\Compiled\lib\VS2017\Release *.lib /S

robocopy VS15\Dev\Cpp\EffekseerRendererDX11\Debug %RDIR_R%\Compiled\lib\VS2017\Debug *.lib /S
robocopy VS15\Dev\Cpp\EffekseerRendererDX11\Release %RDIR_R%\Compiled\lib\VS2017\Release *.lib /S

robocopy VS15\Dev\Cpp\3rdParty\LLGI\src\Debug %RDIR_R%\Compiled\lib\VS2017\Debug *.lib /S
robocopy VS15\Dev\Cpp\3rdParty\LLGI\src\Release %RDIR_R%\Compiled\lib\VS2017\Release *.lib /S

robocopy VS15\Dev\Cpp\EffekseerRendererDX12\Debug %RDIR_R%\Compiled\lib\VS2017\Debug *.lib /S
robocopy VS15\Dev\Cpp\EffekseerRendererDX12\Release %RDIR_R%\Compiled\lib\VS2017\Release *.lib /S

copy VS15\Dev\Cpp\EffekseerSoundXAudio2\Debug\EffekseerSoundXAudio2.lib %RDIR_R%\Compiled\lib\VS2017\Debug\.
copy VS15\Dev\Cpp\EffekseerSoundXAudio2\Release\EffekseerSoundXAudio2.lib %RDIR_R%\Compiled\lib\VS2017\Release\.

robocopy VS15WIN64\Dev\Cpp\Effekseer\Debug %RDIR_R%\Compiled\lib\VS2017WIN64\Debug *.lib /S
robocopy VS15WIN64\Dev\Cpp\Effekseer\Release %RDIR_R%\Compiled\lib\VS2017WIN64\Release *.lib /S

robocopy VS15WIN64\Dev\Cpp\EffekseerRendererDX9\Debug %RDIR_R%\Compiled\lib\VS2017WIN64\Debug *.lib /S
robocopy VS15WIN64\Dev\Cpp\EffekseerRendererDX9\Release %RDIR_R%\Compiled\lib\VS2017WIN64\Release *.lib /S

robocopy VS15WIN64\Dev\Cpp\EffekseerRendererDX11\Debug %RDIR_R%\Compiled\lib\VS2017WIN64\Debug *.lib /S
robocopy VS15WIN64\Dev\Cpp\EffekseerRendererDX11\Release %RDIR_R%\Compiled\lib\VS2017WIN64\Release *.lib /S

robocopy VS15WIN64\Dev\Cpp\3rdParty\LLGI\src\Debug %RDIR_R%\Compiled\lib\VS2017WIN64\Debug *.lib /S
robocopy VS15WIN64\Dev\Cpp\3rdParty\LLGI\src\Release %RDIR_R%\Compiled\lib\VS2017WIN64\Release *.lib /S

robocopy VS15WIN64\Dev\Cpp\EffekseerRendererDX12\Debug %RDIR_R%\Compiled\lib\VS2017WIN64\Debug *.lib /S
robocopy VS15WIN64\Dev\Cpp\EffekseerRendererDX12\Release %RDIR_R%\Compiled\lib\VS2017WIN64\Release *.lib /S

copy VS15WIN64\Dev\Cpp\EffekseerSoundXAudio2\Debug\EffekseerSoundXAudio2.lib %RDIR_R%\Compiled\lib\VS2017WIN64\Debug\.
copy VS15WIN64\Dev\Cpp\EffekseerSoundXAudio2\Release\EffekseerSoundXAudio2.lib %RDIR_R%\Compiled\lib\VS2017WIN64\Release\.

mkdir %RDIR_R%\Compiled\lib\VS2019\
mkdir %RDIR_R%\Compiled\lib\VS2019WIN64\

robocopy VS16\Dev\Cpp\Effekseer\Debug %RDIR_R%\Compiled\lib\VS2019\Debug *.lib /S
robocopy VS16\Dev\Cpp\Effekseer\Release %RDIR_R%\Compiled\lib\VS2019\Release *.lib /S

robocopy VS16\Dev\Cpp\EffekseerRendererDX9\Debug %RDIR_R%\Compiled\lib\VS2019\Debug *.lib /S
robocopy VS16\Dev\Cpp\EffekseerRendererDX9\Release %RDIR_R%\Compiled\lib\VS2019\Release *.lib /S

robocopy VS16\Dev\Cpp\EffekseerRendererDX11\Debug %RDIR_R%\Compiled\lib\VS2019\Debug *.lib /S
robocopy VS16\Dev\Cpp\EffekseerRendererDX11\Release %RDIR_R%\Compiled\lib\VS2019\Release *.lib /S

robocopy VS16\Dev\Cpp\3rdParty\LLGI\src\Debug %RDIR_R%\Compiled\lib\VS2019\Debug *.lib /S
robocopy VS16\Dev\Cpp\3rdParty\LLGI\src\Release %RDIR_R%\Compiled\lib\VS2019\Release *.lib /S

robocopy VS16WIN64\Dev\Cpp\EffekseerRendererDX12\Debug %RDIR_R%\Compiled\lib\VS2019WIN64\Debug *.lib /S
robocopy VS16WIN64\Dev\Cpp\EffekseerRendererDX12\Release %RDIR_R%\Compiled\lib\VS2019WIN64\Release *.lib /S

copy VS16\Dev\Cpp\EffekseerSoundXAudio2\Debug\EffekseerSoundXAudio2.lib %RDIR_R%\Compiled\lib\VS2019\Debug\.
copy VS16\Dev\Cpp\EffekseerSoundXAudio2\Release\EffekseerSoundXAudio2.lib %RDIR_R%\Compiled\lib\VS2019\Release\.

robocopy VS16WIN64\Dev\Cpp\Effekseer\Debug %RDIR_R%\Compiled\lib\VS2019WIN64\Debug *.lib /S
robocopy VS16WIN64\Dev\Cpp\Effekseer\Release %RDIR_R%\Compiled\lib\VS2019WIN64\Release *.lib /S

robocopy VS16WIN64\Dev\Cpp\EffekseerRendererDX9\Debug %RDIR_R%\Compiled\lib\VS2019WIN64\Debug *.lib /S
robocopy VS16WIN64\Dev\Cpp\EffekseerRendererDX9\Release %RDIR_R%\Compiled\lib\VS2019WIN64\Release *.lib /S

robocopy VS16WIN64\Dev\Cpp\EffekseerRendererDX11\Debug %RDIR_R%\Compiled\lib\VS2019WIN64\Debug *.lib /S
robocopy VS16WIN64\Dev\Cpp\EffekseerRendererDX11\Release %RDIR_R%\Compiled\lib\VS2019WIN64\Release *.lib /S

robocopy VS16WIN64\Dev\Cpp\3rdParty\LLGI\src\Debug %RDIR_R%\Compiled\lib\VS2019WIN64\Debug *.lib /S
robocopy VS16WIN64\Dev\Cpp\3rdParty\LLGI\src\Release %RDIR_R%\Compiled\lib\VS2019WIN64\Release *.lib /S

robocopy VS16WIN64\Dev\Cpp\EffekseerRendererDX12\Debug %RDIR_R%\Compiled\lib\VS2019WIN64\Debug *.lib /S
robocopy VS16WIN64\Dev\Cpp\EffekseerRendererDX12\Release %RDIR_R%\Compiled\lib\VS2019WIN64\Release *.lib /S

copy VS16WIN64\Dev\Cpp\EffekseerSoundXAudio2\Debug\EffekseerSoundXAudio2.lib %RDIR_R%\Compiled\lib\VS2019WIN64\Debug\.
copy VS16WIN64\Dev\Cpp\EffekseerSoundXAudio2\Release\EffekseerSoundXAudio2.lib %RDIR_R%\Compiled\lib\VS2019WIN64\Release\.

copy Dev\Cpp\Effekseer\Effekseer.h %RDIR_R%\Compiled\include\.
copy Dev\Cpp\EffekseerRendererDX9\EffekseerRendererDX9.h %RDIR_R%\Compiled\include\.
copy Dev\Cpp\EffekseerRendererDX11\EffekseerRendererDX11.h %RDIR_R%\Compiled\include\.
copy Dev\Cpp\EffekseerRendererDX12\EffekseerRendererDX12.h %RDIR_R%\Compiled\include\.
copy Dev\Cpp\EffekseerRendererGL\EffekseerRendererGL.h %RDIR_R%\Compiled\include\.
copy Dev\Cpp\EffekseerSoundXAudio2\EffekseerSoundXAudio2.h %RDIR_R%\Compiled\include\.
copy Dev\Cpp\EffekseerSoundAL\EffekseerSoundAL.h %RDIR_R%\Compiled\include\.

pause

Add script for Dxlib

Add script for Dxlib


REM ***********************************************
REM Copyright (c) Microsoft. All rights reserved.
REM Licensed under the MIT license. See LICENSE file in the project root for full license information.
REM ***********************************************

@echo off
setlocal

REM ***********************************************
REM Setup
REM ***********************************************

if "%LLVMSOURCE%"=="" (
    echo.No LLVMSOURCE
    set RETURN=2
    goto done
)

if "%LLVMBUILD%"=="" (
    echo.No LLVMBUILD
    set RETURN=2
    goto done
)

if "%LLILCSOURCE%"=="" (
   set LLILCSOURCE=%LLVMSOURCE%\tools\llilc
)

set LLILCLIB=%LLILCSOURCE%\lib
set LLILCINC=%LLILCSOURCE%\include
set CLRINC=%LLILCINC%\clr
set LLVMINC=%LLVMSOURCE%\include

SET RETURN=0
set FORMATFIX=
set TIDYFIX=
set FORMAT=Yes
set TIDY=Yes
set BASE=origin
set TIDYCHECKS=llvm*,misc*,microsoft*

:parse

REM ***********************************************
REM Driver
REM ***********************************************

if "%1"=="" (
    goto done_parsing
) else if /I .%1==./fix (
    set FORMATFIX=-i
    set TIDYFIX=-fix
) else if /I .%1==./untidy (
    set TIDY=No
) else if /I .%1==./noformat (
    set FORMAT=No
) else if /I .%1==./checks (
    set TIDYCHECKS=%2
    shift /1
) else if /I .%1==./base (
    set BASE=%2
    shift /1
) else if /I .%1==./help (
    goto help
) else if /I .%1==./? (
    goto help
) else (
    echo.Unknown option %1
    set RETURN=3
    goto done
)

shift /1
goto parse

:done_parsing

REM ***********************************************
REM Run Clang Tidy
REM ***********************************************
:tidy

if .%TIDY%==.No (
    goto format
)

set INC=-I%LLILCLIB%\Jit -I%LLILCLIB%\MSILReader -I%LLILCINC% -I%LLVMINC% -I%CLRINC% -I%LLILCINC%\Driver -I%LLILCINC%\Jit -I%LLILCINC%\Reader -I%LLILCINC%\Pal -I%LLILCINC%\Pal\Rt -I%LLVMBUILD%\tools\LLILC\lib\Reader -I%LLVMBUILD%\tools\LLILC\include -I%LLVMBUILD%\include
set DEF=-D_DEBUG -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS-D__STDC_LIMIT_MACROS -D_GNU_SOURCE -DLLILCJit_EXPORTS -D_WINDLL -D_MBCS

pushd %LLILCSOURCE%
for /f %%f in ('dir /s /b *.c *.cpp') do (
   clang-tidy %TIDYFIX% -checks=%TIDYCHECKS% -header-filter="LLILC.*(Reader)|(Jit)|(Pal)" %%f -- %DEF% %INC%
   if ERRORLEVEL 1 set RETURN=1
)
popd

REM ***********************************************
REM Run Clang Format
REM ***********************************************
:format

if .%FORMAT%==.No (
    goto done
)

git diff %BASE% -U0 2>nul | clang-format-diff -p1 %FORMATFIX%

goto done

:help

REM ***********************************************
REM Help Section
REM ***********************************************

echo.Usage: ccFormat [/Check] [/Fix] [/?]
echo.  /fix          Fix failures when possible
echo.  /untidy       Don't run clang-tidy
echo.  /noformat     Don't run clang-format
echo.  /checks ^<chk^> Clang Tidy checks to run
echo.  /base ^<base^>  Base for obtaining Diffs
echo.  /help         Display this help message.
echo.
echo.Requirements:
echo.  Environment variables: LLVMSOURCE, LLVMBUILD
echo.  Tools (on path): clang-format.exe, clang-tidy.exe clang-format-diff.py
echo.  Tool Dependencies: Python 2.7
echo.

:done

exit /b %RETURN%

REM ***********************************************
REM Copyright (c) Microsoft. All rights reserved.
REM Licensed under the MIT license. See LICENSE file in the project root for full license information.
REM ***********************************************

@echo off
setlocal

REM ***********************************************
REM Setup
REM ***********************************************

if "%LLVMSOURCE%"=="" (
    echo.No LLVMSOURCE
    set RETURN=2
    goto done
)

if "%LLVMBUILD%"=="" (
    echo.No LLVMBUILD
    set RETURN=2
    goto done
)

if "%LLILCSOURCE%"=="" (
   set LLILCSOURCE=%LLVMSOURCE%\tools\llilc
)

set LLILCLIB=%LLILCSOURCE%\lib
set LLILCINC=%LLILCSOURCE%\include
set CLRINC=%LLILCINC%\clr
set LLVMINC=%LLVMSOURCE%\include

SET RETURN=0
set FORMATFIX=
set TIDYFIX=
set FORMAT=Yes
set TIDY=Yes
set BASE=origin
set TIDYCHECKS=llvm*,misc*,microsoft*

:parse

REM ***********************************************
REM Driver
REM ***********************************************

if "%1"=="" (
    goto done_parsing
) else if /I .%1==./fix (
    set FORMATFIX=-i
    set TIDYFIX=-fix
) else if /I .%1==./untidy (
    set TIDY=No
) else if /I .%1==./noformat (
    set FORMAT=No
) else if /I .%1==./checks (
    set TIDYCHECKS=%2
    shift /1
) else if /I .%1==./base (
    set BASE=%2
    shift /1
) else if /I .%1==./help (
    goto help
) else if /I .%1==./? (
    goto help
) else (
    echo.Unknown option %1
    set RETURN=3
    goto done
)

shift /1
goto parse

:done_parsing

REM ***********************************************
REM Run Clang Tidy
REM ***********************************************
:tidy

if .%TIDY%==.No (
    goto format
)

setlocal EnableDelayedExpansion
set INC=
set TEMPINC=%INCLUDE%
:loop
    for /f "tokens=1* delims=;" %%i in ("%TEMPINC%") do (
      set INC=!INC! -isystem "%%i"
      set TEMPINC=%%j
    )
    if defined TEMPINC goto loop

set FLAGS=-target x86_64-pc-win32-msvc -fms-extensions -fms-compatibility -fmsc-version=1800
set INC=%INC% -I%LLILCLIB%\Jit -I%LLILCLIB%\MSILReader -I%LLILCINC% -I%LLVMINC% -I%CLRINC% -I%LLILCINC%\Driver -I%LLILCINC%\Jit -I%LLILCINC%\Reader -I%LLILCINC%\Pal -I%LLVMBUILD%\tools\LLILC\lib\Reader -I%LLVMBUILD%\tools\LLILC\include -I%LLVMBUILD%\include
set DEF=-D_DEBUG -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS-D__STDC_LIMIT_MACROS -D_GNU_SOURCE -DLLILCJit_EXPORTS -D_WINDLL -D_MBCS -DNOMINMAX

pushd %LLILCSOURCE%
for /f %%f in ('dir /s /b *.c *.cpp') do (
   clang-tidy %TIDYFIX% -checks=%TIDYCHECKS% -header-filter="LLILC.*(Reader)|(Jit)|(Pal)" %%f -- %FLAGS% %DEF% %INC%
   if ERRORLEVEL 1 set RETURN=1
)
popd

REM ***********************************************
REM Run Clang Format
REM ***********************************************
:format

if .%FORMAT%==.No (
    goto done
)

git diff %BASE% -U0 2>nul | clang-format-diff -p1 %FORMATFIX%

goto done

:help

REM ***********************************************
REM Help Section
REM ***********************************************

echo.Usage: ccFormat [/Check] [/Fix] [/?]
echo.  /fix          Fix failures when possible
echo.  /untidy       Don't run clang-tidy
echo.  /noformat     Don't run clang-format
echo.  /checks ^<chk^> Clang Tidy checks to run
echo.  /base ^<base^>  Base for obtaining Diffs
echo.  /help         Display this help message.
echo.
echo.Requirements:
echo.  Environment variables: LLVMSOURCE, LLVMBUILD
echo.  Tools (on path): clang-format.exe, clang-tidy.exe clang-format-diff.py
echo.  Tool Dependencies: Python 2.7
echo.

:done

exit /b %RETURN%

Fix ccformat.cmd.

Fix ccformat.cmd.

- Properly set the various Microsoft-related flags when invoking
  clang-tidy.
- Remove include/Pal/Rt from the include path on Windows, as it
  contains headers that conflict with standard Windows headers.
- NOMINMAX must be defined to avoid pulling in min/max macros from
  the Windows headers.


::
:: Microsoft Azure SDK for Net - Generate library code
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::

@echo off
set autoRestVersion=0.16.0
if  "%1" == "" (
    set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-trafficmanager/2017-03-01/swagger/trafficmanager.json"
) else (
    set specFile="%1"
)
set repoRoot=%~dp0..\..\..\..
set generateFolder=%~dp0Generated

if exist %generateFolder% rd /S /Q  %generateFolder%
call "%repoRoot%\tools\autorest.gen.cmd" %specFile% Microsoft.Azure.Management.TrafficManager %autoRestVersion% %generateFolder% "-FT 2"

::
:: Microsoft Azure SDK for Net - Generate library code
:: Copyright (C) Microsoft Corporation. All Rights Reserved.
::

@echo off
set autoRestVersion=0.16.0
if  "%1" == "" (
    set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/776baa315cfda36195fe4b7f38f56e6fa34f1819/arm-trafficmanager/2017-03-01/swagger/trafficmanager.json"
) else (
    set specFile="%1"
)
set repoRoot=%~dp0..\..\..\..
set generateFolder=%~dp0Generated

if exist %generateFolder% rd /S /Q  %generateFolder%
call "%repoRoot%\tools\autorest.gen.cmd" %specFile% Microsoft.Azure.Management.TrafficManager %autoRestVersion% %generateFolder% "-FT 2"

Update generate.cmd with the exact commit in the spec repository for Traffic Manager 2017-03-01


@ECHO off
SETLOCAL EnableExtensions
SETLOCAL EnableDelayedExpansion

SET version=1.0.0_20160616-0600
SET title=idefixInstaller script %~nx0 - version %version%
TITLE %title%
SET POWERSHELL_TITLE=$Host.UI.RawUI.WindowTitle='%title%'

SET JAVA_WEB=http://www.klib.io/_archives/java/1.8
SET JAVA_ARCHIVE=win32.x86_64-jre1.8.0_74.zip
SET JAVA=%JAVA_ARCHIVE:~13,-4%

:: ###########################################################
SET SCRIPTNAME=%~n0
SET SCRIPT_PATH=%~dp0
SET SCRIPT_PATH=%SCRIPT_PATH:~0,-1%

SET ECL_INST_NAME=idefixInstaller
SET DL=%SCRIPT_PATH%\.download
:: folder must exists for powershell download requests
MKDIR %DL% 2>&1 > NUL

SET GITHUB_IO_BOOT=http://peterkir.github.io/idefix/bootstrap/peterkir/win32

SET BUILD_SERVER_ROOT=https://dl.bintray.com/peterkir/generic/org.eclipse.oomph
::SET BUILD_SERVER_ROOT=http://www.klib.io/org.eclipse.oomph
SET OOMPH_VERSION=1.6.0

SET PROD_CAT_FILTER=io\\.klib\\.products
SET PROD_FILTER=osgi\\.idefix\\.neon
SET PROD_VERSION=osgi\\.idefix\\.neon\\.bndtools\\.3\\.3\\.0

SET productSetup=https://peterkir.github.io/idefix/bootstrap/peterkir/catalogProducts.setup
SET projectSetup=https://peterkir.github.io/idefix/bootstrap/peterkir/catalogProjects.setup

::ECHO.
::ECHO # workaroung for NTLMv2 ProxyAuth - starting IE
::ECHO.
::SET IE_CMD="C:\Program Files (x86)\Internet Explorer\iexplore.exe www.google.de"
::SET IE_DIR="%TEMP%"
::FOR /F "tokens=2 delims=;=" %%a IN (
::  'WMIC process call create %IE_CMD%^, %IE_DIR% ^| find "ProcessId"'
::) DO (
::  SET IE_PID=%%a
::)
::ECHO browser launched with PID %IE_PID%
:: TODO search an kill the IE if not previously open WMIC process %IE_PID% delete

SET JAVA_CMD=setupJavaSDK.cmd
ECHO.
ECHO # downloading and configuring Java via %GITHUB_IO_BOOT%/%JAVA_CMD%
ECHO.
powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%JAVA_CMD% ) { Write-Output 'skipping download, cause file exists - %DL%\%JAVA_CMD%' } else {(New-Object System.Net.WebClient).DownloadFile('%GITHUB_IO_BOOT%/%JAVA_CMD%','%DL%\%JAVA_CMD%')}"
IF "%ERRORLEVEL%"=="" (
    ECHO failing downloading file %GITHUB_IO_BOOT%/%JAVA_CMD%
    GOTO END
)

:: installing JDKs into %SCRIPT_PATH%/java
CALL %DL%\%JAVA_CMD% %SCRIPT_PATH%

FOR /F %%a IN ('DIR /B %SCRIPT_PATH%\java\1.8') DO SET JAVA8=%SCRIPT_PATH%\java\1.8\%%a

ECHO.
ECHO # download and extract into %SCRIPT_PATH%\%ECL_INST_NAME%
ECHO.

SET ECLIPSE_INSTALLER_WEB=%BUILD_SERVER_ROOT%/%OOMPH_VERSION%
SET ECLIPSE_INSTALLER_ARCHIVE=org.eclipse.oomph.setup.installer.product-win32.win32.x86_64.zip
SET ECLIPSE_INSTALLER=%ECLIPSE_INSTALLER_ARCHIVE:~0,-4%

powershell -nologo -noprofile -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%ECLIPSE_INSTALLER_ARCHIVE% ) { Write-Output '   - skipping download, cause file exists - %DL%\%ECLIPSE_INSTALLER_ARCHIVE%' } else { Write-Output '   - downloading archive %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%';$browser = New-Object System.Net.WebClient; $browser.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials; $browser.DownloadFile('%ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%','%DL%\%ECLIPSE_INSTALLER_ARCHIVE%')}"
IF "%ERRORLEVEL%"=="" (
    ECHO failing downloading file %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%
    GOTO END
)

powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path '%SCRIPT_PATH%\%ECL_INST_NAME%' -PathType Container )  { Write-Output '   - skipping extraction, cause folder exists - %SCRIPT_PATH%\%ECL_INST_NAME%' } else { Write-Output '   - extracting ECLIPSE_INSTALLER archive to %SCRIPT_PATH%\%ECL_INST_NAME%'; Add-Type -A System.IO.Compression.FileSystem; [IO.Compression.ZipFile]::ExtractToDirectory('%DL%\%ECLIPSE_INSTALLER_ARCHIVE%', '%SCRIPT_PATH%\%ECL_INST_NAME%')}"

ECHO    - copying latest java %JAVA8%\jre into %SCRIPT_PATH%\%ECL_INST_NAME%\jre
IF NOT EXIST %SCRIPT_PATH%\%ECL_INST_NAME%\jre\NUL (
    XCOPY /Y /I /E /H %JAVA8%\jre %SCRIPT_PATH%\%ECL_INST_NAME%\jre 2>&1 > NUL
)

SET ECL_INST_INI=%SCRIPT_PATH%\%ECL_INST_NAME%\eclipse-inst.ini

FINDSTR peterkir.github.io %ECL_INST_INI% 2>&1 > NUL
IF "%ERRORLEVEL%"=="" (
    ECHO    - skipping vmArgs addition, cause already inside
) ELSE (
    ECHO    - adding vmArgs to ini file
    :: allow installation of unsigned bundles
    ECHO -Declipse.p2.unsignedPolicy=allow >> %ECL_INST_INI%

    :: hidden p2 options (configured to default)
    ECHO -Declipse.p2.max.threads=4        >> %ECL_INST_INI%
    ECHO -Declipse.p2.force.threading=true >> %ECL_INST_INI%
    ECHO -Declipse.p2.mirrors=true         >> %ECL_INST_INI%

    :: filtering user displayed catalogs/products/versions
    ECHO -Doomph.setup.product.catalog.filter=%PROD_CAT_FILTER%>> %ECL_INST_INI%
    ECHO -Doomph.setup.product.filter=%PROD_FILTER%>>             %ECL_INST_INI%
    ECHO -Doomph.setup.product.version.filter=%PROD_VERSION%>>    %ECL_INST_INI%

    ECHO -Doomph.setup.jre.choice=false                          >> %ECL_INST_INI%
    ECHO -Doomph.installer.update.url=%BUILD_STORE%/p2/installer >> %ECL_INST_INI%
    ECHO -Doomph.update.url=%BUILD_STORE%/p2/oomph               >> %ECL_INST_INI%
    ECHO -Doomph.setup.installer.mode=advanced                   >> %ECL_INST_INI%
    ECHO -Doomph.redirection.klibProductCatalog=index:/redirectable.products.setup-^>%productSetup% >> %ECL_INST_INI%
    ECHO -Doomph.redirection.klibProjectCatalog=index:/redirectable.projects.setup-^>%projectSetup% >> %ECL_INST_INI%
)

ECHO.
ECHO # launching %ECL_INST_NAME%
ECHO.
START /B %SCRIPT_PATH%\%ECL_INST_NAME%\eclipse-inst.exe

::ECHO.
::ECHO # clean-up
::ECHO.
::RMDIR /Q /S %DL%

:END

@ECHO off
SETLOCAL EnableExtensions
SETLOCAL EnableDelayedExpansion

SET version=1.0.0_20160616-0600
SET title=idefixInstaller script %~nx0 - version %version%
TITLE %title%
SET POWERSHELL_TITLE=$Host.UI.RawUI.WindowTitle='%title%'

SET JAVA_WEB=http://www.klib.io/_archives/java/1.8
SET JAVA_ARCHIVE=win32.x86_64-jre1.8.0_74.zip
SET JAVA=%JAVA_ARCHIVE:~13,-4%

:: ###########################################################
SET SCRIPTNAME=%~n0
SET SCRIPT_PATH=%~dp0
SET SCRIPT_PATH=%SCRIPT_PATH:~0,-1%

SET ECL_INST_NAME=idefixInstaller
SET DL=%SCRIPT_PATH%\.download
:: folder must exists for powershell download requests
MKDIR %DL% 2>&1 > NUL

SET GITHUB_IO_BOOT=http://peterkir.github.io/idefix/bootstrap/peterkir/win32

SET BUILD_SERVER_ROOT=https://dl.bintray.com/peterkir/generic/org.eclipse.oomph
::SET BUILD_SERVER_ROOT=http://www.klib.io/org.eclipse.oomph
SET OOMPH_VERSION=1.6.0

SET PROD_CAT_FILTER=io\\.klib\\.products
SET PROD_FILTER=osgi\\.idefix\\.neon
SET PROD_VERSION=osgi\\.idefix\\.neon\\.bndtools\\.3\\.3\\.0

SET productSetup=https://peterkir.github.io/idefix/bootstrap/peterkir/catalogProducts.setup
SET projectSetup=https://peterkir.github.io/idefix/bootstrap/peterkir/catalogProjects.setup

SET INSTALLER_UPDATE_URL=http://www.klib.io/org.eclipse.oomph/%OOMPH_VERSION%/installer
SET UPDATE_URL=http://www.klib.io/org.eclipse.oomph/%OOMPH_VERSION%/product

::ECHO.
::ECHO # workaroung for NTLMv2 ProxyAuth - starting IE
::ECHO.
::SET IE_CMD="C:\Program Files (x86)\Internet Explorer\iexplore.exe www.google.de"
::SET IE_DIR="%TEMP%"
::FOR /F "tokens=2 delims=;=" %%a IN (
::  'WMIC process call create %IE_CMD%^, %IE_DIR% ^| find "ProcessId"'
::) DO (
::  SET IE_PID=%%a
::)
::ECHO browser launched with PID %IE_PID%
:: TODO search an kill the IE if not previously open WMIC process %IE_PID% delete

SET JAVA_CMD=setupJavaSDK.cmd
ECHO.
ECHO # downloading and configuring Java via %GITHUB_IO_BOOT%/%JAVA_CMD%
ECHO.
powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%JAVA_CMD% ) { Write-Output 'skipping download, cause file exists - %DL%\%JAVA_CMD%' } else {(New-Object System.Net.WebClient).DownloadFile('%GITHUB_IO_BOOT%/%JAVA_CMD%','%DL%\%JAVA_CMD%')}"
IF "%ERRORLEVEL%"=="" (
    ECHO failing downloading file %GITHUB_IO_BOOT%/%JAVA_CMD%
    GOTO END
)

:: installing JDKs into %SCRIPT_PATH%/java
CALL %DL%\%JAVA_CMD% %SCRIPT_PATH%

FOR /F %%a IN ('DIR /B %SCRIPT_PATH%\java\1.8') DO SET JAVA8=%SCRIPT_PATH%\java\1.8\%%a

ECHO.
ECHO # download and extract into %SCRIPT_PATH%\%ECL_INST_NAME%
ECHO.

SET ECLIPSE_INSTALLER_WEB=%BUILD_SERVER_ROOT%/%OOMPH_VERSION%
SET ECLIPSE_INSTALLER_ARCHIVE=org.eclipse.oomph.setup.installer.product-win32.win32.x86_64.zip
SET ECLIPSE_INSTALLER=%ECLIPSE_INSTALLER_ARCHIVE:~0,-4%

powershell -nologo -noprofile -command "%POWERSHELL_TITLE%;if ( Test-Path %DL%\%ECLIPSE_INSTALLER_ARCHIVE% ) { Write-Output '   - skipping download, cause file exists - %DL%\%ECLIPSE_INSTALLER_ARCHIVE%' } else { Write-Output '   - downloading archive %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%';$browser = New-Object System.Net.WebClient; $browser.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials; $browser.DownloadFile('%ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%','%DL%\%ECLIPSE_INSTALLER_ARCHIVE%')}"
IF "%ERRORLEVEL%"=="" (
    ECHO failing downloading file %ECLIPSE_INSTALLER_WEB%/%ECLIPSE_INSTALLER_ARCHIVE%
    GOTO END
)

powershell -nologo -noprofile  -command "%POWERSHELL_TITLE%;if ( Test-Path '%SCRIPT_PATH%\%ECL_INST_NAME%' -PathType Container )  { Write-Output '   - skipping extraction, cause folder exists - %SCRIPT_PATH%\%ECL_INST_NAME%' } else { Write-Output '   - extracting ECLIPSE_INSTALLER archive to %SCRIPT_PATH%\%ECL_INST_NAME%'; Add-Type -A System.IO.Compression.FileSystem; [IO.Compression.ZipFile]::ExtractToDirectory('%DL%\%ECLIPSE_INSTALLER_ARCHIVE%', '%SCRIPT_PATH%\%ECL_INST_NAME%')}"

ECHO    - copying latest java %JAVA8%\jre into %SCRIPT_PATH%\%ECL_INST_NAME%\jre
IF NOT EXIST %SCRIPT_PATH%\%ECL_INST_NAME%\jre\NUL (
    XCOPY /Y /I /E /H %JAVA8%\jre %SCRIPT_PATH%\%ECL_INST_NAME%\jre 2>&1 > NUL
)

SET ECL_INST_INI=%SCRIPT_PATH%\%ECL_INST_NAME%\eclipse-inst.ini

FINDSTR peterkir.github.io %ECL_INST_INI% 2>&1 > NUL
IF "%ERRORLEVEL%"=="" (
    ECHO    - skipping vmArgs addition, cause already inside
) ELSE (
    ECHO    - adding vmArgs to ini file
    :: allow installation of unsigned bundles
    ECHO -Declipse.p2.unsignedPolicy=allow >> %ECL_INST_INI%

    :: hidden p2 options (configured to default)
    ECHO -Declipse.p2.max.threads=4        >> %ECL_INST_INI%
    ECHO -Declipse.p2.force.threading=true >> %ECL_INST_INI%
    ECHO -Declipse.p2.mirrors=true         >> %ECL_INST_INI%

    :: filtering user displayed catalogs/products/versions
    ECHO -Doomph.setup.product.catalog.filter=%PROD_CAT_FILTER%>> %ECL_INST_INI%
    ECHO -Doomph.setup.product.filter=%PROD_FILTER%>>             %ECL_INST_INI%
    ECHO -Doomph.setup.product.version.filter=%PROD_VERSION%>>    %ECL_INST_INI%

    ECHO -Doomph.setup.jre.choice=false                          >> %ECL_INST_INI%
    ECHO -Doomph.installer.update.url=%INSTALLER_UPDATE_URL%    >> %ECL_INST_INI%
    ECHO -Doomph.update.url=%UPDATE_URL%                         >> %ECL_INST_INI%
    ECHO -Doomph.setup.installer.mode=advanced                   >> %ECL_INST_INI%
    ECHO -Doomph.redirection.klibProductCatalog=index:/redirectable.products.setup-^>%productSetup% >> %ECL_INST_INI%
    ECHO -Doomph.redirection.klibProjectCatalog=index:/redirectable.projects.setup-^>%projectSetup% >> %ECL_INST_INI%
)

ECHO.
ECHO # launching %ECL_INST_NAME%
ECHO.
START /B %SCRIPT_PATH%\%ECL_INST_NAME%\eclipse-inst.exe

::ECHO.
::ECHO # clean-up
::ECHO.
::RMDIR /Q /S %DL%

:END

update peterkir to oomph 1.6.0

update peterkir to oomph 1.6.0


SET GOPATH=%CD%\cf-release-repo
SET GATSPATH=%GOPATH%\src\github.com\cloudfoundry\cf-acceptance-tests

SET PATH=C:\Go\bin;%PATH%
SET PATH=C:\Program Files\Git\cmd\;%PATH%
SET PATH=%CD%\cf-release-repo\bin;%PATH%
SET PATH=C:\Program Files\GnuWin32\bin;%PATH%
SET PATH=C:\Program Files\cURL\bin;%PATH%
SET PATH=C:\Program Files\CloudFoundry;%PATH%
SET PATH=%CD%;%PATH%

SET CONFIG=%CD%\cats-config\integration_config.json

go get -v github.com/onsi/ginkgo/ginkgo

pushd %CD%\cf-cli-binaries
	gzip -d cf-cli-binaries.tgz
	tar -xvf cf-cli-binaries.tar
	MOVE %CD%\cf-cli_winx64.exe ..\cf.exe
	dir ..
popd

cd %GATSPATH%
ginkgo.exe -slowSpecThreshold=120 -skip="NO_DEA_SUPPORT|go makes the app reachable via its bound route|SSO|takes effect after a restart, not requiring a push|doesn't die when printing 32MB|exercises basic loggregator|firehose data|Users can manage droplet bits for an app|can delete the key|dotnet-core|transparently proxies both reserved" -nodes=%NODES%

SET GOPATH=%CD%\cf-release-repo
SET GATSPATH=%GOPATH%\src\github.com\cloudfoundry\cf-acceptance-tests

SET PATH=C:\Go\bin;%PATH%
SET PATH=C:\Program Files\Git\cmd\;%PATH%
SET PATH=%CD%\cf-release-repo\bin;%PATH%
SET PATH=C:\Program Files\GnuWin32\bin;%PATH%
SET PATH=C:\Program Files\cURL\bin;%PATH%
SET PATH=C:\Program Files\CloudFoundry;%PATH%
SET PATH=%CD%;%PATH%

SET CONFIG=%CD%\cats-config\integration_config.json

go get -v github.com/onsi/ginkgo/ginkgo

pushd %CD%\cf-cli-binaries
	gzip -d cf-cli-binaries.tgz
	tar -xvf cf-cli-binaries.tar
	MOVE %CD%\cf-cli_winx64.exe ..\cf.exe
	dir ..
popd

cd %GATSPATH%
ginkgo.exe -slowSpecThreshold=120 -skip="NO_DEA_SUPPORT|go makes the app reachable via its bound route|SSO|takes effect after a restart, not requiring a push|doesn't die when printing 32MB|exercises basic loggregator|firehose data|can delete the key|dotnet-core|transparently proxies both reserved" -nodes=%NODES%

stop skippin'

stop skippin'

[Finishes #133138041]

Signed-off-by: Matthew Boedicker <bd646ec310948bf2f36146b5501a0018bf548d0d@pivotal.io>


@echo off
title Spotify Discord Music Bot
color 3f
cd "C:\Users\Administrator\Desktop\spotify-discord-bot-master\Spotify"
node app.js
pause

Create startBot.bat

Create startBot.bat


@echo off
rem Please run as administrator, bitch!
%SystemRoot%\System32\iisreset.exe -stop
net stop comsysapp
net stop msdtc
net stop "TTI WCF Host Service"
taskkill -im WebDev.WebServer40.EXE -f
taskkill -im dllhost.exe -f
taskkill -im w3wp.exe -f
for /d %%i in ("%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\*") do rd /s /q "%%i"
for /d %%i in ("%SystemRoot%\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\*") do rd /s /q "%%i"
net start msdtc
net start comsysapp
net start "TTI WCF Host Service"
%SystemRoot%\System32\iisreset.exe -start

@echo off
rem Please run as administrator, bitch!
%SystemRoot%\System32\iisreset.exe -stop
net stop comsysapp
net stop msdtc
net stop "TTI WCF Host Service"
taskkill -im WebDev.WebServer40.EXE -f
taskkill -im dllhost.exe -f
taskkill -im w3wp.exe -f
for /d %%i in ("%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\*") do rd /s /q "%%i"
for /d %%i in ("%SystemRoot%\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\*") do rd /s /q "%%i"
msdtc -resetlog
net start msdtc
net start comsysapp
net start "TTI WCF Host Service"
%SystemRoot%\System32\iisreset.exe -start

Reset log for MSDTC

Reset log for MSDTC


@echo off
echo Update environment...

echo Update Ruby...
call gem update --system

echo Update Ruby Sass...
call gem update sass

echo Update Bourbon...
call gem update bourbon
call gem update neat
call gem update bitters

echo Update Grunt...
call npm update grunt-cli -g

echo Install project...
call npm install --save-dev

pause

@echo off

echo Update Grunt...
call npm update grunt-cli -g

echo Install project...
call npm install --save-dev

pause

Remove Ruby update from unstall

Remove Ruby update from unstall


@setlocal

@echo Creating a package of files for easy use of ETW/WPT.

set UIforETW=%~dp0
set destdir=%UIforETW%etwpackage

rmdir %destdir% /s/q
@if exist %destdir%\bin\UIforETW.exe goto pleasecloseUIforETW
@if exist %destdir%\bin\ETWProviders.dll goto pleasecloseSomething
mkdir %destdir%\bin
mkdir %destdir%\include
mkdir %destdir%\lib
mkdir %destdir%\third_party

set wptredistmsi=Windows Performance Toolkit\Redistributables\WPTx64-x86_en-us.msi
@rem set wpt81=c:\Program Files (x86)\Windows Kits\8.1\
@rem if not exist "%wpt81%%wptredistmsi%" goto nowpt81
@rem mkdir %destdir%\third_party\wpt81
@rem xcopy "%wpt81%%wptredistmsi%" %destdir%\third_party\wpt81
@rem xcopy "%wpt81%sdk_license.rtf" %destdir%\third_party\wpt81
@rem ren %destdir%\third_party\wpt81\sdk_license.rtf LICENSE.rtf

set wpt10=c:\Program Files (x86)\Windows Kits\10\
if not exist "%wpt10%%wptredistmsi%" goto nowpt10
mkdir %destdir%\third_party\wpt10
xcopy "%wpt10%%wptredistmsi%" %destdir%\third_party\wpt10
xcopy "%wpt10%Licenses\10.0.10240.0\sdk_license.rtf" %destdir%\third_party\wpt10
ren %destdir%\third_party\wpt10\sdk_license.rtf LICENSE.rtf

@rem Add VS tools to the path
@call "%vs140comntools%vsvars32.bat"

cd /d %UIforETW%ETWInsights
devenv /rebuild "release|Win32" ETWInsights.sln
@if ERRORLEVEL 1 goto BuildFailure
xcopy Release\flame_graph.exe %UIforETW%\bin /y

cd /d %UIforETW%UIforETW
@rem Modify the UIforETW project to be statically linked and build that version
@rem so that it will run without any extra install requirements.
sed "s/UIforETW.vcxproj/UIforETWStatic.vcxproj/" <UIforETW.sln >UIforETWStatic.sln
@echo First do a test build with ETW marks disabled to test the inline functions.
sed "s/_WINDOWS/_WINDOWS;DISABLE_ETW_MARKS/" <UIforETW.vcxproj >UIforETWStatic.vcxproj
devenv /rebuild "release|Win32" UIforETWStatic.sln
@if ERRORLEVEL 1 goto BuildFailure

@rem Now prepare for the real builds
sed "s/UseOfMfc>Dynamic/UseOfMfc>Static/" <UIforETW.vcxproj >UIforETWStatic.vcxproj
rmdir Release /s/q
rmdir x64\Release /s/q
devenv /rebuild "release|Win32" UIforETWStatic.sln
@if ERRORLEVEL 1 goto BuildFailure
devenv /rebuild "release|x64" UIforETWStatic.sln
@if ERRORLEVEL 1 goto BuildFailure
@rem Clean up after building the static version.
rmdir Release /s/q
rmdir x64\Release /s/q
del UIforETWStatic.vcxproj
del UIforETWStatic.sln

xcopy %UIforETW%CONTRIBUTING %destdir%
xcopy %UIforETW%CONTRIBUTORS %destdir%
xcopy %UIforETW%AUTHORS %destdir%
xcopy %UIforETW%LICENSE %destdir%
xcopy %UIforETW%README %destdir%

xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%bin %destdir%\bin /s
xcopy %UIforETW%ETWProviders\etwproviders.man %destdir%\bin /y
xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%include %destdir%\include /s
xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%lib %destdir%\lib /s
xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%third_party %destdir%\third_party /s
@rem Get the destinations to exist so that the xcopy proceeds without a question.
echo >%destdir%\bin\UIforETW.exe
echo >%destdir%\bin\UIforETW32.exe
xcopy %UIforETW%bin\UIforETWStatic_devrel32.exe %destdir%\bin\UIforETW32.exe /y
xcopy %UIforETW%bin\UIforETWStatic_devrel.exe %destdir%\bin\UIforETW.exe /y
@rem Copy the official binaries back to the local copy, for development purposes.
xcopy /exclude:%UIforETW%excludecopy.txt %destdir%\bin\UIforETW*.exe %UIforETW%bin /y

cd /d %UIforETW%
python %UIforETW%make_zip_file.py %UIforETW%etwpackage.zip etwpackage

@echo Now upload the new etwpackage.zip
@exit /b

:pleasecloseUIforETW
@echo UIforETW is running. Please close it and try again.
@exit /b

:pleasecloseSomething
@echo Something is running with ETWProviders.dll loaded. Please close it and try again.
@exit /b

@rem :nowpt81
@rem @echo WPT 8.1 redistributables not found. Aborting.
@rem @exit /b

:nowpt10
@echo WPT 10 redistributables not found. Aborting.
@exit /b

:BuildFailure
@echo Build failure of some sort. Aborting.
@exit /b

@setlocal

@echo Creating a package of files for easy use of ETW/WPT.

set UIforETW=%~dp0
set destdir=%UIforETW%etwpackage

rmdir %destdir% /s/q
@if exist %destdir%\bin\UIforETW.exe goto pleasecloseUIforETW
@if exist %destdir%\bin\ETWProviders.dll goto pleasecloseSomething
mkdir %destdir%\bin
mkdir %destdir%\include
mkdir %destdir%\lib
mkdir %destdir%\third_party

set wptredistmsi=Windows Performance Toolkit\Redistributables\WPTx64-x86_en-us.msi

set wpt10=c:\Program Files (x86)\Windows Kits\10\
if not exist "%wpt10%%wptredistmsi%" goto nowpt10
mkdir %destdir%\third_party\wpt10
xcopy "%wpt10%%wptredistmsi%" %destdir%\third_party\wpt10
@if errorlevel 1 goto copyfailure
xcopy "%wpt10%Licenses\10.0.10240.0\sdk_license.rtf" %destdir%\third_party\wpt10
@if errorlevel 1 goto copyfailure
ren %destdir%\third_party\wpt10\sdk_license.rtf LICENSE.rtf

@rem Add VS tools to the path
@call "%vs140comntools%vsvars32.bat"

cd /d %UIforETW%ETWInsights
devenv /rebuild "release|Win32" ETWInsights.sln
@if ERRORLEVEL 1 goto BuildFailure
xcopy Release\flame_graph.exe %UIforETW%\bin /y

cd /d %UIforETW%UIforETW
@rem Modify the UIforETW project to be statically linked and build that version
@rem so that it will run without any extra install requirements.
sed "s/UIforETW.vcxproj/UIforETWStatic.vcxproj/" <UIforETW.sln >UIforETWStatic.sln
@echo First do a test build with ETW marks disabled to test the inline functions.
sed "s/_WINDOWS/_WINDOWS;DISABLE_ETW_MARKS/" <UIforETW.vcxproj >UIforETWStatic.vcxproj
devenv /rebuild "release|Win32" UIforETWStatic.sln
@if ERRORLEVEL 1 goto BuildFailure

@rem Now prepare for the real builds
sed "s/UseOfMfc>Dynamic/UseOfMfc>Static/" <UIforETW.vcxproj >UIforETWStatic.vcxproj
rmdir Release /s/q
rmdir x64\Release /s/q
devenv /rebuild "release|Win32" UIforETWStatic.sln
@if ERRORLEVEL 1 goto BuildFailure
devenv /rebuild "release|x64" UIforETWStatic.sln
@if ERRORLEVEL 1 goto BuildFailure
@rem Clean up after building the static version.
rmdir Release /s/q
rmdir x64\Release /s/q
del UIforETWStatic.vcxproj
del UIforETWStatic.sln

xcopy %UIforETW%CONTRIBUTING %destdir%
xcopy %UIforETW%CONTRIBUTORS %destdir%
xcopy %UIforETW%AUTHORS %destdir%
xcopy %UIforETW%LICENSE %destdir%
xcopy %UIforETW%README %destdir%

xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%bin %destdir%\bin /s
xcopy %UIforETW%ETWProviders\etwproviders.man %destdir%\bin /y
xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%include %destdir%\include /s
xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%lib %destdir%\lib /s
xcopy /exclude:%UIforETW%excludecopy.txt %UIforETW%third_party %destdir%\third_party /s
@rem Get the destinations to exist so that the xcopy proceeds without a question.
echo >%destdir%\bin\UIforETW.exe
echo >%destdir%\bin\UIforETW32.exe
xcopy %UIforETW%bin\UIforETWStatic_devrel32.exe %destdir%\bin\UIforETW32.exe /y
xcopy %UIforETW%bin\UIforETWStatic_devrel.exe %destdir%\bin\UIforETW.exe /y
@rem Copy the official binaries back to the local copy, for development purposes.
xcopy /exclude:%UIforETW%excludecopy.txt %destdir%\bin\UIforETW*.exe %UIforETW%bin /y

cd /d %UIforETW%
python %UIforETW%make_zip_file.py %UIforETW%etwpackage.zip etwpackage

@echo Now upload the new etwpackage.zip
@exit /b

:pleasecloseUIforETW
@echo UIforETW is running. Please close it and try again.
@exit /b

:pleasecloseSomething
@echo Something is running with ETWProviders.dll loaded. Please close it and try again.
@exit /b

:nowpt10
@echo WPT 10 redistributables not found. Aborting.
@exit /b

:BuildFailure
@echo Build failure of some sort. Aborting.
@exit /b

:copyfailure
@echo Failed to copy file. Aborting.
@exit /b

Update packaging script - error checking and deleting old code

The two xcopy commands in the packaging script could fail silently so I
added error checking.

There was still commented out script commands for WPT 8.1 which UIforETW
does not support - deleted.


@ECHO OFF
REM $Id$

REM Bat script building libHDF5 dependency automatically
REM Author: Peter Nordin peter.nordin@liu.se
REM Date:   2015-07-06

set dirname=hdf5

REM Automatic code starts here

echo.
echo ======================
echo Building 64-bit version of FMILibrary
echo ======================
set OLDPATH=%PATH%
call setHopsanBuildPaths.bat
REM We don want msys in the path so we have to set it manually
set PATH=%mingw_path%;%cmake_path%;%OLDPATH%
cd %dirname%
mkdir build
cd build
cmake -Wno-dev -G "MinGW Makefiles" -DBUILD_SHARED_LIBS=ON -DHDF5_BUILD_FORTRAN=OFF -DCMAKE_INSTALL_PREFIX="../install" ../
mingw32-make.exe -j4
mingw32-make.exe install
echo.
echo Done
pause

@ECHO OFF
REM $Id$

REM Bat script building libHDF5 dependency automatically
REM Author: Peter Nordin peter.nordin@liu.se
REM Date:   2015-07-06

set dirname=hdf5

REM Automatic code starts here

echo.
echo ======================
echo Building the HDF5 library and tools
echo ======================
set OLDPATH=%PATH%
call setHopsanBuildPaths.bat
REM We don want msys in the path so we have to set it manually
set PATH=%mingw_path%;%cmake_path%;%OLDPATH%
cd %dirname%
mkdir hopsanbuild
cd hopsanbuild
cmake -Wno-dev -G "MinGW Makefiles" -DBUILD_SHARED_LIBS=ON -DHDF5_BUILD_FORTRAN=OFF -DBUILD_TESTING=OFF -DHDF5_BUILD_EXAMPLES=OFF -DCMAKE_INSTALL_PREFIX="../install" ../
REM DO NOT enable multi-core build (make -j4), we must build sequentially
mingw32-make.exe
mingw32-make.exe install
cd ..
echo.
echo Done
pause

Enable hdf5 1_8_18 to build by turning of tests, examples and multi-core build


@echo off

setlocal
set Shells=%~d0\Shell
set wdir=%~d0
if not exist "%Shells%" mkdir "%Shells%"

rem VS
for /F "tokens=1,* delims==" %%I in ( 'set VS ^| findstr COMNTOOLS' ) do call :addVS "%%I" "%%J"

rem cmd
call :createShortcut cmd64 "%comspec%" "%~d0"
call :createShortcut cmd32 "%WINDIR%\SysWOW64\cmd.exe" "%~d0"

rem PS
set ps="%windir%\system32\WindowsPowerShell\v1.0\powershell.exe"
call :createShortcut PS "%ps%" "%~d0"

rem Azure
set azureps=%ProgramFiles(x86)%\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Services\ShortcutStartup.ps1
if exist "%azureps%" call :createShortcut AzurePS "%ps%" "%wdir%" "-NoExit -ExecutionPolicy Bypass -File '%azureps%' "

rem Exchange
call :copyExchange

goto :eof

:addVS
	set VS=%~1
	set VS=%VS:~2,2%
	set vsScript=%~2\vsvars32.bat
	if not exist "%vsScript%" (
		echo VS%VS% script not found
		goto :eof
	)

	call :createShortcut "VS%VS%" "%comspec%" "%wdir%" "/k '%~2\vsvars32.bat' "
	goto :eof

:createShortcut
	if exist "%Shell%\%~1.lnk" goto :eof
	if not exist "%~2" goto :eof

	cscript /nologo "%~dp0CreateShortcut.vbs" "%Shells%" %*
	goto :eof

:copyExchange
	set exch_src=%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\programs\Microsoft Exchange Server 2016\Exchange Management Shell.lnk
	if not exist "%exch_src%" goto :eof
	set exch_dst=%Shells%\Exchange.lnk
	echo Creating %exch_dst%
	copy /y "%exch_src%" "%exch_dst%" > nul
	echo.	DONE
	goto :eof

@echo off

setlocal
set Shells=%~d0\Shell
set wdir=%~d0
if not exist "%Shells%" mkdir "%Shells%"

rem VS
for /F "tokens=1,* delims==" %%I in ( 'set VS ^| findstr COMNTOOLS' ) do call :addVS "%%I" "%%J"

rem cmd
call :createShortcut cmd64 "%comspec%" "%wdir%"
call :createShortcut cmd32 "%WINDIR%\SysWOW64\cmd.exe" "%wdir%"

rem PS
set ps="%windir%\system32\WindowsPowerShell\v1.0\powershell.exe"
call :createShortcut PS "%ps%" "%wdir%"

rem Git
call :createShortcut "Git Bash" "%ProgramFiles%\Git\git-bash.exe" "%wdir%" --cd-to-home

rem Azure
set azureps=%ProgramFiles(x86)%\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Services\ShortcutStartup.ps1
if exist "%azureps%" call :createShortcut AzurePS "%ps%" "%wdir%" "-NoExit -ExecutionPolicy Bypass -File '%azureps%' "

rem Exchange
call :copyExchange

goto :eof

:addVS
	set VS=%~1
	set VS=%VS:~2,2%
	set vsScript=%~2\vsvars32.bat
	if not exist "%vsScript%" (
		echo VS%VS% script not found
		goto :eof
	)

	call :createShortcut "VS%VS%" "%comspec%" "%wdir%" "/k '%~2\vsvars32.bat' "
	goto :eof

:createShortcut
	if exist "%Shell%\%~1.lnk" goto :eof
	if not exist "%~2" goto :eof

	cscript /nologo "%~dp0CreateShortcut.vbs" "%Shells%" %*
	goto :eof

:copyExchange
	set exch_src=%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\programs\Microsoft Exchange Server 2016\Exchange Management Shell.lnk
	if not exist "%exch_src%" goto :eof
	set exch_dst=%Shells%\Exchange.lnk
	echo Creating %exch_dst%
	copy /y "%exch_src%" "%exch_dst%" > nul
	echo.	DONE
	goto :eof

Add git bash shell shortcut

Add git bash shell shortcut


@echo off
REM Specify the 4x4 values to exclude, separated by space characters
set DATASETS_TO_EXCLUDE="n4j6-wkkf t2qx-9pjd qmqz-2xku 97wa-y6ff"
set TODAY=%date:~10,4%%date:~4,2%%date:~7,2%

IF [%1] == [] GOTO DEFAULT
IF [%1] == [-e] GOTO EXCLUDE

echo Usage: A_Today.bat [-e]
echo    -e Exclude a pre-specified set of datasets by 4x4. generally those that run

frequently and would clutter the output.
exit /B 1

:DEFAULT
dir /b | find "%TODAY%"
exit /B

:EXCLUDE
dir /b | find "%TODAY%" | findstr /V %DATASETS_TO_EXCLUDE%

Update A_TodayLogs.bat

Update A_TodayLogs.bat


@rem Please make sure that the IIB v10 profile has been sourced before running this script
@rem please also make sure that the appropriate WebSphere MQ profile has been sourced, if your installation is not primary
@rem some parameters which define what sort of IIB environment is to be created
@rem please change these to be appropriate for your environment

setlocal
set INTEGRATION_NODE_NAME=PMDEMO_NODE
@rem don't choose a value which clashes with another integration node on the system
@rem make sure these ports agree with other parts of the demo and policy files
set INTEGRATION_NODE_ADMIN_PORT=4569
set INTEGRATION_NODE_MQTT_PORT=11869
@rem this queue manager must match what is in the MQ policy file in this repo
set DEMO_QUEUE_MANAGER=PMDEMO_QMGR

@rem define the servers we need to perform the integration function
@rem we need an integration node and also a queue manager

mqsistop %INTEGRATION_NODE_NAME%
mqsideletebroker %INTEGRATION_NODE_NAME%
endmqm -i %DEMO_QUEUE_MANAGER%
dltmqm %DEMO_QUEUE_MANAGER%

crtmqm %DEMO_QUEUE_MANAGER%
strmqm %DEMO_QUEUE_MANAGER%
if NOT ERRORLEVEL 1 goto qmcreatedok
  echo Failed to start queue manager!
  exit /b 1
:qmcreatedok

runmqsc %DEMO_QUEUE_MANAGER% < qdefs.dat
if NOT ERRORLEVEL 1 goto queuescreatedok
  echo Failed to define queues on %DEMO_QUEUE_MANAGER%
  exit /b 2
:queuescreatedok

@rem set up basic integration server
mqsicreatebroker %INTEGRATION_NODE_NAME%
mqsichangeproperties %INTEGRATION_NODE_NAME% -b webadmin -o HTTPConnector  -n port -v %INTEGRATION_NODE_ADMIN_PORT%
mqsichangeproperties %INTEGRATION_NODE_NAME% -b pubsub -o MQTTServer  -n port -v %INTEGRATION_NODE_MQTT_PORT%
mqsistart %INTEGRATION_NODE_NAME%
call mqsicreateexecutiongroup %INTEGRATION_NODE_NAME% -e default
if NOT ERRORLEVEL 1 goto intnodecreatedok
  echo Failed to define basic integration node %INTEGRATION_NODE_NAME%
  exit /b 3
:intnodecreatedok

@echo Integration node defined, now configure it.

@rem set up environment for SAP nodes
call mqsichangeproperties %INTEGRATION_NODE_NAME% -c EISProviders -o SAP -n nativeLibs,jarsURL -v "C:\John\sapjco3\308\64","C:\John\sapjco3\308\64"
@rem setup policy and credentials to connect to IoT cloud
call mqsisetdbparms %INTEGRATION_NODE_NAME% -n MQTT::iotFoundation -u "a-88xzb2-fcffsvhwxb" -p "jRZ!fA)Iw2GDH5eKEm"
call mqsicreatepolicy %INTEGRATION_NODE_NAME% -t MQTTSubscribe -f ..\policy\BusEvents.policy -l BusEvents
@rem setup other policies to match configuration of local integration node
call mqsicreatepolicy %INTEGRATION_NODE_NAME% -t MQTTPublish -f ..\policy\InternalBroker.policy -l InternalBroker
call mqsicreatepolicy %INTEGRATION_NODE_NAME% -t MQEndpoint -f ..\policy\LocalMaintenanceQmgr.policy -l LocalMaintenanceQmgr
call mqsicreatepolicy %INTEGRATION_NODE_NAME% -t WorkloadManagement -l smoothing -f ..\policy\smoothing.policy
@rem local test mode call mqsicreatepolicy %INTEGRATION_NODE_NAME% -t MQTTSubscribe -f ..\policy\BusEvents.local.policy -l BusEvents
call mqsichangeproperties %INTEGRATION_NODE_NAME% -b pubsub -o BusinessEvents/MQTT -n policyUrl -v /MQTTPublish/InternalBroker.policy
call mqsichangeproperties %INTEGRATION_NODE_NAME% -b pubsub -o BusinessEvents/MQTT -n enabled -v true
call mqsistop %INTEGRATION_NODE_NAME%
call mqsistart %INTEGRATION_NODE_NAME%

@echo Package BAR file and deploy it
mkdir output
call mqsipackagebar -a output\demo.bar -w ..\ad -y VehicleMaintenance -k PredictiveMaintenance
call mqsideploy -a output\demo.bar %INTEGRATION_NODE_NAME% -i localhost -p %INTEGRATION_NODE_ADMIN_PORT% -e default

@echo Activate flow monitoring and statistics on the solution which has been deployed
call mqsichangeresourcestats %INTEGRATION_NODE_NAME% -e default -c active
call mqsichangeflowmonitoring %INTEGRATION_NODE_NAME% -e default -c active -j -k PredictiveMaintenance
call mqsichangeflowstats %INTEGRATION_NODE_NAME% -g -c active -j -k PredictiveMaintenance -s -o json -n advanced
@rem call mqsichangeflowstats %INTEGRATION_NODE_NAME% -g -c active -j -k PredictiveMaintenance -a -o json -n advanced

@rem deploy policy
@rem mqsicreatepolicy %INTEGRATION_NODE_NAME% -t MQTTSubscribe -f ..\policy\BusEvents.policy -l BusEvents
@rem mqsichangeproperties %INTEGRATION_NODE_NAME% -e default -o ComIbmJVMManager -n jvmDebugPort -v 1818

rm C:\Users\IBM_ADMIN\Desktop\VehiclePartReplacements\Today.csv

@rem Please make sure that the IIB v10 profile has been sourced before running this script
@rem please also make sure that the appropriate WebSphere MQ profile has been sourced, if your installation is not primary
@rem some parameters which define what sort of IIB environment is to be created
@rem please change these to be appropriate for your environment

setlocal
set INTEGRATION_NODE_NAME=PMDEMO_NODE
@rem don't choose a value which clashes with another integration node on the system
@rem make sure these ports agree with other parts of the demo and policy files
set INTEGRATION_NODE_ADMIN_PORT=4569
set INTEGRATION_NODE_MQTT_PORT=11869
@rem this queue manager must match what is in the MQ policy file in this repo
set DEMO_QUEUE_MANAGER=PMDEMO_QMGR

@rem define the servers we need to perform the integration function
@rem we need an integration node and also a queue manager

mqsistop %INTEGRATION_NODE_NAME%
mqsideletebroker %INTEGRATION_NODE_NAME%
endmqm -i %DEMO_QUEUE_MANAGER%
dltmqm %DEMO_QUEUE_MANAGER%

crtmqm %DEMO_QUEUE_MANAGER%
strmqm %DEMO_QUEUE_MANAGER%
if NOT ERRORLEVEL 1 goto qmcreatedok
  echo Failed to start queue manager!
  exit /b 1
:qmcreatedok

runmqsc %DEMO_QUEUE_MANAGER% < qdefs.dat
if NOT ERRORLEVEL 1 goto queuescreatedok
  echo Failed to define queues on %DEMO_QUEUE_MANAGER%
  exit /b 2
:queuescreatedok

@rem set up basic integration server
mqsicreatebroker %INTEGRATION_NODE_NAME%
mqsichangeproperties %INTEGRATION_NODE_NAME% -b webadmin -o HTTPConnector  -n port -v %INTEGRATION_NODE_ADMIN_PORT%
mqsichangeproperties %INTEGRATION_NODE_NAME% -b pubsub -o MQTTServer  -n port -v %INTEGRATION_NODE_MQTT_PORT%
mqsistart %INTEGRATION_NODE_NAME%
call mqsicreateexecutiongroup %INTEGRATION_NODE_NAME% -e default
if NOT ERRORLEVEL 1 goto intnodecreatedok
  echo Failed to define basic integration node %INTEGRATION_NODE_NAME%
  exit /b 3
:intnodecreatedok

@echo Integration node defined, now configure it.

@rem set up environment for SAP nodes
call mqsichangeproperties %INTEGRATION_NODE_NAME% -c EISProviders -o SAP -n nativeLibs,jarsURL -v "C:\John\sapjco3\308\64","C:\John\sapjco3\308\64"
@rem setup policy and credentials to connect to IoT cloud
call mqsisetdbparms %INTEGRATION_NODE_NAME% -n MQTT::iotFoundation -u "a-88xzb2-fcffsvhwxb" -p "jRZ!fA)Iw2GDH5eKEm"
call mqsicreatepolicy %INTEGRATION_NODE_NAME% -t MQTTSubscribe -f ..\policy\BusEvents.policy -l BusEvents
@rem setup other policies to match configuration of local integration node
call mqsicreatepolicy %INTEGRATION_NODE_NAME% -t MQTTPublish -f ..\policy\InternalBroker.policy -l InternalBroker
@rem policy to control the MQ nodes connecting flows together
call mqsicreatepolicy %INTEGRATION_NODE_NAME% -t MQEndpoint -f ..\policy\LocalMaintenanceQmgr.policy -l LocalMaintenanceQmgr
call mqsicreatepolicy %INTEGRATION_NODE_NAME% -t WorkloadManagement -l smoothing -f ..\policy\smoothing.policy
@rem local test mode call mqsicreatepolicy %INTEGRATION_NODE_NAME% -t MQTTSubscribe -f ..\policy\BusEvents.local.policy -l BusEvents
call mqsichangeproperties %INTEGRATION_NODE_NAME% -b pubsub -o BusinessEvents/MQTT -n policyUrl -v /MQTTPublish/InternalBroker.policy
call mqsichangeproperties %INTEGRATION_NODE_NAME% -b pubsub -o BusinessEvents/MQTT -n enabled -v true
call mqsistop %INTEGRATION_NODE_NAME%
call mqsistart %INTEGRATION_NODE_NAME%

@echo Package BAR file and deploy it
mkdir output
call mqsipackagebar -a output\demo.bar -w ..\ad -y VehicleMaintenance -k PredictiveMaintenance
call mqsideploy -a output\demo.bar %INTEGRATION_NODE_NAME% -i localhost -p %INTEGRATION_NODE_ADMIN_PORT% -e default

@echo Activate flow monitoring and statistics on the solution which has been deployed
call mqsichangeresourcestats %INTEGRATION_NODE_NAME% -e default -c active
call mqsichangeflowmonitoring %INTEGRATION_NODE_NAME% -e default -c active -j -k PredictiveMaintenance
call mqsichangeflowstats %INTEGRATION_NODE_NAME% -g -c active -j -k PredictiveMaintenance -s -o json -n advanced
@rem call mqsichangeflowstats %INTEGRATION_NODE_NAME% -g -c active -j -k PredictiveMaintenance -a -o json -n advanced

@rem deploy policy
@rem mqsicreatepolicy %INTEGRATION_NODE_NAME% -t MQTTSubscribe -f ..\policy\BusEvents.policy -l BusEvents
@rem mqsichangeproperties %INTEGRATION_NODE_NAME% -e default -o ComIbmJVMManager -n jvmDebugPort -v 1818

rm C:\Users\IBM_ADMIN\Desktop\VehiclePartReplacements\Today.csv

update comments in setup script

update comments in setup script


@echo off
setlocal

set DATALOADER_VERSION=@@FULL_VERSION@@
for /f "tokens=1 delims=." %%a in ("%DATALOADER_VERSION%") do (
  set DATALOADER_SHORT_VERSION=%%a
)
set DATALOADER_UBER_JAR_NAME=dataloader-%DATALOADER_VERSION%-uber.jar
set MIN_JAVA_VERSION=@@MIN_JAVA_VERSION@@

CALL "%~dp0util\util.bat" showBanner

echo Data Loader installation requires you to provide an installation directory to create a version-specific subdirectory for the installation artifacts.
echo It uses '%USERPROFILE%\^<relative path^>' as the installation directory if you provide a relative path for the installation directory.
echo.
set /p "DIR_NAME=Provide the installation directory [default: dataloader]" : || set DIR_NAME=dataloader

if "%DIR_NAME:~1,1%" == ":" (
    REM absolute path specified
    set "INSTALLATION_DIR=%DIR_NAME%\v%DATALOADER_VERSION%"
) else (
    if "%DIR_NAME:~0,1%" == "\" (
        REM absolute path specified
        set "INSTALLATION_DIR=%DIR_NAME%\v%DATALOADER_VERSION%"
    ) else (
        REM relative path specified
        set "INSTALLATION_DIR=%USERPROFILE%\%DIR_NAME%\v%DATALOADER_VERSION%"
    )
)

IF EXIST %INSTALLATION_DIR% (
    goto ExistingDir
) ELSE (
    goto CopyFiles
)

:ExistingDir
    echo.
    echo Do you want to overwrite previously installed versions of Data Loader v%DATALOADER_VERSION% and configurations in '%INSTALLATION_DIR%'?
    set /p DELETE_EXISTING_DIR=If not, installation will quit and you can restart installation using another directory.[Yes/No]
    if /I "%DELETE_EXISTING_DIR%"=="Y" goto DeleteDirYes
    if /I "%DELETE_EXISTING_DIR%"=="Yes" goto DeleteDirYes
    if /I "%DELETE_EXISTING_DIR%"=="N" goto DeleteDirNo
    if /I "%DELETE_EXISTING_DIR%"=="No" goto DeleteDirNo
    echo Type Yes or No.
    goto ExistingDir
:DeleteDirYes
    echo Deleting existing Data Loader v%DATALOADER_VERSION%...
    rd /s /q "%INSTALLATION_DIR%"
    goto CopyFiles
:DeleteDirNo
    goto Exit

:CopyFiles
    echo.
    set "SRC_DIR=%~dp0"
    IF %SRC_DIR:~-1%==\ SET "SRC_DIR=%SRC_DIR:~0,-1%"
    echo Copying files from '%SRC_DIR%' to '%INSTALLATION_DIR%'  ...
    xcopy "%SRC_DIR%" "%INSTALLATION_DIR%" /e /i
    del "%INSTALLATION_DIR%\install.bat" /q
    echo Your Data Loader v%DATALOADER_VERSION% is created in '%INSTALLATION_DIR%'

:CreateStartMenuShortCut
    echo.
    set /p REPLY=Would you like to create a start menu shortcut? [Yes/No]
    if /I "%REPLY%"=="Y" goto StartMenuShortCutYes
    if /I "%REPLY%"=="Yes" goto StartMenuShortCutYes
    if /I "%REPLY%"=="N" goto StartMenuShortCutNo
    if /I "%REPLY%"=="No" goto StartMenuShortCutNo
    echo Type Yes or No.
    goto CreateStartMenuShortCut
:StartMenuShortCutNo
    goto CreateDesktopShortcut
:StartMenuShortCutYes
    IF NOT EXIST "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Salesforce\" (
        mkdir "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Salesforce"
    )
    powershell -Command "$WshShell = New-Object -comObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut(""""$Home\Desktop\Dataloader.lnk""""); $Shortcut.WorkingDirectory = """"$env:INSTALLATION_DIR""""; $Shortcut.TargetPath = """"$env:INSTALLATION_DIR\dataloader.bat""""; $Shortcut.IconLocation = """"$env:INSTALLATION_DIR\dataloader.ico""""; $Shortcut.WindowStyle=7; $Shortcut.Save()"
    move "%USERPROFILE%\Desktop\Dataloader.lnk" "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Salesforce\Dataloader %DATALOADER_VERSION%.lnk" >nul

:CreateDesktopShortcut
    echo.
    set /p REPLY=Would you like to create a desktop icon? [Yes/No]
    if /I "%REPLY%"=="Y" goto DesktopShortCutYes
    if /I "%REPLY%"=="Yes" goto DesktopShortCutYes
    if /I "%REPLY%"=="N" goto DesktopShortCutNo
    if /I "%REPLY%"=="No" goto DesktopShortCutNo
    echo Type Yes or No.
    goto CreateDesktopShortcut
:DesktopShortCutNo
    goto Exit
:DesktopShortCutYes
    powershell -Command "$WshShell = New-Object -comObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut(""""$Home\Desktop\Dataloader.lnk""""); $Shortcut.WorkingDirectory = """"$env:INSTALLATION_DIR""""; $Shortcut.TargetPath = """"$env:INSTALLATION_DIR\dataloader.bat""""; $Shortcut.IconLocation = """"$env:INSTALLATION_DIR\dataloader.ico""""; $Shortcut.WindowStyle=7; $Shortcut.Save()"
    for /f "usebackq tokens=3*" %%D IN (`reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop`) do set DESKTOP_DIR=%%D
    move "%USERPROFILE%\Desktop\Dataloader.lnk" "%DESKTOP_DIR%\Dataloader %DATALOADER_VERSION%.lnk" >nul

:Exit
    echo.
    echo Data Loader installation is quitting.
    endlocal
    PAUSE

@echo off
setlocal

CALL "%~dp0util\util.bat" showBanner

echo Data Loader installation requires you to provide an installation directory to create a version-specific subdirectory for the installation artifacts.
echo It uses '%USERPROFILE%\^<relative path^>' as the installation directory if you provide a relative path for the installation directory.
echo.
set /p "DIR_NAME=Provide the installation directory [default: dataloader]" : || set DIR_NAME=dataloader

if "%DIR_NAME:~1,1%" == ":" (
    REM absolute path specified
    set "INSTALLATION_DIR=%DIR_NAME%\v%DATALOADER_VERSION%"
) else (
    if "%DIR_NAME:~0,1%" == "\" (
        REM absolute path specified
        set "INSTALLATION_DIR=%DIR_NAME%\v%DATALOADER_VERSION%"
    ) else (
        REM relative path specified
        set "INSTALLATION_DIR=%USERPROFILE%\%DIR_NAME%\v%DATALOADER_VERSION%"
    )
)

IF EXIST %INSTALLATION_DIR% (
    goto ExistingDir
) ELSE (
    goto CopyFiles
)

:ExistingDir
    echo.
    echo Do you want to overwrite previously installed versions of Data Loader v%DATALOADER_VERSION% and configurations in '%INSTALLATION_DIR%'?
    set /p DELETE_EXISTING_DIR=If not, installation will quit and you can restart installation using another directory.[Yes/No]
    if /I "%DELETE_EXISTING_DIR%"=="Y" goto DeleteDirYes
    if /I "%DELETE_EXISTING_DIR%"=="Yes" goto DeleteDirYes
    if /I "%DELETE_EXISTING_DIR%"=="N" goto DeleteDirNo
    if /I "%DELETE_EXISTING_DIR%"=="No" goto DeleteDirNo
    echo Type Yes or No.
    goto ExistingDir
:DeleteDirYes
    echo Deleting existing Data Loader v%DATALOADER_VERSION%...
    rd /s /q "%INSTALLATION_DIR%"
    goto CopyFiles
:DeleteDirNo
    goto Exit

:CopyFiles
    echo.
    set "SRC_DIR=%~dp0"
    IF %SRC_DIR:~-1%==\ SET "SRC_DIR=%SRC_DIR:~0,-1%"
    echo Copying files from '%SRC_DIR%' to '%INSTALLATION_DIR%'  ...
    xcopy "%SRC_DIR%" "%INSTALLATION_DIR%" /e /i
    del "%INSTALLATION_DIR%\install.bat" /q
    echo Your Data Loader v%DATALOADER_VERSION% is created in '%INSTALLATION_DIR%'

:CreateStartMenuShortCut
    echo.
    set /p REPLY=Would you like to create a start menu shortcut? [Yes/No]
    if /I "%REPLY%"=="Y" goto StartMenuShortCutYes
    if /I "%REPLY%"=="Yes" goto StartMenuShortCutYes
    if /I "%REPLY%"=="N" goto StartMenuShortCutNo
    if /I "%REPLY%"=="No" goto StartMenuShortCutNo
    echo Type Yes or No.
    goto CreateStartMenuShortCut
:StartMenuShortCutNo
    goto CreateDesktopShortcut
:StartMenuShortCutYes
    IF NOT EXIST "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Salesforce\" (
        mkdir "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Salesforce"
    )
    powershell -Command "$WshShell = New-Object -comObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut(""""$Home\Desktop\Dataloader.lnk""""); $Shortcut.WorkingDirectory = """"$env:INSTALLATION_DIR""""; $Shortcut.TargetPath = """"$env:INSTALLATION_DIR\dataloader.bat""""; $Shortcut.IconLocation = """"$env:INSTALLATION_DIR\dataloader.ico""""; $Shortcut.WindowStyle=7; $Shortcut.Save()"
    move "%USERPROFILE%\Desktop\Dataloader.lnk" "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Salesforce\Dataloader %DATALOADER_VERSION%.lnk" >nul

:CreateDesktopShortcut
    echo.
    set /p REPLY=Would you like to create a desktop icon? [Yes/No]
    if /I "%REPLY%"=="Y" goto DesktopShortCutYes
    if /I "%REPLY%"=="Yes" goto DesktopShortCutYes
    if /I "%REPLY%"=="N" goto DesktopShortCutNo
    if /I "%REPLY%"=="No" goto DesktopShortCutNo
    echo Type Yes or No.
    goto CreateDesktopShortcut
:DesktopShortCutNo
    goto Exit
:DesktopShortCutYes
    powershell -Command "$WshShell = New-Object -comObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut(""""$Home\Desktop\Dataloader.lnk""""); $Shortcut.WorkingDirectory = """"$env:INSTALLATION_DIR""""; $Shortcut.TargetPath = """"$env:INSTALLATION_DIR\dataloader.bat""""; $Shortcut.IconLocation = """"$env:INSTALLATION_DIR\dataloader.ico""""; $Shortcut.WindowStyle=7; $Shortcut.Save()"
    for /f "usebackq tokens=3*" %%D IN (`reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop`) do set DESKTOP_DIR=%%D
    move "%USERPROFILE%\Desktop\Dataloader.lnk" "%DESKTOP_DIR%\Dataloader %DATALOADER_VERSION%.lnk" >nul

:Exit
    echo.
    echo Data Loader installation is quitting.
    endlocal
    PAUSE

remove duplicate code in install.bat

remove duplicate code in install.bat

install.bat sets the same variables that are set in util.bat, which it calls, thereby resulting in duplication. remove their setting to avoid duplication.


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

@echo off
setlocal enabledelayedexpansion

if not defined python (
    set python=python.exe
)

if "%python%a"=="pythona" (
    set python=python.exe
)

if "%FLINK_TESTING%a"=="1a" (
    set CURRENT_DIR=!cd!
    cd /d %FLINK_HOME%
    set ACTUAL_FLINK_HOME=!cd!
    cd /d ../../../../
    set FLINK_SOURCE_ROOT_DIR=!cd!
    cd /d flink-python
    set FLINK_PYTHON=!cd!
    if exist !FLINK_PYTHON!/pyflink/fn_execution/boot.py (
        :: use pyflink source code to override the pyflink.zip in PYTHONPATH
        :: to ensure loading latest code
        set PYTHONPATH=!FLINK_PYTHON!;%PYTHONPATH%
    )
    cd /d !CURRENT_DIR!
)

if %_PYTHON_WORKING_DIR%a NEQ a (
    :: set current working directory to _PYTHON_WORKING_DIR
    cd /d %_PYTHON_WORKING_DIR%
)

set log=%BOOT_LOG_DIR%/flink-python-udf-boot.log
call %python% -m pyflink.fn_execution.boot %* 2>&1 > %log%

endlocal

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

@echo off
setlocal enabledelayedexpansion

if not defined python (
    set python=python.exe
)

if "%python%a"=="pythona" (
    set python=python.exe
)

if "%FLINK_TESTING%a"=="1a" (
    set CURRENT_DIR=!cd!
    cd /d %FLINK_HOME%
    set ACTUAL_FLINK_HOME=!cd!
    cd /d ../../../../
    set FLINK_SOURCE_ROOT_DIR=!cd!
    cd /d flink-python
    set FLINK_PYTHON=!cd!
    if exist !FLINK_PYTHON!/pyflink/fn_execution/boot.py (
        :: use pyflink source code to override the pyflink.zip in PYTHONPATH
        :: to ensure loading latest code
        set PYTHONPATH=!FLINK_PYTHON!;%PYTHONPATH%
    )
    cd /d !CURRENT_DIR!
)

if %_PYTHON_WORKING_DIR%a NEQ a (
    :: set current working directory to _PYTHON_WORKING_DIR
    cd /d %_PYTHON_WORKING_DIR%
)

set log=%BOOT_LOG_DIR%/flink-python-udf-boot.log
call %python% -m pyflink.fn_execution.beam.beam_boot %* 2>&1 > %log%

endlocal

[hotfix][python] Fix the module name of the entrypoint in pyflink-udf-runner.bat (#13848)


@setlocal enableextensions enabledelayedexpansion & set "PATH0=%~f0" & PowerShell.exe -Command "& (Invoke-Expression -Command ('{#' + ((Get-Content '!PATH0:'=''!') -join \"`n\") + '}'))" %* & exit /b !errorlevel!
#
# - Name
#     Install-Vim.bat
#
# - Contents
#     Install Vim.
#
# - Reference
#     PowerShell on *.bat - http://pf-j.sakura.ne.jp/program/tips/ps1bat2.htm
#     Vim - KaoriYa - https://www.kaoriya.net/software/vim/
#
# - Revision
#     2016-05-24 created.
#     yyyy-MM-dd modified.
#

################
# constant
################
$psDir = "$env:USERPROFILE\Documents\WindowsPowerShell"; if (-Not(Test-Path -Path $psDir)) { mkdir $psDir }
$psProfile = "$psDir\Microsoft.PowerShell_profile.ps1"
$vimZip = "$env:USERPROFILE\Documents\vim.zip"
$vimUri = 'https://github.com/koron/vim-kaoriya/releases/download/v8.0.0596-20170502/vim80-kaoriya-win64-8.0.0596-20170502.zip'

################
# main
################
# Get vim.zip.
if (-Not(Test-Path -Path $vimZip)) { Invoke-RestMethod -Uri $vimUri -OutFile $vimZip -UseBasicParsing }

# Unzip vim.zip.
if (Test-Path -Path $vimZip)
{
    if (-Not(Test-Path -Path "$env:USERPROFILE\Documents\vim*\vim.exe"))
    {
        $shApp = New-Object -Com shell.application
        $unzip = $shApp.NameSpace($vimZip)
        foreach ($item in $unzip.items()) { $shApp.Namespace("$env:USERPROFILE\Documents").copyhere($item, 0x8); }
    }
}
else
{
    Write-Output "[ERROR]: Failed to download from Uri($vimUri)."
    exit 1
}

# Get the full path of the vim.exe.
if (Test-Path -Path "$env:USERPROFILE\Documents\vim*\vim.exe")
{
    $vimExe = (Get-Item "$env:USERPROFILE\Documents\vim*\vim.exe").FullName
}
else
{
    Write-Output "[ERROR]: Failed to unzip file($vimZip)."
    exit 1
}

# If there is no description about Vim in Profile,
if (-Not((Get-Content $psProfile | Select-String '# vim').Matches.Success))
{
    # Add a description about Vim.
    Write-Output "# vim`r`nNew-Alias vi $vimExe`r`nNew-Alias vim $vimExe`r`nfunction view() { $vimExe -R `$args }`r`n" >> $psProfile
}

# Display Profile information.
Get-Item $psProfile
Write-Output '================'
Get-Content $psProfile
Write-Output '================'

@setlocal enableextensions enabledelayedexpansion & set "PATH0=%~f0" & PowerShell.exe -Command "& (Invoke-Expression -Command ('{#' + ((Get-Content '!PATH0:'=''!') -join \"`n\") + '}'))" %* & exit /b !errorlevel!
#
# - Name
#     Install-Vim.bat
#
# - Contents
#     Install Vim.
#
# - Reference
#     PowerShell on *.bat - http://pf-j.sakura.ne.jp/program/tips/ps1bat2.htm
#     Vim - KaoriYa - https://www.kaoriya.net/software/vim/
#
# - Revision
#     2016-05-24 created.
#     yyyy-MM-dd modified.
#

################
# constant
################
$psDir = "$env:USERPROFILE\Documents\WindowsPowerShell"; if (-Not(Test-Path -Path $psDir)) { mkdir $psDir }
$psProfile = "$psDir\Microsoft.PowerShell_profile.ps1"
$vimZip = "$env:USERPROFILE\Documents\vim.zip"
$vimUri = 'https://github.com/koron/vim-kaoriya/releases/download/v8.0.0596-20170502/vim80-kaoriya-win64-8.0.0596-20170502.zip'

################
# main
################
# Get vim.zip.
if (-Not(Test-Path -Path $vimZip)) { Invoke-RestMethod -Uri $vimUri -OutFile $vimZip -UseBasicParsing }

# Unzip vim.zip.
if (Test-Path -Path $vimZip)
{
    if (-Not(Test-Path -Path "$env:USERPROFILE\Documents\vim*\vim.exe"))
    {
        $shApp = New-Object -Com shell.application
        $unzip = $shApp.NameSpace($vimZip)
        foreach ($item in $unzip.items()) { $shApp.Namespace("$env:USERPROFILE\Documents").copyhere($item, 0x8); }
    }
}
else
{
    Write-Output "[ERROR]: Failed to download from Uri($vimUri)."
    exit 1
}

# Get the full path of the vim.exe.
if (Test-Path -Path "$env:USERPROFILE\Documents\vim*\vim.exe")
{
    $vimExe = (Get-Item "$env:USERPROFILE\Documents\vim*\vim.exe").FullName
}
else
{
    Write-Output "[ERROR]: Failed to unzip file($vimZip)."
    exit 1
}

# If there is no description about Vim in Profile,
if (-Not((Get-Content $psProfile | Select-String '# vim').Matches.Success))
{
    # Add a description about Vim.
    Write-Output "# vim`r`nNew-Alias vi $vimExe`r`nNew-Alias vim $vimExe`r`nfunction view() { $vimExe -R `$args }`r`n" >> $psProfile
}

# Display Profile information.
Get-Item $psProfile
Write-Output "`r`n"
Write-Output "================================"
Get-Content $psProfile
Write-Output "================================"
[Console]::ReadKey() | Out-Null

Update Install-Vim.bat

Update Install-Vim.bat


@echo off
if not exist "%~dp0marks" mkdir "%~dp0marks"
echo %CD% > "%~dp0marks\%~1"

@echo off
if not exist "%~dp0marks" mkdir "%~dp0marks"
echo %CD%>"%~dp0marks\%~1"

Remove trailing space in mark file.

Remove trailing space in mark file.


echo off
rem call vc.bat
call ../../src/locatevc.bat

cls

rc rnote.rc
cl /DEBUG rnote.c rnote.res /link advapi32.lib shell32.lib /SUBSYSTEM:WINDOWS,"5.01"

copy rnote.exe ..\

echo off
rem call vc.bat
call ../src/locatevc.bat

cls

rc rnote.rc
cl /DEBUG rnote.c rnote.res /link advapi32.lib shell32.lib /SUBSYSTEM:WINDOWS,"5.01"

copy rnote.exe ..\

Update buildrnote.bat

Update buildrnote.bat


@echo off

setlocal enableextensions enabledelayedexpansion

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

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

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

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

:skip_help

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

set PHP_SDK_RUN_FROM_ROOT=1

title PHP SDK

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

set PHP_SDK_RUN_FROM_ROOT=
set CRT=
set ARCH=

if errorlevel 3 (
	exit /b %errorlevel%
)

if "%PHP_SDK_PGO_TOOLS_ROOT_PATH%"=="" (
	if exist "%PHP_SDK_ROOT_PATH%\pgo" (
		set PHP_SDK_PGO_TOOLS_ROOT_PATH=%PHP_SDK_ROOT_PATH%\pgo
		set PATH=!PHP_SDK_PGO_TOOLS_ROOT_PATH!\bin;!PATH!
	)
)

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

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

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

exit /b

@echo off

setlocal enableextensions enabledelayedexpansion

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

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

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

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

:skip_help

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

set PHP_SDK_RUN_FROM_ROOT=1

title PHP SDK

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

set PHP_SDK_RUN_FROM_ROOT=
set CRT=
set ARCH=

if errorlevel 3 (
	exit /b %errorlevel%
)

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

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

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

exit /b

Revert "recognize pgo stuff automatically if it's put into a subdir"

This reverts commit 010ae4236296847aa2865bfd04f260625c07fab7.


@echo off

rmdir /s /q "%TEMP%/zpm-cache"
rmdir /s /q "%TEMP%/zpm-install"

mkdir "%TEMP%/zpm-install"
cd "%TEMP%/zpm-install"

if exist "premake5.zip" del /q "premake5.zip"

if defined GH_TOKEN (
    powershell -command "Invoke-WebRequest -Uri https://github.com/premake/premake-core/releases/download/v5.0.0-alpha11/premake-5.0.0-alpha11-windows.zip -OutFile premake5.zip -Headers @{'Authorization'='token %GH_TOKEN%'}"
) else (
    powershell -command "Invoke-WebRequest -Uri https://github.com/premake/premake-core/releases/download/v5.0.0-alpha11/premake-5.0.0-alpha11-windows.zip -OutFile premake5.zip"
)
echo Finished downloading premake...

powershell -command "Expand-Archive premake5.zip -DestinationPath ."

git clone https://github.com/Zefiros-Software/ZPM.git ./zpm

echo Finished cloning ZPM...

dir

if defined GH_TOKEN (
    premake5.exe --github-token=%GH_TOKEN% --file=zpm/zpm.lua install-zpm;
) else (
    premake5.exe --file=zpm/zpm.lua install-zpm;
)

rmdir /s /q "%TEMP%/zpm-install"

echo ZPM is installed, however a restart is required!

if defined APPVEYOR (
    @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
    choco install git.install
)

@echo off

rmdir /s /q "%TEMP%/zpm-cache"
rmdir /s /q "%TEMP%/zpm-install"

mkdir "%TEMP%/zpm-install"
cd "%TEMP%/zpm-install"

if exist "premake5.zip" del /q "premake5.zip"

if defined GH_TOKEN (
    powershell -command "Invoke-WebRequest -Uri https://github.com/premake/premake-core/releases/download/v5.0.0-alpha11/premake-5.0.0-alpha11-windows.zip -OutFile premake5.zip -Headers @{'Authorization'='token %GH_TOKEN%'}"
) else (
    powershell -command "Invoke-WebRequest -Uri https://github.com/premake/premake-core/releases/download/v5.0.0-alpha11/premake-5.0.0-alpha11-windows.zip -OutFile premake5.zip"
)
echo Finished downloading premake...

powershell -command "Expand-Archive premake5.zip -DestinationPath ."

git clone https://github.com/Zefiros-Software/ZPM.git ./zpm

echo Finished cloning ZPM...

dir zpm

if defined GH_TOKEN (
    premake5.exe --github-token=%GH_TOKEN% --file=zpm/zpm.lua install-zpm;
) else (
    premake5.exe --file=zpm/zpm.lua install-zpm;
)

rmdir /s /q "%TEMP%/zpm-install"

echo ZPM is installed, however a restart is required!

if defined APPVEYOR (
    @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
    choco install git.install
)

Debug zpm dir

Debug zpm dir


::Run.bat
::Automates installation for apk files
ADB\adb kill-server
apk_mass_install -m backup -d backup

Create backup_win.bat

Create backup_win.bat


..\..\dailyUse\windows\traditionalCollectiveInfluence.cmd ..\..\data\networks\model1.csv 0 0
..\..\dailyUse\windows\newReinsertCollectiveInfluence.cmd ..\..\data\networks\model2.csv 0 1 0
..\..\dailyUse\windows\cppCollectiveInfluence.cmd ..\..\data\networks\model3.csv 0 1 0

mergeResult.cmd

echo model1 0.212114535
echo model2 a little worse than 0.174871586
echo model3 0.348837118

pause

call ..\..\dailyUse\windows\traditionalCollectiveInfluence.cmd ..\..\data\networks\model1.csv 0 0
call ..\..\dailyUse\windows\newReinsertCollectiveInfluence.cmd ..\..\data\networks\model2.csv 0 1 0
call ..\..\dailyUse\windows\cppCollectiveInfluence.cmd ..\..\data\networks\model3.csv 0 1 0

call mergeResult.cmd

echo model1 0.212114535
echo model2 a little worse than 0.174871586
echo model3 0.348837118

pause

add call in the regressionTestForDailyUse.cmd


@echo off
rem ----------------------------------------------------------------------------
rem  Copyright 2018 WSO2, Inc. http://www.wso2.org
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.

set usertLocation=%cd%
set pathToApiManagerXML=..\repository\conf\api-manager.xml
set pathToAxis2XML=..\repository\conf\axis2\axis2.xml
set pathToRegistry=..\repository\conf\registry.xml
set pathToInboundEndpoints=..\repository\deployment\server\synapse-configs\default\inbound-endpoints
set pathToWebapps=..\repository\deployment\server\webapps
set pathToJaggeryapps=..\repository\deployment\server\jaggeryapps
set pathToSynapseConfigs=..\repository\deployment\server\synapse-configs\default
cd /d %~dp0

rem ----- Process the input commands (two args only)-------------------------------------------
if ""%1""==""-Dprofile"" (
	if ""%2""==""api-key-manager"" 	goto keyManager
	if ""%2""==""api-publisher"" 	goto publisher
	if ""%2""==""api-store"" 		goto store
	if ""%2""==""traffic-manager"" 	goto trafficManager
	if ""%2""==""gateway-worker"" 	goto gatewayWorker
)
echo Profile is not specifed properly, please try again
goto end

:keyManager
echo Starting to optimize API Manager for the Key Manager profile
call :disableDataPublisher
call :disableJMSConnectionDetails
call :disablePolicyDeployer
call :disableTransportSenderWS
call :disableTransportSenderWSS
call :removeWebSocketInboundEndpoint
call :removeSecureWebSocketInboundEndpoint
call :removeSynapseConfigs
rem ---removing webbapps which are not required for this profile--------
for /f %%i in ('dir %pathToWebapps% /A:-D /b ^| findstr /v "client-registration#v.*war authenticationendpoint.war oauth2.war throttle#data#v.*war api#identity#consent-mgt#v.*war"') do (
	del /f %pathToWebapps%\%%i
	call :Timestamp value
	echo %value% INFO - Removed the %%i file from %pathToWebapps%
	setlocal enableDelayedExpansion
	set folderName=%%i
	set folderName=!folderName:.war=!
	if exist %pathToWebapps%\!folderName!\ (
		rmdir /s /q %pathToWebapps%\!folderName!
		call :Timestamp value
		echo %value% INFO - Removed the !folderName! directory from %pathToWebapps%
	)
	endlocal
)
rem ---removing jaggeryapps which are not required for this profile--------
for /f %%i in ('dir "%pathToJaggeryapps%" /A:D /b') do (
	rmdir /s /q %pathToJaggeryapps%\%%i
	call :Timestamp value
	echo %value% INFO - Removed the %%i directory from %pathToJaggeryapps%
)
goto finishOptimization

:publisher
echo Starting to optimize API Manager for the API Publisher profile
call :disableDataPublisher
call :disableJMSConnectionDetails
call :disableTransportSenderWS
call :disableTransportSenderWSS
call :removeWebSocketInboundEndpoint
call :removeSecureWebSocketInboundEndpoint
rem ---removing webbapps which are not required for this profile--------
for /f %%i in ('dir %pathToWebapps% /A:-D /b ^| findstr /v "api#am#publisher#v.*war"') do (
	del /f %pathToWebapps%\%%i
	call :Timestamp value
	echo %value% INFO - Removed the %%i file from %pathToWebapps%
	setlocal enableDelayedExpansion
	set folderName=%%i
	set folderName=!folderName:.war=!
	if exist %pathToWebapps%\!folderName!\ (
		rmdir /s /q %pathToWebapps%\!folderName!
		call :Timestamp value
		echo %value% INFO - Removed the !folderName! directory from %pathToWebapps%
	)
	endlocal
)
rem ---removing jaggeryapps which are not required for this profile--------
for /f %%i in ('dir "%pathToJaggeryapps%" /A:D /b ^| findstr /v "publisher admin"') do (
	rmdir /s /q %pathToJaggeryapps%\%%i
	call :Timestamp value
	echo %value% INFO - Removed the %%i directory from %pathToJaggeryapps%
)
goto finishOptimization

:store
echo Starting to optimize API Manager for the Developer Portal (API Store) profile
call :disableDataPublisher
call :disableJMSConnectionDetails
call :disablePolicyDeployer
call :disableTransportSenderWS
call :disableTransportSenderWSS
call :removeWebSocketInboundEndpoint
call :removeSecureWebSocketInboundEndpoint
rem ---removing webbapps which are not required for this profile--------
for /f %%i in ('dir %pathToWebapps% /A:-D /b ^| findstr /v "api#am#store#v.*war"') do (
	del /f %pathToWebapps%\%%i
	call :Timestamp value
	echo %value% INFO - Removed the %%i file from %pathToWebapps%
	setlocal enableDelayedExpansion
	set folderName=%%i
	set folderName=!folderName:.war=!
	if exist %pathToWebapps%\!folderName!\ (
		rmdir /s /q %pathToWebapps%\!folderName!
		call :Timestamp value
		echo %value% INFO - Removed the !folderName! directory from %pathToWebapps%
	)
	endlocal
)
rem ---removing jaggeryapps which are not required for this profile--------
for /f %%i in ('dir "%pathToJaggeryapps%" /A:D /b ^| findstr /v "store"') do (
	rmdir /s /q %pathToJaggeryapps%\%%i
	call :Timestamp value
	echo %value% INFO - Removed the %%i directory from %pathToJaggeryapps%
)
goto finishOptimization

:trafficManager
echo Starting to optimize API Manager for the Traffic Manager profile
call :disableTransportSenderWS
call :disableTransportSenderWSS
call :removeWebSocketInboundEndpoint
call :removeSecureWebSocketInboundEndpoint
call :disableIndexingConfiguration
call :removeSynapseConfigs
rem ---removing webbapps which are not required for this profile--------
for /f %%i in ('dir %pathToWebapps% /A:-D /b') do (
	del /f %pathToWebapps%\%%i
	call :Timestamp value
	echo %value% INFO - Removed the %%i file from %pathToWebapps%
	setlocal enableDelayedExpansion
	set folderName=%%i
	set folderName=!folderName:.war=!
	if exist %pathToWebapps%\!folderName!\ (
		rmdir /s /q %pathToWebapps%\!folderName!
		call :Timestamp value
		echo %value% INFO - Removed the !folderName! directory from %pathToWebapps%
	)
	endlocal
)
rem ---removing jaggeryapps which are not required for this profile--------
for /f %%i in ('dir "%pathToJaggeryapps%" /A:D /b') do (
	rmdir /s /q %pathToJaggeryapps%\%%i
	call :Timestamp value
	echo %value% INFO - Removed the %%i directory from %pathToJaggeryapps%
)
goto finishOptimization

:gatewayWorker
echo Starting to optimize API Manager for the Gateway worker profile
call :disablePolicyDeployer
call :disableIndexingConfiguration
rem ---removing webbapps which are not required for this profile--------
for /f %%i in ('dir %pathToWebapps% /A:-D /b ^| findstr /v "am#sample#pizzashack#v.*war"') do (
	del /f %pathToWebapps%\%%i
	call :Timestamp value
	echo %value% INFO - Removed the %%i file from %pathToWebapps%
	setlocal enableDelayedExpansion
	set folderName=%%i
	set folderName=!folderName:.war=!
	if exist %pathToWebapps%\!folderName!\ (
		rmdir /s /q %pathToWebapps%\!folderName!
		call :Timestamp value
		echo %value% INFO - Removed the !folderName! directory from %pathToWebapps%
	)
	endlocal
)
rem ---removing jaggeryapps which are not required for this profile--------
for /f %%i in ('dir "%pathToJaggeryapps%" /A:D /b') do (
	rmdir /s /q %pathToJaggeryapps%\%%i
	call :Timestamp value
	echo %value% INFO - Removed the %%i directory from %pathToJaggeryapps%
)
goto finishOptimization

:disableDataPublisher
for /f %%i in ('powershell -Command "$xml = [xml] (Get-Content %pathToApiManagerXML%); $xml.APIManager.ThrottlingConfigurations.DataPublisher.Enabled;"') do (
	if %%i==true (
		powershell -Command "$xml = [xml] (Get-Content %pathToApiManagerXML%); $xml.APIManager.ThrottlingConfigurations.DataPublisher.Enabled='false'; $xml.Save('%pathToApiManagerXML%');"
		call :Timestamp value
		echo %value% INFO - Disabled the ^<DataPublisher^> from api-manager.xml file
	)
)
EXIT /B 0

:disableJMSConnectionDetails
for /f %%i in ('powershell -Command "$xml = [xml] (Get-Content %pathToApiManagerXML%); $xml.APIManager.ThrottlingConfigurations.JMSConnectionDetails.Enabled;"') do (
	if %%i==true (
		powershell -Command "$xml = [xml] (Get-Content %pathToApiManagerXML%); $xml.APIManager.ThrottlingConfigurations.JMSConnectionDetails.Enabled='false'; $xml.Save('%pathToApiManagerXML%');"
		call :Timestamp value
		echo %value% INFO - Disabled the ^<JMSConnectionDetails^> from api-manager.xml file
	)
)
EXIT /B 0

:disablePolicyDeployer
for /f %%i in ('powershell -Command "$xml = [xml] (Get-Content %pathToApiManagerXML%); $xml.APIManager.ThrottlingConfigurations.PolicyDeployer.Enabled;"') do (
	if %%i==true (
		powershell -Command "$xml = [xml] (Get-Content %pathToApiManagerXML%); $xml.APIManager.ThrottlingConfigurations.PolicyDeployer.Enabled='false'; $xml.Save('%pathToApiManagerXML%');"
		call :Timestamp value
		echo %value% INFO - Disabled the ^<PolicyDeployer^> from api-manager.xml file
	)
)
EXIT /B 0

:disableTransportSenderWS
for /f %%i in ('powershell -Command "& {$xml = [xml] (Get-Content %pathToAxis2XML%); $xml.selectSingleNode('//transportSender[@name=\"ws\"]'); }" ') do (
	powershell -Command "& { $xml = [xml] (Get-Content %pathToAxis2XML%); $xml.selectNodes('//transportSender[@name=\"ws\"]') | ForEach-Object { $node = $_; $comment = $xml.CreateComment($node.OuterXml); $node=$node.ParentNode.ReplaceChild($comment, $node);}; $xml.Save('%pathToAxis2XML%');}"
	call :Timestamp value
	echo %value% INFO - Disabled the ^<transportSender name="ws" class="org.wso2.carbon.websocket.transport.WebsocketTransportSender"^> from axis2.xml file
	goto skipLoop1
)
:skipLoop1
EXIT /B 0

:disableTransportSenderWSS
for /f %%i in ('powershell -Command "& {$xml = [xml] (Get-Content %pathToAxis2XML%); $xml.SelectSingleNode('//transportSender[@name=\"wss\"]'); }" ') do (
	powershell -Command "& { $xml = [xml] (Get-Content %pathToAxis2XML%); $xml.selectNodes('//transportSender[@name=\"wss\"]') | ForEach-Object { $node = $_; $comment = $xml.CreateComment($node.OuterXml); $node=$node.ParentNode.ReplaceChild($comment, $node);}; $xml.Save('%pathToAxis2XML%');}"
	call :Timestamp value
	echo %value% INFO - Disabled the ^<transportSender name="wss" class="org.wso2.carbon.websocket.transport.WebsocketTransportSender"^> from axis2.xml file
	goto skipLoop2
	)
:skipLoop2
EXIT /B 0

:disableIndexingConfiguration
for /f %%i in ('powershell -Command "$xml = [xml] (Get-Content %pathToRegistry%); $xml.wso2registry.indexingConfiguration.startIndexing;"') do (
	if %%i==true (
		powershell -Command "$xml = [xml] (Get-Content %pathToRegistry%); $xml.wso2registry.indexingConfiguration.startIndexing='false'; $xml.Save('%pathToRegistry%');"
		call :Timestamp value
		echo %value% INFO - Disabled the ^<indexingConfiguration^> from registry.xml file
	)
)
EXIT /B 0

:removeWebSocketInboundEndpoint
if exist %pathToInboundEndpoints%\WebSocketInboundEndpoint.xml (
	del /f %pathToInboundEndpoints%\WebSocketInboundEndpoint.xml
	call :Timestamp value
	echo %value% INFO - Removed the WebSocketInboundEndpoint.xml file from %pathToInboundEndpoints%
)
EXIT /B 0

:removeSecureWebSocketInboundEndpoint
if exist %pathToInboundEndpoints%\SecureWebSocketInboundEndpoint.xml (
	del /f %pathToInboundEndpoints%\SecureWebSocketInboundEndpoint.xml
	call :Timestamp value
	echo %value% INFO - Removed the SecureWebSocketInboundEndpoint.xml file from %pathToInboundEndpoints%
)
EXIT /B 0

:removeSynapseConfigs
rem ----removing directories if exists ----
for /f %%i in ('dir "%pathToSynapseConfigs%" /A:D /b') do (
	rmdir /s /q %pathToSynapseConfigs%\%%i
	call :Timestamp value
	echo %value% INFO - Removed the %%i directory from %pathToSynapseConfigs%
)
rem ----removing the files if exists ------
for /f %%i in ('dir "%pathToSynapseConfigs%" /A:-D /b ^| find /v "synapse.xml"') do (
	del /f %pathToSynapseConfigs%\%%i
	call :Timestamp value
	echo %value% INFO - Removed the %%i file from %pathToSynapseConfigs%
)
EXIT /B 0

:Timestamp
set "%~1=[%date:~10,14%-%date:~4,2%-%date:~7,2% %time%]"
EXIT /B 0

:finishOptimization
echo Finished the optimizations
goto end

:end
cd /d %usertLocation%

add prfile2

add prfile2


:: vagrant public key
if exist a:\vagrant.pub (
  copy a:\vagrant.pub C:\Users\vagrant\.ssh\authorized_keys
) else (
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub', 'C:\Users\vagrant\.ssh\authorized_keys')" <NUL
)

:: vagrant public key
if not exist C:\Users\vagrant\.ssh mkdir C:\Users\vagrant\.ssh
if exist a:\vagrant.pub (
  copy a:\vagrant.pub C:\Users\vagrant\.ssh\authorized_keys
) else (
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub', 'C:\Users\vagrant\.ssh\authorized_keys')" <NUL
)

create c:\users\vagrant\.ssh path is missing