@echo off

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

rem   =====================================================
rem   Environment variables that can be defined externally:
rem
rem   JMETER_BIN - JMeter bin directory (must end in \)
rem   JM_LAUNCH - java.exe (default) or javaw.exe
rem   JVM_ARGS - additional java options, e.g. -Dprop=val
rem   JM_START - set this to "start" to launch JMeter in a separate window
rem              this is used by the jmeterw.cmd script.
rem
rem   =====================================================

rem Minimal version to run JMeter
set MINIMAL_VERSION=1.6.0

for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
    rem @echo Debug Output: %%g
    set JAVAVER=%%g
)
set JAVAVER=%JAVAVER:"=%
if not defined JAVAVER (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2-NO_JAVA
    goto pause
)
@echo JAVAVER %JAVAVER%
for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
    set current_minor=%%w
)

for /f "delims=. tokens=1-3" %%v in ("%MINIMAL_VERSION%") do (
    set minimal_minor=%%w
)

if not defined current_minor (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2-NO_JAVA
    goto pause
)
rem @echo Debug: CURRENT=%current_minor% - MINIMAL=%minimal_minor%
if %current_minor% LSS %minimal_minor% (
    @echo Error: Java version is too lower to run JMeter. Needs at least Java greater or equal to %MINIMAL_VERSION%
    set ERRORLEVEL=3-JAVA_TOO_LOWER
    goto pause
)

if .%JM_LAUNCH% == . set JM_LAUNCH=java.exe

if not "%OS%"=="Windows_NT" goto win9xStart
:winNTStart
@setlocal

rem Need to check if we are using the 4NT shell...
if "%eval[2+2]" == "4" goto setup4NT

if exist jmeter.bat goto winNT1
if .%JMETER_BIN% == . set JMETER_BIN=%~dp0

:winNT1
rem On NT/2K grab all arguments at once
set JMETER_CMD_LINE_ARGS=%*
goto doneStart

:setup4NT
set JMETER_CMD_LINE_ARGS=%$
goto doneStart

:win9xStart
rem Slurp the command line arguments.  This loop allows for an unlimited number of
rem arguments (up to the command line limit, anyway).

set JMETER_CMD_LINE_ARGS=

:setupArgs
if %1a==a goto doneStart
set JMETER_CMD_LINE_ARGS=%JMETER_CMD_LINE_ARGS% %1
shift
goto setupArgs

:doneStart
rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.

rem The following link describes the -XX options:
rem http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
rem http://java.sun.com/developer/TechTips/2000/tt1222.html has some more descriptions
rem Unfortunately TechTips no longer seem to be available

rem See the unix startup file for the rationale of the following parameters,
rem including some tuning recommendations
set HEAP=-Xms512m -Xmx512m
set NEW=-XX:NewSize=128m -XX:MaxNewSize=128m
set SURVIVOR=-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%
set TENURING=-XX:MaxTenuringThreshold=2
rem Java 8 remove Permanent generation, don't settings the PermSize
if %current_minor% LEQ "8" (
    rem Increase MaxPermSize if you use a lot of Javascript in your Test Plan :
    set PERM=-XX:PermSize=64m -XX:MaxPermSize=128m
)

set CLASS_UNLOAD=-XX:+CMSClassUnloadingEnabled
rem set DEBUG=-verbose:gc -XX:+PrintTenuringDistribution

rem Always dump on OOM (does not cost anything unless triggered)
set DUMP=-XX:+HeapDumpOnOutOfMemoryError

rem Additional settings that might help improve GUI performance on some platforms
rem See: http://java.sun.com/products/java-media/2D/perf_graphics.html

set DDRAW=
rem  Setting this flag to true turns off DirectDraw usage, which sometimes helps to get rid of a lot of rendering problems on Win32.
rem set DDRAW=%DDRAW% -Dsun.java2d.noddraw=true

rem  Setting this flag to false turns off DirectDraw offscreen surfaces acceleration by forcing all createVolatileImage calls to become createImage calls, and disables hidden acceleration performed on surfaces created with createImage .
rem set DDRAW=%DDRAW% -Dsun.java2d.ddoffscreen=false

rem Setting this flag to true enables hardware-accelerated scaling.
rem set DDRAW=%DDRAW% -Dsun.java2d.ddscale=true

rem Server mode
rem Collect the settings defined above
set ARGS=%DUMP% %HEAP% %NEW% %SURVIVOR% %TENURING% %PERM% %CLASS_UNLOAD% %DDRAW%

%JM_START% %JM_LAUNCH% %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

rem If the errorlevel is not zero, then display it and pause

if NOT errorlevel 0 goto pause
if errorlevel 1 goto pause

goto end

:pause
echo errorlevel=%ERRORLEVEL%
pause

:end

@echo off

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

rem   =====================================================
rem   Environment variables that can be defined externally:
rem
rem   JMETER_BIN - JMeter bin directory (must end in \)
rem   JM_LAUNCH - java.exe (default) or javaw.exe
rem   JVM_ARGS - additional java options, e.g. -Dprop=val
rem   JM_START - set this to "start" to launch JMeter in a separate window
rem              this is used by the jmeterw.cmd script.
rem
rem   =====================================================

rem Minimal version to run JMeter
set MINIMAL_VERSION=1.6.0

for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
    rem @echo Debug Output: %%g
    set JAVAVER=%%g
)
set JAVAVER=%JAVAVER:"=%
if not defined JAVAVER (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2-NO_JAVA
    goto pause
)
rem @echo JAVAVER %JAVAVER%
for /f "delims=. tokens=1-3" %%v in ("%JAVAVER%") do (
    set current_minor=%%w
)

for /f "delims=. tokens=1-3" %%v in ("%MINIMAL_VERSION%") do (
    set minimal_minor=%%w
)

if not defined current_minor (
    @echo Not able to find Java executable or version. Please check your Java installation.
    set ERRORLEVEL=2-NO_JAVA
    goto pause
)
rem @echo Debug: CURRENT=%current_minor% - MINIMAL=%minimal_minor%
if %current_minor% LSS %minimal_minor% (
    @echo Error: Java version is too lower to run JMeter. Needs at least Java greater or equal to %MINIMAL_VERSION%
    set ERRORLEVEL=3-JAVA_TOO_LOWER
    goto pause
)

if .%JM_LAUNCH% == . set JM_LAUNCH=java.exe

if not "%OS%"=="Windows_NT" goto win9xStart
:winNTStart
@setlocal

rem Need to check if we are using the 4NT shell...
if "%eval[2+2]" == "4" goto setup4NT

if exist jmeter.bat goto winNT1
if .%JMETER_BIN% == . set JMETER_BIN=%~dp0

:winNT1
rem On NT/2K grab all arguments at once
set JMETER_CMD_LINE_ARGS=%*
goto doneStart

:setup4NT
set JMETER_CMD_LINE_ARGS=%$
goto doneStart

:win9xStart
rem Slurp the command line arguments.  This loop allows for an unlimited number of
rem arguments (up to the command line limit, anyway).

set JMETER_CMD_LINE_ARGS=

:setupArgs
if %1a==a goto doneStart
set JMETER_CMD_LINE_ARGS=%JMETER_CMD_LINE_ARGS% %1
shift
goto setupArgs

:doneStart
rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.

rem The following link describes the -XX options:
rem http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
rem http://java.sun.com/developer/TechTips/2000/tt1222.html has some more descriptions
rem Unfortunately TechTips no longer seem to be available

rem See the unix startup file for the rationale of the following parameters,
rem including some tuning recommendations
set HEAP=-Xms512m -Xmx512m
set NEW=-XX:NewSize=128m -XX:MaxNewSize=128m
set SURVIVOR=-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%
set TENURING=-XX:MaxTenuringThreshold=2
rem Java 8 remove Permanent generation, don't settings the PermSize
if %current_minor% LEQ "8" (
    rem Increase MaxPermSize if you use a lot of Javascript in your Test Plan :
    set PERM=-XX:PermSize=64m -XX:MaxPermSize=128m
)

set CLASS_UNLOAD=-XX:+CMSClassUnloadingEnabled
rem set DEBUG=-verbose:gc -XX:+PrintTenuringDistribution

rem Always dump on OOM (does not cost anything unless triggered)
set DUMP=-XX:+HeapDumpOnOutOfMemoryError

rem Additional settings that might help improve GUI performance on some platforms
rem See: http://java.sun.com/products/java-media/2D/perf_graphics.html

set DDRAW=
rem  Setting this flag to true turns off DirectDraw usage, which sometimes helps to get rid of a lot of rendering problems on Win32.
rem set DDRAW=%DDRAW% -Dsun.java2d.noddraw=true

rem  Setting this flag to false turns off DirectDraw offscreen surfaces acceleration by forcing all createVolatileImage calls to become createImage calls, and disables hidden acceleration performed on surfaces created with createImage .
rem set DDRAW=%DDRAW% -Dsun.java2d.ddoffscreen=false

rem Setting this flag to true enables hardware-accelerated scaling.
rem set DDRAW=%DDRAW% -Dsun.java2d.ddscale=true

rem Server mode
rem Collect the settings defined above
set ARGS=%DUMP% %HEAP% %NEW% %SURVIVOR% %TENURING% %PERM% %CLASS_UNLOAD% %DDRAW%

%JM_START% %JM_LAUNCH% %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

rem If the errorlevel is not zero, then display it and pause

if NOT errorlevel 0 goto pause
if errorlevel 1 goto pause

goto end

:pause
echo errorlevel=%ERRORLEVEL%
pause

:end

Comment debug output

Comment debug output

git-svn-id: 5ccfe34f605a6c2f9041ff2965ab60012c62539a@1581489 13f79535-47bb-0310-9956-ffa450edef68


REM SET BUILD=Debug
SET BUILD=Release

COPY ..\src\ServiceStack.Redis\bin\%BUILD%\ServiceStack.Redis.* ..\NuGet\lib\net35

COPY ..\src\ServiceStack.Redis\bin\%BUILD%\ServiceStack.* ..\..\ServiceStack\release\latest\ServiceStack.Redis

COPY ..\src\ServiceStack.Redis\bin\%BUILD%\ServiceStack.* ..\..\ServiceStack\lib
COPY ..\src\ServiceStack.Redis\bin\%BUILD%\ServiceStack.* ..\..\ServiceStack.Examples\lib
COPY ..\src\ServiceStack.Redis\bin\%BUILD%\ServiceStack.Redis.* ..\..\ServiceStack.Contrib\lib
COPY ..\src\ServiceStack.Redis\bin\%BUILD%\ServiceStack.Redis.* ..\..\ServiceStack.RedisWebServices\lib

add copy.bat

add copy.bat


call mqsistop TESTNODE_John
call mqsideletebroker TESTNODE_John
@rem start queue manager
set PATH=%PATH%;"C:\Program Files (x86)\IBM\WebSphere MQ\bin"
strmqm IB9QMGR

call mqsicreatebroker TESTNODE_John
call mqsistart TESTNODE_John
call mqsicreateexecutiongroup TESTNODE_John -e default

@rem set up environment for SAP nodes
call mqsichangeproperties TESTNODE_John -c EISProviders -o SAP -n nativeLibs,jarsURL -v "C:\John\sapjco3\308\64","C:\John\sapjco3\308\64"
@rem pcrockers org call mqsisetdbparms TESTNODE_John -n MQTT::iotFoundation -u "a-3siysh-fiux9wzyex" -p "bftwcV9@*TZy(iwF)1"
call mqsisetdbparms TESTNODE_John -n MQTT::iotFoundation -u "a-88xzb2-fcffsvhwxb" -p "jRZ!fA)Iw2GDH5eKEm"
call mqsicreatepolicy TESTNODE_John -t MQTTPublish -f ..\policy\InternalBroker.policy -l InternalBroker
@rem use IoT cloud
call mqsicreatepolicy TESTNODE_John -t MQTTSubscribe -f ..\policy\BusEvents.policy -l BusEvents
call mqsicreatepolicy TESTNODE_John -t WorkloadManagement -l smoothing -f ..\policy\smoothing.policy
@rem local test mode call mqsicreatepolicy TESTNODE_John -t MQTTSubscribe -f ..\policy\BusEvents.local.policy -l BusEvents
call mqsichangeproperties TESTNODE_John -b pubsub -o BusinessEvents/MQTT -n policyUrl -v /MQTTPublish/InternalBroker.policy
call mqsichangeproperties TESTNODE_John -b pubsub -o BusinessEvents/MQTT -n enabled -v true
call mqsistop TESTNODE_John
call mqsistart TESTNODE_John
@rem build bar file
mkdir output
call mqsipackagebar -a output\demo.bar -w ..\ad -y VehicleMaintenance -k PredictiveMaintenance
call mqsideploy -a output\demo.bar TESTNODE_John -e default
@rem activate flow monitoring
call mqsichangeresourcestats TESTNODE_John -e default -c active
call mqsichangeflowmonitoring TESTNODE_John -e default -c active -j -k PredictiveMaintenance
call mqsichangeflowstats TESTNODE_John -g -c active -j -k PredictiveMaintenance -s -o json -n advanced
@rem call mqsichangeflowstats TESTNODE_John -g -c active -j -k PredictiveMaintenance -a -o json -n advanced

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

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

delete file on setup

delete file on setup


set conda_env="fc_env"
set copy_dir="FreeCAD_Conda_Build"

mkdir %copy_dir%

conda create ^
 -p %conda_env% ^
 freecad libredwg calculix gitpython gmsh ^
 numpy matplotlib-base scipy sympy pandas six ^
 pyyaml opencamlib ifcopenshell ^
 freecad.asm3 libredwg pycollada ^
 --copy ^
 -c freecad/label/dev ^
 -c conda-forge ^
 -y

REM Copy Conda's Python and (U)CRT to FreeCAD/bin
robocopy %conda_env%\DLLs %copy_dir%\bin\DLLs /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Lib %copy_dir%\bin\Lib /XD __pycache__ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Scripts %copy_dir%\bin\Scripts /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ python*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ msvc*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ ucrt*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy gmsh and calculix
robocopy %conda_env%\Library\bin ccx.exe %copy_dir%\bin\ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\bin gmsh.exe %copy_dir%\bin\ /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy Conda's QT5/plugins to FreeCAD/bin
robocopy %conda_env%\Library\plugins %copy_dir%\bin\ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\bin\ QtWebEngineProces* %copy_dir%\bin\ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\resources %copy_dir%\resources /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\translations %copy_dir%\translations /MT:%NUMBER_OF_PROCESSORS% > nul
echo [Paths] > %copy_dir%\bin\qt.conf
echo Prefix =.. >> "%copy_dir%\bin\qt.conf"
REM get all the dependency .dlls
robocopy %conda_env%\Library\bin *.dll %copy_dir%\bin /XF *.pdb /XF api*.* /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy FreeCAD build
robocopy %conda_env%\Library\bin FreeCAD* %copy_dir%\bin /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\data %copy_dir%\data /XF *.txt /S /MT:%NUMBER_OF_PROCESSORS% > nul
REM robocopy %conda_env%\Library\doc\ *.html %copy_dir%\doc MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\Ext %copy_dir%\Ext /S /XD __pycache__ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\lib %copy_dir%\lib /XF *.lib /XF *.prl /XF *.sh /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\Mod %copy_dir%\Mod /S /XD __pycache__ /MT:%NUMBER_OF_PROCESSORS% > nul
%copy_dir%\bin\python.exe -c "import FreeCAD;print((FreeCAD.Version()[0]) +'.' + (FreeCAD.Version()[1]) +'.' + (FreeCAD.Version()[2]))" > tempver.txt
set /p fcver=<tempver.txt
echo %fcver%
cd %copy_dir%\..
ren %copy_dir% FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64
"%ProgramFiles%\7-Zip\7z.exe" a -t7z -mmt=%NUMBER_OF_PROCESSORS% FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64\
certutil -hashfile "FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z" SHA256 > "FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z"-SHA256.txt
echo  %date%-%time% >>"FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z"-SHA256.txt

set conda_env="fc_env"
set copy_dir="FreeCAD_Conda_Build"

mkdir %copy_dir%

conda create ^
 -p %conda_env% ^
 freecad libredwg calculix gitpython gmsh ^
 numpy matplotlib-base scipy sympy pandas six ^
 pyyaml opencamlib ifcopenshell ^
 freecad.asm3 libredwg pycollada ^
 --copy ^
 -c freecad/label/dev ^
 -c conda-forge ^
 -y

REM Copy Conda's Python and (U)CRT to FreeCAD/bin
robocopy %conda_env%\DLLs %copy_dir%\bin\DLLs /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Lib %copy_dir%\bin\Lib /XD __pycache__ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Scripts %copy_dir%\bin\Scripts /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ python*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ msvc*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ ucrt*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy gmsh and calculix
robocopy %conda_env%\Library\bin %copy_dir%\bin\ ccx.exe /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\bin %copy_dir%\bin\ gmsh.exe /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy Conda's QT5/plugins to FreeCAD/bin
robocopy %conda_env%\Library\plugins %copy_dir%\bin\ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\bin\ QtWebEngineProces* %copy_dir%\bin\ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\resources %copy_dir%\resources /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\translations %copy_dir%\translations /MT:%NUMBER_OF_PROCESSORS% > nul
echo [Paths] > %copy_dir%\bin\qt.conf
echo Prefix =.. >> "%copy_dir%\bin\qt.conf"
REM get all the dependency .dlls
robocopy %conda_env%\Library\bin *.dll %copy_dir%\bin /XF *.pdb /XF api*.* /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy FreeCAD build
robocopy %conda_env%\Library\bin FreeCAD* %copy_dir%\bin /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\data %copy_dir%\data /XF *.txt /S /MT:%NUMBER_OF_PROCESSORS% > nul
REM robocopy %conda_env%\Library\doc\ *.html %copy_dir%\doc MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\Ext %copy_dir%\Ext /S /XD __pycache__ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\lib %copy_dir%\lib /XF *.lib /XF *.prl /XF *.sh /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\Mod %copy_dir%\Mod /S /XD __pycache__ /MT:%NUMBER_OF_PROCESSORS% > nul
%copy_dir%\bin\python.exe -c "import FreeCAD;print((FreeCAD.Version()[0]) +'.' + (FreeCAD.Version()[1]) +'.' + (FreeCAD.Version()[2]))" > tempver.txt
set /p fcver=<tempver.txt
echo %fcver%
cd %copy_dir%\..
ren %copy_dir% FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64
"%ProgramFiles%\7-Zip\7z.exe" a -t7z -mmt=%NUMBER_OF_PROCESSORS% FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64\
certutil -hashfile "FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z" SHA256 > "FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z"-SHA256.txt
echo  %date%-%time% >>"FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64.7z"-SHA256.txt

fix ccx, gmsh copying

win: fix ccx, gmsh copying


:: Copyright 2014-2015 Viktor Szakats <https://github.com/vszakats>
:: See LICENSE.md

@echo off

set _NAM=%~n0
set _NAM=%_NAM:~3%
set _VER=%1
set _CPU=%2

setlocal
pushd "%_NAM%"

:: Apply local patches

sed -e "s/-march=i486 -Wall::-D_MT:MINGW32:-lws2_32/-march=i686 -mtune=generic -m32 -fno-ident -flto -ffat-lto-objects -frandom-seed=__RANDOM_SEED__ -static-libgcc -Wall::-D_MT:MINGW32:-lws2_32/g" -i Configure
sed -e "s/-DWIN32_LEAN_AND_MEAN -DUNICODE/-DWIN32_LEAN_AND_MEAN -m64 -fno-ident -flto -ffat-lto-objects -frandom-seed=__RANDOM_SEED__ -static-libgcc -DUNICODE/g" -i Configure
sed -e "s/windres -o rc.o/windres $(SHARED_RCFLAGS) -o rc.o/g" -i Makefile.shared

:: Build

set MAKE=mingw32-make

if "%_CPU%" == "win32" set SHARED_RCFLAGS=-F pe-i386
if "%_CPU%" == "win64" set SHARED_RCFLAGS=-F pe-x86-64

del /s *.o *.a *.exe >> nul 2>&1
if "%_CPU%" == "win32" perl Configure mingw   shared no-unit-test no-ssl2 no-ssl3 no-rc5 no-idea        "--prefix=%CD:\=/%"
:: Disable asm in 64-bit builds. It makes linking the static libs fail in LTO mode:
::   C:\Users\...\AppData\Local\Temp\ccUO3sBD.s: Assembler messages:
::   C:\Users\...\AppData\Local\Temp\ccUO3sBD.s:23710: Error: operand type mismatch for `div'
::   lto-wrapper.exe: fatal error: gcc.exe returned 1 exit status
::   compilation terminated.
::   C:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: lto-wrapper failed
::   collect2.exe: error: ld returned 1 exit status
if "%_CPU%" == "win64" perl Configure mingw64 shared no-unit-test no-ssl2 no-ssl3 no-rc5 no-idea no-asm "--prefix=%CD:\=/%"
sh -c "mingw32-make depend"
sh -c "mingw32-make"

:: Make steps for determinism

if exist *.a   strip -p --enable-deterministic-archives -g *.a
if exist *.lib strip -p --enable-deterministic-archives -g *.lib

:: Strip debug info

strip -p -s apps\openssl.exe

python ..\peclean.py apps\openssl.exe
python ..\peclean.py apps\*.dll
python ..\peclean.py engines\*.dll

touch -c apps/openssl.exe    -r CHANGES
touch -c apps/*.dll          -r CHANGES
touch -c engines/*.dll       -r CHANGES
touch -c include/openssl/*.h -r CHANGES
touch -c *.a                 -r CHANGES
touch -c *.lib               -r CHANGES

:: Create package

set _BAS=%_NAM%-%_VER%-%_CPU%-mingw
if not "%APPVEYOR_REPO_BRANCH%" == "master" set _BAS=%_BAS%-test
set _DST=%TEMP%\%_BAS%

xcopy /y /q    apps\openssl.exe "%_DST%\"
xcopy /y /q    apps\*.dll       "%_DST%\"
xcopy /y /q    engines\*.dll    "%_DST%\engines\"
 copy /y       apps\openssl.cnf "%_DST%\openssl.cfg"
xcopy /y /s /q include\*.*      "%_DST%\include\"
xcopy /y /q    ms\applink.c     "%_DST%\include\openssl\"
 copy /y       CHANGES          "%_DST%\CHANGES.txt"
 copy /y       LICENSE          "%_DST%\LICENSE.txt"
 copy /y       README           "%_DST%\README.txt"
 copy /y       FAQ              "%_DST%\FAQ.txt"
 copy /y       NEWS             "%_DST%\NEWS.txt"

if exist *.a   xcopy /y /s *.a   "%_DST%\lib\"
if exist *.lib xcopy /y /s *.lib "%_DST%\lib\"

unix2dos -k %_DST:\=/%/*.txt

touch -c %_DST:\=/%/engines         -r CHANGES
touch -c %_DST:\=/%/include/openssl -r CHANGES
touch -c %_DST:\=/%/include         -r CHANGES
touch -c %_DST:\=/%/lib             -r CHANGES
touch -c %_DST:\=/%                 -r CHANGES

call ..\pack.bat
call ..\upload.bat

popd
endlocal

:: Copyright 2014-2015 Viktor Szakats <https://github.com/vszakats>
:: See LICENSE.md

@echo off

set _NAM=%~n0
set _NAM=%_NAM:~3%
set _VER=%1
set _CPU=%2

setlocal
pushd "%_NAM%"

:: Apply local patches

sed -e "s/-march=i486 -Wall::-D_MT:MINGW32:-lws2_32/-march=i686 -mtune=generic -m32 -fno-ident -flto -ffat-lto-objects -frandom-seed=__RANDOM_SEED__ -static-libgcc -Wall::-D_MT:MINGW32:-lws2_32/g" -i Configure
sed -e "s/-DWIN32_LEAN_AND_MEAN -DUNICODE/-DWIN32_LEAN_AND_MEAN -m64 -fno-ident -flto -ffat-lto-objects -frandom-seed=__RANDOM_SEED__ -static-libgcc -DUNICODE/g" -i Configure
sed -e "s/windres -o rc.o/windres $(SHARED_RCFLAGS) -o rc.o/g" -i Makefile.shared

:: Build

set MAKE=mingw32-make

if "%_CPU%" == "win32" set SHARED_RCFLAGS=-F pe-i386
if "%_CPU%" == "win64" set SHARED_RCFLAGS=-F pe-x86-64

del /s *.o *.a *.exe >> nul 2>&1
if "%_CPU%" == "win32" perl Configure mingw   shared no-unit-test no-ssl2 no-ssl3 no-rc5 no-idea no-dso "--prefix=%CD:\=/%"
:: Disable asm in 64-bit builds. It makes linking the static libs fail in LTO mode:
::   C:\Users\...\AppData\Local\Temp\ccUO3sBD.s: Assembler messages:
::   C:\Users\...\AppData\Local\Temp\ccUO3sBD.s:23710: Error: operand type mismatch for `div'
::   lto-wrapper.exe: fatal error: gcc.exe returned 1 exit status
::   compilation terminated.
::   C:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: lto-wrapper failed
::   collect2.exe: error: ld returned 1 exit status
if "%_CPU%" == "win64" perl Configure mingw64 shared no-unit-test no-ssl2 no-ssl3 no-rc5 no-idea no-dso no-asm "--prefix=%CD:\=/%"
sh -c "mingw32-make depend"
sh -c "mingw32-make"

:: Make steps for determinism

if exist *.a   strip -p --enable-deterministic-archives -g *.a
if exist *.lib strip -p --enable-deterministic-archives -g *.lib

:: Strip debug info

strip -p -s apps\openssl.exe

python ..\peclean.py apps\openssl.exe
python ..\peclean.py apps\*.dll
if exist engines\*.dll python ..\peclean.py engines\*.dll

touch -c apps/openssl.exe    -r CHANGES
touch -c apps/*.dll          -r CHANGES
touch -c engines/*.dll       -r CHANGES
touch -c include/openssl/*.h -r CHANGES
touch -c *.a                 -r CHANGES
touch -c *.lib               -r CHANGES

:: Create package

set _BAS=%_NAM%-%_VER%-%_CPU%-mingw
if not "%APPVEYOR_REPO_BRANCH%" == "master" set _BAS=%_BAS%-test
set _DST=%TEMP%\%_BAS%

xcopy /y /q    apps\openssl.exe "%_DST%\"
xcopy /y /q    apps\*.dll       "%_DST%\"
xcopy /y /q    engines\*.dll    "%_DST%\engines\"
 copy /y       apps\openssl.cnf "%_DST%\openssl.cfg"
xcopy /y /s /q include\*.*      "%_DST%\include\"
xcopy /y /q    ms\applink.c     "%_DST%\include\openssl\"
 copy /y       CHANGES          "%_DST%\CHANGES.txt"
 copy /y       LICENSE          "%_DST%\LICENSE.txt"
 copy /y       README           "%_DST%\README.txt"
 copy /y       FAQ              "%_DST%\FAQ.txt"
 copy /y       NEWS             "%_DST%\NEWS.txt"

if exist *.a   xcopy /y /s *.a   "%_DST%\lib\"
if exist *.lib xcopy /y /s *.lib "%_DST%\lib\"

unix2dos -k %_DST:\=/%/*.txt

touch -c %_DST:\=/%/engines         -r CHANGES
touch -c %_DST:\=/%/include/openssl -r CHANGES
touch -c %_DST:\=/%/include         -r CHANGES
touch -c %_DST:\=/%/lib             -r CHANGES
touch -c %_DST:\=/%                 -r CHANGES

call ..\pack.bat
call ..\upload.bat

popd
endlocal

disable DSO again

mk-openssl.bat: disable DSO again

Also:
- don't fail if engines are not built


SET PYTHONPATH=.
SET TARGET_ENVIRONMENT=development
CALL pypy server.py
EXIT

SET PYTHONPATH=.
SET TARGET_ENVIRONMENT=development
CALL .env\bin\activate
CALL .env\bin\pypy.exe server.py

update server script

update server script


@ECHO OFF
SETLOCAL
SET /A ARGS_COUNT=0
FOR %%A in (%*) DO SET /A "ARGS_COUNT+=1"
IF %ARGS_COUNT% NEQ 2 (
	@ECHO Invalid arguments.
	@ECHO Usage: runAs.cmd credentials_file command
	@EXIT -1
)
ENDLOCAL

REM Define OS bitness
SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN=%~dp0"
SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL=JetBrains.runAs.exe"
%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN%x86\%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL% -t
SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_OS_BITNESS=%errorlevel%"

IF %RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_OS_BITNESS% EQU 64 (
	SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL=%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN%x64\%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL%"
	GOTO RUN_AS
)

IF %RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_OS_BITNESS% EQU 32 (
	SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL=%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN%x86\%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL%"
	GOTO RUN_AS
)

SET "EXIT_CODE=%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_OS_BITNESS%"
ECHO.
IF %EXIT_CODE% EQU 1 ECHO ##teamcity[message text='Invoker has no administrative privileges, when running under the Windows service as LocalSystem.' status='ERROR']
IF %EXIT_CODE% EQU 2 ECHO ##teamcity[message text='Invoker has no SeAssignPrimaryTokenPrivilege privilege, when running under the Windows service as LocalSystem.' status='ERROR']
EXIT /B %EXIT_CODE%

:RUN_AS
SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN="
SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_="

REM Run command line
%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL% -i:auto -l:normal -c:%1 -b:-10000 cmd.exe /C %2
SET "EXIT_CODE=%ERRORLEVEL%"

ECHO.
IF %EXIT_CODE% EQU -10000 ECHO ##teamcity[message text='Unknown error occurred.' status='ERROR']
IF %EXIT_CODE% EQU -10001 ECHO ##teamcity[message text='Invalid usage of the tool.' status='ERROR']
IF %EXIT_CODE% EQU -10002 ECHO ##teamcity[message text='Security error occurred.' status='ERROR']
IF %EXIT_CODE% EQU -10003 ECHO ##teamcity[message text='WIN32 API error occurred.' status='ERROR']

EXIT /B %EXIT_CODE%

@ECHO OFF
SETLOCAL
SET /A ARGS_COUNT=0
FOR %%A in (%*) DO SET /A "ARGS_COUNT+=1"
IF %ARGS_COUNT% NEQ 2 (
	@ECHO Invalid arguments.
	@ECHO Usage: runAs.cmd credentials_file command
	@EXIT -1
)
ENDLOCAL

REM Create user for tests
net user RunAsTestUser /delete>NUL
net user /add /active:yes RunAsTestUser aaa>NUL
net localgroup Administrators RunAsTestUser /ADD>NUL

REM Define OS bitness
SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN=%~dp0"
SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL=JetBrains.runAs.exe"
%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN%x86\%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL% -t
SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_OS_BITNESS=%errorlevel%"

IF %RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_OS_BITNESS% EQU 64 (
	SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL=%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN%x64\%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL%"
	GOTO RUN_AS
)

IF %RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_OS_BITNESS% EQU 32 (
	SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL=%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN%x86\%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL%"
	GOTO RUN_AS
)

SET "EXIT_CODE=%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_OS_BITNESS%"
ECHO.
IF %EXIT_CODE% EQU 1 ECHO ##teamcity[message text='Invoker has no administrative privileges, when running under the Windows service as LocalSystem.' status='ERROR']
IF %EXIT_CODE% EQU 2 ECHO ##teamcity[message text='Invoker has no SeAssignPrimaryTokenPrivilege privilege, when running under the Windows service as LocalSystem.' status='ERROR']
EXIT /B %EXIT_CODE%

:RUN_AS
SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_BIN="
SET "RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_="

REM Run command line
%RUNAS_76200936_0AA1_4855_A204_05C3F3C54476_PATH_TO_TOOL% -i:auto -l:normal -c:%1 -b:-10000 cmd.exe /C %2
SET "EXIT_CODE=%ERRORLEVEL%"

ECHO.
IF %EXIT_CODE% EQU -10000 ECHO ##teamcity[message text='Unknown error occurred.' status='ERROR']
IF %EXIT_CODE% EQU -10001 ECHO ##teamcity[message text='Invalid usage of the tool.' status='ERROR']
IF %EXIT_CODE% EQU -10002 ECHO ##teamcity[message text='Security error occurred.' status='ERROR']
IF %EXIT_CODE% EQU -10003 ECHO ##teamcity[message text='WIN32 API error occurred.' status='ERROR']

EXIT /B %EXIT_CODE%

Add test user in the runAs.cmd

Add test user in the runAs.cmd


REM https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/certutil#BKMK_importPFX

certutil -f -p [password] -dump "cert.p12"

REM TODO: validate expiration above

certutil -f -p [password] -importpfx "cert.p12"

REM https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/certutil#BKMK_importPFX

certutil -f -p [password] -dump "cert.p12"

REM get just expiration: https://github.com/jgstew/tools/blob/master/CMD/cert_file_expiration.bat

certutil -f -p [password] -importpfx "cert.p12"

Update import_cert_local.bat

Update import_cert_local.bat


@echo off
setlocal EnableDelayedExpansion

:: build system uses non-standard env vars
set "XCFLAGS=%CFLAGS% -I%LIBRARY_PREFIX%\\include"
set "XLIBS=%LIBS%"
set "USE_SYSTEM_LIBS=yes"
set "USE_SYSTEM_JPEGXR=yes"

:: diagnostics
dir %LIBRARY_PREFIX%\\include

:: build and install
make "prefix=%LIBRARY_PREFIX%" -j %CPU_COUNT% all
if errorlevel 1 exit 1
:: no make check
make "prefix=%LIBRARY_PREFIX%" install
if errorlevel 1 exit 1

@echo off
setlocal EnableDelayedExpansion

:: build system uses non-standard env vars
set "XCFLAGS=%CFLAGS% -I%LIBRARY_PREFIX%/include"
set "XLIBS=%LIBS%"
set "USE_SYSTEM_LIBS=yes"
set "USE_SYSTEM_JPEGXR=yes"

:: diagnostics
dir %LIBRARY_PREFIX%\\include

:: build and install
make "prefix=%LIBRARY_PREFIX%" -j %CPU_COUNT% all
if errorlevel 1 exit 1
:: no make check
make "prefix=%LIBRARY_PREFIX%" install
if errorlevel 1 exit 1

use unix dir

use unix dir


@echo off
setlocal

pushd %~dp0\..

set VSCODEUSERDATADIR=%TMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,5%

:: Integration & performance tests in AMD
call .\scripts\test.bat --runGlob **\*.integrationTest.js %*
if %errorlevel% neq 0 exit /b %errorlevel%

:: Tests in the extension host
REM call .\scripts\code.bat %~dp0\..\extensions\vscode-api-tests\testWorkspace --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\singlefolder-tests --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
REM if %errorlevel% neq 0 exit /b %errorlevel%

REM call .\scripts\code.bat %~dp0\..\extensions\vscode-api-tests\testworkspace.code-workspace --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\workspace-tests --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
REM if %errorlevel% neq 0 exit /b %errorlevel%

call .\scripts\code.bat %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
if %errorlevel% neq 0 exit /b %errorlevel%

call .\scripts\code.bat $%~dp0\..\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disableExtensions --user-data-dir=%VSCODEUSERDATADIR% .
if %errorlevel% neq 0 exit /b %errorlevel%

# Tests in commonJS (HTML, CSS, JSON language server tests...)
call .\scripts\node-electron.bat .\node_modules\mocha\bin\_mocha .\extensions\*\server\out\test\**\*.test.js
if %errorlevel% neq 0 exit /b %errorlevel%

rmdir /s /q %VSCODEUSERDATADIR%

popd

endlocal

@echo off
setlocal

pushd %~dp0\..

set VSCODEUSERDATADIR=%TMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,5%

:: Integration & performance tests in AMD
call .\scripts\test.bat --runGlob **\*.integrationTest.js %*
if %errorlevel% neq 0 exit /b %errorlevel%

:: Tests in the extension host
call .\scripts\code.bat %~dp0\..\extensions\vscode-api-tests\testWorkspace --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\singlefolder-tests --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
if %errorlevel% neq 0 exit /b %errorlevel%

call .\scripts\code.bat %~dp0\..\extensions\vscode-api-tests\testworkspace.code-workspace --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\workspace-tests --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
if %errorlevel% neq 0 exit /b %errorlevel%

call .\scripts\code.bat %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
if %errorlevel% neq 0 exit /b %errorlevel%

call .\scripts\code.bat $%~dp0\..\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disableExtensions --user-data-dir=%VSCODEUSERDATADIR% .
if %errorlevel% neq 0 exit /b %errorlevel%

# Tests in commonJS (HTML, CSS, JSON language server tests...)
call .\scripts\node-electron.bat .\node_modules\mocha\bin\_mocha .\extensions\*\server\out\test\**\*.test.js
if %errorlevel% neq 0 exit /b %errorlevel%

rmdir /s /q %VSCODEUSERDATADIR%

popd

endlocal

Enable Windows integration tests

Enable Windows integration tests


@echo off
setlocal

:: Integration Tests
.\scripts\code.bat %~dp0\..\extensions\vscode-api-tests\testWorkspace --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out
.\scripts\code.bat %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out

endlocal

Add test-integration.bat

Add test-integration.bat


@ECHO OFF
rem ******************************************************************************
rem *
rem * Notepad2-mod
rem *
rem * build_wdk.bat
rem *   Batch file "wrapper" for makefile.mak, used to build Notepad2 with WDK
rem *
rem * See License.txt for details about distribution and modification.
rem *
rem *                                     (c) XhmikosR 2010-2013
rem *                                     https://github.com/XhmikosR/notepad2-mod
rem *
rem ******************************************************************************

SETLOCAL ENABLEEXTENSIONS
CD /D %~dp0

rem Set the WDK directory
IF NOT DEFINED WDKBASEDIR   SET "WDKBASEDIR=C:\WinDDK\7600.16385.1"
rem My new WDK location
IF NOT EXIST "%WDKBASEDIR%" SET "WDKBASEDIR=H:\WinDDK\7600.16385.1"

rem Check the building environment
IF NOT EXIST "%WDKBASEDIR%" CALL :SUBMSG "ERROR" "Specify your WDK directory!"

IF NOT DEFINED VS100COMNTOOLS (
  CALL :SUBMSG "INFO" "Visual Studio 2010 wasn't found, I will use WDK's compiler"
  SET USE_MSVC2010=
) ELSE (
  rem Comment out the following line or set USE_MSVC2010 to anything but true
  rem if you want to use WDK's compiler instead of MSVC 2010 compiler
  SET USE_MSVC2010=true
)

rem Check for the help switches
IF /I "%~1" == "help"   GOTO SHOWHELP
IF /I "%~1" == "/help"  GOTO SHOWHELP
IF /I "%~1" == "-help"  GOTO SHOWHELP
IF /I "%~1" == "--help" GOTO SHOWHELP
IF /I "%~1" == "/?"     GOTO SHOWHELP

rem Check for the first switch
IF "%~1" == "" (
  SET "BUILDTYPE=Build"
) ELSE (
  IF /I "%~1" == "Build"     SET "BUILDTYPE=Build"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "/Build"    SET "BUILDTYPE=Build"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "-Build"    SET "BUILDTYPE=Build"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "--Build"   SET "BUILDTYPE=Build"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "Clean"     SET "BUILDTYPE=Clean"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "/Clean"    SET "BUILDTYPE=Clean"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "-Clean"    SET "BUILDTYPE=Clean"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "--Clean"   SET "BUILDTYPE=Clean"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "Rebuild"   SET "BUILDTYPE=Rebuild" & GOTO CHECKSECONDARG
  IF /I "%~1" == "/Rebuild"  SET "BUILDTYPE=Rebuild" & GOTO CHECKSECONDARG
  IF /I "%~1" == "-Rebuild"  SET "BUILDTYPE=Rebuild" & GOTO CHECKSECONDARG
  IF /I "%~1" == "--Rebuild" SET "BUILDTYPE=Rebuild" & GOTO CHECKSECONDARG

  ECHO.
  ECHO Unsupported commandline switch!
  ECHO Run "%~nx0 help" for details about the commandline switches.
  CALL :SUBMSG "ERROR" "Compilation failed!"
)

:CHECKSECONDARG
rem Check for the second switch
IF "%~2" == "" (
  SET "ARCH=all"
) ELSE (
  IF /I "%~2" == "x86"   SET "ARCH=x86" & GOTO START
  IF /I "%~2" == "/x86"  SET "ARCH=x86" & GOTO START
  IF /I "%~2" == "-x86"  SET "ARCH=x86" & GOTO START
  IF /I "%~2" == "--x86" SET "ARCH=x86" & GOTO START
  IF /I "%~2" == "x64"   SET "ARCH=x64" & GOTO START
  IF /I "%~2" == "/x64"  SET "ARCH=x64" & GOTO START
  IF /I "%~2" == "-x64"  SET "ARCH=x64" & GOTO START
  IF /I "%~2" == "--x64" SET "ARCH=x64" & GOTO START
  IF /I "%~2" == "all"   SET "ARCH=all" & GOTO START
  IF /I "%~2" == "/all"  SET "ARCH=all" & GOTO START
  IF /I "%~2" == "-all"  SET "ARCH=all" & GOTO START
  IF /I "%~2" == "--all" SET "ARCH=all" & GOTO START

  ECHO.
  ECHO Unsupported commandline switch!
  ECHO Run "%~nx0 help" for details about the commandline switches.
  CALL :SUBMSG "ERROR" "Compilation failed!"
)

:START
IF "%ARCH%" == "x64" GOTO x64
IF "%ARCH%" == "x86" GOTO x86

:x86
IF "%USE_MSVC2010%" == "true" (
  CALL "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" x86
) ELSE (
  SET "PATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\x86;%PATH%"
)
SET "INCLUDE=%WDKBASEDIR%\inc\api;%WDKBASEDIR%\inc\api\crt\stl70;%WDKBASEDIR%\inc\crt;%WDKBASEDIR%\inc\ddk"
SET "LIB=%WDKBASEDIR%\lib\crt\i386;%WDKBASEDIR%\lib\win7\i386"

TITLE Building Notepad2-mod x86 with WDK...
ECHO. & ECHO.

CALL :SUBNMAKE

IF "%ARCH%" == "x86" GOTO END

:x64
IF DEFINED PROGRAMFILES(x86) (SET build_type=amd64) ELSE (SET build_type=x86_amd64)

IF "%USE_MSVC2010%" == "true" (
  CALL "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" %build_type%
) ELSE (
  SET "PATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\amd64;%PATH%"
)
SET "INCLUDE=%WDKBASEDIR%\inc\api;%WDKBASEDIR%\inc\api\crt\stl70;%WDKBASEDIR%\inc\crt;%WDKBASEDIR%\inc\ddk"
SET "LIB=%WDKBASEDIR%\lib\crt\amd64;%WDKBASEDIR%\lib\win7\amd64"

TITLE Building Notepad2-mod x64 with WDK...
ECHO. & ECHO.

CALL :SUBNMAKE "x64=1"

:END
TITLE Building Notepad2-mod with WDK - Finished!
ENDLOCAL
EXIT /B

:SUBNMAKE
nmake /NOLOGO /f "makefile.mak" %BUILDTYPE% %1
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"
EXIT /B

:SHOWHELP
TITLE %~nx0 %1
ECHO. & ECHO.
ECHO Usage: %~nx0 [Clean^|Build^|Rebuild] [x86^|x64^|all]
ECHO.
ECHO Notes: You can also prefix the commands with "-", "--" or "/".
ECHO        The arguments are not case sensitive.
ECHO. & ECHO.
ECHO Edit %~nx0 and set your WDK directory or define %%WDKBASEDIR%%.
ECHO You shouldn't need to make any changes other than that.
ECHO.
ECHO If MSVC 2010 is installed, its compiler will be used.
ECHO If you don't wish to use that then edit %~nx0 (see the first lines)
ECHO. & ECHO.
ECHO Executing %~nx0 without any arguments is equivalent to "%~nx0 build all"
ECHO.
ECHO If you skip the second argument the default one will be used. Example:
ECHO "%~nx0 rebuild" is the same as "%~nx0 rebuild all"
ECHO.
ECHO WARNING: "%~nx0 x86" won't work.
ECHO.
ENDLOCAL
EXIT /B

:SUBMSG
ECHO. & ECHO ______________________________
ECHO [%~1] %~2
ECHO ______________________________ & ECHO.
IF /I "%~1" == "ERROR" (
  PAUSE
  EXIT
) ELSE (
  EXIT /B
)

@ECHO OFF
rem ******************************************************************************
rem *
rem * Notepad2-mod
rem *
rem * build_wdk.bat
rem *   Batch file "wrapper" for makefile.mak, used to build Notepad2 with WDK
rem *
rem * See License.txt for details about distribution and modification.
rem *
rem *                                     (c) XhmikosR 2010-2015
rem *                                     https://github.com/XhmikosR/notepad2-mod
rem *
rem ******************************************************************************

SETLOCAL ENABLEEXTENSIONS
CD /D %~dp0

rem Set the WDK directory
IF NOT DEFINED WDKBASEDIR   SET "WDKBASEDIR=C:\WinDDK\7600.16385.1"
rem My new WDK location
IF NOT EXIST "%WDKBASEDIR%" SET "WDKBASEDIR=H:\WinDDK\7600.16385.1"

rem Check the building environment
IF NOT EXIST "%WDKBASEDIR%" CALL :SUBMSG "ERROR" "Specify your WDK directory!"

rem Check for the help switches
IF /I "%~1" == "help"   GOTO SHOWHELP
IF /I "%~1" == "/help"  GOTO SHOWHELP
IF /I "%~1" == "-help"  GOTO SHOWHELP
IF /I "%~1" == "--help" GOTO SHOWHELP
IF /I "%~1" == "/?"     GOTO SHOWHELP

rem Check for the first switch
IF "%~1" == "" (
  SET "BUILDTYPE=Build"
) ELSE (
  IF /I "%~1" == "Build"     SET "BUILDTYPE=Build"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "/Build"    SET "BUILDTYPE=Build"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "-Build"    SET "BUILDTYPE=Build"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "--Build"   SET "BUILDTYPE=Build"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "Clean"     SET "BUILDTYPE=Clean"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "/Clean"    SET "BUILDTYPE=Clean"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "-Clean"    SET "BUILDTYPE=Clean"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "--Clean"   SET "BUILDTYPE=Clean"   & GOTO CHECKSECONDARG
  IF /I "%~1" == "Rebuild"   SET "BUILDTYPE=Rebuild" & GOTO CHECKSECONDARG
  IF /I "%~1" == "/Rebuild"  SET "BUILDTYPE=Rebuild" & GOTO CHECKSECONDARG
  IF /I "%~1" == "-Rebuild"  SET "BUILDTYPE=Rebuild" & GOTO CHECKSECONDARG
  IF /I "%~1" == "--Rebuild" SET "BUILDTYPE=Rebuild" & GOTO CHECKSECONDARG

  ECHO.
  ECHO Unsupported commandline switch!
  ECHO Run "%~nx0 help" for details about the commandline switches.
  CALL :SUBMSG "ERROR" "Compilation failed!"
)

:CHECKSECONDARG
rem Check for the second switch
IF "%~2" == "" (
  SET "ARCH=all"
) ELSE (
  IF /I "%~2" == "x86"   SET "ARCH=x86" & GOTO START
  IF /I "%~2" == "/x86"  SET "ARCH=x86" & GOTO START
  IF /I "%~2" == "-x86"  SET "ARCH=x86" & GOTO START
  IF /I "%~2" == "--x86" SET "ARCH=x86" & GOTO START
  IF /I "%~2" == "x64"   SET "ARCH=x64" & GOTO START
  IF /I "%~2" == "/x64"  SET "ARCH=x64" & GOTO START
  IF /I "%~2" == "-x64"  SET "ARCH=x64" & GOTO START
  IF /I "%~2" == "--x64" SET "ARCH=x64" & GOTO START
  IF /I "%~2" == "all"   SET "ARCH=all" & GOTO START
  IF /I "%~2" == "/all"  SET "ARCH=all" & GOTO START
  IF /I "%~2" == "-all"  SET "ARCH=all" & GOTO START
  IF /I "%~2" == "--all" SET "ARCH=all" & GOTO START

  ECHO.
  ECHO Unsupported commandline switch!
  ECHO Run "%~nx0 help" for details about the commandline switches.
  CALL :SUBMSG "ERROR" "Compilation failed!"
)

:START
IF "%ARCH%" == "x64" GOTO x64
IF "%ARCH%" == "x86" GOTO x86

:x86
SET "PATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\x86;%PATH%"
SET "INCLUDE=%WDKBASEDIR%\inc\api;%WDKBASEDIR%\inc\api\crt\stl70;%WDKBASEDIR%\inc\crt;%WDKBASEDIR%\inc\ddk"
SET "LIB=%WDKBASEDIR%\lib\crt\i386;%WDKBASEDIR%\lib\win7\i386"

TITLE Building Notepad2-mod x86 with WDK...
ECHO. & ECHO.

CALL :SUBNMAKE

IF "%ARCH%" == "x86" GOTO END

:x64
SET "PATH=%WDKBASEDIR%\bin\x86;%WDKBASEDIR%\bin\x86\amd64;%PATH%"
SET "INCLUDE=%WDKBASEDIR%\inc\api;%WDKBASEDIR%\inc\api\crt\stl70;%WDKBASEDIR%\inc\crt;%WDKBASEDIR%\inc\ddk"
SET "LIB=%WDKBASEDIR%\lib\crt\amd64;%WDKBASEDIR%\lib\win7\amd64"

TITLE Building Notepad2-mod x64 with WDK...
ECHO. & ECHO.

CALL :SUBNMAKE "x64=1"

:END
TITLE Building Notepad2-mod with WDK - Finished!
ENDLOCAL
EXIT /B

:SUBNMAKE
nmake /NOLOGO /f "makefile.mak" %BUILDTYPE% %1
IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!"
EXIT /B

:SHOWHELP
TITLE %~nx0 %1
ECHO. & ECHO.
ECHO Usage: %~nx0 [Clean^|Build^|Rebuild] [x86^|x64^|all]
ECHO.
ECHO Notes: You can also prefix the commands with "-", "--" or "/".
ECHO        The arguments are not case sensitive.
ECHO. & ECHO.
ECHO Edit %~nx0 and set your WDK directory or define %%WDKBASEDIR%%.
ECHO You shouldn't need to make any changes other than that.
ECHO. & ECHO.
ECHO Executing %~nx0 without any arguments is equivalent to "%~nx0 build all"
ECHO.
ECHO If you skip the second argument the default one will be used. Example:
ECHO "%~nx0 rebuild" is the same as "%~nx0 rebuild all"
ECHO.
ECHO WARNING: "%~nx0 x86" won't work.
ECHO.
ENDLOCAL
EXIT /B

:SUBMSG
ECHO. & ECHO ______________________________
ECHO [%~1] %~2
ECHO ______________________________ & ECHO.
IF /I "%~1" == "ERROR" (
  PAUSE
  EXIT
) ELSE (
  EXIT /B
)

Remove MSVC 2010 from WDK script.

Remove MSVC 2010 from WDK script.


@echo off
setlocal

rem brief: Compress directory
rem usage: gzipd dir_name

tar -aczf %1.zip %1

endlocal
@echo on

add zipd.bat

[GladiatorTool] add zipd.bat


jpackage --type app-image --name Nightcode --app-version %1 --input target --main-jar Nightcode-%1-windows.jar --icon package/windows/Nightcode.ico --copyright "Public Domain"

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

Update windows package script

Update windows package script


@if "%DEBUG%" == "" @echo off
setlocal
Setlocal EnableDelayedExpansion

set SOURCE_DIR=%CD%
set ZLIB_ZIP=%CD%\cppbuild\zlib1211.zip
set BUILD_DIR=%CD%\cppbuild\Release
set ZLIB_BUILD_DIR=%BUILD_DIR%\zlib-build
set ZLIB_INSTALL_DIR=%BUILD_DIR%\zlib64
set EXTRA_CMAKE_ARGS=-DAERON_SYSTEM_TESTS=OFF

for %%o in (%*) do (

    set PROCESSED=0

    if "%%o"=="--help" (
	    echo cppbuild-vs.cmd [--c-warnings-as-errors] [--cxx-warnings-as-errors] [--build-aeron-driver]
		exit /b
	)

	if "%%o"=="--c-warnings-as-errors" (
	    set EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DC_WARNINGS_AS_ERRORS=ON
		set PROCESSED=1
	)

    if "%%o"=="--cxx-warnings-as-errors" (
	    set EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DCXX_WARNINGS_AS_ERRORS=ON
		set PROCESSED=1
    )

    if "%%o"=="--build-aeron-driver" (
        set EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DBUILD_AERON_DRIVER=ON
	    set PROCESSED=1
	)

	if "%%o"=="--link-samples-client-shared" (
        set EXTRA_CMAKE_ARGS=!EXTRA_CMAKE_ARGS! -DLINK_SAMPLES_CLIENT_SHARED=ON
	    set PROCESSED=1
	)
)

call cppbuild/vs-helper.cmd
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

if EXIST %BUILD_DIR% rd /S /Q %BUILD_DIR%

md %BUILD_DIR%
pushd %BUILD_DIR%
md %ZLIB_BUILD_DIR%
pushd %ZLIB_BUILD_DIR%
7z x %ZLIB_ZIP%
pushd zlib-1.2.11
md build
pushd build

cmake -DCMAKE_INSTALL_PREFIX=%ZLIB_INSTALL_DIR% ..
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

cmake --build . --target install
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

pushd %BUILD_DIR%
cmake %EXTRA_CMAKE_ARGS% %SOURCE_DIR%
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

cmake --build . --config Release
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

ctest -C Release --output-on-failure
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

Replace tabs with spaces

Replace tabs with spaces


# about '|| exit /b' see http://stackoverflow.com/a/21912169

mocha --no-exit --globals s,cooked --reporter spec test/actions.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/application-helpers.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/config-helpers.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/config-watcher.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/cozy-light.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/functional.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/main-app-helpers.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/node-helpers.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/npm-helpers.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/plugin-helpers.js || exit /b

:: about '|| exit /b' see http://stackoverflow.com/a/21912169

mocha --no-exit --globals s,cooked --reporter spec test/actions.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/application-helpers.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/config-helpers.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/config-watcher.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/cozy-light.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/functional.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/main-app-helpers.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/node-helpers.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/npm-helpers.js || exit /b
mocha --no-exit --globals s,cooked --reporter spec test/plugin-helpers.js || exit /b

improve tests

improve tests


@SET CONFIGURATION=Release

"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -latest -property installationPath > temp.txt
set /p $MSBUILDROOT=<temp.txt
del temp.txt

"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationVersion > temp.txt
Rem lower VS version
Rem set /p $MSBUILDVER=<temp.txt
Rem higher/unique VS
for /f "delims==" %%a in (temp.txt) do set $MSBUILDVER=%%a
del temp.txt

for /f "tokens=1 delims=." %%G in ("%$MSBUILDVER%") do set Current=%%G.0
Rem VS2017 => ~\MSBuild\15.0\Bin\MSBuild.exe
Rem VS2019 => ~\MsBuild\Current\Bin\MSBuild.exe
If "%Current%" NEQ "15.0" set Current=Current

@set $MSBUILDPATH="%$MSBUILDROOT%\MsBuild\%Current%\Bin\MSBuild.exe"

%$MSBUILDPATH% YAF.NET-MySql.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Clean,Build /p:WarningLevel=0;CreatePackages=true /flp1:logfile=errors.txt
%$MSBUILDPATH% YAF.NET-PostgreSQL.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Clean,Build /p:WarningLevel=0;CreatePackages=true /flp1:logfile=errors.txt
%$MSBUILDPATH% YAF.NET-Sqlite.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Clean,Build /p:WarningLevel=0;CreatePackages=true /flp1:logfile=errors.txt
%$MSBUILDPATH% YAF.NET-SqlServer.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Clean,Build /p:WarningLevel=0;CreatePackages=true /flp1:logfile=errors.txt

@SET CONFIGURATION=Release

"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -latest -property installationPath > temp.txt
set /p $MSBUILDROOT=<temp.txt
del temp.txt

"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationVersion > temp.txt
Rem lower VS version
Rem set /p $MSBUILDVER=<temp.txt
Rem higher/unique VS
for /f "delims==" %%a in (temp.txt) do set $MSBUILDVER=%%a
del temp.txt

for /f "tokens=1 delims=." %%G in ("%$MSBUILDVER%") do set Current=%%G.0
Rem VS2017 => ~\MSBuild\15.0\Bin\MSBuild.exe
Rem VS2019 => ~\MsBuild\Current\Bin\MSBuild.exe
If "%Current%" NEQ "15.0" set Current=Current

@set $MSBUILDPATH="%$MSBUILDROOT%\MsBuild\%Current%\Bin\MSBuild.exe"

%$MSBUILDPATH% YAF.NET-MySql.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Clean,Build /p:WarningLevel=0;CreatePackages=true /flp1:logfile=errors.txt;errorsonly %1 %2 %3 %4 %5 %6 %7 %8 %9
%$MSBUILDPATH% YAF.NET-PostgreSQL.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Clean,Build /p:WarningLevel=0;CreatePackages=true /flp1:logfile=errors.txt;errorsonly %1 %2 %3 %4 %5 %6 %7 %8 %9
%$MSBUILDPATH% YAF.NET-Sqlite.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Clean,Build /p:WarningLevel=0;CreatePackages=true /flp1:logfile=errors.txt;errorsonly %1 %2 %3 %4 %5 %6 %7 %8 %9
%$MSBUILDPATH% YAF.NET-SqlServer.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Clean,Build /p:WarningLevel=0;CreatePackages=true /flp1:logfile=errors.txt;errorsonly %1 %2 %3 %4 %5 %6 %7 %8 %9

Update BuildPackages.bat

Update BuildPackages.bat


@if "%_echo%"=="" echo off
@rem ===========================================================================================================
@rem Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the Apache License,
@rem               Version 2.0.  See License.txt in the project root for license information.
@rem ===========================================================================================================

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

echo adding required strong name verification skipping, and NGening built binaries
echo Usage:
echo    update.cmd debug   [-ngen]
echo    update.cmd release [-ngen]
exit /b 1

:ok

set BINDIR=%~dp0..\%1\net40\bin

if exist "%WindowsSDK_ExecutablePath_x64%" set WINSDKNETFXTOOLS_X64=%WindowsSDK_ExecutablePath_x64%
if exist "%WindowsSDK_ExecutablePath_x86%" set WINSDKNETFXTOOLS_X86=%WindowsSDK_ExecutablePath_x86%

if not "%WindowsSDK_ExecutablePath_x86%" == "" goto :havesdk

set REGEXE32BIT=reg.exe
if not "%OSARCH%"=="x86" set REGEXE32BIT=%WINDIR%\syswow64\reg.exe

                                FOR /F "tokens=2* delims=	 " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\NETFXSDK\4.6\WinSDK-NetFx40Tools" /v InstallationFolder')  DO SET WINSDKNETFXTOOLS_x86=%%B
if "%WINSDKNETFXTOOLS_x86%"=="" FOR /F "tokens=2* delims=	 " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\Windows\v8.1A\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS_x86=%%B
if "%WINSDKNETFXTOOLS_x86%"=="" FOR /F "tokens=2* delims=	 " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS_x86=%%B
if "%WINSDKNETFXTOOLS_x86%"=="" FOR /F "tokens=2* delims=	 " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\Windows\v7.1\WinSDK-NetFx40Tools" /v InstallationFolder')  DO SET WINSDKNETFXTOOLS_x86=%%B
if "%WINSDKNETFXTOOLS_x86%"=="" FOR /F "tokens=2* delims=	 " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS_x86=%%B

set WINSDKNETFXTOOLS_x64=%WINSDKNETFXTOOLS_x86%x64\

:havesdk
set SN32="%WINSDKNETFXTOOLS_x86%sn.exe"
set SN64="%WINSDKNETFXTOOLS_x64%sn.exe"

set NGEN32=%windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe
set NGEN64=%windir%\Microsoft.NET\Framework64\v4.0.30319\ngen.exe

rem Disable strong-name validation for F# binaries built from open source that are signed with the microsoft key
%SN32% -Vr FSharp.Core,b03f5f7f11d50a3a
%SN32% -Vr FSharp.Build,b03f5f7f11d50a3a
%SN32% -Vr FSharp.Compiler.Interactive.Settings,b03f5f7f11d50a3a
%SN32% -Vr FSharp.Compiler.Hosted,b03f5f7f11d50a3a

%SN32% -Vr fsc,b03f5f7f11d50a3a
%SN32% -Vr fsi,b03f5f7f11d50a3a
%SN32% -Vr FsiAnyCPU,b03f5f7f11d50a3a

%SN32% -Vr FSharp.Compiler,b03f5f7f11d50a3a
%SN32% -Vr FSharp.Compiler.Server.Shared,b03f5f7f11d50a3a
%SN32% -Vr FSharp.Editor,b03f5f7f11d50a3a
%SN32% -Vr FSharp.LanguageService,b03f5f7f11d50a3a
%SN32% -Vr FSharp.LanguageService.Base,b03f5f7f11d50a3a
%SN32% -Vr FSharp.LanguageService.Compiler,b03f5f7f11d50a3a
%SN32% -Vr FSharp.ProjectSystem.Base,b03f5f7f11d50a3a
%SN32% -Vr FSharp.ProjectSystem.FSharp,b03f5f7f11d50a3a
%SN32% -Vr FSharp.ProjectSystem.PropertyPages,b03f5f7f11d50a3a
%SN32% -Vr FSharp.VS.FSI,b03f5f7f11d50a3a
%SN32% -Vr VisualFSharp.Unittests,b03f5f7f11d50a3a
%SN32% -Vr VisualFSharp.Salsa,b03f5f7f11d50a3a
%SN32% -Vr FSharp.Compiler.Unittests,b03f5f7f11d50a3a

if /i "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
    %SN64% -Vr FSharp.Core,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.Build,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.Compiler.Interactive.Settings,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.Compiler.Hosted,b03f5f7f11d50a3a

    %SN64% -Vr fsc,b03f5f7f11d50a3a
    %SN64% -Vr fsi,b03f5f7f11d50a3a
    %SN64% -Vr FsiAnyCPU,b03f5f7f11d50a3a

    %SN64% -Vr FSharp.Compiler,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.Compiler.Server.Shared,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.Editor,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.LanguageService,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.LanguageService.Base,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.LanguageService.Compiler,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.ProjectSystem.Base,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.ProjectSystem.FSharp,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.ProjectSystem.PropertyPages,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.VS.FSI,b03f5f7f11d50a3a
    %SN64% -Vr VisualFSharp.Unittests,b03f5f7f11d50a3a
    %SN64% -Vr VisualFSharp.Salsa,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.Compiler.Unittests,b03f5f7f11d50a3a
)

if /i '%1' == 'signonly' goto :eof
if /i '%1' == 'debug' set NGEN_FLAGS=/Debug

rem NGen fsc, fsi, fsiAnyCpu, and FSharp.Build.dll
if /i not "%2"=="-ngen" goto :donengen

"%NGEN32%" install "%BINDIR%\fsc.exe" %NGEN_FLAGS% /queue:1
"%NGEN32%" install "%BINDIR%\fsi.exe" %NGEN_FLAGS% /queue:1
"%NGEN32%" install "%BINDIR%\FSharp.Build.dll" %NGEN_FLAGS% /queue:1
"%NGEN32%" executeQueuedItems 1

if /i "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
    "%NGEN64%" install "%BINDIR%\fsiAnyCpu.exe" %NGEN_FLAGS% /queue:1
    "%NGEN64%" install "%BINDIR%\FSharp.Build.dll" %NGEN_FLAGS% /queue:1
    "%NGEN64%" executeQueuedItems 1
)

:donengen

@if "%_echo%"=="" echo off
@rem ===========================================================================================================
@rem Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the Apache License,
@rem               Version 2.0.  See License.txt in the project root for license information.
@rem ===========================================================================================================

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

echo adding required strong name verification skipping, and NGening built binaries
echo Usage:
echo    update.cmd debug   [-ngen]
echo    update.cmd release [-ngen]
exit /b 1

:ok

set BINDIR=%~dp0..\%1\net40\bin

if exist "%WindowsSDK_ExecutablePath_x64%" set WINSDKNETFXTOOLS_X64=%WindowsSDK_ExecutablePath_x64%
if exist "%WindowsSDK_ExecutablePath_x86%" set WINSDKNETFXTOOLS_X86=%WindowsSDK_ExecutablePath_x86%

if not "%WindowsSDK_ExecutablePath_x86%" == "" goto :havesdk

set REGEXE32BIT=reg.exe
if not "%OSARCH%"=="x86" set REGEXE32BIT=%WINDIR%\syswow64\reg.exe

                                FOR /F "tokens=2* delims=	 " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\NETFXSDK\4.6.2\WinSDK-NetFx40Tools" /v InstallationFolder')  DO SET WINSDKNETFXTOOLS_x86=%%B
                                FOR /F "tokens=2* delims=	 " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\NETFXSDK\4.6.1\WinSDK-NetFx40Tools" /v InstallationFolder')  DO SET WINSDKNETFXTOOLS_x86=%%B
                                FOR /F "tokens=2* delims=	 " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\NETFXSDK\4.6\WinSDK-NetFx40Tools" /v InstallationFolder')  DO SET WINSDKNETFXTOOLS_x86=%%B
if "%WINSDKNETFXTOOLS_x86%"=="" FOR /F "tokens=2* delims=	 " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\Windows\v8.1A\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS_x86=%%B
if "%WINSDKNETFXTOOLS_x86%"=="" FOR /F "tokens=2* delims=	 " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS_x86=%%B
if "%WINSDKNETFXTOOLS_x86%"=="" FOR /F "tokens=2* delims=	 " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\Windows\v7.1\WinSDK-NetFx40Tools" /v InstallationFolder')  DO SET WINSDKNETFXTOOLS_x86=%%B
if "%WINSDKNETFXTOOLS_x86%"=="" FOR /F "tokens=2* delims=	 " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS_x86=%%B

set WINSDKNETFXTOOLS_x64=%WINSDKNETFXTOOLS_x86%x64\

:havesdk
set SN32="%WINSDKNETFXTOOLS_x86%sn.exe"
set SN64="%WINSDKNETFXTOOLS_x64%sn.exe"

set NGEN32=%windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe
set NGEN64=%windir%\Microsoft.NET\Framework64\v4.0.30319\ngen.exe

rem Disable strong-name validation for F# binaries built from open source that are signed with the microsoft key
%SN32% -Vr FSharp.Core,b03f5f7f11d50a3a
%SN32% -Vr FSharp.Build,b03f5f7f11d50a3a
%SN32% -Vr FSharp.Compiler.Interactive.Settings,b03f5f7f11d50a3a
%SN32% -Vr FSharp.Compiler.Hosted,b03f5f7f11d50a3a

%SN32% -Vr fsc,b03f5f7f11d50a3a
%SN32% -Vr fsi,b03f5f7f11d50a3a
%SN32% -Vr FsiAnyCPU,b03f5f7f11d50a3a

%SN32% -Vr FSharp.Compiler,b03f5f7f11d50a3a
%SN32% -Vr FSharp.Compiler.Server.Shared,b03f5f7f11d50a3a
%SN32% -Vr FSharp.Editor,b03f5f7f11d50a3a
%SN32% -Vr FSharp.LanguageService,b03f5f7f11d50a3a
%SN32% -Vr FSharp.LanguageService.Base,b03f5f7f11d50a3a
%SN32% -Vr FSharp.LanguageService.Compiler,b03f5f7f11d50a3a
%SN32% -Vr FSharp.ProjectSystem.Base,b03f5f7f11d50a3a
%SN32% -Vr FSharp.ProjectSystem.FSharp,b03f5f7f11d50a3a
%SN32% -Vr FSharp.ProjectSystem.PropertyPages,b03f5f7f11d50a3a
%SN32% -Vr FSharp.VS.FSI,b03f5f7f11d50a3a
%SN32% -Vr VisualFSharp.Unittests,b03f5f7f11d50a3a
%SN32% -Vr VisualFSharp.Salsa,b03f5f7f11d50a3a
%SN32% -Vr FSharp.Compiler.Unittests,b03f5f7f11d50a3a

if /i "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
    %SN64% -Vr FSharp.Core,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.Build,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.Compiler.Interactive.Settings,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.Compiler.Hosted,b03f5f7f11d50a3a

    %SN64% -Vr fsc,b03f5f7f11d50a3a
    %SN64% -Vr fsi,b03f5f7f11d50a3a
    %SN64% -Vr FsiAnyCPU,b03f5f7f11d50a3a

    %SN64% -Vr FSharp.Compiler,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.Compiler.Server.Shared,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.Editor,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.LanguageService,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.LanguageService.Base,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.LanguageService.Compiler,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.ProjectSystem.Base,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.ProjectSystem.FSharp,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.ProjectSystem.PropertyPages,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.VS.FSI,b03f5f7f11d50a3a
    %SN64% -Vr VisualFSharp.Unittests,b03f5f7f11d50a3a
    %SN64% -Vr VisualFSharp.Salsa,b03f5f7f11d50a3a
    %SN64% -Vr FSharp.Compiler.Unittests,b03f5f7f11d50a3a
)

if /i '%1' == 'signonly' goto :eof
if /i '%1' == 'debug' set NGEN_FLAGS=/Debug

rem NGen fsc, fsi, fsiAnyCpu, and FSharp.Build.dll
if /i not "%2"=="-ngen" goto :donengen

"%NGEN32%" install "%BINDIR%\fsc.exe" %NGEN_FLAGS% /queue:1
"%NGEN32%" install "%BINDIR%\fsi.exe" %NGEN_FLAGS% /queue:1
"%NGEN32%" install "%BINDIR%\FSharp.Build.dll" %NGEN_FLAGS% /queue:1
"%NGEN32%" executeQueuedItems 1

if /i "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
    "%NGEN64%" install "%BINDIR%\fsiAnyCpu.exe" %NGEN_FLAGS% /queue:1
    "%NGEN64%" install "%BINDIR%\FSharp.Build.dll" %NGEN_FLAGS% /queue:1
    "%NGEN64%" executeQueuedItems 1
)

:donengen

Update update.cmd to support win sdk 10

Update update.cmd to support win sdk 10


@echo ON

set FFMPEG_FN=ffmpeg-%PKG_VERSION%-win%ARCH%

rem On a version update, change the following SHA256 hashes (win32 and win64)
if %ARCH% == 32 (
    set FFMPEG_SHA256="SHA256(%FFMPEG_FN%-dev.zip)= 30e47528f8d16b4365ccbe76dc8ccfa145930064e7a496495a3e805d225b5801"
) else (
    set FFMPEG_SHA256="SHA256(%FFMPEG_FN%-dev.zip)= 3486b694cf92b1480c53609cc3695b5f0b53cbc7c1894170fe60575b707fd300"
)

rem Download the source and check the SHA256
cd %SRC_DIR%
curl -L -O "https://ffmpeg.zeranoe.com/builds/win%ARCH%/dev/%FFMPEG_FN%-dev.zip"
openssl dgst -sha256 -out sha256.out %FFMPEG_FN%-dev.zip
SET /p DOWNLOADED_SHA256=<sha256.out
if NOT "%DOWNLOADED_SHA256%" == %FFMPEG_SHA256% (
    exit 1
)

rem Extract the archive
7za x %FFMPEG_FN%-dev.zip

rem Copy over the bin, include and lib dirs
robocopy %SRC_DIR%\bin\ %LIBRARY_BIN%\ *.* /E
if %ERRORLEVEL% GEQ 8 exit 1

robocopy %SRC_DIR%\%FFMPEG_FN%-dev\include\ %LIBRARY_INC%\ *.* /E
if %ERRORLEVEL% GEQ 8 exit 1

robocopy %SRC_DIR%\%FFMPEG_FN%-dev\lib\ %LIBRARY_LIB%\ *.* /E
if %ERRORLEVEL% GEQ 8 exit 1

rem Add the licences to the recipe directory
copy "%SRC_DIR%\README.txt" "%RECIPE_DIR%"
mkdir "%RECIPE_DIR%\licenses"
copy "%SRC_DIR%\licenses" "%RECIPE_DIR%\licenses"

exit 0

@echo ON

set FFMPEG_FN=ffmpeg-%PKG_VERSION%-win%ARCH%

rem On a version update, change the following SHA256 hashes (win32 and win64)
if %ARCH% == 32 (
    set FFMPEG_SHA256="SHA256(%FFMPEG_FN%-dev.zip)= 2cfc802561d68e58ba3185276d244eac3a6163998ab3ea9b8fa457b077a8d7c8"
) else (
    set FFMPEG_SHA256="SHA256(%FFMPEG_FN%-dev.zip)= 21be6704bd57497ee2307646002e4aac0d496d7dc72dceb4847e9e6c0be257bf"
)

rem Download the source and check the SHA256
cd %SRC_DIR%
curl -L -O "https://ffmpeg.zeranoe.com/builds/win%ARCH%/dev/%FFMPEG_FN%-dev.zip"
openssl dgst -sha256 -out sha256.out %FFMPEG_FN%-dev.zip
SET /p DOWNLOADED_SHA256=<sha256.out
if NOT "%DOWNLOADED_SHA256%" == %FFMPEG_SHA256% (
    exit 1
)

rem Extract the archive
7za x %FFMPEG_FN%-dev.zip

rem Copy over the bin, include and lib dirs
robocopy %SRC_DIR%\bin\ %LIBRARY_BIN%\ *.* /E
if %ERRORLEVEL% GEQ 8 exit 1

robocopy %SRC_DIR%\%FFMPEG_FN%-dev\include\ %LIBRARY_INC%\ *.* /E
if %ERRORLEVEL% GEQ 8 exit 1

robocopy %SRC_DIR%\%FFMPEG_FN%-dev\lib\ %LIBRARY_LIB%\ *.* /E
if %ERRORLEVEL% GEQ 8 exit 1

rem Add the licences to the recipe directory
copy "%SRC_DIR%\README.txt" "%RECIPE_DIR%"
mkdir "%RECIPE_DIR%\licenses"
copy "%SRC_DIR%\licenses" "%RECIPE_DIR%\licenses"

exit 0

Update bld.bat

Update bld.bat


@echo off
SET STATUS=,
:START:
python.exe mcedit.py
ECHO.
ECHO ^|-----------------^|
ECHO ^|Mcedit Terminated^|
ECHO ^|-----------------^|
ECHO.
SET /P K=Press R or Enter to restart MCEdit%STATUS% any other key to exit:
IF /I %K%==R GOTO CLEAR

GOTO EXIT

:CLEAR:
CLS
SET STATUS= again,
GOTO START

:EXIT:

@echo off
SET STATUS=,
:START:
python.exe mcedit.py
ECHO.
ECHO ^|-----------------^|
ECHO ^|Mcedit Terminated^|
ECHO ^|-----------------^|
ECHO.
SET K==R
SET /P K=Press R or Enter to restart MCEdit%STATUS% any other key to exit:
IF /I %K%==R GOTO CLEAR

GOTO EXIT

:CLEAR:
CLS
SET STATUS= again,
GOTO START

:EXIT:

Improve bat not accepting enter first loop


rem PeopleTool Patching 11/5/2019
@echo off
@echo Stop Processes > e:\temp\ps_patching.log
call net stop "ORACLE ProcMGR V12.2.2.0.0_VS2015"
call net stop "psHRPROD-WebLogicAdmin"
call net stop "psPORTPROD-WebLogicAdmin"
call net stop "psTAMPROD-WebLogicAdmin"
call net stop "psELMPROD-WebLogicAdmin"
call net stop "psHRPROD-PIA"
call net stop "psPORTPROD-PIA"
call net stop "psTAMPROD-PIA"
call net stop "psELMPROD-PIA"
timeout 10
@echo Download Files >> e:\temp\ps_patching.log
aws s3 cp s3://cap-sw/Windows/7zip/7z920.exe e:\temp\
aws s3 cp "s3://cap-sw/Java/pt-jdk8 (8u231).zip" e:\temp\jdk8.zip
aws s3 cp s3://cap-sw/Oracle/weblogic/patch/12.2.1.3.0/p30386660_122130_Generic.zip e:\temp\
cd e:\temp
@echo Install 7zip >> e:\temp\ps_patching.log
call "e:\temp\7z920.exe" /S /D="C:\Program Files (x86)\7-Zip"
timeout 5
@echo Extract Files >> e:\temp\ps_patching.log
call "C:\Program Files (x86)\7-Zip\7z.exe" x E:\temp\p30386660_122130_Generic.zip
call "C:\Program Files (x86)\7-Zip\7z.exe" x -oE:\pt857\pt\jdk8 -y E:\temp\jdk8.zip
timeout 5
@echo Uninstall 7zip >> e:\temp\ps_patching.log
call "C:\Program Files (x86)\7-Zip\Uninstall.exe" /S
timeout 5
cd e:\temp\30386660
@echo Apply Patch >> e:\temp\ps_patching.log
call "e:\pt857\pt\bea\OPatch\opatch.bat" apply -oh e:\pt857\pt\bea -silent >> e:\temp\ps_patching.log
timeout 10
@echo Remove Files >> e:\temp\ps_patching.log
del E:\temp\7z920.exe
del E:\temp\jdk8.zip
del E:\temp\p30386660_122130_Generic.zip
timeout 5
rmdir /S /Q e:\temp\30386660
cd e:\pt857\pt\bea\opatch
call "e:\pt857\pt\bea\opatch\opatch.bat" lsinventory -oh e:\pt857\pt\bea >> e:\temp\ps_patching.log

Create ps_patching.bat

Create ps_patching.bat


if not exist .git exit 1
git describe
if errorlevel 1 exit 1
for /f "delims=" %%i in ('git describe') do set gitdesc=%%i
if errorlevel 1 exit 1
echo "%gitdesc%"
if not "%gitdesc%"=="1.8.1" exit 1
set PYTHONPATH=.
python -c "import conda_build; assert conda_build.__version__ == '1.8.1', conda_build.__version__"
if errorlevel 1 exit 1

if not exist .git exit 1
git describe
if errorlevel 1 exit 1
for /f "delims=" %%i in ('git describe') do set gitdesc=%%i
if errorlevel 1 exit 1
echo "%gitdesc%"
if not "%gitdesc%"=="1.8.1" exit 1
git status
if errorlevel 1 exit 1
set PYTHONPATH=.
python -c "import conda_build; assert conda_build.__version__ == '1.8.1', conda_build.__version__"
if errorlevel 1 exit 1

Add git status debug output to test

Add git status debug output to test


@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.25.4 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.25.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.25.4
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.0 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.0 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.0
)

set encoding=utf-8
"%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %*

popd

@echo off

pushd %~dp0

SET PACKAGEPATH=.\packages\
SET NUGET=.\tools\nuget\NuGet.exe
SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion

IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.25.4 (
  RD /S/Q %PACKAGEPATH%FAKE
  %NUGET% install FAKE -Version 4.25.4 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE\Ver_4.25.4
)

IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.3 (
  RD /S/Q %PACKAGEPATH%FAKE.BuildLib
  %NUGET% install FAKE.BuildLib -Version 0.3.3 %NUGETOPTIONS%
  COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.3
)

set encoding=utf-8
"%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %*

popd

Use BuildLib 0.3.3

Use BuildLib 0.3.3


rem @echo off

@echo on
pushd %~dp0
set "KRE_NUGET_API_URL=https://www.nuget.org/api/v2"
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.ps1'))"

set PATH=%PATH%;%userprofile%\.k\bin
set KRE_HOME=%USERPROFILE%\.k
set
call kvm install 1.0.0-beta3
call kvm use 1.0.0-beta3
call kvm list
rem set the runtime path because the above commands set \.k<space>\runtimes
set PATH=%USERPROFILE%\.k\runtimes\kre-clr-win-x86.1.0.0-beta3\bin;%PATH%
call kpm restore
cd tests\OmniSharp.Tests
k test
cd ..\OmniSharp.Stdio.Tests
k test
cd ..\..
call kpm bundle src\OmniSharp --no-source --out artifacts\build\omnisharp --runtime kre-clr-win-x86.1.0.0-beta3

popd

@echo off

pushd %~dp0
set "KRE_NUGET_API_URL=https://www.nuget.org/api/v2"
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.ps1'))"

set PATH=%PATH%;%userprofile%\.k\bin
set KRE_HOME=%USERPROFILE%\.k

call kvm install 1.0.0-beta3
call kvm use 1.0.0-beta3
rem set the runtime path because the above commands set \.k<space>\runtimes
set PATH=%USERPROFILE%\.k\runtimes\kre-clr-win-x86.1.0.0-beta3\bin;%PATH%
call kpm restore
cd tests\OmniSharp.Tests
call k test
cd ..\OmniSharp.Stdio.Tests
call k test
cd ..\..
call kpm bundle src\OmniSharp --no-source --out artifacts\build\omnisharp --runtime kre-clr-win-x86.1.0.0-beta3

popd

tidy up

tidy up


rem Make Geo::GDAL Perl Binding
rem  steps courtesy Anderson Ku
rem Update base paths to match your system

set PERL_ROOT=C:\berrybrew\5.24.0_64_PDL
set GDAL_ROOT=C:\gdal_builds\gdal-2.1.2
set MSYS_ROOT=C:\msys64
set PATH=%PERL_ROOT%\c\bin;%PERL_ROOT%\perl\bin;%MSYS_ROOT%\usr\bin;%PATH%
set CPATH=%PERL_ROOT%\c\include;%PERL_ROOT%\perl\lib\CORE;%GDAL_ROOT%\port;%GDAL_ROOT%\gcore;%GDAL_ROOT%\ogr;%GDAL_ROOT%\alg;%GDAL_ROOT%\apps;%PERL_ROOT%\c\x86_64-w64-mingw32\include\c++;

call make clean
perl Makefile.PL MAKE=gmake --gdal-config=%GDAL_ROOT%/apps/gdal-config --no-version-check --gdal-source-tree=%GDAL_ROOT%

:: Redundant now we add include\c++ to CPATH
:: SWL: should perlify these
:: sed -i -e 's^|^^#include ^<iostream^>^|^/^/#include ^<iostream^>^|' *wrap.cpp
:: sed -i -e 's^|^^void VSIStdoutUnsetRedirection()^|#undef fwrite\nvoid VSIStdoutUnsetRedirection()^|' *wrap.cpp

:: Redundant when using gmake
::  definitely need to perlify these, as the third one does not run under windows:
:: sed -i -e 's/RANLIB = rem/RANLIB = ranlib/' Makefile_*
:: sed -i -e 's/NOOP = rem/NOOP =/' Makefile_*
:: sed -i -e 's|DIRFILESEP = \\|DIRFILESEP = /|' Makefile_*

call make
call make test
:: call make install
:: call prove

rem Make Geo::GDAL Perl Binding
rem  steps courtesy Anderson Ku
rem Update base paths to match your system

set PERL_ROOT=C:\berrybrew\5.24.0_64_PDL
set GDAL_ROOT=C:\gdal_builds\gdal-2.1.2
set MSYS_ROOT=C:\msys64
set PATH=%PERL_ROOT%\c\bin;%PERL_ROOT%\perl\bin;%MSYS_ROOT%\usr\bin;%PATH%
set CPATH=%PERL_ROOT%\c\include;%PERL_ROOT%\perl\lib\CORE;%GDAL_ROOT%\port;%GDAL_ROOT%\gcore;%GDAL_ROOT%\ogr;%GDAL_ROOT%\alg;%GDAL_ROOT%\apps;%PERL_ROOT%\c\x86_64-w64-mingw32\include\c++;

call make clean
perl Makefile.PL MAKE=gmake --gdal-config=%GDAL_ROOT%/apps/gdal-config --no-version-check --gdal-source-tree=%GDAL_ROOT%

:: Redundant now we add include\c++ to CPATH
:: SWL: should perlify these
:: sed -i -e 's^|^^#include ^<iostream^>^|^/^/#include ^<iostream^>^|' *wrap.cpp
:: sed -i -e 's^|^^void VSIStdoutUnsetRedirection()^|#undef fwrite\nvoid VSIStdoutUnsetRedirection()^|' *wrap.cpp

:: Redundant when using gmake
::  definitely need to perlify these, as the third one does not run under windows:
:: sed -i -e 's/RANLIB = rem/RANLIB = ranlib/' Makefile_*
:: sed -i -e 's/NOOP = rem/NOOP =/' Makefile_*
:: sed -i -e 's|DIRFILESEP = \\|DIRFILESEP = /|' Makefile_*

rem YOU NEED TO EDIT make.bat to use gmake instead of dmake
call make
call make test
:: call make install
:: call prove

Add one comment

Add one comment


@echo off
powershell -ExecutionPolicy ByPass -File downloadDependencies.ps1 -vsGenerator "Visual Studio 16 2019"
powershell -ExecutionPolicy ByPass -File generateProject.ps1 -vsGenerator "Visual Studio 16 2019"
cmake --build csound-vs --config RelWithDebInfo

@echo off
powershell -ExecutionPolicy ByPass -File downloadDependencies.ps1 -vsGenerator "Visual Studio 16 2019"
powershell -ExecutionPolicy ByPass -File generateProject.ps1 -vsGenerator "Visual Studio 16 2019"
cmake --build csound-vs --config Release

build Release by default to match Appveyor build


powershell -Command "(gc .build/projects/vs2015/unit_test.vcxproj) -replace '<ExceptionHandling>false', '<ExceptionHandling>Sync' | Out-File -encoding UTF8 .build/projects/vs2015/unit_test.vcxproj"
powershell -Command "(gc .build/projects/vs2015/unit_test.vcxproj) -replace '<RuntimeTypeInfo>false', '<RuntimeTypeInfo>true' | Out-File -encoding UTF8 .build/projects/vs2015/unit_test.vcxproj"

powershell -Command "(gc .build/projects/%1/unit_test.vcxproj) -replace '<ExceptionHandling>false', '<ExceptionHandling>Sync' | Out-File -encoding UTF8 .build/projects/%1/unit_test.vcxproj"
powershell -Command "(gc .build/projects/%1/unit_test.vcxproj) -replace '<RuntimeTypeInfo>false', '<RuntimeTypeInfo>true' | Out-File -encoding UTF8 .build/projects/%1/unit_test.vcxproj"

Add toolset as commandline parameter

Add toolset as commandline parameter


nuget pack Kirkin.nuspec -Build -IncludeReferencedProjects -Properties Configuration=Release;Platform=AnyCPU
nuget pack Kirkin.Sources.nuspec -IncludeReferencedProjects

nuget pack Kirkin.nuspec -IncludeReferencedProjects -Properties Configuration=Release;Platform=AnyCPU
nuget pack Kirkin.Sources.nuspec -IncludeReferencedProjects

Remove -Build arg from pack.bat as it is ignored


echo off

echo Check command line parameter
echo html directory: %1
set htmldir=%1
echo wikijournals directory: %2
set wikidir=%2
echo dbuser: %3
set dbuser=%3
echo dbpass: %4
set dbpass=%4
echo dbserver: %5
set dbserver=%5
echo dbname: %6
set dbname=%6
echo wikiuser: %7
set wikiuser=%7
echo wikipwd: %8
set wikipwd=%8
echo wikiname: %9
set wikiname=%9

set PROJECTDIR="%cd%"

echo Download Mediawiki
set MEDIAWIKIVERSION=1.31.1
set MEDIAWIKIURL=https://releases.wikimedia.org/mediawiki/1.31/mediawiki-%MEDIAWIKIVERSION%.tar.gz
set MEDIAWIKIDIR=mediawiki-%MEDIAWIKIVERSION%
cd %1
curl %MEDIAWIKIURL% --output wikijournals.tar.gz

echo Uncompress Mediawiki into wikijournals directory
tar -xvzf wikijournals.tar.gz
ren %MEDIAWIKIDIR% %2

echo Install Mediawiki
cd %1/%2/maintenance
call php install.php --dbuser=%dbuser% --dbpass=%dbpass% --dbserver=%dbserver% --dbname=%dbname% --dbtype=mysql --installdbpass=%dbpass% --installdbuser=%dbuser% --lang=da --pass=%wikipwd% --scriptpath=/%wikidir%  %wikiname% %wikiuser%
call "%PROJECTDIR%/tools/fnr.exe" --cl --dir "%1\%2" --fileMask "LocalSettings.php" --excludeFileMask "*.dll, *.exe" --includeSubDirectories --find "$wgLanguageCode = ""en"";" --replace "$wgLanguageCode = ""de"";"
cd ..

echo Install foreground
cd skins
git clone https://github.com/thingles/foreground.git
cd ..

cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticDrilldown.git
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PageForms

cd ..

echo Install Semantic Mediawiki
call composer require mediawiki/semantic-media-wiki "3.0.1"

echo Zwschenupdate
cd maintenance
call php update.php
cd ..

cd extensions

echo Install SMW Extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticInternalObjects.git
cd ..

echo Install Maps
call composer require mediawiki/maps "7.1.0"

echo Install Semantic Result Formats
call composer require mediawiki/semantic-result-formats "3.0.0"

echo Install Semantic Compound Queries
call composer require mediawiki/semantic-compound-queries "2.0.0"

cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AdminLinks.git
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/DataTransfer.git
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ExternalData.git
git clone https://phabricator.wikimedia.org/diffusion/EHET/extension-headertabs.git
ren extension-headertabs HeaderTabs
git clone https://phabricator.wikimedia.org/diffusion/EMYV/extension-myvariables.git
ren extension-myvariables MyVariables
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PageSchemas.git
git clone https://phabricator.wikimedia.org/diffusion/EVAR/extension-variables.git
ren extension-variables Variables
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Widgets.git

cd Widgets
git submodule init
git submodule update

echo Update LocalSetting.php
cd ..\..
type LocalSettings.php %PROJECTDIR%\configExtensions.txt > LocalSettings.bak
del LocalSettings.php
ren LocalSettings.bak LocalSettings.php
call "%PROJECTDIR%/tools/fnr.exe" --cl --dir "%1\%2" --fileMask "LocalSettings.php" --excludeFileMask "*.dll, *.exe" --includeSubDirectories --find "$wgDefaultSkin = ""vector"";" --replace "$wgDefaultSkin = ""foreground"";"
cd maintenance
call php update.php

echo Install Wikijournals Structure
call php importDump.php < %PROJECTDIR%/wikijournals_structure/wikijournalsStructure.xml

cd %PROJECTDIR%

echo off

echo Check command line parameter
echo html directory: %1
set htmldir=%1
echo wikijournals directory: %2
set wikidir=%2
echo dbuser: %3
set dbuser=%3
echo dbpass: %4
set dbpass=%4
echo dbserver: %5
set dbserver=%5
echo dbname: %6
set dbname=%6
echo wikiuser: %7
set wikiuser=%7
echo wikipwd: %8
set wikipwd=%8
echo wikiname: %9
set wikiname=%9

set PROJECTDIR="%cd%"

echo Download Mediawiki
set MEDIAWIKIVERSION=1.31.1
set MEDIAWIKIURL=https://releases.wikimedia.org/mediawiki/1.31/mediawiki-%MEDIAWIKIVERSION%.tar.gz
set MEDIAWIKIDIR=mediawiki-%MEDIAWIKIVERSION%
cd %1
curl %MEDIAWIKIURL% --output wikijournals.tar.gz

echo Uncompress Mediawiki into wikijournals directory
tar -xvzf wikijournals.tar.gz
ren %MEDIAWIKIDIR% %2
del wikijournals.tar.gz

echo Install Mediawiki
cd %1/%2/maintenance
call php install.php --dbuser=%dbuser% --dbpass=%dbpass% --dbserver=%dbserver% --dbname=%dbname% --dbtype=mysql --installdbpass=%dbpass% --installdbuser=%dbuser% --lang=da --pass=%wikipwd% --scriptpath=/%wikidir%  %wikiname% %wikiuser%
call "%PROJECTDIR%/tools/fnr.exe" --cl --dir "%1\%2" --fileMask "LocalSettings.php" --excludeFileMask "*.dll, *.exe" --includeSubDirectories --find "$wgLanguageCode = ""en"";" --replace "$wgLanguageCode = ""de"";"
cd ..

echo Install foreground
cd skins
git clone https://github.com/thingles/foreground.git
cd ..

cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticDrilldown.git
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PageForms

cd ..

echo Install Semantic Mediawiki
call composer require mediawiki/semantic-media-wiki "3.0.1"

echo Zwschenupdate
cd maintenance
call php update.php
cd ..

cd extensions

echo Install SMW Extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticInternalObjects.git
cd ..

echo Install Maps
call composer require mediawiki/maps "7.1.0"

echo Install Semantic Result Formats
call composer require mediawiki/semantic-result-formats "3.0.0"

echo Install Semantic Compound Queries
call composer require mediawiki/semantic-compound-queries "2.0.0"

cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AdminLinks.git
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/DataTransfer.git
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ExternalData.git
git clone https://phabricator.wikimedia.org/diffusion/EHET/extension-headertabs.git
ren extension-headertabs HeaderTabs
git clone https://phabricator.wikimedia.org/diffusion/EMYV/extension-myvariables.git
ren extension-myvariables MyVariables
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PageSchemas.git
git clone https://phabricator.wikimedia.org/diffusion/EVAR/extension-variables.git
ren extension-variables Variables
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Widgets.git

cd Widgets
git submodule init
git submodule update

echo Update LocalSetting.php
cd ..\..
type LocalSettings.php %PROJECTDIR%\configExtensions.txt > LocalSettings.bak
del LocalSettings.php
ren LocalSettings.bak LocalSettings.php
call "%PROJECTDIR%/tools/fnr.exe" --cl --dir "%1\%2" --fileMask "LocalSettings.php" --excludeFileMask "*.dll, *.exe" --includeSubDirectories --find "$wgDefaultSkin = ""vector"";" --replace "$wgDefaultSkin = ""foreground"";"
cd maintenance
call php update.php

echo Install Wikijournals Structure
call php importDump.php < %PROJECTDIR%/wikijournals_structure/wikijournalsStructure.xml

cd %PROJECTDIR%

Delete mediawiki package after installation


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

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

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

:: Change the prompt style
:: Mmm tasty lamb
@prompt $E[1;32;40m$P$S{git}{hg}$S$_$E[1;30;40m{lamb}$S$E[0m

:: Pick right version of clink
@if "%PROCESSOR_ARCHITECTURE%"=="x86" (
    set architecture=86
) else (
    set architecture=64
)

:: Run clink
@"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\vendor"

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

:: Check if msysgit is installed
@if exist "%ProgramFiles%\Git" (
    set "GIT_INSTALL_ROOT=%ProgramFiles%\Git"
) else if exist "%ProgramFiles(x86)%\Git" (
    set "GIT_INSTALL_ROOT=%ProgramFiles(x86)%\Git"
) else if exist "%USERPROFILE%\AppData\Local\Programs\Git" (
    set "GIT_INSTALL_ROOT=%USERPROFILE%\AppData\Local\Programs\Git"
) else if exist "%CMDER_ROOT%\vendor\git-for-windows" (
    set "GIT_INSTALL_ROOT=%CMDER_ROOT%\vendor\git-for-windows"
)

:: Add git to the path
@if defined GIT_INSTALL_ROOT (
    set "PATH=%GIT_INSTALL_ROOT%\bin;%GIT_INSTALL_ROOT%\usr\bin;%GIT_INSTALL_ROOT%\usr\share\vim\vim74;%PATH%"
    :: 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"
)

:: Enhance Path
@set PATH=%CMDER_ROOT%\bin;%PATH%;%CMDER_ROOT%\

:: make sure we have an example file
@if not exist "%CMDER_ROOT%\config\aliases" (
    echo Creating intial aliases in %CMDER_ROOT%\config\aliases
    copy "%CMDER_ROOT%\vendor\aliases.example" "%CMDER_ROOT%\config\aliases" > null
)

:: Add aliases
@doskey /macrofile="%CMDER_ROOT%\config\aliases"

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

:: Set home path
@if not defined HOME set HOME=%USERPROFILE%

@if defined CMDER_START (
    @cd /d "%CMDER_START%"
) else (
    @if "%CD%\" == "%CMDER_ROOT%\" (
        @cd /d "%HOME%"
    )
)

@if exist "%CMDER_ROOT%\config\user-profile.cmd" (
    @rem create this file and place your own command in there
    call "%CMDER_ROOT%\config\user-profile.cmd"
) else (
    @echo Creating user startup file: "%CMDER_ROOT%\config\user-profile.cmd"
    (
    @echo :: use this file to run your own startup commands
    @echo :: use @ in front of the command to prevent printing the command
    @echo.
    @echo :: @call "%%GIT_INSTALL_ROOT%%/cmd/start-ssh-agent.cmd
    @echo :: @set PATH=%%CMDER_ROOT%%\vendor\whatever;%%PATH%%
    @echo.
    ) > "%CMDER_ROOT%\config\user-profile.cmd"
)

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

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

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

:: Change the prompt style
:: Mmm tasty lamb
@prompt $E[1;32;40m$P$S{git}{hg}$S$_$E[1;30;40m{lamb}$S$E[0m

:: Pick right version of clink
@if "%PROCESSOR_ARCHITECTURE%"=="x86" (
    set architecture=86
) else (
    set architecture=64
)

:: Run clink
@"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\vendor"

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

:: Check if msysgit is installed
@if exist "%ProgramFiles%\Git" (
    set "GIT_INSTALL_ROOT=%ProgramFiles%\Git"
) else if exist "%ProgramFiles(x86)%\Git" (
    set "GIT_INSTALL_ROOT=%ProgramFiles(x86)%\Git"
) else if exist "%USERPROFILE%\AppData\Local\Programs\Git" (
    set "GIT_INSTALL_ROOT=%USERPROFILE%\AppData\Local\Programs\Git"
) else if exist "%CMDER_ROOT%\vendor\git-for-windows" (
    set "GIT_INSTALL_ROOT=%CMDER_ROOT%\vendor\git-for-windows"
)

:: Add git to the path
@if defined GIT_INSTALL_ROOT (
    set "PATH=%GIT_INSTALL_ROOT%\bin;%GIT_INSTALL_ROOT%\usr\bin;%GIT_INSTALL_ROOT%\usr\share\vim\vim74;%PATH%"
    :: 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"
)

:: Enhance Path
@set "PATH=%CMDER_ROOT%\bin;%PATH%;%CMDER_ROOT%\"

:: make sure we have an example file
@if not exist "%CMDER_ROOT%\config\aliases" (
    echo Creating intial aliases in %CMDER_ROOT%\config\aliases
    copy "%CMDER_ROOT%\vendor\aliases.example" "%CMDER_ROOT%\config\aliases" > null
)

:: Add aliases
@doskey /macrofile="%CMDER_ROOT%\config\aliases"

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

:: Set home path
@if not defined HOME set HOME=%USERPROFILE%

@if defined CMDER_START (
    @cd /d "%CMDER_START%"
) else (
    @if "%CD%\" == "%CMDER_ROOT%\" (
        @cd /d "%HOME%"
    )
)

@if exist "%CMDER_ROOT%\config\user-profile.cmd" (
    @rem create this file and place your own command in there
    call "%CMDER_ROOT%\config\user-profile.cmd"
) else (
    @echo Creating user startup file: "%CMDER_ROOT%\config\user-profile.cmd"
    (
    @echo :: use this file to run your own startup commands
    @echo :: use @ in front of the command to prevent printing the command
    @echo.
    @echo :: @call "%%GIT_INSTALL_ROOT%%/cmd/start-ssh-agent.cmd
    @echo :: @set PATH=%%CMDER_ROOT%%\vendor\whatever;%%PATH%%
    @echo.
    ) > "%CMDER_ROOT%\config\user-profile.cmd"
)

Fix vendor/init.bat when the PATH contains spaces.