@echo off

REM This is a script that will set environment information about where to find
REM NuGet.exe, it's version and ensure that it's present on the enlistment.
set NuGetExeVersion=3.5.0-beta2
set NuGetExeFolder=%~dp0..\..\Binaries\Download\%NuGetExeVersion%
set NuGetExe=%NuGetExeFolder%\NuGet.exe

REM Download NuGet.exe if we haven't already
if not exist "%NuGetExe%" (
    echo Downloading NuGet %NuGetExeVersion%
    powershell -noprofile -executionPolicy RemoteSigned -file "%~dp0download-nuget.ps1" "%NuGetExeVersion%" "%NuGetExeFolder%" || goto :DownloadNuGetFailed
)

@echo off

REM This is a script that will set environment information about where to find
REM NuGet.exe, it's version and ensure that it's present on the enlistment.
set NuGetExeVersion=3.5.0-beta2
set NuGetExeFolder=%~dp0..\..
set NuGetExe=%NuGetExeFolder%\NuGet.exe

REM Download NuGet.exe if we haven't already
if not exist "%NuGetExe%" (
    echo Downloading NuGet %NuGetExeVersion%
    powershell -noprofile -executionPolicy RemoteSigned -file "%~dp0download-nuget.ps1" "%NuGetExeVersion%" "%NuGetExeFolder%" || goto :DownloadNuGetFailed
)

Move NuGet.exe restore location back to the root

After extensive testing it appears the number of places that assume NuGet.exe is in the root is "at least one more."  Need to unblock the signed build so putting it back in the root temporarily.


echo OFF

set UPLOAD_TARGETS=python-parse python-pkgtk

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

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

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

echo ON

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

echo OFF

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

echo ON

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

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

anaconda logout

echo OFF

set UPLOAD_TARGETS=python-parse python-pkgtk

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

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

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

echo ON

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

echo OFF

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

echo ON

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

for %%x in (%UPLOAD_TARGETS%) do (
  for /f %%i in ('conda build %%x -c %ANACONDA_CHANNEL% %ANACONDA_FLAGS% --output') do anaconda upload --user %ANACONDA_CHANNEL% %%i
)

anaconda logout

Update upload.bat

Update upload.bat


@ECHO OFF

PUSHD "%~dp0..\..\..\"

CALL getversion.cmd

IF "%OLW_CONFIG%" == "" (
  echo %%OLW_CONFIG%% not set, will default to 'Debug'
  set OLW_CONFIG=Debug
)

IF EXIST "%LocalAppData%\Nuget\Nuget.exe" (GOTO package) ELSE (
   echo Nuget.exe missing from %LocalAppData%\Nuget\Nuget.exe
   GOTO end
)

:package
"%LocalAppData%\Nuget\Nuget.exe" pack .\OpenLiveWriter.nuspec -version %dottedVersion% -basepath src\managed\bin\%OLW_CONFIG%\i386\Writer
ECHO Created Writer NuGet package.

.\src\managed\packages\squirrel.windows.1.2.1\tools\Squirrel.exe -i .\src\managed\OpenLiveWriter.PostEditor\Images\Writer.ico %OLW_SIGN% --no-msi --releasify .\OpenLiveWriter.%dottedVersion%.nupkg
ECHO Created Open Live Writer setup file.

:end
POPD

@ECHO OFF

PUSHD "%~dp0..\..\..\"

CALL getversion.cmd

IF "%OLW_CONFIG%" == "" (
  echo %%OLW_CONFIG%% not set, will default to 'Debug'
  set OLW_CONFIG=Debug
)

IF EXIST "%LocalAppData%\Nuget\Nuget.exe" (GOTO package) ELSE (
   echo Nuget.exe missing from %LocalAppData%\Nuget\Nuget.exe
   GOTO end
)

:package
"%LocalAppData%\Nuget\Nuget.exe" pack .\OpenLiveWriter.nuspec -version %dottedVersion% -basepath src\managed\bin\%OLW_CONFIG%\i386\Writer
ECHO Created Writer NuGet package.

.\src\managed\packages\squirrel.windows.1.2.1\tools\Squirrel.exe -i .\src\managed\OpenLiveWriter.PostEditor\Images\Writer.ico %OLW_SIGN% --no-msi --releasify .\OpenLiveWriter.%dottedVersion%.nupkg
MOVE .\Releases\Setup.exe .\Releases\OpenLiveWriter.exe
ECHO Created Open Live Writer setup file.

:end
POPD

rename the installer file to be more descriptive


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

setlocal

set build-root=%~dp0..
rem // resolve to fully qualified path
for %%i in ("%build-root%") do set build-root=%%~fi

REM -- C --
cd %build-root%\tools

call build_dotnet.cmd %*
if errorlevel 1 goto :eof

call build_uwp.cmd %*
if errorlevel 1 goto :eof
cd %build-root%

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

setlocal

set build-root=%~dp0..
rem // resolve to fully qualified path
for %%i in ("%build-root%") do set build-root=%%~fi

REM -- C --
cd %build-root%\tools

call build_dotnet.cmd %*
if errorlevel 1 goto :eof

call build_uwp.cmd --skip-unittests %*
if errorlevel 1 goto :eof
cd %build-root%

Fix unit test run error on UWP by not running them


@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
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"
net start msdtc
net start comsysapp
net start "TTI WCF Host Service"
%SystemRoot%\System32\iisreset.exe -start

Update killcom.cmd

Update killcom.cmd

Esqueci: ""


::THIS FILE IS BEING UNTRACKED FROM GIT with the command: git update-index --assume-unchanged <file>
::To resume the tracking of changes to this file use the command: git update-index --no-assume-unchanged <file>
::You must keep this file in the solution folder for it to work.
::Make sure to pass the solution configuration when calling it (either Debug or Release)

::Set the path below as you need and then run this bat to copy the files and make them debuggeable
SET KSPPATH=C:\Kerbal Space Program
::Set another path in case you run two KSP instances otherwise leave empty
::EXAMPLE: SET KSPPATH2=C:\Kerbal Space Program2
SET KSPPATH2=
SET SOLUTIONCONFIGURATION=%1

mkdir "%KSPPATH%\GameData\LunaMultiPlayer\"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiPlayer\")

mkdir "%KSPPATH%\GameData\LunaMultiPlayer\Plugins"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiPlayer\Plugins")

mkdir "%KSPPATH%\GameData\LunaMultiPlayer\Button"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiPlayer\Button")

"%~dp0..\External\pdb2mdb\pdb2mdb.exe" "%~dp0..\Client\bin\%SOLUTIONCONFIGURATION%\LunaClient.dll"
xcopy /Y "%~dp0..\Client\bin\%SOLUTIONCONFIGURATION%\LunaClient.*" "%KSPPATH%\GameData\LunaMultiPlayer\Plugins"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\Client\bin\%SOLUTIONCONFIGURATION%\LunaClient.*" "%KSPPATH2%\GameData\LunaMultiPlayer\Plugins")

"%~dp0..\External\pdb2mdb\pdb2mdb.exe" "%~dp0..\\Common\bin\%SOLUTIONCONFIGURATION%\LunaCommon.dll"
xcopy /Y "%~dp0..\Common\bin\%SOLUTIONCONFIGURATION%\LunaCommon.*" "%KSPPATH%\GameData\LunaMultiPlayer\Plugins"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\Common\bin\%SOLUTIONCONFIGURATION%\LunaCommon.*" "%KSPPATH2%\GameData\LunaMultiPlayer\Plugins")

"%~dp0..\External\pdb2mdb\pdb2mdb.exe" "%~dp0..\\Common\bin\%SOLUTIONCONFIGURATION%\Lidgren.Network.dll"
xcopy /Y "%~dp0..\Common\bin\%SOLUTIONCONFIGURATION%\Lidgren.Network.*" "%KSPPATH%\GameData\LunaMultiPlayer\Plugins"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\Common\bin\%SOLUTIONCONFIGURATION%\LunaCommon.*" "%KSPPATH2%\GameData\LunaMultiPlayer\Plugins")

xcopy /Y "%~dp0..\External\Dependencies\*.dll" "%KSPPATH%\GameData\LunaMultiPlayer\Plugins"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\External\Dependencies\*.dll" "%KSPPATH2%\GameData\LunaMultiPlayer\Plugins")

xcopy /Y "%~dp0..\Client\Resources\*.png" "%KSPPATH%\GameData\LunaMultiPlayer\Button"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\Client\Resources\*.png" "%KSPPATH2%\GameData\LunaMultiPlayer\Button")

::THIS FILE IS BEING UNTRACKED FROM GIT with the command: git update-index --assume-unchanged <file>
::To resume the tracking of changes to this file use the command: git update-index --no-assume-unchanged <file>
::You must keep this file in the solution folder for it to work.
::Make sure to pass the solution configuration when calling it (either Debug or Release)

::Set the path below as you need and then run this bat to copy the files and make them debuggeable
SET KSPPATH=C:\Kerbal Space Program
::Set another path in case you run two KSP instances otherwise leave empty
::EXAMPLE: SET KSPPATH2=C:\Kerbal Space Program2
SET KSPPATH2=
SET SOLUTIONCONFIGURATION=%1

mkdir "%KSPPATH%\GameData\LunaMultiPlayer\"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiPlayer\")

mkdir "%KSPPATH%\GameData\LunaMultiPlayer\Plugins"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiPlayer\Plugins")

mkdir "%KSPPATH%\GameData\LunaMultiPlayer\Button"
IF DEFINED KSPPATH2 (mkdir "%KSPPATH2%\GameData\LunaMultiPlayer\Button")

"%~dp0..\External\pdb2mdb\pdb2mdb.exe" "%~dp0..\Client\bin\%SOLUTIONCONFIGURATION%\LunaClient.dll"
xcopy /Y "%~dp0..\Client\bin\%SOLUTIONCONFIGURATION%\LunaClient.*" "%KSPPATH%\GameData\LunaMultiPlayer\Plugins"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\Client\bin\%SOLUTIONCONFIGURATION%\LunaClient.*" "%KSPPATH2%\GameData\LunaMultiPlayer\Plugins")

"%~dp0..\External\pdb2mdb\pdb2mdb.exe" "%~dp0..\\Common\bin\%SOLUTIONCONFIGURATION%\LunaCommon.dll"
xcopy /Y "%~dp0..\Common\bin\%SOLUTIONCONFIGURATION%\LunaCommon.*" "%KSPPATH%\GameData\LunaMultiPlayer\Plugins"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\Common\bin\%SOLUTIONCONFIGURATION%\LunaCommon.*" "%KSPPATH2%\GameData\LunaMultiPlayer\Plugins")

"%~dp0..\External\pdb2mdb\pdb2mdb.exe" "%~dp0..\\Common\bin\%SOLUTIONCONFIGURATION%\Lidgren.Network.dll"
xcopy /Y "%~dp0..\Common\bin\%SOLUTIONCONFIGURATION%\Lidgren.Network.*" "%KSPPATH%\GameData\LunaMultiPlayer\Plugins"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\Common\bin\%SOLUTIONCONFIGURATION%\Lidgren.Network.*" "%KSPPATH2%\GameData\LunaMultiPlayer\Plugins")

xcopy /Y "%~dp0..\External\Dependencies\*.dll" "%KSPPATH%\GameData\LunaMultiPlayer\Plugins"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\External\Dependencies\*.dll" "%KSPPATH2%\GameData\LunaMultiPlayer\Plugins")

xcopy /Y "%~dp0..\Client\Resources\*.png" "%KSPPATH%\GameData\LunaMultiPlayer\Button"
IF DEFINED KSPPATH2 (xcopy /Y "%~dp0..\Client\Resources\*.png" "%KSPPATH2%\GameData\LunaMultiPlayer\Button")

Fix issue where KSPPATH2 would not deploy Lidgren network files


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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

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

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

goto :EOF

:error
exit /b 1

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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

@rem npm path is not currently set in our image, we should fix this next time
@rem we upgrade Node.js in the image:
SET PATH=%PATH%;/cygdrive/c/Program Files/nodejs/npm

call nvm use v12.14.1
call which node

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

goto :EOF

:error
exit /b 1

build: update windows configuration to match new vm


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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@5 || goto :error

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

goto :EOF

:error
exit /b 1

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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

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

goto :EOF

:error
exit /b 1

use latest npm on Windows (#344)

chore: use latest npm on Windows (#344)


@echo off

REM This is a script that will set environment information about where to find
REM NuGet.exe, it's version and ensure that it's present on the enlistment.
set NuGetExeVersion=3.6.0-beta1
set NuGetExeFolder=%~dp0..\..
set NuGetExe=%NuGetExeFolder%\NuGet.exe

if "%VisualStudioVersion%" == "15.0" (
    set NuGetAdditionalCommandLineArgs=-verbosity quiet -configfile "%NuGetExeFolder%\nuget.config" -Project2ProjectTimeOut 1200 -msbuildpath "%DevenvDir%\..\..\MSBuild\15.0\Bin"
) else (
    set NuGetAdditionalCommandLineArgs=-verbosity quiet -configfile "%NuGetExeFolder%\nuget.config" -Project2ProjectTimeOut 1200
)

REM Download NuGet.exe if we haven't already
if not exist "%NuGetExe%" (
    echo Downloading NuGet %NuGetExeVersion%
    powershell -noprofile -executionPolicy Bypass -file "%~dp0download-nuget.ps1" "%NuGetExeVersion%" "%NuGetExeFolder%" || goto :DownloadNuGetFailed
)

@echo off

REM This is a script that will set environment information about where to find
REM NuGet.exe, it's version and ensure that it's present on the enlistment.
set NuGetExeVersion=3.6.0-beta1
set NuGetExeFolder=%~dp0..\..
set NuGetExe=%NuGetExeFolder%\NuGet.exe

REM If we have an applocal copy of MSBuild, pass it to NuGet.  Otherwise, assume NuGet knows how to find it.
if exist "%DevenvDir%\..\..\MSBuild\15.0\Bin\MSBuild.exe" (
    set NuGetAdditionalCommandLineArgs=-verbosity quiet -configfile "%NuGetExeFolder%\nuget.config" -Project2ProjectTimeOut 1200 -msbuildpath "%DevenvDir%\..\..\MSBuild\15.0\Bin"
) else (
    set NuGetAdditionalCommandLineArgs=-verbosity quiet -configfile "%NuGetExeFolder%\nuget.config" -Project2ProjectTimeOut 1200
)

REM Download NuGet.exe if we haven't already
if not exist "%NuGetExe%" (
    echo Downloading NuGet %NuGetExeVersion%
    powershell -noprofile -executionPolicy Bypass -file "%~dp0download-nuget.ps1" "%NuGetExeVersion%" "%NuGetExeFolder%" || goto :DownloadNuGetFailed
)

Update test to check for existence of app-local msbuild instead of version number


echo off
IF EXIST dist del /Q dist\*.*

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

:default_value:
IF NOT EXIST c:\Python34 GOTO checkinstall64:

:checkinstall:
IF EXIST c:\Python34vir GOTO nexta:
mkdir c:\Python34vir

:nexta:
IF EXIST c:\Python34vir\install GOTO fullsetupa:
c:\Python34\Scripts\virtualenv c:\Python34vir\install --system-site-packages
if %errorlevel% neq 0 exit /b %errorlevel%

:fullsetupa:
echo #######################################################
c:\Python34vir\install\Scripts\python -u setup.py install
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:checkinstall64:
IF EXIST c:\Python34_64vir GOTO nextb:
mkdir c:\Python34_64vir

:nextb:
IF EXIST c:\Python34_64vir\install GOTO fullsetupb:
c:\Python34_x64\Scripts\virtualenv c:\Python34_64vir\install --system-site-packages
if %errorlevel% neq 0 exit /b %errorlevel%

:fullsetupb:
echo #######################################################
c:\Python34_64vir\install\Scripts\python -u setup.py install
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:setup34:
IF NOT EXIST c:\Python34 GOTO utpy34_64:
set pythonexe="c:\Python34\python"
%pythonexe% setup.py write_version
%pythonexe% setup.py clean_pyd
%pythonexe% setup.py build bdist_wininst --plat-name=win-amd64
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:utpy34_64:
set pythonexe="c:\Python34_x64\python"
%pythonexe% setup.py write_version
%pythonexe% -u setup.py clean_space
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% -u setup.py unittests
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:setup34_x64_msi_wheel:
set pythonexe="c:\Python34_x64\python"
:custom_python:
%pythonexe% setup.py clean_pyd
%pythonexe% setup.py sdist --formats=gztar,zip --verbose
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% setup.py bdist_wininst --plat-name=win-amd64
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% setup.py bdist_msi
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% setup.py bdist_wheel
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:documentation:
%pythonexe% -u setup.py build_sphinx
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:copyfiles:
if not exist dist\html mkdir dist\html
xcopy /E /C /I /Y _doc\sphinxdoc\build\html dist\html
if exist _doc\sphinxdoc\build\latex xcopy /E /C /I /Y _doc\sphinxdoc\build\latex\*.pdf dist\html
if %errorlevel% neq 0 exit /b %errorlevel%

echo off
IF EXIST dist del /Q dist\*.*

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

:default_value:
IF NOT EXIST c:\Python34 GOTO checkinstall64:

:checkinstall:
IF EXIST c:\Python34vir GOTO nexta:
mkdir c:\Python34vir

:nexta:
IF EXIST c:\Python34vir\install GOTO fullsetupa:
c:\Python34\Scripts\virtualenv c:\Python34vir\install --system-site-packages
if %errorlevel% neq 0 exit /b %errorlevel%

:fullsetupa:
echo #######################################################
c:\Python34vir\install\Scripts\python -u setup.py install
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:checkinstall64:
IF EXIST c:\Python34_64vir GOTO nextb:
mkdir c:\Python34_64vir

:nextb:
IF EXIST c:\Python34_64vir\install GOTO fullsetupb:
c:\Python34_x64\Scripts\virtualenv c:\Python34_64vir\install --system-site-packages
if %errorlevel% neq 0 exit /b %errorlevel%

:fullsetupb:
echo #######################################################
c:\Python34_64vir\install\Scripts\python -u setup.py install
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:setup34:
IF NOT EXIST c:\Python34 GOTO utpy34_64:
set pythonexe="c:\Python34\python"
%pythonexe% setup.py write_version
%pythonexe% setup.py clean_pyd
%pythonexe% setup.py build bdist_wininst --plat-name=win-amd64
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:utpy34_64:
set pythonexe="c:\Python34_x64\python"
:custom_python:
%pythonexe% setup.py write_version
%pythonexe% -u setup.py clean_space
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% -u setup.py unittests
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

%pythonexe% setup.py clean_pyd
%pythonexe% setup.py sdist --formats=gztar,zip --verbose
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% setup.py bdist_wininst --plat-name=win-amd64
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% setup.py bdist_msi
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% setup.py bdist_wheel
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

if "%2"=="skip_sphinx" goto end:

:documentation:
%pythonexe% -u setup.py build_sphinx
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:copyfiles:
if not exist dist\html mkdir dist\html
xcopy /E /C /I /Y _doc\sphinxdoc\build\html dist\html
if exist _doc\sphinxdoc\build\latex xcopy /E /C /I /Y _doc\sphinxdoc\build\latex\*.pdf dist\html
if %errorlevel% neq 0 exit /b %errorlevel%

:end:

update build_setup_help_on_windows to run unit tests on anaconda


@echo off
rem configuration Variables
set InstallerName=CormanLispInstaller.msi

set GeneratedWXSFiles=.\installer\Sys.wxs .\installer\Libraries.wxs .\installer\Modules.wxs .\installer\Documentation.wxs .\installer\Headers.wxs .\installer\Examples.wxs .\installer\HyperSpec.wxs
set InstallerFiles= %GeneratedWXSFiles% .\installer\HyperSpecLegalese.wxs .\installer\Features.wxs .\installer\DebugData.wxs .\installer\AddToPath.wxs .\installer\Shortcuts.wxs .\installer\Core.wxs .\installer\Main.wxs
set InstallerObjectFiles= .\installer\Sys.wixobj .\installer\Libraries.wixobj .\installer\Modules.wixobj .\installer\Documentation.wixobj .\installer\Headers.wixobj .\installer\Examples.wixobj .\installer\HyperSpec.wixobj .\installer\HyperSpecLegalese.wixobj .\installer\Features.wixobj  .\installer\DebugData.wixobj .\installer\AddToPath.wixobj .\installer\Shortcuts.wixobj .\installer\Core.wixobj .\installer\Main.wixobj

set HeatOptions=-gg -scom -sreg -sfrag -ke -dr INSTALLDIR  -t .\installer\include.xsl
set WixExtensions=-ext WixUIExtension -ext WixUtilExtension

rem set old current directory
set OldDir=%cd%
cd "%~dp0\"

rem Cleanup
del %InstallerName%
del %GeneratedWXSFiles%
del %InstallerObjectFiles%

rem convert TXT license to RTF
clconsole.exe -execute Utilities\license-to-rtf.lisp

rem Unpack HyperSpec
rd /s /q HyperSpec
del HyperSpec-Legalese.text
del HyperSpec-README.text
clconsole.exe -execute Utilities\install-hyperspec.lisp

rem Generate file with build version information
del installer\Version.wxi
clconsole.exe -execute Utilities\generate-version-wxi.lisp

rem Generate include fragments.
rem These should be synchronised with values in 'Config.wxi'

rem Corman Lisp core
"%WIX%\bin\heat" dir .\Sys -cg SysDir -var var.SysDirectoryPath -out .\installer\Sys.wxs %HeatOptions%

"%WIX%\bin\heat" dir .\Libraries -cg LibrariesDir -var var.LibrariesDirectoryPath -out .\installer\Libraries.wxs %HeatOptions%

"%WIX%\bin\heat" dir .\Modules -cg ModulesDir -var var.ModulesDirectoryPath -out .\installer\Modules.wxs %HeatOptions%

"%WIX%\bin\heat" dir .\documentation -cg DocDir -var var.DocumentationDirectoryPath -out .\installer\Documentation.wxs %HeatOptions%

rem Corman Lisp extra
"%WIX%\bin\heat" dir .\include -cg HeadersDir -var var.HeadersDirectoryPath -out .\installer\Headers.wxs %HeatOptions%

"%WIX%\bin\heat" dir .\examples -cg ExamplesDir -var var.ExamplesDirectoryPath -out .\installer\Examples.wxs %HeatOptions%

"%WIX%\bin\heat" dir .\HyperSpec -cg HyperSpecDir -var var.HyperSpecDirectoryPath -out .\installer\HyperSpec.wxs %HeatOptions%

rem build the installer
"%WIX%\bin\candle" %WiXExtensions% -out .\installer\ %InstallerFiles%
"%WIX%\bin\light" %WiXExtensions% -sw1076 -cultures:en-US %InstallerObjectFiles% -out %InstallerName%

rem change current directory
cd "%OldDir%"

@echo off
rem configuration Variables
set InstallerName=CormanLispInstaller.msi

set GeneratedWXSFiles=.\installer\Sys.wxs .\installer\Libraries.wxs .\installer\Modules.wxs .\installer\Documentation.wxs .\installer\Headers.wxs .\installer\Examples.wxs .\installer\HyperSpec.wxs
set InstallerFiles= %GeneratedWXSFiles% .\installer\HyperSpecLegalese.wxs .\installer\Features.wxs .\installer\DebugData.wxs .\installer\AddToPath.wxs .\installer\Shortcuts.wxs .\installer\Core.wxs .\installer\Main.wxs
set InstallerObjectFiles= .\installer\Sys.wixobj .\installer\Libraries.wixobj .\installer\Modules.wixobj .\installer\Documentation.wixobj .\installer\Headers.wixobj .\installer\Examples.wixobj .\installer\HyperSpec.wixobj .\installer\HyperSpecLegalese.wixobj .\installer\Features.wixobj  .\installer\DebugData.wixobj .\installer\AddToPath.wixobj .\installer\Shortcuts.wixobj .\installer\Core.wixobj .\installer\Main.wixobj

set HeatOptions=-gg -scom -sreg -sfrag -ke -dr INSTALLDIR  -t .\installer\include.xsl
set WixExtensions=-ext WixUIExtension -ext WixUtilExtension

rem set old current directory
set OldDir=%cd%
cd "%~dp0\"

rem Cleanup
del %InstallerName%
del %GeneratedWXSFiles%
del %InstallerObjectFiles%

rem convert TXT license to RTF
clconsole.exe -execute Utilities\license-to-rtf.lisp

rem Unpack HyperSpec
rd /s /q HyperSpec
del HyperSpec-Legalese.text
del HyperSpec-README.text
clconsole.exe -execute Utilities\install-hyperspec.lisp

rem Generate file with build version information
del installer\Version.wxi
clconsole.exe -execute Utilities\generate-version-wxi.lisp

rem Generate include fragments.
rem These should be synchronised with values in 'Config.wxi'

rem Corman Lisp core
"%WIX%\bin\heat" dir .\Sys -cg SysDir -var var.SysDirectoryPath -out .\installer\Sys.wxs %HeatOptions%

"%WIX%\bin\heat" dir .\Libraries -cg LibrariesDir -var var.LibrariesDirectoryPath -out .\installer\Libraries.wxs %HeatOptions%

"%WIX%\bin\heat" dir .\Modules -cg ModulesDir -var var.ModulesDirectoryPath -out .\installer\Modules.wxs %HeatOptions%

"%WIX%\bin\heat" dir .\documentation -cg DocDir -var var.DocumentationDirectoryPath -out .\installer\Documentation.wxs %HeatOptions%

rem Corman Lisp extra
"%WIX%\bin\heat" dir .\include -cg HeadersDir -var var.HeadersDirectoryPath -out .\installer\Headers.wxs %HeatOptions%

"%WIX%\bin\heat" dir .\examples -cg ExamplesDir -var var.ExamplesDirectoryPath -out .\installer\Examples.wxs %HeatOptions%

"%WIX%\bin\heat" dir .\HyperSpec -cg HyperSpecDir -var var.HyperSpecDirectoryPath -out .\installer\HyperSpec.wxs %HeatOptions%

rem build the installer
"%WIX%\bin\candle" %WiXExtensions% -out .\installer\ %InstallerFiles%
"%WIX%\bin\light" %WiXExtensions% -sw1076 -dcl:high -cultures:en-US %InstallerObjectFiles% -out %InstallerName%

rem change current directory
cd "%OldDir%"

Use a better compression method for installer.


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

if not "%ECHO%" == "" echo %ECHO%

setlocal
set DIRNAME=%~dp0%
set PROGNAME=%~nx0%
set ARGS=%*

rem Sourcing environment settings for karaf similar to tomcats setenv
SET KARAF_SCRIPT="karaf.bat"
if exist "%DIRNAME%setenv.bat" (
  call "%DIRNAME%setenv.bat"
)

rem Check console window title. Set to Karaf by default
if not "%KARAF_TITLE%" == "" (
    title %KARAF_TITLE%
) else (
    title Karaf
)

rem Check/Set up some easily accessible MIN/MAX params for JVM mem usage
if "%JAVA_MIN_MEM%" == "" (
    set JAVA_MIN_MEM=128M
)
if "%JAVA_MAX_MEM%" == "" (
    set JAVA_MAX_MEM=512M
)

goto BEGIN

:warn
    echo %PROGNAME%: %*
goto :EOF

:BEGIN

rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

if not "%KARAF_HOME%" == "" (
    call :warn Ignoring predefined value for KARAF_HOME
)
set KARAF_HOME=%DIRNAME%..
if not exist "%KARAF_HOME%" (
    call :warn KARAF_HOME is not valid: "%KARAF_HOME%"
    goto END
)

if not "%KARAF_BASE%" == "" (
    if not exist "%KARAF_BASE%" (
       call :warn KARAF_BASE is not valid: "%KARAF_BASE%"
       goto END
    )
)
if "%KARAF_BASE%" == "" (
  set "KARAF_BASE=%KARAF_HOME%"
)

if not "%KARAF_DATA%" == "" (
    if not exist "%KARAF_DATA%" (
        call :warn KARAF_DATA is not valid: "%KARAF_DATA%"
        goto END
    )
)
if "%KARAF_DATA%" == "" (
    set "KARAF_DATA=%KARAF_BASE%\data"
)

if not "%KARAF_ETC%" == "" (
    if not exist "%KARAF_ETC%" (
        call :warn KARAF_ETC is not valid: "%KARAF_ETC%"
        goto END
    )
)
if "%KARAF_ETC%" == "" (
    set "KARAF_ETC=%KARAF_BASE%\etc"
)

set LOCAL_CLASSPATH=%CLASSPATH%
set JAVA_MODE=-server

rem Check some easily accessible MIN/MAX params for JVM mem usage
if not "%JAVA_PERM_MEM%" == "" (
    set DEFAULT_JAVA_OPTS=%DEFAULT_JAVA_OPTS% -XX:PermSize=%JAVA_PERM_MEM%
)
if not "%JAVA_MAX_PERM_MEM%" == "" (
    set DEFAULT_JAVA_OPTS=%DEFAULT_JAVA_OPTS% -XX:MaxPermSize=%JAVA_MAX_PERM_MEM%
)

set CLASSPATH=%LOCAL_CLASSPATH%;%KARAF_BASE%\conf
set DEFAULT_JAVA_DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

if "%LOCAL_CLASSPATH%" == "" goto :KARAF_CLASSPATH_EMPTY
    set CLASSPATH=%LOCAL_CLASSPATH%;%KARAF_BASE%\conf
    goto :KARAF_CLASSPATH_END
:KARAF_CLASSPATH_EMPTY
    set CLASSPATH=%KARAF_BASE%\conf
:KARAF_CLASSPATH_END

rem Setup Karaf Home
if exist "%KARAF_HOME%\conf\karaf-rc.cmd" call %KARAF_HOME%\conf\karaf-rc.cmd
if exist "%HOME%\karaf-rc.cmd" call %HOME%\karaf-rc.cmd

rem Support for loading native libraries
set PATH=%PATH%;%KARAF_BASE%\lib;%KARAF_HOME%\lib

rem Setup the Java Virtual Machine
if not "%JAVA%" == "" goto :Check_JAVA_END
    if not "%JAVA_HOME%" == "" goto :TryJDKEnd
        call :warn JAVA_HOME not set; results may vary
:TryJRE
    start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
    if not exist __reg1.txt goto :TryJDK
    type __reg1.txt | find "CurrentVersion" > __reg2.txt
    if errorlevel 1 goto :TryJDK
    for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JavaTemp=%%~x
    if errorlevel 1 goto :TryJDK
    set JavaTemp=%JavaTemp%##
    set JavaTemp=%JavaTemp:                ##=##%
    set JavaTemp=%JavaTemp:        ##=##%
    set JavaTemp=%JavaTemp:    ##=##%
    set JavaTemp=%JavaTemp:  ##=##%
    set JavaTemp=%JavaTemp: ##=##%
    set JavaTemp=%JavaTemp:##=%
    del __reg1.txt
    del __reg2.txt
    start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\%JavaTemp%"
    if not exist __reg1.txt goto :TryJDK
    type __reg1.txt | find "JavaHome" > __reg2.txt
    if errorlevel 1 goto :TryJDK
    for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JAVA_HOME=%%~x
    if errorlevel 1 goto :TryJDK
    del __reg1.txt
    del __reg2.txt
    goto TryJDKEnd
:TryJDK
    start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
    if not exist __reg1.txt (
        goto TryRegJRE
    )
    type __reg1.txt | find "CurrentVersion" > __reg2.txt
    if errorlevel 1 (
        goto TryRegJRE
    )
    for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JavaTemp=%%~x
    if errorlevel 1 (
        goto TryRegJRE
    )
    set JavaTemp=%JavaTemp%##
    set JavaTemp=%JavaTemp:                ##=##%
    set JavaTemp=%JavaTemp:        ##=##%
    set JavaTemp=%JavaTemp:    ##=##%
    set JavaTemp=%JavaTemp:  ##=##%
    set JavaTemp=%JavaTemp: ##=##%
    set JavaTemp=%JavaTemp:##=%
    del __reg1.txt
    del __reg2.txt
    start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\%JavaTemp%"
    if not exist __reg1.txt (
        goto TryRegJRE
    )
    type __reg1.txt | find "JavaHome" > __reg2.txt
    if errorlevel 1 (
        goto TryRegJRE
    )
    for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JAVA_HOME=%%~x
    if errorlevel 1 (
        goto TryRegJRE
    )
    del __reg1.txt
    del __reg2.txt
:TryRegJRE
    rem try getting the JAVA_HOME from registry
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment" /v CurrentVersion`) DO (
       set JAVA_VERSION=%%A
    )
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment\%JAVA_VERSION%" /v JavaHome`) DO (
       set JAVA_HOME=%%A %%B
    )
    if not exist "%JAVA_HOME%" (
       goto TryRegJDK
	)
	goto TryJDKEnd
:TryRegJDK
    rem try getting the JAVA_HOME from registry
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Development Kit" /v CurrentVersion`) DO (
       set JAVA_VERSION=%%A
    )
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Development Kit\%JAVA_VERSION%" /v JavaHome`) DO (
       set JAVA_HOME=%%A %%B
    )
    if not exist "%JAVA_HOME%" (
       call :warn Unable to retrieve JAVA_HOME from Registry
    )
	goto TryJDKEnd
:TryJDKEnd
    if not exist "%JAVA_HOME%" (
        call :warn JAVA_HOME is not valid: "%JAVA_HOME%"
        goto END
    )
    set JAVA=%JAVA_HOME%\bin\java
:Check_JAVA_END

if not exist "%JAVA_HOME%\bin\server\jvm.dll" (
    if not exist "%JAVA_HOME%\jre\bin\server\jvm.dll" (
        echo WARNING: Running Karaf on a Java HotSpot Client VM because server-mode is not available.
        echo Install Java Developer Kit to fix this.
        echo For more details see http://java.sun.com/products/hotspot/whitepaper.html#client
        set JAVA_MODE=-client
    )
)
set DEFAULT_JAVA_OPTS=%JAVA_MODE% -Xms%JAVA_MIN_MEM% -Xmx%JAVA_MAX_MEM% -Dderby.system.home="%KARAF_DATA%\derby" -Dderby.storage.fileSyncTransactionLog=true -Dcom.sun.management.jmxremote  -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass

if "%JAVA_OPTS%" == "" set JAVA_OPTS=%DEFAULT_JAVA_OPTS%

if "%EXTRA_JAVA_OPTS%" == "" goto :KARAF_EXTRA_JAVA_OPTS_END
    set JAVA_OPTS="%JAVA_OPTS% %EXTRA_JAVA_OPTS%"
:KARAF_EXTRA_JAVA_OPTS_END

if "%KARAF_DEBUG%" == "" goto :KARAF_DEBUG_END
    if "%1" == "stop" goto :KARAF_DEBUG_END
    if "%1" == "client" goto :KARAF_DEBUG_END
    rem Use the defaults if JAVA_DEBUG_OPTS was not set
    if "%JAVA_DEBUG_OPTS%" == "" set JAVA_DEBUG_OPTS=%DEFAULT_JAVA_DEBUG_OPTS%

    set JAVA_OPTS="%JAVA_DEBUG_OPTS% %JAVA_OPTS%"
    call :warn Enabling Java debug options: %JAVA_DEBUG_OPTS%
:KARAF_DEBUG_END

if "%KARAF_PROFILER%" == "" goto :KARAF_PROFILER_END
    set KARAF_PROFILER_SCRIPT=%KARAF_HOME%\conf\profiler\%KARAF_PROFILER%.cmd

    if exist "%KARAF_PROFILER_SCRIPT%" goto :KARAF_PROFILER_END
    call :warn Missing configuration for profiler '%KARAF_PROFILER%': %KARAF_PROFILER_SCRIPT%
    goto END
:KARAF_PROFILER_END

rem Setup the classpath
pushd "%KARAF_HOME%\lib"
for %%G in (karaf*.jar) do call:APPEND_TO_CLASSPATH %%G
popd
goto CLASSPATH_END

: APPEND_TO_CLASSPATH
set filename=%~1
set suffix=%filename:~-4%
if %suffix% equ .jar set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\lib\%filename%
goto :EOF

:CLASSPATH_END

rem Execute the JVM or the load the profiler
if "%KARAF_PROFILER%" == "" goto :RUN
    rem Execute the profiler if it has been configured
    call :warn Loading profiler script: %KARAF_PROFILER_SCRIPT%
    call %KARAF_PROFILER_SCRIPT%

:RUN
    SET OPTS=-Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=true
    SET MAIN=org.apache.karaf.main.Main
    SET SHIFT=false

:RUN_LOOP
    if "%1" == "stop" goto :EXECUTE_STOP
    if "%1" == "status" goto :EXECUTE_STATUS
    if "%1" == "console" goto :EXECUTE_CONSOLE
    if "%1" == "server" goto :EXECUTE_SERVER
    if "%1" == "client" goto :EXECUTE_CLIENT
    if "%1" == "clean" goto :EXECUTE_CLEAN
    if "%1" == "debug" goto :EXECUTE_DEBUG
    goto :EXECUTE

:EXECUTE_STOP
    SET MAIN=org.apache.karaf.main.Stop
    shift
    goto :RUN_LOOP

:EXECUTE_STATUS
    SET MAIN=org.apache.karaf.main.Status
    shift
    goto :RUN_LOOP

:EXECUTE_CONSOLE
    shift
    goto :RUN_LOOP

:EXECUTE_SERVER
    SET OPTS=-Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true
    shift
    goto :RUN_LOOP

:EXECUTE_CLIENT
    SET OPTS=-Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=false
    shift
    goto :RUN_LOOP

:EXECUTE_CLEAN
    rmdir /S /Q "%KARAF_DATA%"
    shift
    goto :RUN_LOOP

:EXECUTE_DEBUG
    if "%JAVA_DEBUG_OPTS%" == "" set JAVA_DEBUG_OPTS=%DEFAULT_JAVA_DEBUG_OPTS%
    set "JAVA_OPTS=%JAVA_DEBUG_OPTS% %JAVA_OPTS%"
    shift
    goto :RUN_LOOP

:EXECUTE
    SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8
    rem Execute the Java Virtual Machine
    cd "%KARAF_BASE%"
    "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Djava.endorsed.dirs="%JAVA_HOME%\jre\lib\endorsed;%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed" -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext;%JAVA_HOME%\lib\ext;%KARAF_HOME%\lib\ext" -Dkaraf.instances="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Dkaraf.etc="%KARAF_ETC%" -Djava.io.tmpdir="%KARAF_DATA%\tmp" -Dkaraf.data="%KARAF_DATA%" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" -Djavax.management.builder.initial=org.apache.karaf.management.boot.KarafMBeanServerBuilder %KARAF_OPTS% %MAIN% %ARGS%

rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

:END

endlocal

if not "%PAUSE%" == "" pause

:END_NO_PAUSE

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

if not "%ECHO%" == "" echo %ECHO%

setlocal
set DIRNAME=%~dp0%
set PROGNAME=%~nx0%
set ARGS=%*

rem Sourcing environment settings for karaf similar to tomcats setenv
SET KARAF_SCRIPT="karaf.bat"
if exist "%DIRNAME%setenv.bat" (
  call "%DIRNAME%setenv.bat"
)

rem Check console window title. Set to Karaf by default
if not "%KARAF_TITLE%" == "" (
    title %KARAF_TITLE%
) else (
    title Karaf
)

rem Check/Set up some easily accessible MIN/MAX params for JVM mem usage
if "%JAVA_MIN_MEM%" == "" (
    set JAVA_MIN_MEM=128M
)
if "%JAVA_MAX_MEM%" == "" (
    set JAVA_MAX_MEM=512M
)

goto BEGIN

:warn
    echo %PROGNAME%: %*
goto :EOF

:BEGIN

rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

if not "%KARAF_HOME%" == "" (
    call :warn Ignoring predefined value for KARAF_HOME
)
set KARAF_HOME=%DIRNAME%..
if not exist "%KARAF_HOME%" (
    call :warn KARAF_HOME is not valid: "%KARAF_HOME%"
    goto END
)

if not "%KARAF_BASE%" == "" (
    if not exist "%KARAF_BASE%" (
       call :warn KARAF_BASE is not valid: "%KARAF_BASE%"
       goto END
    )
)
if "%KARAF_BASE%" == "" (
  set "KARAF_BASE=%KARAF_HOME%"
)

if not "%KARAF_DATA%" == "" (
    if not exist "%KARAF_DATA%" (
        call :warn KARAF_DATA is not valid: "%KARAF_DATA%"
        goto END
    )
)
if "%KARAF_DATA%" == "" (
    set "KARAF_DATA=%KARAF_BASE%\data"
)

if not "%KARAF_ETC%" == "" (
    if not exist "%KARAF_ETC%" (
        call :warn KARAF_ETC is not valid: "%KARAF_ETC%"
        goto END
    )
)
if "%KARAF_ETC%" == "" (
    set "KARAF_ETC=%KARAF_BASE%\etc"
)

set LOCAL_CLASSPATH=%CLASSPATH%
set JAVA_MODE=-server

set CLASSPATH=%LOCAL_CLASSPATH%;%KARAF_BASE%\conf
set DEFAULT_JAVA_DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

if "%LOCAL_CLASSPATH%" == "" goto :KARAF_CLASSPATH_EMPTY
    set CLASSPATH=%LOCAL_CLASSPATH%;%KARAF_BASE%\conf
    goto :KARAF_CLASSPATH_END
:KARAF_CLASSPATH_EMPTY
    set CLASSPATH=%KARAF_BASE%\conf
:KARAF_CLASSPATH_END

rem Setup Karaf Home
if exist "%KARAF_HOME%\conf\karaf-rc.cmd" call %KARAF_HOME%\conf\karaf-rc.cmd
if exist "%HOME%\karaf-rc.cmd" call %HOME%\karaf-rc.cmd

rem Support for loading native libraries
set PATH=%PATH%;%KARAF_BASE%\lib;%KARAF_HOME%\lib

rem Setup the Java Virtual Machine
if not "%JAVA%" == "" goto :Check_JAVA_END
    if not "%JAVA_HOME%" == "" goto :TryJDKEnd
        call :warn JAVA_HOME not set; results may vary
:TryJRE
    start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
    if not exist __reg1.txt goto :TryJDK
    type __reg1.txt | find "CurrentVersion" > __reg2.txt
    if errorlevel 1 goto :TryJDK
    for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JavaTemp=%%~x
    if errorlevel 1 goto :TryJDK
    set JavaTemp=%JavaTemp%##
    set JavaTemp=%JavaTemp:                ##=##%
    set JavaTemp=%JavaTemp:        ##=##%
    set JavaTemp=%JavaTemp:    ##=##%
    set JavaTemp=%JavaTemp:  ##=##%
    set JavaTemp=%JavaTemp: ##=##%
    set JavaTemp=%JavaTemp:##=%
    del __reg1.txt
    del __reg2.txt
    start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\%JavaTemp%"
    if not exist __reg1.txt goto :TryJDK
    type __reg1.txt | find "JavaHome" > __reg2.txt
    if errorlevel 1 goto :TryJDK
    for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JAVA_HOME=%%~x
    if errorlevel 1 goto :TryJDK
    del __reg1.txt
    del __reg2.txt
    goto TryJDKEnd
:TryJDK
    start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
    if not exist __reg1.txt (
        goto TryRegJRE
    )
    type __reg1.txt | find "CurrentVersion" > __reg2.txt
    if errorlevel 1 (
        goto TryRegJRE
    )
    for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JavaTemp=%%~x
    if errorlevel 1 (
        goto TryRegJRE
    )
    set JavaTemp=%JavaTemp%##
    set JavaTemp=%JavaTemp:                ##=##%
    set JavaTemp=%JavaTemp:        ##=##%
    set JavaTemp=%JavaTemp:    ##=##%
    set JavaTemp=%JavaTemp:  ##=##%
    set JavaTemp=%JavaTemp: ##=##%
    set JavaTemp=%JavaTemp:##=%
    del __reg1.txt
    del __reg2.txt
    start /w regedit /e __reg1.txt "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\%JavaTemp%"
    if not exist __reg1.txt (
        goto TryRegJRE
    )
    type __reg1.txt | find "JavaHome" > __reg2.txt
    if errorlevel 1 (
        goto TryRegJRE
    )
    for /f "tokens=2 delims==" %%x in (__reg2.txt) do set JAVA_HOME=%%~x
    if errorlevel 1 (
        goto TryRegJRE
    )
    del __reg1.txt
    del __reg2.txt
:TryRegJRE
    rem try getting the JAVA_HOME from registry
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment" /v CurrentVersion`) DO (
       set JAVA_VERSION=%%A
    )
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment\%JAVA_VERSION%" /v JavaHome`) DO (
       set JAVA_HOME=%%A %%B
    )
    if not exist "%JAVA_HOME%" (
       goto TryRegJDK
	)
	goto TryJDKEnd
:TryRegJDK
    rem try getting the JAVA_HOME from registry
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Development Kit" /v CurrentVersion`) DO (
       set JAVA_VERSION=%%A
    )
    FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKLM\Software\JavaSoft\Java Development Kit\%JAVA_VERSION%" /v JavaHome`) DO (
       set JAVA_HOME=%%A %%B
    )
    if not exist "%JAVA_HOME%" (
       call :warn Unable to retrieve JAVA_HOME from Registry
    )
	goto TryJDKEnd
:TryJDKEnd
    if not exist "%JAVA_HOME%" (
        call :warn JAVA_HOME is not valid: "%JAVA_HOME%"
        goto END
    )
    set JAVA=%JAVA_HOME%\bin\java
:Check_JAVA_END

if not exist "%JAVA_HOME%\bin\server\jvm.dll" (
    if not exist "%JAVA_HOME%\jre\bin\server\jvm.dll" (
        echo WARNING: Running Karaf on a Java HotSpot Client VM because server-mode is not available.
        echo Install Java Developer Kit to fix this.
        echo For more details see http://java.sun.com/products/hotspot/whitepaper.html#client
        set JAVA_MODE=-client
    )
)
set DEFAULT_JAVA_OPTS=%JAVA_MODE% -Xms%JAVA_MIN_MEM% -Xmx%JAVA_MAX_MEM% -Dderby.system.home="%KARAF_DATA%\derby" -Dderby.storage.fileSyncTransactionLog=true -Dcom.sun.management.jmxremote  -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass

rem Check some easily accessible MIN/MAX params for JVM mem usage
if not "%JAVA_PERM_MEM%" == "" (
    set DEFAULT_JAVA_OPTS=%DEFAULT_JAVA_OPTS% -XX:PermSize=%JAVA_PERM_MEM%
)
if not "%JAVA_MAX_PERM_MEM%" == "" (
    set DEFAULT_JAVA_OPTS=%DEFAULT_JAVA_OPTS% -XX:MaxPermSize=%JAVA_MAX_PERM_MEM%
)

if "%JAVA_OPTS%" == "" set JAVA_OPTS=%DEFAULT_JAVA_OPTS%

if "%EXTRA_JAVA_OPTS%" == "" goto :KARAF_EXTRA_JAVA_OPTS_END
    set JAVA_OPTS=%JAVA_OPTS% %EXTRA_JAVA_OPTS%
:KARAF_EXTRA_JAVA_OPTS_END

if "%KARAF_DEBUG%" == "" goto :KARAF_DEBUG_END
    if "%1" == "stop" goto :KARAF_DEBUG_END
    if "%1" == "client" goto :KARAF_DEBUG_END
    rem Use the defaults if JAVA_DEBUG_OPTS was not set
    if "%JAVA_DEBUG_OPTS%" == "" set JAVA_DEBUG_OPTS=%DEFAULT_JAVA_DEBUG_OPTS%

    set JAVA_OPTS=%JAVA_DEBUG_OPTS% %JAVA_OPTS%
    call :warn Enabling Java debug options: %JAVA_DEBUG_OPTS%
:KARAF_DEBUG_END

if "%KARAF_PROFILER%" == "" goto :KARAF_PROFILER_END
    set KARAF_PROFILER_SCRIPT=%KARAF_HOME%\conf\profiler\%KARAF_PROFILER%.cmd

    if exist "%KARAF_PROFILER_SCRIPT%" goto :KARAF_PROFILER_END
    call :warn Missing configuration for profiler '%KARAF_PROFILER%': %KARAF_PROFILER_SCRIPT%
    goto END
:KARAF_PROFILER_END

rem Setup the classpath
pushd "%KARAF_HOME%\lib"
for %%G in (karaf*.jar) do call:APPEND_TO_CLASSPATH %%G
popd
goto CLASSPATH_END

: APPEND_TO_CLASSPATH
set filename=%~1
set suffix=%filename:~-4%
if %suffix% equ .jar set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\lib\%filename%
goto :EOF

:CLASSPATH_END

rem Execute the JVM or the load the profiler
if "%KARAF_PROFILER%" == "" goto :RUN
    rem Execute the profiler if it has been configured
    call :warn Loading profiler script: %KARAF_PROFILER_SCRIPT%
    call %KARAF_PROFILER_SCRIPT%

:RUN
    SET OPTS=-Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=true
    SET MAIN=org.apache.karaf.main.Main
    SET SHIFT=false

:RUN_LOOP
    if "%1" == "stop" goto :EXECUTE_STOP
    if "%1" == "status" goto :EXECUTE_STATUS
    if "%1" == "console" goto :EXECUTE_CONSOLE
    if "%1" == "server" goto :EXECUTE_SERVER
    if "%1" == "client" goto :EXECUTE_CLIENT
    if "%1" == "clean" goto :EXECUTE_CLEAN
    if "%1" == "debug" goto :EXECUTE_DEBUG
    goto :EXECUTE

:EXECUTE_STOP
    SET MAIN=org.apache.karaf.main.Stop
    shift
    goto :RUN_LOOP

:EXECUTE_STATUS
    SET MAIN=org.apache.karaf.main.Status
    shift
    goto :RUN_LOOP

:EXECUTE_CONSOLE
    shift
    goto :RUN_LOOP

:EXECUTE_SERVER
    SET OPTS=-Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true
    shift
    goto :RUN_LOOP

:EXECUTE_CLIENT
    SET OPTS=-Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=false
    shift
    goto :RUN_LOOP

:EXECUTE_CLEAN
    rmdir /S /Q "%KARAF_DATA%"
    shift
    goto :RUN_LOOP

:EXECUTE_DEBUG
    if "%JAVA_DEBUG_OPTS%" == "" set JAVA_DEBUG_OPTS=%DEFAULT_JAVA_DEBUG_OPTS%
    set JAVA_OPTS=%JAVA_DEBUG_OPTS% %JAVA_OPTS%
    shift
    goto :RUN_LOOP

:EXECUTE
    SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8
    rem Execute the Java Virtual Machine
    cd "%KARAF_BASE%"
    "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Djava.endorsed.dirs="%JAVA_HOME%\jre\lib\endorsed;%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed" -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext;%JAVA_HOME%\lib\ext;%KARAF_HOME%\lib\ext" -Dkaraf.instances="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Dkaraf.etc="%KARAF_ETC%" -Djava.io.tmpdir="%KARAF_DATA%\tmp" -Dkaraf.data="%KARAF_DATA%" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" -Djavax.management.builder.initial=org.apache.karaf.management.boot.KarafMBeanServerBuilder %KARAF_OPTS% %MAIN% %ARGS%

rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

:END

endlocal

if not "%PAUSE%" == "" pause

:END_NO_PAUSE

[KARAF-3250] Fix options support in karaf.bat on Windows platform


rmdir ALS_Prolog_Foreign_SDK /S

mkdir "ALS_Prolog_Foreign_SDK"
cd "ALS_Prolog_Foreign_SDK"
mkdir ALS_Prolog_Support
copy ..\..\..\core\win32\alspro.lib ALS_Prolog_Support
copy ..\..\..\core\alsp_src\generic\alspi.h ALS_Prolog_Support
copy ..\..\..\core\alsp_src\generic\alspi_slib.h ALS_Prolog_Support
copy ..\..\..\core\alsp_src\generic\alspi_slib.c ALS_Prolog_Support
mkdir Documentation
copy ..\..\docs\FI_Manual.pdf "Documentation\Foreign Interface Manual.pdf"
copy ..\..\docs\FI_Ref.pdf "Documentation\Foreign Interface Reference.pdf"
mkdir Examples
copy ..\..\examples\win32\Examples_Read_Me.txt "Examples\Examples Read Me.txt"
cd Examples
mkdir Even_Example
copy ..\..\..\examples\common\even.c Even_Example
copy ..\..\..\examples\win32\even.mak Even_Example
copy ..\..\..\examples\win32\even_x86.mcp Even_Example
mkdir QA_Example
copy ..\..\..\examples\common\qa.c QA_Example
copy ..\..\..\examples\common\know.pro QA_Example
copy ..\..\..\examples\win32\Q_and_A_x86.mcp QA_Example
copy ..\..\..\examples\win32\qa.mak QA_Example
mkdir Tutorial_Example
copy ..\..\..\examples\common\examples.c Tutorial_Example
copy ..\..\..\examples\win32\examples_x86.mcp Tutorial_Example
copy ..\..\..\examples\win32\examples.mak Tutorial_Example
cd ..
cd ..

rmdir ALS_Prolog_Foreign_SDK /S /Q

mkdir "ALS_Prolog_Foreign_SDK"
cd "ALS_Prolog_Foreign_SDK"
mkdir ALS_Prolog_Support
copy ..\..\..\core\win32\libalspro.a ALS_Prolog_Support
copy ..\..\..\core\alsp_src\generic\alspi.h ALS_Prolog_Support
copy ..\..\..\core\alsp_src\generic\alspi_slib.h ALS_Prolog_Support
copy ..\..\..\core\alsp_src\generic\alspi_slib.c ALS_Prolog_Support
mkdir Documentation
copy ..\..\docs\FI_Manual.pdf "Documentation\Foreign Interface Manual.pdf"
copy ..\..\docs\FI_Ref.pdf "Documentation\Foreign Interface Reference.pdf"
mkdir Examples
copy ..\..\examples\win32\Examples_Read_Me.txt "Examples\Examples Read Me.txt"
cd Examples
mkdir Even_Example
copy ..\..\..\examples\common\even.c Even_Example
copy ..\..\..\examples\win32\even.mak Even_Example
copy ..\..\..\examples\win32\even_x86.mcp Even_Example
mkdir QA_Example
copy ..\..\..\examples\common\qa.c QA_Example
copy ..\..\..\examples\common\know.pro QA_Example
copy ..\..\..\examples\win32\Q_and_A_x86.mcp QA_Example
copy ..\..\..\examples\win32\qa.mak QA_Example
mkdir Tutorial_Example
copy ..\..\..\examples\common\examples.c Tutorial_Example
copy ..\..\..\examples\win32\examples_x86.mcp Tutorial_Example
copy ..\..\..\examples\win32\examples.mak Tutorial_Example
cd ..
cd ..

Update foreign SDK batch file for win32 - force rmdir to avoid prompt - fix library name


@REM use a variable as sketch name
@set SKETCH_NAME=Processing_print

@FOR /F %%A IN ('WMIC OS GET LocalDateTime ^| FINDSTR \.') DO @SET B=%%A
@set FORMAT_DATE=%B:~0,4%-%B:~4,2%-%B:~6,2%
@set FORMAT_TIME=%TIME:~0,2%-%TIME:~3,2%-%TIME:~6,2%

cd application.windows32
%SKETCH_NAME% >> "%~dp0\Win_log_both_stdout_stderr_on_%FORMAT_DATE%_%FORMAT_TIME%.txt" 2>&1

Add windows batch file

Add windows batch file


@echo on

cd /d "%~dp0"

if "%EMULATED%"=="true" if DEFINED APPCMD goto emulator_setup
if "%EMULATED%"== "true" exit /b 0

echo Granting permissions for Network Service to the web root directory...
icacls ..\ /grant "Network Service":(OI)(CI)W
if %ERRORLEVEL% neq 0 goto error
echo OK

echo Configuring powershell permissions
powershell -c "set-executionpolicy unrestricted"

echo Downloading and installing runtime components
powershell .\download.ps1 '%RUNTIMEURL%' '%RUNTIMEURLOVERRIDE%'
if %ERRORLEVEL% neq 0 goto error

echo SUCCESS
exit /b 0

:error
echo FAILED
exit /b -1

:emulator_setup
echo Running in emulator adding iisnode to application host config
FOR /F "tokens=1,2 delims=/" %%a in ("%APPCMD%") DO set FN=%%a&set OPN=%%b
if "%OPN%"=="%OPN:apphostconfig:=%" (
    echo "Could not parse appcmd '%appcmd% for configuration file, exiting"
    goto error
)

set IISNODE_BINARY_DIRECTORY=%programfiles(x86)%\iisnode-dev\release\x64
set IISNODE_SCHEMA=%programfiles(x86)%\iisnode-dev\release\x64\iisnode_schema.xml

if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto start
set IISNODE_BINARY_DIRECTORY=%programfiles%\iisnode_dev\release\x86
set IISNODE_SCHEMA=%programfiles%\iisnode_dev\release\x86\iisnode_schema_x86.xml

:start
set

echo Using iisnode binaries location '%IISNODE_BINARY_DIRECTORY%'
echo installing iisnode module using AppCMD alias %appcmd%
%appcmd% install module /name:"iisnode" /image:"%IISNODE_BINARY_DIRECTORY%\iisnode.dll"

set apphostconfigfile=%OPN:apphostconfig:=%
powershell -c "set-executionpolicy unrestricted"
powershell .\ChangeConfig.ps1 %apphostconfigfile%
if %ERRORLEVEL% neq 0 goto error

copy /y "%IISNODE_SCHEMA%" "%programfiles%\IIS Express\config\schema\iisnode_schema.xml"
if %ERRORLEVEL% neq 0 goto error
exit /b 0

@echo on

cd /d "%~dp0"

if "%EMULATED%"=="true" if DEFINED APPCMD goto emulator_setup
if "%EMULATED%"== "true" exit /b 0

echo Granting permissions for Network Service to the web root directory...
icacls ..\ /grant "Network Service":(OI)(CI)W
if %ERRORLEVEL% neq 0 goto error
echo OK

echo Configuring powershell permissions
powershell -c "set-executionpolicy unrestricted"

echo Downloading and installing runtime components
powershell .\download.ps1 '%RUNTIMEURL%' '%RUNTIMEURLOVERRIDE%'
if %ERRORLEVEL% neq 0 goto error

echo SUCCESS
exit /b 0

:error
echo FAILED
exit /b -1

:emulator_setup
echo Running in emulator adding iisnode to application host config
FOR /F "tokens=1,2 delims=/" %%a in ("%APPCMD%") DO set FN=%%a&set OPN=%%b
if "%OPN%"=="%OPN:apphostconfig:=%" (
    echo "Could not parse appcmd '%appcmd% for configuration file, exiting"
    goto error
)

set IISNODE_BINARY_DIRECTORY=%programfiles(x86)%\iisnode-dev\release\x64
set IISNODE_SCHEMA=%programfiles(x86)%\iisnode-dev\release\x64\iisnode_schema.xml

if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto start
set IISNODE_BINARY_DIRECTORY=%programfiles%\iisnode-dev\release\x86
set IISNODE_SCHEMA=%programfiles%\iisnode-dev\release\x86\iisnode_schema_x86.xml

:start
set

echo Using iisnode binaries location '%IISNODE_BINARY_DIRECTORY%'
echo installing iisnode module using AppCMD alias %appcmd%
%appcmd% install module /name:"iisnode" /image:"%IISNODE_BINARY_DIRECTORY%\iisnode.dll"

set apphostconfigfile=%OPN:apphostconfig:=%
powershell -c "set-executionpolicy unrestricted"
powershell .\ChangeConfig.ps1 %apphostconfigfile%
if %ERRORLEVEL% neq 0 goto error

copy /y "%IISNODE_SCHEMA%" "%programfiles%\IIS Express\config\schema\iisnode_schema.xml"
if %ERRORLEVEL% neq 0 goto error
exit /b 0

Fix for x86 emulator issue

Fix for x86 emulator issue


cd /d %~dp0
call mvn clean install
java -Dnode.name=node0 -Dnode.bootstrap=src/main/kevs/main.kevs  -jar org.kevoree.watchdog.jar 5.1.3

cd /d %~dp0
call mvn clean install
start /B java -jar org.kevoree.editor.jar
java -Dnode.name=node0 -Dnode.bootstrap=src/main/kevs/main.kevs  -jar org.kevoree.watchdog.jar 5.1.3

update generated Kevoree launcher

update generated Kevoree launcher


@echo off

IF NOT EXIST "external\ispc.exe" (
    IF NOT EXIST "external\external.7z" (
        echo "downloading external libararies..."
        powershell.exe -Command "(new-object System.Net.WebClient).DownloadFile('https://github.com/unity3d-jp/FrameCapturer/releases/download/20170510/external.7z', 'external/external.7z')"
    )
    cd external
    7z\7za.exe x -aos external.7z
    cd ..
)

@echo off

IF NOT EXIST "external\ispc.exe" (
    IF NOT EXIST "external\external.7z" (
        echo "downloading external libararies..."
        powershell.exe -Command "[System.Net.ServicePointManager]::SecurityProtocol=[System.Net.SecurityProtocolType]::Tls12; wget https://github.com/unity3d-jp/FrameCapturer/releases/download/20170510/external.7z -OutFile external/external.7z"
    )
    cd external
    7z\7za.exe x -aos external.7z
    cd ..
)

fix build script

fix build script


CALL procdump -s 2 -n 4 CESService7.exe c:\ProcDumpFiles

CALL  procdump -s 2 -n 4 CESCustomCrawlers7.exe c:\ProcDumpFiles

CALL procdump -s 2 -n 4 CESConverter7.exe c:\ProcDumpFiles

CALL taskkill /f /im CESService7.exe

CALL taskkill /f /im CESCustomCrawlers7.exe

CALL taskkill /f /im CESConverter7.exe

CALL msg * "CESService7 has just stop because it was taking too much memory(RAM), please contact Coveo and check your dump files C:\ProcDumpFiles, Link to doc: LINK"

CALL procdump -s 2 -n 4 CESService7.exe c:\ProcDumpFiles

CALL  procdump -s 2 -n 4 CESCustomCrawlers7.exe c:\ProcDumpFiles

CALL procdump -s 2 -n 4 CESConverter7.exe c:\ProcDumpFiles

CALL taskkill /f /im CESService7.exe

CALL taskkill /f /im CESCustomCrawlers7.exe

CALL taskkill /f /im CESConverter7.exe

CALL msg * "CESService7 has been stopped because it was taking too much memory, please contact Coveo. More informations :  "https://developers.coveo.com/display/SupportKB/TroubleShooting+memory+issues+with+CESService7""

Update ScriptDumpFiles.bat

Update ScriptDumpFiles.bat


@echo off
setlocal

if "%1" == "auto" goto AUTO

echo "error input"
goto END

:AUTO
echo auto
goto END

:BAK_MODIFIED
echo bak_modified
goto END

:BRANCH
echo branch
goto END

:END
endlocal
@echo on

add isvn.bat

[scripts] add isvn.bat


cd %APPVEYOR_BUILD_FOLDER%
:: Download and compile Lua
appveyor DownloadFile %LUAURL%/lua-%LUA_VER%.tar.gz
7z x lua-%LUA_VER%.tar.gz
7z x lua-%LUA_VER%.tar
cd lua-%LUA_VER%
appveyor DownloadFile https://github.com/Tieske/luawinmake/archive/master.zip
7z x master.zip
if not exist etc mkdir etc
mv luawinmake-master\etc\winmake.bat %APPVEYOR_BUILD_FOLDER%\lua-%LUA_VER%\etc\winmake.bat
call etc\winmake.bat
call etc\winmake.bat install c:\lua%LUA_VER%
:: defines LUA_DIR so Cmake can find this Lua install
set LUA_DIR=c:\lua%LUA_VER%
set PATH=%PATH%;c:\lua%LUA_VER%\bin
:: Downloads and installs LuaRocks
cd %APPVEYOR_BUILD_FOLDER%
appveyor DownloadFile %LUAROCKS_URL%/luarocks-%LUAROCKS_VER%-win32.zip
7z x luarocks-%LUAROCKS_VER%-win32.zip
cd luarocks-%LUAROCKS_VER%-win32
call install.bat /LUA c:\lua%LUA_VER% /Q /LV %LUA_SHORTV%
set PATH="%PATH%;%ProgramFiles(x86)%\LuaRocks\%LUAROCKS_SHORTV%"
echo PATH: %PATH%
set LUA_PATH="C:\Program Files (x86)\LuaRocks\%LUAROCKS_SHORTV%\lua\?.lua;C:\Program Files (x86)\LuaRocks\%LUAROCKS_SHORTV%\lua\?\init.lua;C:\Program Files (x86)\LuaRocks\systree\share\lua\%LUA_SHORTV%\?.lua;C:\Program Files (x86)\LuaRocks\systree\share\lua\%LUA_SHORTV%\?\init.lua"
set LUA_CPATH="C:\Program Files (x86)\LuaRocks\systree\lib\lua\%LUA_SHORTV%\?.dll"
luarocks --version
:: Install lunitx
luarocks install lunitx

cd %APPVEYOR_BUILD_FOLDER%
:: Download and compile Lua
appveyor DownloadFile %LUAURL%/lua-%LUA_VER%.tar.gz
7z x lua-%LUA_VER%.tar.gz
7z x lua-%LUA_VER%.tar
cd lua-%LUA_VER%
appveyor DownloadFile https://github.com/Tieske/luawinmake/archive/master.zip
7z x master.zip
if not exist etc mkdir etc
mv luawinmake-master\etc\winmake.bat %APPVEYOR_BUILD_FOLDER%\lua-%LUA_VER%\etc\winmake.bat
call etc\winmake.bat
call etc\winmake.bat install c:\lua%LUA_VER%
:: defines LUA_DIR so Cmake can find this Lua install
set LUA_DIR=c:\lua%LUA_VER%
set PATH=%PATH%;c:\lua%LUA_VER%\bin
:: Downloads and installs LuaRocks
cd %APPVEYOR_BUILD_FOLDER%
appveyor DownloadFile %LUAROCKS_URL%/luarocks-%LUAROCKS_VER%-win32.zip
7z x luarocks-%LUAROCKS_VER%-win32.zip
cd luarocks-%LUAROCKS_VER%-win32
call install.bat /LUA c:\lua%LUA_VER% /Q /LV %LUA_SHORTV%
set PATH="%PATH%;%ProgramFiles(x86)%\LuaRocks\%LUAROCKS_SHORTV%"
echo PATH: %PATH%
set LUA_PATH="%ProgramFiles(x86)%\LuaRocks\%LUAROCKS_SHORTV%\lua\?.lua;%ProgramFiles(x86)%\LuaRocks\%LUAROCKS_SHORTV%\lua\?\init.lua;%ProgramFiles(x86)%\LuaRocks\systree\share\lua\%LUA_SHORTV%\?.lua;%ProgramFiles(x86)%\LuaRocks\systree\share\lua\%LUA_SHORTV%\?\init.lua"
set LUA_CPATH="%ProgramFiles(x86)%\LuaRocks\systree\lib\lua\%LUA_SHORTV%\?.dll"
luarocks --version
:: Install lunitx
luarocks install lunitx

work 3

work 3


@echo off

set CMDER_INIT_START=%time%

:: Init Script for cmd.exe
:: Created as part of cmder project

:: !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
:: !!! Use "%CMDER_ROOT%\config\user_profile.cmd" to add your own startup commands

:: Use /v command line arg or set to > 0 for verbose output to aid in debugging.
if not defined verbose_output set verbose_output=0

:: Use /d command line arg or set to 1 for debug output to aid in debugging.
if not defined debug_output set debug_output=0

:: Use /t command line arg or set to 1 to display init time.
if not defined time_init set time_init=0

:: Use /f command line arg to speed up init at the expense of some functionality.
if not defined fast_init set fast_init=0

:: Use /max_depth 1-5 to set max recurse depth for calls to `enhance_path_recursive`
if not defined max_depth set max_depth=1

:: Add *nix tools to end of path. 0 turns off *nix tools, 2 adds *nix tools to the front of thr path.
if not defined nix_tools set nix_tools=1

set "CMDER_USER_FLAGS= "

:: Find root dir
if not defined CMDER_ROOT (
    if defined ConEmuDir (
        for /f "delims=" %%i in ("%ConEmuDir%\..\..") do (
            set "CMDER_ROOT=%%~fi"
        )
    ) else (
        for /f "delims=" %%i in ("%~dp0\..") do (
            set "CMDER_ROOT=%%~fi"
        )
    )
)

:: Remove trailing '\' from %CMDER_ROOT%
if "%CMDER_ROOT:~-1%" == "\" SET "CMDER_ROOT=%CMDER_ROOT:~0,-1%"

call "%cmder_root%\vendor\bin\cexec.cmd" /setpath
call "%cmder_root%\vendor\lib\lib_base"
call "%cmder_root%\vendor\lib\lib_path"
call "%cmder_root%\vendor\lib\lib_console"
call "%cmder_root%\vendor\lib\lib_git"
call "%cmder_root%\vendor\lib\lib_profile"

:var_loop
    if "%~1" == "" (
        goto :start
    ) else if /i "%1" == "/f" (
        set fast_init=1
    ) else if /i "%1" == "/t" (
        set time_init=1
    ) else if /i "%1"=="/v" (
        set verbose_output=1
    ) else if /i "%1"=="/d" (
        set debug_output=1
    ) else if /i "%1" == "/max_depth" (
        if "%~2" geq "1" if "%~2" leq "5" (
            set "max_depth=%~2"
            shift
        ) else (
            %lib_console% show_error "'/max_depth' requires a number between 1 and 5!"
            exit /b
        )
    ) else if /i "%1" == "/c" (
        if exist "%~2" (
            if not exist "%~2\bin" mkdir "%~2\bin"
            set "cmder_user_bin=%~2\bin"
            if not exist "%~2\config\profile.d" mkdir "%~2\config\profile.d"
            set "cmder_user_config=%~2\config"
            shift
        )
    ) else if /i "%1" == "/user_aliases" (
        if exist "%~2" (
            set "user_aliases=%~2"
            shift
        )
    ) else if /i "%1" == "/git_install_root" (
        if exist "%~2" (
            set "GIT_INSTALL_ROOT=%~2"
            shift
        ) else (
            %lib_console% show_error "The Git install root folder "%~2", you specified does not exist!"
            exit /b
        )
    ) else if /i "%1"=="/nix_tools" (
        if "%2" equ "0" (
            REM Do not add *nix tools to path
            set nix_tools=0
            shift
        ) else if "%2" equ "1" (
            REM Add *nix tools to end of path
            set nix_tools=1
            shift
        ) else if "%2" equ "2" (
            REM Add *nix tools to front of path
            set nix_tools=2
            shift
        )
    ) else if /i "%1" == "/home" (
        if exist "%~2" (
            set "HOME=%~2"
            shift
        ) else (
            %lib_console% show_error The home folder "%2", you specified does not exist!
            exit /b
        )
    ) else if /i "%1" == "/svn_ssh" (
        set SVN_SSH=%2
        shift
    ) else (
      set "CMDER_USER_FLAGS=%1 %CMDER_USER_FLAGS%"
    )
    shift
goto var_loop

:start
:: Sets CMDER_SHELL, CMDER_CLINK, CMDER_ALIASES
%lib_base% cmder_shell
%lib_console% debug_output init.bat "Env Var - CMDER_ROOT=%CMDER_ROOT%"
%lib_console% debug_output init.bat "Env Var - debug_output=%debug_output%"

if defined CMDER_USER_CONFIG (
    %lib_console% debug_output init.bat "CMDER IS ALSO USING INDIVIDUAL USER CONFIG FROM '%CMDER_USER_CONFIG%'!"

    if not exist "%CMDER_USER_CONFIG%\opt" md "%CMDER_USER_CONFIG%\opt"
)

:: Pick right version of clink
if "%PROCESSOR_ARCHITECTURE%"=="x86" (
    set clink_architecture=x86
    set architecture_bits=32
) else (
    set clink_architecture=x64
    set architecture_bits=64
)

if "%CMDER_CLINK%" == "1" (
  %lib_console% verbose_output "Injecting Clink!"

  :: Run clink
  if defined CMDER_USER_CONFIG (
    if not exist "%CMDER_USER_CONFIG%\settings" (
      echo Generating clink initial settings in "%CMDER_USER_CONFIG%\settings"
      copy "%CMDER_ROOT%\vendor\clink_settings.default" "%CMDER_USER_CONFIG%\settings"
      echo Additional *.lua files in "%CMDER_USER_CONFIG%" are loaded on startup.\
    )
    "%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" inject --quiet --profile "%CMDER_USER_CONFIG%" --scripts "%CMDER_ROOT%\vendor"
  ) else (
    if not exist "%CMDER_ROOT%\config\settings" (
      echo Generating clink initial settings in "%CMDER_ROOT%\config\settings"
      copy "%CMDER_ROOT%\vendor\clink_settings.default" "%CMDER_ROOT%\config\settings"
      echo Additional *.lua files in "%CMDER_ROOT%\config" are loaded on startup.
    )
    "%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor"
  )
) else (
  %lib_console% verbose_output "WARNING: Incompatible 'ComSpec/Shell' Detetected Skipping Clink Injection!"
)

if "%CMDER_CONFIGURED%" GTR "1" (
  %lib_console% verbose_output "Cmder is already configured, skipping Cmder Init!"

  goto USER_ALIASES
) else if "%CMDER_CONFIGURED%" == "1" (
  %lib_console% verbose_output "Cmder is already configured, skipping to Cmder User Init!"

  goto USER_CONFIG_START
)

:: Prepare for git-for-windows

:: I do not even know, copypasted from their .bat
set PLINK_PROTOCOL=ssh
if not defined TERM set TERM=cygwin

:: The idea:
:: * if the users points as to a specific git, use that
:: * test if a git is in path and if yes, use that
:: * last, use our vendored git
:: also check that we have a recent enough version of git by examining the version string
if defined GIT_INSTALL_ROOT (
    if exist "%GIT_INSTALL_ROOT%\cmd\git.exe" goto :SPECIFIED_GIT
) else if "%fast_init%" == "1" (
    if exist "%CMDER_ROOT%\vendor\git-for-windows\cmd\git.exe" (
      %lib_console% debug_output "Skipping Git Auto-Detect!"
      goto :VENDORED_GIT
    )
)

%lib_console% debug_output init.bat "Looking for Git install root..."

:: get the version information for vendored git binary
%lib_git% read_version VENDORED "%CMDER_ROOT%\vendor\git-for-windows\cmd"
%lib_git% validate_version VENDORED %GIT_VERSION_VENDORED%

:: check if git is in path...
for /F "delims=" %%F in ('where git.exe 2^>nul') do (
    :: get the absolute path to the user provided git binary
    %lib_git% is_git_shim "%%~dpF"
    %lib_git% get_user_git_version
    %lib_git% compare_git_versions

    if defined GIT_INSTALL_ROOT (
        goto :FOUND_GIT
    )
)

:: our last hope: our own git...
:VENDORED_GIT
if exist "%CMDER_ROOT%\vendor\git-for-windows" (
    set "GIT_INSTALL_ROOT=%CMDER_ROOT%\vendor\git-for-windows"
    %lib_console% debug_output "Using vendored Git '%GIT_VERSION_VENDORED%'..."
    goto :CONFIGURE_GIT
) else (
    goto :NO_GIT
)

:SPECIFIED_GIT
%lib_console% debug_output "Using /GIT_INSTALL_ROOT..."
goto :CONFIGURE_GIT

:FOUND_GIT
%lib_console% debug_output "Using found Git '%GIT_VERSION_USER%' from '%GIT_INSTALL_ROOT%..."
goto :CONFIGURE_GIT

:CONFIGURE_GIT
%lib_console% debug_output "Using Git from '%GIT_INSTALL_ROOT%..."
:: Add git to the path
rem add the unix commands at the end to not shadow windows commands like more
if %nix_tools% equ 1 (
    %lib_console% verbose_output "Preferring Windows commands"
    set "path_position=append"
) else (
    %lib_console% verbose_output "Preferring *nix commands"
    set "path_position="
)

if exist "%GIT_INSTALL_ROOT%\cmd\git.exe" %lib_path% enhance_path "%GIT_INSTALL_ROOT%\cmd" %path_position%
if %nix_tools% geq 1 (
    if exist "%GIT_INSTALL_ROOT%\mingw32" (
        %lib_path% enhance_path "%GIT_INSTALL_ROOT%\mingw32\bin" %path_position%
    ) else if exist "%GIT_INSTALL_ROOT%\mingw64" (
        %lib_path% enhance_path "%GIT_INSTALL_ROOT%\mingw64\bin" %path_position%
    )

    %lib_path% enhance_path "%GIT_INSTALL_ROOT%\usr\bin" %path_position%
)

:: define SVN_SSH so we can use git svn with ssh svn repositories
if not defined SVN_SSH set "SVN_SSH=%GIT_INSTALL_ROOT:\=\\%\\bin\\ssh.exe"

:: Find locale.exe: From the git install root, from the path, using the git installed env, or fallback using the env from the path.
if not defined git_locale if exist "%GIT_INSTALL_ROOT%\usr\bin\locale.exe" set git_locale="%GIT_INSTALL_ROOT%\usr\bin\locale.exe"
if not defined git_locale for /F "tokens=* delims=" %%F in ('where locale.exe 2^>nul') do ( if not defined git_locale  set git_locale="%%F" )
if not defined git_locale if exist "%GIT_INSTALL_ROOT%\usr\bin\env.exe" set git_locale="%GIT_INSTALL_ROOT%\usr\bin\env.exe" /usr/bin/locale
if not defined git_locale for /F "tokens=* delims=" %%F in ('where env.exe 2^>nul') do ( if not defined git_locale  set git_locale="%%F" /usr/bin/locale )

if defined git_locale (
  %lib_console% debug_output init.bat "Env Var - git_locale=%git_locale%"
  if not defined LANG (
      for /F "delims=" %%F in ('%git_locale% -uU 2') do (
          set "LANG=%%F"
      )
  )
)

%lib_console% debug_output init.bat "Env Var - GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%"
%lib_console% debug_output init.bat "Found Git in: '%GIT_INSTALL_ROOT%'"
goto :PATH_ENHANCE

:NO_GIT
:: Skip this if GIT WAS FOUND else we did 'endlocal' above!
endlocal

:PATH_ENHANCE
%lib_path% enhance_path "%CMDER_ROOT%\vendor\bin"

:USER_CONFIG_START
%lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" 0 %max_depth%
if defined CMDER_USER_BIN (
  %lib_path% enhance_path_recursive "%CMDER_USER_BIN%" 0 %max_depth%
)
%lib_path% enhance_path "%CMDER_ROOT%" append

:: Drop *.bat and *.cmd files into "%CMDER_ROOT%\config\profile.d"
:: to run them at startup.
%lib_profile% run_profile_d "%CMDER_ROOT%\config\profile.d"
if defined CMDER_USER_CONFIG (
  %lib_profile% run_profile_d "%CMDER_USER_CONFIG%\profile.d"
)

:USER_ALIASES
:: Allows user to override default aliases store using profile.d
:: scripts run above by setting the 'aliases' env variable.
::
:: Note: If overriding default aliases store file the aliases
:: must also be self executing, see '.\user_aliases.cmd.default',
:: and be in profile.d folder.
if not defined user_aliases (
  if defined CMDER_USER_CONFIG (
     set "user_aliases=%CMDER_USER_CONFIG%\user_aliases.cmd"
  ) else (
     set "user_aliases=%CMDER_ROOT%\config\user_aliases.cmd"
  )
)

if "%CMDER_ALIASES%" == "1" (
  REM The aliases environment variable is used by alias.bat to id
  REM the default file to store new aliases in.
  if not defined aliases (
    set "aliases=%user_aliases%"
  )

  REM Make sure we have a self-extracting user_aliases.cmd file
  if not exist "%user_aliases%" (
      echo Creating initial user_aliases store in "%user_aliases%"...
      copy "%CMDER_ROOT%\vendor\user_aliases.cmd.default" "%user_aliases%"
  ) else (
    %lib_base% update_legacy_aliases
  )

  :: Update old 'user_aliases' to new self executing 'user_aliases.cmd'
  if exist "%CMDER_ROOT%\config\aliases" (
    echo Updating old "%CMDER_ROOT%\config\aliases" to new format...
    type "%CMDER_ROOT%\config\aliases" >> "%user_aliases%"
    del "%CMDER_ROOT%\config\aliases"
  ) else if exist "%user_aliases%.old_format" (
    echo Updating old "%user_aliases%" to new format...
    type "%user_aliases%.old_format" >> "%user_aliases%"
    del "%user_aliases%.old_format"
  )
)

:: Add aliases to the environment
call "%user_aliases%"

if "%CMDER_CONFIGURED%" gtr "1" goto CMDER_CONFIGURED

:: See vendor\git-for-windows\README.portable for why we do this
:: A
:: A
:: Basically we need to execute this post-install.bat because we are
:: manually extracting the archive rather than executing the 7z sfx
if exist "%GIT_INSTALL_ROOT%\post-install.bat" (
    echo Running Git for Windows one time Post Install....
    pushd "%GIT_INSTALL_ROOT%\"
    "%GIT_INSTALL_ROOT%\git-cmd.exe" --no-needs-console --no-cd --command=post-install.bat
    popd
)

:: Set home path
if not defined HOME set "HOME=%USERPROFILE%"
%lib_console% debug_output init.bat "Env Var - HOME=%HOME%"

set "initialConfig=%CMDER_ROOT%\config\user_profile.cmd"
if exist "%CMDER_ROOT%\config\user_profile.cmd" (
    REM Create this file and place your own command in there
    %lib_console% debug_output init.bat "Calling - %CMDER_ROOT%\config\user_profile.cmd"
    call "%CMDER_ROOT%\config\user_profile.cmd"
)

if defined CMDER_USER_CONFIG (
  set "initialConfig=%CMDER_USER_CONFIG%\user_profile.cmd"
  if exist "%CMDER_USER_CONFIG%\user_profile.cmd" (
      REM Create this file and place your own command in there
      %lib_console% debug_output init.bat "Calling - %CMDER_USER_CONFIG%\user_profile.cmd
      call "%CMDER_USER_CONFIG%\user_profile.cmd"
  )
)

if not exist "%initialConfig%" (
    echo Creating user startup file: "%initialConfig%"
    copy "%CMDER_ROOT%\vendor\user_profile.cmd.default" "%initialConfig%"
)

if "%CMDER_ALIASES%" == "1" if exist "%CMDER_ROOT%\bin\alias.bat" if exist "%CMDER_ROOT%\vendor\bin\alias.cmd" (
  echo Cmder's 'alias' command has been moved into "%CMDER_ROOT%\vendor\bin\alias.cmd"
  echo to get rid of this message either:
  echo.
  echo Delete the file "%CMDER_ROOT%\bin\alias.bat"
  echo.
  echo or
  echo.
  echo If you have customized it and want to continue using it instead of the included version
  echo   * Rename "%CMDER_ROOT%\bin\alias.bat" to "%CMDER_ROOT%\bin\alias.cmd".
  echo   * Search for 'user-aliases' and replace it with 'user_aliases'.
)

set initialConfig=

:CMDER_CONFIGURED
if not defined CMDER_CONFIGURED set CMDER_CONFIGURED=1

set CMDER_INIT_END=%time%

if %time_init% gtr 0 (
  "%cmder_root%\vendor\bin\timer.cmd" %CMDER_INIT_START% %CMDER_INIT_END%
)
exit /b

Update init.bat

Update init.bat


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

echo Releasing mbed bits ...

call release_mbed_project.cmd iothub_amqp_transport ..\..\c\iothub_client\build iothub_amqp_transport_filelist.txt
call release_mbed_project.cmd iothub_http_transport ..\..\c\iothub_client\build iothub_http_transport_filelist.txt
call release_mbed_project.cmd iothub_client ..\..\c\iothub_client\build iothub_client_filelist.txt
call release_mbed_project.cmd serializer ..\..\c\serializer\build serializer_filelist.txt
call release_mbed_project.cmd azureiot_common ..\..\c\common\build mbed\common_filelist.txt
call release_mbed_project.cmd iothub_client_sample_amqp ..\..\c\iothub_client\samples\iothub_client_sample_amqp mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd iothub_client_sample_http ..\..\c\iothub_client\samples\iothub_client_sample_http mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd remote_monitoring ..\..\c\serializer\samples\remote_monitoring mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd simplesample_amqp ..\..\c\serializer\samples\simplesample_amqp mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd simplesample_http ..\..\c\serializer\samples\simplesample_http mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd temp_sensor_anomaly ..\..\c\serializer\samples\temp_sensor_anomaly mbed\filelist.txt FRDM-K64F

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

echo Releasing mbed bits ...

call release_mbed_project.cmd iothub_amqp_transport ..\..\c\iothub_client\build iothub_amqp_transport_filelist.txt
call release_mbed_project.cmd iothub_http_transport ..\..\c\iothub_client\build iothub_http_transport_filelist.txt
call release_mbed_project.cmd iothub_client ..\..\c\iothub_client\build iothub_client_filelist.txt
call release_mbed_project.cmd serializer ..\..\c\serializer\build serializer_filelist.txt
call release_mbed_project.cmd azureiot_common ..\..\c\azure-c-shared-utility\c\build mbed\shared-util_filelist.txt
call release_mbed_project.cmd iothub_client_sample_amqp ..\..\c\iothub_client\samples\iothub_client_sample_amqp mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd iothub_client_sample_http ..\..\c\iothub_client\samples\iothub_client_sample_http mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd remote_monitoring ..\..\c\serializer\samples\remote_monitoring mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd simplesample_amqp ..\..\c\serializer\samples\simplesample_amqp mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd simplesample_http ..\..\c\serializer\samples\simplesample_http mbed\filelist.txt FRDM-K64F
call release_mbed_project.cmd temp_sensor_anomaly ..\..\c\serializer\samples\temp_sensor_anomaly mbed\filelist.txt FRDM-K64F

adjust to use the filelist for the mbed shared utilities


"%R%" CMD INSTALL --build .
IF %ERRORLEVEL% NEQ 0 exit 1

Update bld.bat

Update bld.bat


flit build --format wheel
python -m pip install --no-deps dist/*.whl -vv

Add bld.bat for Windows builds

Add bld.bat for Windows builds


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

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

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

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

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

:returncode
exit /B %SCONS_ERRORLEVEL%

:endscons
call :returncode %SCONS_ERRORLEVEL%

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

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

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

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

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

:returncode
exit /B %SCONS_ERRORLEVEL%

:endscons
call :returncode %SCONS_ERRORLEVEL%

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


cls
call ../../src/locatevc.bat
cl /c /DEBUG ring_raylib.c -I"..\..\libdepwin\raylib2.5\include" -I"..\..\include"
link /DEBUG ring_raylib.obj  ..\..\lib\ring.lib ..\..\libdepwin\raylib2.5\lib\raylib_static.lib winmm.lib gdi32.lib /DLL /OUT:..\..\bin\ring_raylib.dll
del ring_raylib.obj

cls
call ../../src/locatevc.bat
cl /c /DEBUG ring_raylib.c -I"..\..\libdepwin\raylib2.5\include" -I"..\..\include"
link /DEBUG ring_raylib.obj  ..\..\lib\ring.lib ..\..\libdepwin\raylib2.5\lib\raylib.lib  /DLL /OUT:..\..\bin\ring_raylib.dll
del ring_raylib.obj

Update extensions/ringraylib/buildvc.bat


@echo off
rmdir /s /q yojimbo
mkdir yojimbo
mkdir yojimbo\tests
copy ..\*.h yojimbo
copy ..\*.cpp yojimbo
copy ..\premake5.lua libyojimbo
robocopy /MIR /DCOPY:T ..\tlsf yojimbo\tlsf
REM because robocopy sometimes sets non-zero error codes on successful operation. what the actual fuck windows
cmd /c "exit /b 0"

@echo off
rmdir /s /q yojimbo
mkdir yojimbo
mkdir yojimbo\tests
copy ..\*.h yojimbo
copy ..\*.cpp yojimbo
copy ..\premake5.lua yojimbo
robocopy /MIR /DCOPY:T ..\tlsf yojimbo\tlsf
REM because robocopy sometimes sets non-zero error codes on successful operation. what the actual fuck windows
cmd /c "exit /b 0"

fix docker action on windows

fix docker action on windows


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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

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

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

goto :EOF

:error
exit /b 1

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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

@rem npm path is not currently set in our image, we should fix this next time
@rem we upgrade Node.js in the image:
SET PATH=%PATH%;/cygdrive/c/Program Files/nodejs/npm

call nvm use v12.14.1
call which node

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

goto :EOF

:error
exit /b 1


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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

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

goto :EOF

:error
exit /b 1

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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

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

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

goto :EOF

:error
exit /b 1

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


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

set version=
if not "%PackageVersion%" == "" (
   set version=-Version %PackageVersion%
)

echo Build
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild Zirpl.FluentReflection.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
if not "%errorlevel%"=="0" goto failure

echo Unit tests
call %nuget% install NUnit.Runners -Version 2.6.4 -OutputDirectory packages
packages\NUnit.Runners.2.6.4\tools\nunit-console.exe /config:%config% /framework:net-4.5 Zirpl.FluentReflection.Tests\bin\%config%\Zirpl.FluentReflection.Tests.dll
if not "%errorlevel%"=="0" goto failure

echo Package
mkdir Output
call %nuget% pack ".nuget\Zirpl.FluentReflection.nuspec" -symbols -o Output -p Configuration=%config% %version%
if not "%errorlevel%"=="0" goto failure

:success
exit 0

:failure
exit -1

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

set version=
if not "%PackageVersion%" == "" (
   set version=-Version %PackageVersion%
)

echo Build
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild Zirpl.FluentReflection.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
if not "%errorlevel%"=="0" goto failure

echo Unit tests
call %nuget% install NUnit.Runners -Version 2.6.4 -OutputDirectory packages
packages\NUnit.Runners.2.6.4\tools\nunit-console.exe /config:%config% /framework:net-4.5 Zirpl.FluentReflection.Tests\bin\%config%\Zirpl.FluentReflection.Tests.dll
if not "%errorlevel%"=="0" goto failure

echo Package
mkdir .nuget\bin\%config%\
call %nuget% pack ".nuget\Zirpl.FluentReflection.nuspec" -symbols -o .nuget\bin\%config%\ -p Configuration=%config% %version%
if not "%errorlevel%"=="0" goto failure

:success
exit 0

:failure
exit -1

build file fix

build file fix


set /p version=Release version (x.x.x)?:
sentry-cli releases -o webapi -p admin-panel upload-sourcemaps ./build
pause

set /p version=Release version (x.x.x)?:
sentry-cli releases -o webapi -p admin-panel files {version} upload-sourcemaps ./build

Fix upload sourcemaps command

chore(sentry): Fix upload sourcemaps command


@echo off

if “%1%” == “precustomization” (
@rem First Boot
echo Do precustomization tasks
cmd.exe /c winrm quickconfig -q
cmd.exe /c winrm quickconfig -transport:http
cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}
cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}
cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}
cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}
cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
@rem Make sure winrm is off for this boot, but enabled on next
cmd.exe /c net stop winrm
cmd.exe /c sc config winrm start= auto
cmd.exe /c net accounts /maxpwage:unlimited
echo %DATE% %TIME% > C:\vm-is-customized

) else if “%1%” == “postcustomization” (
@rem Second Boot / start winrm, just incase, and fix firewall
cmd.exe /c net start winrm
cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985 for WinRM"

@rem Password Setting, Force Password Change, and Autologin currently seem broken
@rem Forcing the password here at least allows us to connect remotely
cmd.exe /c net user administrator Password1
@rem Incase DNS failed to be set
@rem cmd.exe /c netsh interface ipv4 add dnsserver "Ethernet" address=8.8.8.8
@rem cmd.exe /c netsh interface ipv4 add dnsserver "Ethernet0" address=8.8.8.8
echo %DATE% %TIME% > C:\vm-is-ready

)

@echo off

if “%1%” == “precustomization” (
@rem First Boot
echo Do precustomization tasks
cmd.exe /c winrm quickconfig -q
cmd.exe /c winrm quickconfig -transport:http
cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}
cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}
cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}
cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}
cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
@rem Make sure winrm is off for this boot, but enabled on next
cmd.exe /c net stop winrm
cmd.exe /c sc config winrm start= auto
cmd.exe /c net accounts /maxpwage:unlimited
echo %DATE% %TIME% > C:\vm-is-customized

) else if “%1%” == “postcustomization” (
@rem Second Boot / start winrm, just incase, and fix firewall
cmd.exe /c net start winrm
cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985 for WinRM"
cmd.exe /c netsh advfirewall firewall set rule name="RDP" profile=public protocol=tcp localport=3389 remoteip=localsubnet new remoteip=any
cmd.exe /c reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

@rem Password Setting, Force Password Change, and Autologin currently seem broken
@rem Forcing the password here at least allows us to connect remotely
cmd.exe /c net user administrator Password1
@rem Incase DNS failed to be set
@rem cmd.exe /c netsh interface ipv4 add dnsserver "Ethernet" address=8.8.8.8
@rem cmd.exe /c netsh interface ipv4 add dnsserver "Ethernet0" address=8.8.8.8
echo %DATE% %TIME% > C:\vm-is-ready

)

Enable remote desktop and open corresponding firewall rule


@echo off
SET _BIN_PACK_DIR=%_BUILTBOT_PUBLISH_PACK_PATH%

set issue_server_ip=172.16.41.114
set issue_kbcp_dir=\\%issue_server_ip%\d$\KCBP\KCBP\KCBP\bin\

net use \\%issue_server_ip% /del /yes
net use \\%issue_server_ip% "SZadmin898" /user:administrator

copy %_BIN_PACK_DIR%\*.* %issue_kbcp_dir%

call %issue_kbcp_dir%\merge_spd.bat

@echo off
SET _BIN_PACK_DIR=%_BUILTBOT_PUBLISH_PACK_PATH%

set issue_server_ip=172.16.41.114
set issue_kbcp_dir=\\%issue_server_ip%\d$\KCBP\KCBP\KCBP\bin\

net use \\%issue_server_ip% /del /yes
net use \\%issue_server_ip% "" /user:administrator

copy %_BIN_PACK_DIR%\*.* %issue_kbcp_dir%

call %issue_kbcp_dir%\merge_spd.bat

Update publish_to_kcbp.bat

Update publish_to_kcbp.bat


@echo off
cls
echo.
echo BEGIN OF DEMO 3: Bach.java
pause > nul

if exist demo rmdir /q/s demo
mkdir demo
cd demo
mkdir src\demo

echo ______
echo Step 1: Declare demo module: src\demo\module-info.java
pause > nul
(
echo module demo {}
)>"src\demo\module-info.java"
echo.
type src\demo\module-info.java
pause > nul

echo ______
echo Step 2: NOOP -- no local build file is needed
pause > nul

echo ______
echo Step 3: Show tree of source files
pause > nul
echo.
tree /f . | findstr /v Volume | findstr /v :
pause > nul

echo ______
echo Step 4: Build
pause > nul
@echo on
jshell --show-version https://bit.ly/bach-build
@echo off
pause > nul

echo ______
echo Step 5: Show tree of source and binary files
pause > nul
echo.
tree /f . | findstr /v Volume | findstr /v :
pause > nul

echo ______
echo Step 6: Describe demo module
pause > nul
echo.
jar --describe-module --file .bach\modules\demo.jar
pause > nul

cd ..
echo.
echo END OF DEMO
echo.

@echo off
cls
echo.
echo BEGIN OF DEMO 3: Bach.java
pause > nul

if exist demo rmdir /q/s demo
mkdir demo
cd demo
mkdir src\demo

echo ______
echo Step 1: Declare demo module: src\demo\module-info.java
pause > nul
(
echo module demo {}
)>"src\demo\module-info.java"
echo.
type src\demo\module-info.java
pause > nul

echo ______
echo Step 2: NOOP -- no local build file is needed
pause > nul

echo ______
echo Step 3: Show tree of source files
pause > nul
echo.
tree /f . | findstr /v Volume | findstr /v :
pause > nul

echo ______
echo Step 4: Build
pause > nul
@echo on
jshell --show-version https://bit.do/bach-build
@echo off
pause > nul

echo ______
echo Step 5: Show tree of source and binary files
pause > nul
echo.
tree /f . | findstr /v Volume | findstr /v :
pause > nul

echo ______
echo Step 6: Describe demo module
pause > nul
echo.
jar --describe-module --file .bach\modules\demo.jar
pause > nul

cd ..
echo.
echo END OF DEMO
echo.

Update demo-3-bach.bat

Update demo-3-bach.bat

Update bit.ly to bit.do