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

mkdir %copy_dir%

conda create ^
 -p %conda_env% ^
 freecad libredwg calculix gitpython gmsh netgen=6.2.1808 ^
 numpy matplotlib-base scipy=1.4.1 sympy pandas pythonocc-core six ^
 pyyaml opencamlib ifcopenshell openglider ^
 freecad.asm3 libredwg pycollada ^
 lxml xlutils olefile requests ^
 blinker opencv qt.py nine docutils ^
 --copy ^
 -c freecad/label/dev ^
 -c conda-forge ^
 -y

if errorlevel 1 exit 1

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
robocopy %conda_env%\Library\mingw-w64\bin * %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
rename %copy_dir%\bin\Lib\ssl.py ssl-orig.py
copy ssl-patch.py %copy_dir%\bin\Lib\ssl.py
%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

REM mpmath PY3.8 fix:
del FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64/bin/Lib/site-packages/mpmath/ctx_mp_python.py
copy ../modifications/ctx_mp_python.py FreeCAD_%fcver:~0,10%-Win-Conda_vc14.x-x86_64/bin/Lib/site-packages/mpmath/ctx_mp_python.py

if errorlevel1 exit 1

"%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\ -bb
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 netgen=6.2.1808 ^
 numpy matplotlib-base scipy=1.4.1 sympy pandas pythonocc-core six ^
 pyyaml opencamlib ifcopenshell openglider ^
 freecad.asm3 libredwg pycollada ^
 lxml xlutils olefile requests ^
 blinker opencv qt.py nine docutils ^
 --copy ^
 -c freecad/label/dev ^
 -c conda-forge ^
 -y

if errorlevel 1 exit 1

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
robocopy %conda_env%\Library\mingw-w64\bin * %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
REM Apply Patches
rename %copy_dir%\bin\Lib\ssl.py ssl-orig.py
copy ssl-patch.py %copy_dir%\bin\Lib\ssl.py
rename %copy_dir%\bin\Lib\site-packages\mpmath\ctx_mp_python.py ctx_mp_python-orig.py
copy C:/Users/travis/build/FreeCAD/FreeCAD-AppImage/conda/modifications/ctx_mp_python.py %copy_dir%\bin\Lib\site-packages\mpmath\ctx_mp_python.py

%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

if errorlevel1 exit 1

"%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\ -bb
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 mpmath on Win

Fix mpmath on Win


@ECHO OFF
SETLOCAL ENABLEEXTENSIONS

IF EXIST ".\package.log" DEL ".\package.log"

IF "%MAKENSIS%"=="" SET MAKENSIS=%PROGRAMFILES(X86)%\NSIS\makensis.exe

"%MAKENSIS%" ".\mygeneration.nsi" >> ".\package.log"
"%MAKENSIS%" ".\mymeta.nsi"       >> ".\package.log"
"%MAKENSIS%" ".\doodads.nsi"      >> ".\package.log"
"%MAKENSIS%" ".\cst2mygen.nsi"    >> ".\package.log"
SET MAKENSIS=

ECHO ON

@ECHO OFF
SETLOCAL ENABLEEXTENSIONS

IF EXIST ".\pack.log" DEL ".\pack.log"

IF "%MAKENSIS%"=="" SET MAKENSIS=%PROGRAMFILES(X86)%\NSIS\makensis.exe

"%MAKENSIS%" ".\mygeneration.nsi" >> ".\pack.log"
"%MAKENSIS%" ".\mymeta.nsi"       >> ".\pack.log"
"%MAKENSIS%" ".\doodads.nsi"      >> ".\pack.log"
"%MAKENSIS%" ".\cst2mygen.nsi"    >> ".\pack.log"
SET MAKENSIS=

ECHO ON

Change log filename for pack.cmd

Change log filename for pack.cmd


@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 0.2.2
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
goto Deployment

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

:Deployment
echo Handling node.js deployment.

echo 1. Select node version
call :SelectNodeVersion

echo 2. Install npm packages
IF EXIST "package.json" (
  echo Calling !NPM_CMD! install --production
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd !NPM_CMD! install --production -d
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

echo 3. Install bower packages
IF EXIST "bower.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd bower install
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

echo 4. Gulp build
IF EXIST "gulpfile.js (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd grunt build
  call :ExecuteCmd grunt
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

echo 5. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error

goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 0.2.2
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
goto Deployment

:: Utility Functions
:: -----------------

:SelectNodeVersion

IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
  :: The following are done only on Windows Azure Websites environment
  call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
  IF !ERRORLEVEL! NEQ 0 goto error

  IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
    SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
    SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
    IF !ERRORLEVEL! NEQ 0 goto error
  )

  IF NOT DEFINED NODE_EXE (
    SET NODE_EXE=node
  )

  SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
) ELSE (
  SET NPM_CMD=npm
  SET NODE_EXE=node
)

goto :EOF

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

:Deployment
echo Handling node.js deployment.

echo 1. Select node version
call :SelectNodeVersion

echo 2. Install npm packages
IF EXIST "package.json" (
  echo Calling !NPM_CMD! install --production
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd npm install --production -d
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

echo 3. Install bower packages
IF EXIST "bower.json" (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd bower install
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

echo 4. Gulp build
IF EXIST "gulpfile.js (
  pushd "%DEPLOYMENT_TARGET%"
  call :ExecuteCmd grunt build
  call :ExecuteCmd grunt
  IF !ERRORLEVEL! NEQ 0 goto error
  popd
)

echo 5. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error

goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

fix kudu

fix kudu


call DeletePdbFiles.cmd ..\Output\NET45\Examples
call DeletePdbFiles.cmd ..\Output\NET40\Examples

del /S /Q ..\Output\NET40\Examples

"C:\Program Files\7-Zip\7z.exe" a -r ..\Output\HelixToolkit-%1.zip ..\Output\*.* > ZipRelease.log

mkdir ..\Output\Release
mkdir ..\Output\Release\NET40
mkdir ..\Output\Release\NET45

copy ..\Output\NET45\HelixToolkit.??? ..\Output\Release
copy ..\Output\NET45\HelixToolkit.Wpf.??? ..\Output\Release\NET45
copy ..\Output\NET40\HelixToolkit.Wpf.??? ..\Output\Release\NET40
copy ..\Output\NET45\HelixToolkit.Wpf.Input.??? ..\Output\Release\NET45
copy ..\Output\NET40\HelixToolkit.Wpf.Input.??? ..\Output\Release\NET40
copy ..\Output\NET45\HelixToolkit.Wpf.SharpDX.??? ..\Output\Release\NET45
copy ..\Output\NET40\HelixToolkit.Wpf.SharpDX.??? ..\Output\Release\NET40

"C:\Program Files\7-Zip\7z.exe" a -r ..\Output\HelixToolkit-%1.zip ..\Output\Release\*.* > ZipRelease.log

Remove examples from Codeplex Release package.


@ECHO OFF
set SCISRC=..\scintilla

rem create the objects and output directory and delete any files from previous build
md "%OBJDIR%" >NUL 2>&1
del "%OUTDIR%\Notepad2.exe" >NUL 2>&1
del "%OBJDIR%\*.idb" >NUL 2>&1
del "%OBJDIR%\*.obj" >NUL 2>&1
del "%OBJDIR%\*.pdb" >NUL 2>&1

ECHO. && ECHO:______________________________
ECHO:[INFO] compiling stage...
ECHO:______________________________ && ECHO.

rem compiler command line
IF /I "%1"=="x86" (
set CLADDCMD=/D "STATIC_BUILD" /D "SCI_LEXER" /D "_WINDOWS" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_WIN32_WINNT=0x0501"
)
IF /I "%1"=="x64" (
set CLADDCMD=/D "STATIC_BUILD" /D "SCI_LEXER" /D "_WINDOWS" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "_WIN64" /D "_WIN32_WINNT=0x0502" /wd4133 /wd4244 /wd4267
)

cl /Fo"%OBJDIR%/" /I "%SCISRC%\include" /I "%SCISRC%\src" /I "%SCISRC%\win32" %CLADDCMD% /c /EHsc /MD /O2 /GS /GT /GL /W3 /MP^
 /Tp "%SCISRC%\src\AutoComplete.cxx" /Tp "%SCISRC%\src\CallTip.cxx" /Tp "%SCISRC%\src\CellBuffer.cxx"^
 /Tp "%SCISRC%\src\CharClassify.cxx" /Tp "%SCISRC%\src\ContractionState.cxx" /Tp "%SCISRC%\src\Decoration.cxx"^
 /Tp "%SCISRC%\src\Document.cxx" /Tp "%SCISRC%\src\DocumentAccessor.cxx" /Tp "%SCISRC%\src\Editor.cxx"^
 /Tp "%SCISRC%\src\ExternalLexer.cxx" /Tp "%SCISRC%\src\Indicator.cxx" /Tp "%SCISRC%\src\KeyMap.cxx"^
 /Tp "%SCISRC%\src\KeyWords.cxx" /Tp "%SCISRC%\src\LexAsm.cxx" /Tp "%SCISRC%\src\LexAU3.cxx"^
 /Tp "%SCISRC%\src\LexBash.cxx" /Tp "%SCISRC%\src\LexConf.cxx" /Tp "%SCISRC%\src\LexCPP.cxx"^
 /Tp "%SCISRC%\src\LexCSS.cxx" /Tp "%SCISRC%\src\LexHTML.cxx" /Tp "%SCISRC%\src\LexLua.cxx"^
 /Tp "%SCISRC%\src\LexInno.cxx" /Tp "%SCISRC%\src\LexNsis.cxx" /Tp "%SCISRC%\src\LexOthers.cxx"^
 /Tp "%SCISRC%\src\LexPascal.cxx" /Tp "%SCISRC%\src\LexPerl.cxx" /Tp "%SCISRC%\src\LexPowerShell.cxx"^
 /Tp "%SCISRC%\src\LexPython.cxx" /Tp "%SCISRC%\src\LexRuby.cxx" /Tp "%SCISRC%\src\LexSQL.cxx"^
 /Tp "%SCISRC%\src\LexTCL.cxx" /Tp "%SCISRC%\src\LexVB.cxx" /Tp "%SCISRC%\src\LineMarker.cxx"^
 /Tp "%SCISRC%\src\PerLine.cxx" /Tp "%SCISRC%\src\PositionCache.cxx" /Tp "%SCISRC%\src\PropSet.cxx"^
 /Tp "%SCISRC%\src\RESearch.cxx" /Tp "%SCISRC%\src\RunStyles.cxx" /Tp "%SCISRC%\src\ScintillaBase.cxx"^
 /Tp "%SCISRC%\src\Selection.cxx" /Tp "%SCISRC%\src\Style.cxx" /Tp "%SCISRC%\src\StyleContext.cxx"^
 /Tp "%SCISRC%\src\UniConversion.cxx" /Tp "%SCISRC%\src\ViewStyle.cxx" /Tp "%SCISRC%\src\WindowAccessor.cxx"^
 /Tp "%SCISRC%\src\XPM.cxx" /Tp "%SCISRC%\win32\PlatWin.cxx" /Tp "%SCISRC%\win32\ScintillaWin.cxx"^
 /Tc "..\src\Dialogs.c" /Tc "..\src\Dlapi.c" /Tc "..\src\Edit.c" /Tc "..\src\Helpers.c"^
 /Tc "..\src\Notepad2.c" /Tc "..\src\Styles.c" /Tp "..\src\Print.cpp"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________
ECHO:[INFO] resource compiler stage...
ECHO:______________________________ && ECHO.

rem resource compiler command line
IF /I "%1"=="x86" (
set RCADDCMD=/d "WIN32"
)
IF /I "%1"=="x64" (
set RCADDCMD=/d "_WIN64"
)

rc /d "_UNICODE" /d "UNICODE" %RCADDCMD% /fo"%OBJDIR%/Notepad2.res" "..\src\Notepad2.rc"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________
ECHO:[INFO] linking stage...
ECHO:______________________________ && ECHO.

rem linker command line
IF /I "%1"=="x86" (
set LNKADDCMD=/SUBSYSTEM:WINDOWS,5.01 /MACHINE:X86
set WDK_LIB=msvcrt_winxp.obj
)
IF /I "%1"=="x64" (
set LNKADDCMD=/SUBSYSTEM:WINDOWS,5.02 /MACHINE:X64
set WDK_LIB=msvcrt_win2003.obj
)

link /OUT:"%OUTDIR%/Notepad2.exe" /INCREMENTAL:NO /RELEASE %LNKADDCMD% /OPT:REF /OPT:ICF /DYNAMICBASE /NXCOMPAT^
 /MERGE:.rdata=.text /LTCG kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib shlwapi.lib comdlg32.lib^
 comctl32.lib winspool.lib imm32.lib ole32.lib oleaut32.lib psapi.lib^
 "%OBJDIR%\AutoComplete.obj" "%OBJDIR%\CallTip.obj" "%OBJDIR%\CellBuffer.obj" "%OBJDIR%\CharClassify.obj"^
 "%OBJDIR%\ContractionState.obj" "%OBJDIR%\Decoration.obj" "%OBJDIR%\Dialogs.obj" "%OBJDIR%\Dlapi.obj"^
 "%OBJDIR%\Document.obj" "%OBJDIR%\DocumentAccessor.obj" "%OBJDIR%\Edit.obj" "%OBJDIR%\Editor.obj"^
 "%OBJDIR%\ExternalLexer.obj" "%OBJDIR%\Helpers.obj" "%OBJDIR%\Indicator.obj" "%OBJDIR%\KeyMap.obj"^
 "%OBJDIR%\KeyWords.obj" "%OBJDIR%\LexAsm.obj" "%OBJDIR%\LexAU3.obj" "%OBJDIR%\LexBash.obj" "%OBJDIR%\LexConf.obj"^
 "%OBJDIR%\LexCPP.obj" "%OBJDIR%\LexCSS.obj" "%OBJDIR%\LexHTML.obj" "%OBJDIR%\LexInno.obj" "%OBJDIR%\LexLua.obj"^
 "%OBJDIR%\LexNsis.obj" "%OBJDIR%\LexOthers.obj" "%OBJDIR%\LexPascal.obj" "%OBJDIR%\LexPerl.obj" "%OBJDIR%\LexPowerShell.obj"^
 "%OBJDIR%\LexPython.obj" "%OBJDIR%\LexRuby.obj" "%OBJDIR%\LexSQL.obj" "%OBJDIR%\LexTCL.obj" "%OBJDIR%\LexVB.obj"^
 "%OBJDIR%\LineMarker.obj" "%OBJDIR%\Notepad2.obj" "%OBJDIR%\Notepad2.res" "%OBJDIR%\PerLine.obj" "%OBJDIR%\PlatWin.obj"^
 "%OBJDIR%\PositionCache.obj" "%OBJDIR%\Print.obj" "%OBJDIR%\PropSet.obj" "%OBJDIR%\RESearch.obj" "%OBJDIR%\RunStyles.obj"^
 "%OBJDIR%\ScintillaBase.obj" "%OBJDIR%\ScintillaWin.obj" "%OBJDIR%\Selection.obj" "%OBJDIR%\Style.obj"^
 "%OBJDIR%\StyleContext.obj" "%OBJDIR%\Styles.obj" "%OBJDIR%\UniConversion.obj" "%OBJDIR%\ViewStyle.obj"^
 "%OBJDIR%\WindowAccessor.obj" "%OBJDIR%\XPM.obj" "%WDK_LIB%"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________
ECHO:[INFO] manifest stage...
ECHO:______________________________ && ECHO.

rem manifest tool command line
"%SDKDIR%\Bin\mt.exe" -manifest "..\res\Notepad2.exe.manifest" -outputresource:"%OUTDIR%\Notepad2.exe;#1"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________

@ECHO OFF

rem create the objects and output directory and delete any files from previous build
md "%OBJDIR%" >NUL 2>&1
del "%OUTDIR%\Notepad2.exe" >NUL 2>&1
del "%OBJDIR%\*.idb" >NUL 2>&1
del "%OBJDIR%\*.obj" >NUL 2>&1
del "%OBJDIR%\*.pdb" >NUL 2>&1

ECHO. && ECHO:______________________________
ECHO:[INFO] compiling stage...
ECHO:______________________________ && ECHO.

rem compiler command line
IF /I "%1"=="x86" (
set CLADDCMD=/D "STATIC_BUILD" /D "SCI_LEXER" /D "_WINDOWS" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_WIN32_WINNT=0x0501"
)
IF /I "%1"=="x64" (
set CLADDCMD=/D "STATIC_BUILD" /D "SCI_LEXER" /D "_WINDOWS" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "_WIN64" /D "_WIN32_WINNT=0x0502" /wd4133 /wd4244 /wd4267
)

cl /Fo"%OBJDIR%/" /I "..\scintilla\include" /I "..\scintilla\src" /I "..\scintilla\win32" %CLADDCMD% /c /EHsc /MD /O2 /GS /GT /GL /W3 /MP^
 /Tp "..\scintilla\src\AutoComplete.cxx"^
 /Tp "..\scintilla\src\CallTip.cxx"^
 /Tp "..\scintilla\src\CellBuffer.cxx"^
 /Tp "..\scintilla\src\CharClassify.cxx"^
 /Tp "..\scintilla\src\ContractionState.cxx"^
 /Tp "..\scintilla\src\Decoration.cxx"^
 /Tp "..\scintilla\src\Document.cxx"^
 /Tp "..\scintilla\src\DocumentAccessor.cxx"^
 /Tp "..\scintilla\src\Editor.cxx"^
 /Tp "..\scintilla\src\ExternalLexer.cxx"^
 /Tp "..\scintilla\src\Indicator.cxx"^
 /Tp "..\scintilla\src\KeyMap.cxx"^
 /Tp "..\scintilla\src\KeyWords.cxx"^
 /Tp "..\scintilla\src\LexAsm.cxx"^
 /Tp "..\scintilla\src\LexAU3.cxx"^
 /Tp "..\scintilla\src\LexBash.cxx"^
 /Tp "..\scintilla\src\LexConf.cxx"^
 /Tp "..\scintilla\src\LexCPP.cxx"^
 /Tp "..\scintilla\src\LexCSS.cxx"^
 /Tp "..\scintilla\src\LexHTML.cxx"^
 /Tp "..\scintilla\src\LexLua.cxx"^
 /Tp "..\scintilla\src\LexInno.cxx"^
 /Tp "..\scintilla\src\LexNsis.cxx"^
 /Tp "..\scintilla\src\LexOthers.cxx"^
 /Tp "..\scintilla\src\LexPascal.cxx"^
 /Tp "..\scintilla\src\LexPerl.cxx"^
 /Tp "..\scintilla\src\LexPowerShell.cxx"^
 /Tp "..\scintilla\src\LexPython.cxx"^
 /Tp "..\scintilla\src\LexRuby.cxx"^
 /Tp "..\scintilla\src\LexSQL.cxx"^
 /Tp "..\scintilla\src\LexTCL.cxx"^
 /Tp "..\scintilla\src\LexVB.cxx"^
 /Tp "..\scintilla\src\LineMarker.cxx"^
 /Tp "..\scintilla\src\PerLine.cxx"^
 /Tp "..\scintilla\src\PositionCache.cxx"^
 /Tp "..\scintilla\src\PropSet.cxx"^
 /Tp "..\scintilla\src\RESearch.cxx"^
 /Tp "..\scintilla\src\RunStyles.cxx"^
 /Tp "..\scintilla\src\ScintillaBase.cxx"^
 /Tp "..\scintilla\src\Selection.cxx"^
 /Tp "..\scintilla\src\Style.cxx"^
 /Tp "..\scintilla\src\StyleContext.cxx"^
 /Tp "..\scintilla\src\UniConversion.cxx"^
 /Tp "..\scintilla\src\ViewStyle.cxx"^
 /Tp "..\scintilla\src\WindowAccessor.cxx"^
 /Tp "..\scintilla\src\XPM.cxx"^
 /Tp "..\scintilla\win32\PlatWin.cxx"^
 /Tp "..\scintilla\win32\ScintillaWin.cxx"^
 /Tc "..\src\Dialogs.c"^
 /Tc "..\src\Dlapi.c"^
 /Tc "..\src\Edit.c"^
 /Tc "..\src\Helpers.c"^
 /Tc "..\src\Notepad2.c"^
 /Tc "..\src\Styles.c"^
 /Tp "..\src\Print.cpp"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________
ECHO:[INFO] resource compiler stage...
ECHO:______________________________ && ECHO.

rem resource compiler command line
IF /I "%1"=="x86" (
set RCADDCMD=/d "WIN32"
)
IF /I "%1"=="x64" (
set RCADDCMD=/d "_WIN64"
)

rc /d "_UNICODE" /d "UNICODE" %RCADDCMD% /fo"%OBJDIR%/Notepad2.res" "..\src\Notepad2.rc"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________
ECHO:[INFO] linking stage...
ECHO:______________________________ && ECHO.

rem linker command line
IF /I "%1"=="x86" (
set LNKADDCMD=/SUBSYSTEM:WINDOWS,5.01 /MACHINE:X86
set WDK_LIB=msvcrt_winxp.obj
)
IF /I "%1"=="x64" (
set LNKADDCMD=/SUBSYSTEM:WINDOWS,5.02 /MACHINE:X64
set WDK_LIB=msvcrt_win2003.obj
)

link /OUT:"%OUTDIR%/Notepad2.exe" /INCREMENTAL:NO /RELEASE %LNKADDCMD% /OPT:REF /OPT:ICF /DYNAMICBASE /NXCOMPAT^
 /MERGE:.rdata=.text /LTCG kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib shlwapi.lib comdlg32.lib^
 comctl32.lib winspool.lib imm32.lib ole32.lib oleaut32.lib psapi.lib^
 "%OBJDIR%\AutoComplete.obj"^
 "%OBJDIR%\CallTip.obj"^
 "%OBJDIR%\CellBuffer.obj"^
 "%OBJDIR%\CharClassify.obj"^
 "%OBJDIR%\ContractionState.obj"^
 "%OBJDIR%\Decoration.obj"^
 "%OBJDIR%\Dialogs.obj"^
 "%OBJDIR%\Dlapi.obj"^
 "%OBJDIR%\Document.obj"^
 "%OBJDIR%\DocumentAccessor.obj"^
 "%OBJDIR%\Edit.obj"^
 "%OBJDIR%\Editor.obj"^
 "%OBJDIR%\ExternalLexer.obj"^
 "%OBJDIR%\Helpers.obj"^
 "%OBJDIR%\Indicator.obj"^
 "%OBJDIR%\KeyMap.obj"^
 "%OBJDIR%\KeyWords.obj"^
 "%OBJDIR%\LexAsm.obj"^
 "%OBJDIR%\LexAU3.obj"^
 "%OBJDIR%\LexBash.obj"^
 "%OBJDIR%\LexConf.obj"^
 "%OBJDIR%\LexCPP.obj"^
 "%OBJDIR%\LexCSS.obj"^
 "%OBJDIR%\LexHTML.obj"^
 "%OBJDIR%\LexInno.obj"^
 "%OBJDIR%\LexLua.obj"^
 "%OBJDIR%\LexNsis.obj"^
 "%OBJDIR%\LexOthers.obj"^
 "%OBJDIR%\LexPascal.obj"^
 "%OBJDIR%\LexPerl.obj"^
 "%OBJDIR%\LexPowerShell.obj"^
 "%OBJDIR%\LexPython.obj"^
 "%OBJDIR%\LexRuby.obj"^
 "%OBJDIR%\LexSQL.obj"^
 "%OBJDIR%\LexTCL.obj"^
 "%OBJDIR%\LexVB.obj"^
 "%OBJDIR%\LineMarker.obj"^
 "%OBJDIR%\Notepad2.obj"^
 "%OBJDIR%\Notepad2.res"^
 "%OBJDIR%\PerLine.obj"^
 "%OBJDIR%\PlatWin.obj"^
 "%OBJDIR%\PositionCache.obj"^
 "%OBJDIR%\Print.obj"^
 "%OBJDIR%\PropSet.obj"^
 "%OBJDIR%\RESearch.obj"^
 "%OBJDIR%\RunStyles.obj"^
 "%OBJDIR%\ScintillaBase.obj"^
 "%OBJDIR%\ScintillaWin.obj"^
 "%OBJDIR%\Selection.obj"^
 "%OBJDIR%\Style.obj"^
 "%OBJDIR%\StyleContext.obj"^
 "%OBJDIR%\Styles.obj"^
 "%OBJDIR%\UniConversion.obj"^
 "%OBJDIR%\ViewStyle.obj"^
 "%OBJDIR%\WindowAccessor.obj"^
 "%OBJDIR%\XPM.obj"^
 "%WDK_LIB%"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________
ECHO:[INFO] manifest stage...
ECHO:______________________________ && ECHO.

rem manifest tool command line
"%SDKDIR%\Bin\mt.exe" -manifest "..\res\Notepad2.exe.manifest" -outputresource:"%OUTDIR%\Notepad2.exe;#1"
IF %ERRORLEVEL% NEQ 0 ECHO:[ERROR]Compilation failed!&&PAUSE&&EXIT

ECHO. && ECHO:______________________________

break compiler and linker files for better readability


REM Add other things if could be automated, RUN THIS AS ADMIN
@echo off
echo Check for Admn
net sessions
if %errorlevel%==0 (
echo Success
) else (
echo No admin
pause
exit
)
REM Windows Defender scan
cd C:\Program Files\Windows Defender\
MpCmdRun.exe -Scan 2
REM Listing possible penetrations
cd C:\
echo Staring to output active processes to dir C:\!
wmic process list brief > BriefProcesses.txt
if %errorlevel%==1 echo Brief Processes failed to write
wmic process list full >FullProcesses.txt
if %errorlevel%==1 echo Full Processes failed to write
wmic startup list full > StartupLists.txt
if %errorlevel%==1 echo Startup Processes failed to write
net start > StartedProcesses.txt
if %errorlevel%==1 echo Started processes failed to write
reg export HKLM\Software\Microsoft\Windows\CurrentVersion\Run  Run.reg
if %errorlevel%==1 echo Run processes failed to write
REM Passwords must be 10 digits
net accounts /minpwlen:10
REM Passwords must be changed every 30 days
net accounts /maxpwage:30
REM Passwords can only be changed after 1 day has passed
net accounts /minpwage:1
REM Display current password policy
net accounts
REM Turn on UAC
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f
REM No Remote Desktop
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f
REM Windows auomatic updates
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 3 /f
REM Removing good ol' insecure stuff
dism /online /disable-feature /featurename:IIS-WebServerRole >NUL
dism /online /disable-feature /featurename:IIS-WebServer >NUL
dism /online /disable-feature /featurename:IIS-CommonHttpFeatures >NUL
dism /online /disable-feature /featurename:IIS-HttpErrors >NUL
dism /online /disable-feature /featurename:IIS-HttpRedirect >NUL
dism /online /disable-feature /featurename:IIS-ApplicationDevelopment >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility45 >NUL
dism /online /disable-feature /featurename:IIS-HealthAndDiagnostics >NUL
dism /online /disable-feature /featurename:IIS-HttpLogging >NUL
dism /online /disable-feature /featurename:IIS-LoggingLibraries >NUL
dism /online /disable-feature /featurename:IIS-RequestMonitor >NUL
dism /online /disable-feature /featurename:IIS-HttpTracing >NUL
dism /online /disable-feature /featurename:IIS-Security >NUL
dism /online /disable-feature /featurename:IIS-URLAuthorization >NUL
dism /online /disable-feature /featurename:IIS-RequestFiltering >NUL
dism /online /disable-feature /featurename:IIS-IPSecurity >NUL
dism /online /disable-feature /featurename:IIS-Performance >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionDynamic >NUL
dism /online /disable-feature /featurename:IIS-WebServerManagementTools >NUL
dism /online /disable-feature /featurename:IIS-ManagementScriptingTools >NUL
dism /online /disable-feature /featurename:IIS-IIS6ManagementCompatibility >NUL
dism /online /disable-feature /featurename:IIS-Metabase >NUL
dism /online /disable-feature /featurename:IIS-HostableWebCore >NUL
dism /online /disable-feature /featurename:IIS-StaticContent >NUL
dism /online /disable-feature /featurename:IIS-DefaultDocument >NUL
dism /online /disable-feature /featurename:IIS-DirectoryBrowsing >NUL
dism /online /disable-feature /featurename:IIS-WebDAV >NUL
dism /online /disable-feature /featurename:IIS-WebSockets >NUL
dism /online /disable-feature /featurename:IIS-ApplicationInit >NUL
dism /online /disable-feature /featurename:IIS-ASPNET >NUL
dism /online /disable-feature /featurename:IIS-ASPNET45 >NUL
dism /online /disable-feature /featurename:IIS-ASP >NUL
dism /online /disable-feature /featurename:IIS-CGI >NUL
dism /online /disable-feature /featurename:IIS-ISAPIExtensions >NUL
dism /online /disable-feature /featurename:IIS-ISAPIFilter >NUL
dism /online /disable-feature /featurename:IIS-ServerSideIncludes >NUL
dism /online /disable-feature /featurename:IIS-CustomLogging >NUL
dism /online /disable-feature /featurename:IIS-BasicAuthentication >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionStatic >NUL
dism /online /disable-feature /featurename:IIS-ManagementConsole >NUL
dism /online /disable-feature /featurename:IIS-ManagementService >NUL
dism /online /disable-feature /featurename:IIS-WMICompatibility >NUL
dism /online /disable-feature /featurename:IIS-LegacyScripts >NUL
dism /online /disable-feature /featurename:IIS-LegacySnapIn >NUL
dism /online /disable-feature /featurename:IIS-FTPServer >NUL
dism /online /disable-feature /featurename:IIS-FTPSvc >NUL
dism /online /disable-feature /featurename:IIS-FTPExtensibility >NUL
dism /online /disable-feature /featurename:TFTP >NUL
dism /online /disable-feature /featurename:TelnetClient >NUL
dism /online /disable-feature /featurename:TelnetServer >NUL
REM START SCAN!
Sfc.exe /scannow
REM PowerShell!
powershell Invoke-WebRequest -OutFile MBRTKit.exe https://data-cdn.mbamupdates.com/web/mbar-1.09.3.1001.exe
MBRTKit.exe

REM Add other things if could be automated, RUN THIS AS ADMIN
@echo off
echo Check for Admn
net sessions
if %errorlevel%==0 (
echo Success
) else (
echo No admin
pause
exit
)
REM Windows Defender scan
cd C:\Program Files\Windows Defender\
MpCmdRun.exe -Scan 2
REM Listing possible penetrations
cd C:\
echo Staring to output active processes to dir C:\!
wmic process list brief > BriefProcesses.txt
if %errorlevel%==1 echo Brief Processes failed to write
wmic process list full >FullProcesses.txt
if %errorlevel%==1 echo Full Processes failed to write
wmic startup list full > StartupLists.txt
if %errorlevel%==1 echo Startup Processes failed to write
net start > StartedProcesses.txt
if %errorlevel%==1 echo Started processes failed to write
reg export HKLM\Software\Microsoft\Windows\CurrentVersion\Run  Run.reg
if %errorlevel%==1 echo Run processes failed to write
REM Passwords must be 10 digits
net accounts /minpwlen:10
REM Passwords must be changed every 30 days
net accounts /maxpwage:30
REM Passwords can only be changed after 1 day has passed
net accounts /minpwage:1
REM Display current password policy
net accounts
REM Turn on UAC
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f
REM No Remote Desktop
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f
REM Windows auomatic updates
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 3 /f
REM Removing good ol' insecure stuff
dism /online /disable-feature /featurename:IIS-WebServerRole >NUL
dism /online /disable-feature /featurename:IIS-WebServer >NUL
dism /online /disable-feature /featurename:IIS-CommonHttpFeatures >NUL
dism /online /disable-feature /featurename:IIS-HttpErrors >NUL
dism /online /disable-feature /featurename:IIS-HttpRedirect >NUL
dism /online /disable-feature /featurename:IIS-ApplicationDevelopment >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility45 >NUL
dism /online /disable-feature /featurename:IIS-HealthAndDiagnostics >NUL
dism /online /disable-feature /featurename:IIS-HttpLogging >NUL
dism /online /disable-feature /featurename:IIS-LoggingLibraries >NUL
dism /online /disable-feature /featurename:IIS-RequestMonitor >NUL
dism /online /disable-feature /featurename:IIS-HttpTracing >NUL
dism /online /disable-feature /featurename:IIS-Security >NUL
dism /online /disable-feature /featurename:IIS-URLAuthorization >NUL
dism /online /disable-feature /featurename:IIS-RequestFiltering >NUL
dism /online /disable-feature /featurename:IIS-IPSecurity >NUL
dism /online /disable-feature /featurename:IIS-Performance >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionDynamic >NUL
dism /online /disable-feature /featurename:IIS-WebServerManagementTools >NUL
dism /online /disable-feature /featurename:IIS-ManagementScriptingTools >NUL
dism /online /disable-feature /featurename:IIS-IIS6ManagementCompatibility >NUL
dism /online /disable-feature /featurename:IIS-Metabase >NUL
dism /online /disable-feature /featurename:IIS-HostableWebCore >NUL
dism /online /disable-feature /featurename:IIS-StaticContent >NUL
dism /online /disable-feature /featurename:IIS-DefaultDocument >NUL
dism /online /disable-feature /featurename:IIS-DirectoryBrowsing >NUL
dism /online /disable-feature /featurename:IIS-WebDAV >NUL
dism /online /disable-feature /featurename:IIS-WebSockets >NUL
dism /online /disable-feature /featurename:IIS-ApplicationInit >NUL
dism /online /disable-feature /featurename:IIS-ASPNET >NUL
dism /online /disable-feature /featurename:IIS-ASPNET45 >NUL
dism /online /disable-feature /featurename:IIS-ASP >NUL
dism /online /disable-feature /featurename:IIS-CGI >NUL
dism /online /disable-feature /featurename:IIS-ISAPIExtensions >NUL
dism /online /disable-feature /featurename:IIS-ISAPIFilter >NUL
dism /online /disable-feature /featurename:IIS-ServerSideIncludes >NUL
dism /online /disable-feature /featurename:IIS-CustomLogging >NUL
dism /online /disable-feature /featurename:IIS-BasicAuthentication >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionStatic >NUL
dism /online /disable-feature /featurename:IIS-ManagementConsole >NUL
dism /online /disable-feature /featurename:IIS-ManagementService >NUL
dism /online /disable-feature /featurename:IIS-WMICompatibility >NUL
dism /online /disable-feature /featurename:IIS-LegacyScripts >NUL
dism /online /disable-feature /featurename:IIS-LegacySnapIn >NUL
dism /online /disable-feature /featurename:IIS-FTPServer >NUL
dism /online /disable-feature /featurename:IIS-FTPSvc >NUL
dism /online /disable-feature /featurename:IIS-FTPExtensibility >NUL
dism /online /disable-feature /featurename:TFTP >NUL
dism /online /disable-feature /featurename:TelnetClient >NUL
dism /online /disable-feature /featurename:TelnetServer >NUL
REM START SYS INTEG SCAN!
Sfc.exe /scannow
REM PowerShell RootKit detection start
powershell Invoke-WebRequest -OutFile MBRTKit.exe https://data-cdn.mbamupdates.com/web/mbar-1.09.3.1001.exe
MBRTKit.exe

Update Main.bat

Update Main.bat


@echo off
if not exist .venv python -m venv .venv

if not exist tmp mkdir tmp

if not exist tmp/bootstrap-salt.sh powershell -Command "Invoke-WebRequest https://bootstrap.saltstack.com -OutFile tmp/bootstrap-salt.sh"

copy configuration\minion.yaml tmp\salt\minion.conf

vagrant up
pause

@echo off
if not exist .venv python -m venv .venv

if not exist tmp mkdir tmp

if not exist tmp\bootstrap-salt.sh powershell -Command "Invoke-WebRequest https://bootstrap.saltstack.com -OutFile tmp/bootstrap-salt.sh"

if not exist tmp\salt mkdir tmp\salt
copy configuration\minion.yaml tmp\salt\minion.conf

vagrant up
pause

use windows slashes

use windows slashes


set msbuild=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\msbuild

%msbuild% Build.targets /v:minimal /maxcpucount /nodeReuse:false %*

@echo OFF
for /F "tokens=2* delims=	 " %%A in ('reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client" /v Version') do set fw_version=%%B
for /f "delims=. tokens=1-3" %%a in ("%fw_version%") do (
  set fw_version_major=%%a
  set fw_version_minor=%%b
  set fw_version_build=%%c
)

set fw_version_ok=
if %fw_version_major% geq 5 ( set fw_version_ok=1 )
if %fw_version_major% equ 4 ( if %fw_version_minor% geq 5 ( set fw_version_ok=1 ))

if not defined fw_version_ok (
    echo .NET Framework 4.5 is not installed!
    exit /b -1
)

set msbuild=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\msbuild

if not exist %msbuild% (
    echo MsBuild was not found!
    exit /b -2
)

%msbuild% Build.targets /v:minimal /maxcpucount /nodeReuse:false %*

Build script now verifies environment

Build script now verifies environment


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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

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

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

goto :EOF

:error
exit /b 1

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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

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

call nvm use v12.14.1
call which node

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

goto :EOF

:error
exit /b 1

build: update windows configuration to match new vm


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

SET ROOT=%~dp0
cd /d %~dp0

powershell -c "Get-Host"
powershell -c "$PSVersionTable"
powershell -c "[System.Environment]::OSVersion"
powershell -c "Get-WmiObject -Class Win32_ComputerSystem"
powershell -c "(Get-WmiObject -Class Win32_ComputerSystem).SystemType"

powershell -c "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; & { iwr https://raw.githubusercontent.com/grumpycoders/nvm-ps/master/nvm.ps1 | iex }"

SET PATH=%APPDATA%\nvm-ps;%APPDATA%\nvm-ps\nodejs;%PATH%
SET JOBS=8

call nvm version

call nvm install 10
call nvm use 10

SET npm_config_fetch_retries=5

call npm install || goto :error

SET JUNIT_REPORT_STACK=1
SET FAILED=0

for %%v in (10 12) do (
  call nvm install %%v
  call nvm use %%v
  if "%%v"=="4" (
    call npm install -g npm@5
  )
  @rem https://github.com/mapbox/node-pre-gyp/issues/362
  call npm install -g node-gyp
  node -e "console.log(process.versions)"

  mkdir reports\node%%v
  SET JUNIT_REPORT_PATH=reports/node%%v

  node -e "process.exit(process.version.startsWith('v%%v') ? 0 : -1)" || goto :error

  call .\node_modules\.bin\gulp cleanAll || SET FAILED=1
  call .\node_modules\.bin\gulp setup || SET FAILED=1
  call .\node_modules\.bin\gulp test || SET FAILED=1
  cmd.exe /c "SET GRPC_DNS_RESOLVER=ares& call .\node_modules\.bin\gulp nativeTestOnly" || SET FAILED=1
)

node merge_kokoro_logs.js
if %FAILED% neq 0 exit /b 1
goto :EOF

:error
exit /b 1

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

SET ROOT=%~dp0
cd /d %~dp0

powershell -c "Get-Host"
powershell -c "$PSVersionTable"
powershell -c "[System.Environment]::OSVersion"
powershell -c "Get-WmiObject -Class Win32_ComputerSystem"
powershell -c "(Get-WmiObject -Class Win32_ComputerSystem).SystemType"

powershell -c "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; & { iwr https://raw.githubusercontent.com/grumpycoders/nvm-ps/master/nvm.ps1 | iex }"

SET PATH=%APPDATA%\nvm-ps;%APPDATA%\nvm-ps\nodejs;%PATH%
SET JOBS=8

call nvm version

call nvm install 10
call nvm use 10

git submodule update --init --recursive

SET npm_config_fetch_retries=5

call npm install || goto :error

SET JUNIT_REPORT_STACK=1
SET FAILED=0

for %%v in (10 12) do (
  call nvm install %%v
  call nvm use %%v
  if "%%v"=="4" (
    call npm install -g npm@5
  )
  @rem https://github.com/mapbox/node-pre-gyp/issues/362
  call npm install -g node-gyp
  node -e "console.log(process.versions)"

  mkdir reports\node%%v
  SET JUNIT_REPORT_PATH=reports/node%%v

  node -e "process.exit(process.version.startsWith('v%%v') ? 0 : -1)" || goto :error

  call .\node_modules\.bin\gulp cleanAll || SET FAILED=1
  call .\node_modules\.bin\gulp setup || SET FAILED=1
  call .\node_modules\.bin\gulp test || SET FAILED=1
  cmd.exe /c "SET GRPC_DNS_RESOLVER=ares& call .\node_modules\.bin\gulp nativeTestOnly" || SET FAILED=1
)

node merge_kokoro_logs.js
if %FAILED% neq 0 exit /b 1
goto :EOF

:error
exit /b 1

Update submodules in Windows test script


@echo off
:: MakeInstall install|portable|both
:: if no argument, both

setlocal

:: to be checked, configuration dependant
set godir=G:\Go
set inno="C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
set zip=7z.exe

set mode=%1
if "%mode%"=="" set mode=both

set makeinstall=No
set makeportable=No
if "%mode%"=="install"  set makeinstall=Yes
if "%mode%"=="both"     set makeinstall=Yes
if "%mode%"=="portable" set makeportable=Yes
if "%mode%"=="both"     set makeportable=Yes

set nver=0431

:: files in portable install
set files=^
 Drago.exe^
 .\Releases\DragoPortable.ini^
 LibKombilo.dll^
 libhpdf.dll^
 engines.config^
 Drago-??.chm^
 .\Releases\Readme.txt^
 .\Releases\License.txt^
 Stones\Default\*.*^
 Stones\SenteGoban\*.*^
 Textures\*.*^
 Languages\Drago-??.lng^
 Players\*.*^
 %godir%\Sgf\Fuseki\fuseki8.sgf^
 %godir%\Sgf\Games\kisei.sgf^
 %godir%\Sgf\Problemes\kido.sgf^
 %godir%\Sgf\Problemes\easy.sgf^
 %godir%\Sgf\Problemes\hard.sgf^
 %godir%\Sgf\Problemes\reflexes.sgf^
 %godir%\Databases\kisei.db^
 %godir%\Databases\kisei.db1^
 %godir%\Databases\kisei.db2

:: make sure the files used at runtime are correctly archived
cd %godir%\Drago
for %%1 in (LibKombilo.dll libhpdf.dll engines.config Drago-??.chm) do (
    fc %%1 runtime\%%1 > NUL
    if errorlevel 1 (echo Diff between installed and archived file: %%1. Please check. & goto :eof)
)

:: check version numbers
set /P choice=Check version numbers (%nver%) in readme, about, executable versions? [ok, quit]
if "%choice%" neq "ok" goto :eof

:: check source management
git status .. --short -uno
set /P choice=Check source management? [ok, quit]
if "%choice%" neq "ok" goto :eof

:: delete executable to have the creation date reset
del %godir%\Drago\drago.exe

:: build executable
cd %godir%\Drago\Src
call Build-Release DragoRelease.cfg

:: archive sources
set y=%date:~-4%
set m=%date:~3,2%
set d=%date:~0,2%
set today=%y%%m%%d%
set name=%today%-%nver%
cd %godir%\Drago\Src
%zip% a -r %name%.7z *.*
move %name%.7z ..\Releases\Sources

:: make standard install
if %makeinstall%==Yes (
    cd %godir%\Drago\Releases
    %inno% Drago.iss
    %zip% a SetupDrago%nver%.zip SetupDrago%nver%.exe
    del SetupDrago%nver%.exe > nul
    move SetupDrago%nver%.zip %godir%\Drago\Releases\Install
)

:: make portable install
if %makeportable%==Yes (
    cd %godir%\Drago
    %zip% a PortableDrago%nver%.zip %files%
    move PortableDrago%nver%.zip %godir%\Drago\Releases\Install
)

@echo off
:: MakeInstall install|portable|both
:: if no argument, both

setlocal

:: to be checked, configuration dependant
set godir=G:\Go
set inno="C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
set zip=7z.exe

set mode=%1
if "%mode%"=="" set mode=both

set makeinstall=No
set makeportable=No
if "%mode%"=="install"  set makeinstall=Yes
if "%mode%"=="both"     set makeinstall=Yes
if "%mode%"=="portable" set makeportable=Yes
if "%mode%"=="both"     set makeportable=Yes

set nver=0431

:: files in portable install
set files=^
 Drago.exe^
 .\Releases\DragoPortable.ini^
 LibKombilo.dll^
 libhpdf.dll^
 engines.config^
 Drago-??.chm^
 .\Releases\Readme.txt^
 .\Releases\License.txt^
 Stones\Default\*.*^
 Stones\SenteGoban\*.*^
 Textures\*.*^
 Languages\Drago-??.lng^
 Players\*.*^
 %godir%\Sgf\Fuseki\fuseki8.sgf^
 %godir%\Sgf\Games\kisei.sgf^
 %godir%\Sgf\Problemes\kido.sgf^
 %godir%\Sgf\Problemes\easy.sgf^
 %godir%\Sgf\Problemes\hard.sgf^
 %godir%\Sgf\Problemes\reflexes.sgf^
 %godir%\Databases\kisei.db^
 %godir%\Databases\kisei.db1^
 %godir%\Databases\kisei.db2

:: make sure the files used at runtime are correctly archived
cd %godir%\Drago
for %%1 in (LibKombilo.dll libhpdf.dll engines.config Drago-??.chm) do (
    fc %%1 runtime\%%1 > NUL
    if errorlevel 1 (echo Diff between installed and archived file: %%1. Please check. & goto :eof)
)

:: check version numbers
set /P choice=Check version numbers (%nver%) in readme, about, executable versions? [ok, quit]
if "%choice%" neq "ok" goto :eof

:: check source management
git status --short -uno
set /P choice=Check source management? [ok, quit]
if "%choice%" neq "ok" goto :eof

:: delete executable to have the creation date reset
del %godir%\Drago\drago.exe

:: build executable
cd %godir%\Drago\Src
call Build-Release DragoRelease.cfg

:: archive sources
set y=%date:~-4%
set m=%date:~3,2%
set d=%date:~0,2%
set today=%y%%m%%d%
set name=%today%-%nver%
cd %godir%\Drago\Src
%zip% a -r %name%.7z *.*
move %name%.7z ..\Releases\Sources

:: make standard install
if %makeinstall%==Yes (
    cd %godir%\Drago\Releases
    %inno% Drago.iss
    %zip% a SetupDrago%nver%.zip SetupDrago%nver%.exe
    del SetupDrago%nver%.exe > nul
    move SetupDrago%nver%.zip %godir%\Drago\Releases\Install
)

:: make portable install
if %makeportable%==Yes (
    cd %godir%\Drago
    %zip% a PortableDrago%nver%.zip %files%
    move PortableDrago%nver%.zip %godir%\Drago\Releases\Install
)

Fix path.

Fix path.


nuget restore -SolutionDirectory ../  ../Rock.Encryption\RockLib.Encryption.csproj

msbuild /p:Configuration=Release /t:Clean ..\Rock.Encryption\RockLib.Encryption.csproj

msbuild /p:Configuration=Release /t:Rebuild ..\Rock.Encryption\RockLib.Encryption.csproj

msbuild /t:pack /p:PackageOutputPath=..\builtPackages  /p:Configuration=Release ..\Rock.Encryption\RockLib.Encryption.csproj

Add build script

Add build script


@echo off
SetLocal EnableDelayedExpansion

set "pattern=%1"
shift

set "envs="
for /f "usebackq" %%e in (
   `tox --listenvs-all ^| find "%pattern%" ^| find "-w32"`
) do (
   if not defined envs (set "envs=%%e") else (set "envs=!envs!,%%e")
)

if not "%envs%"=="" (
   tox -e "%envs%" %*
) else (
   echo "No environments match %pattern%" >&2
)

@echo off
SetLocal EnableDelayedExpansion

set "pattern=%1"
shift

set "envs="
for /f "usebackq" %%e in (
   `tox --listenvs-all ^| find "%pattern%" ^| find "-w32"`
) do (
   if defined envs (set "envs=!envs!,%%e") else (set "envs=%%e")
)

if not "%envs%"=="" (
   tox -e "%envs%" %*
) else (
   echo "No environments match %pattern%" >&2
)

Refactor `tox-select-envs.cmd`

Tests(tox): Refactor `tox-select-envs.cmd`


@echo off

SET BIN=..\Binaries
SET BUILD=Debug

DEL /q *.nupkg > nul 2> nul

IF not exist lib     mkdir lib     > nul 2> nul

CALL :BUILD AM.Core            core sl
CALL :BUILD ManagedIrbis       core sl
CALL :BUILD AM.Drawing         no   no
CALL :BUILD AM.Rfid            no   no
CALL :BUILD AM.Windows.Forms   no   no
CALL :BUILD AM.Win32           no   no
CALL :BUILD IrbisUI            no   no
CALL :BUILD AM.Suggestions     no   no
CALL :BUILD AM.AOT             no   no
CALL :BUILD AM.Ocr             no   no

GOTO :END

:BUILD
ECHO BUILD %1

cd lib

del /s /q *.*   > nul 2> nul
rmdir /s /q *.* > nul 2> nul

IF not exist net35 mkdir net35 > nul 2> nul
IF not exist net40 mkdir net40 > nul 2> nul
IF not exist net45 mkdir net45 > nul 2> nul

IF %2==core mkdir netstandard1.0  > nul 2> nul
IF %2==no   rmdir netstandard1.0  > nul 2> nul

IF %3==sl   mkdir sl50            > nul 2> nul
IF %3==no   rmdir sl50            > nul 2> nul

cd ..

copy %BIN%\%BUILD%35\%1.* lib\net35\  > nul
copy %BIN%\%BUILD%40\%1.* lib\net40\  > nul
copy %BIN%\%BUILD%45\%1.* lib\net45\  > nul

RMDIR lib\net35\ru > nul 2> nul
RMDIR lib\net40\ru > nul 2> nul
RMDIR lib\net45\ru > nul 2> nul

IF EXIST %BIN%\%BUILD%35\ru\%1.resources.dll (
MKDIR lib\net35\ru > nul 2> nul
copy %BIN%\%BUILD%35\ru\%1.resources.dll lib\net35\ru > nul 2> nul
)
IF EXIST %BIN%\%BUILD%40\ru\%1.resources.dll (
MKDIR lib\net40\ru > nul 2> nul
copy %BIN%\%BUILD%40\ru\%1.resources.dll lib\net40\ru > nul 2> nul
)
IF EXIST %BIN%\%BUILD%45\ru\%1.resources.dll (
MKDIR lib\net45\ru > nul 2> nul
copy %BIN%\%BUILD%45\ru\%1.resources.dll lib\net45\ru > nul 2> nul
)

copy %BIN%\%BUILD%35\System.Threading.* lib\net35\ > nul

IF %2==core copy %BIN%\%BUILD%Core\%1\bin\%BUILD%\netstandard1.6\%1.* lib\netstandard1.0 > nul
IF %3==sl   copy %BIN%\%BUILD%SL50\%1.* lib\sl50 > nul
DEL lib\netstandard1.0\*.json > nul 2> nul
IF %1==AM.Rfid (
copy %BIN%\%BUILD%35\FeCom.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\FedmIscCoreVC80.dll      lib\net35 > nul
copy %BIN%\%BUILD%35\FedmIscMyAxxessVC80.dll  lib\net35 > nul
copy %BIN%\%BUILD%35\fefu.dll                 lib\net35 > nul
copy %BIN%\%BUILD%35\FeIsc.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\fetcl.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\fetcp.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\feusb.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\OBIDISC4NET.dll          lib\net35 > nul
copy %BIN%\%BUILD%35\OBIDISC4NETnative.dll    lib\net35 > nul
copy %BIN%\%BUILD%35\pcsc-sharp.dll           lib\net35 > nul
copy %BIN%\%BUILD%35\pcsc-sharp.pdb           lib\net35 > nul
copy %BIN%\%BUILD%35\pcsc-sharp.xml           lib\net35 > nul

copy %BIN%\%BUILD%40\FeCom.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\FedmIscCoreVC100.dll     lib\net40 > nul
copy %BIN%\%BUILD%40\FedmIscMyAxxessVC100.dll lib\net40 > nul
copy %BIN%\%BUILD%40\fefu.dll                 lib\net40 > nul
copy %BIN%\%BUILD%40\FeIsc.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\fetcl.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\fetcp.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\feusb.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\OBIDISC4NET.dll          lib\net40 > nul
copy %BIN%\%BUILD%40\OBIDISC4NETnative.dll    lib\net40 > nul
copy %BIN%\%BUILD%40\pcsc-sharp.dll           lib\net40 > nul
copy %BIN%\%BUILD%40\pcsc-sharp.pdb           lib\net40 > nul
copy %BIN%\%BUILD%40\pcsc-sharp.xml           lib\net40 > nul

copy %BIN%\%BUILD%45\FeCom.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\FedmIscCoreVC100.dll     lib\net45 > nul
copy %BIN%\%BUILD%45\FedmIscMyAxxessVC100.dll lib\net45 > nul
copy %BIN%\%BUILD%45\fefu.dll                 lib\net45 > nul
copy %BIN%\%BUILD%45\FeIsc.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\fetcl.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\fetcp.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\feusb.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\OBIDISC4NET.dll          lib\net45 > nul
copy %BIN%\%BUILD%45\OBIDISC4NETnative.dll    lib\net45 > nul
copy %BIN%\%BUILD%45\pcsc-sharp.dll           lib\net45 > nul
copy %BIN%\%BUILD%45\pcsc-sharp.pdb           lib\net45 > nul
copy %BIN%\%BUILD%45\pcsc-sharp.xml           lib\net45 > nul
)

PatchNugetVersion.exe %BIN%\%BUILD%40\AM.Core.dll %1.nuspec

nuget.exe pack %1.nuspec

echo.

GOTO :END

:END

@echo off

SET BIN=..\Binaries
SET BUILD=Debug

DEL /q *.nupkg > nul 2> nul

IF not exist lib     mkdir lib     > nul 2> nul

CALL :BUILD AM.Core            core sl droid
CALL :BUILD ManagedIrbis       core sl droid
CALL :BUILD AM.Drawing         no   no no
CALL :BUILD AM.Rfid            no   no no
CALL :BUILD AM.Windows.Forms   no   no no
CALL :BUILD AM.Win32           no   no no
CALL :BUILD IrbisUI            no   no no
CALL :BUILD AM.Suggestions     no   no no
CALL :BUILD AM.AOT             no   no no
CALL :BUILD AM.Ocr             no   no no

GOTO :END

:BUILD
ECHO BUILD %1

cd lib

del /s /q *.*   > nul 2> nul
rmdir /s /q *.* > nul 2> nul

IF not exist net35 mkdir net35 > nul 2> nul
IF not exist net40 mkdir net40 > nul 2> nul
IF not exist net45 mkdir net45 > nul 2> nul

IF %2==core  mkdir netstandard1.0  > nul 2> nul
IF %2==no    rmdir netstandard1.0  > nul 2> nul

IF %3==sl    mkdir sl50            > nul 2> nul
IF %3==no    rmdir sl50            > nul 2> nul

IF %4==droid mkdir MonoAndroid     > nul 2> nul
IF %4==no    rmdir MonoAndroid     > nul 2> nul

cd ..

copy %BIN%\%BUILD%35\%1.* lib\net35\  > nul
copy %BIN%\%BUILD%40\%1.* lib\net40\  > nul
copy %BIN%\%BUILD%45\%1.* lib\net45\  > nul

RMDIR lib\net35\ru > nul 2> nul
RMDIR lib\net40\ru > nul 2> nul
RMDIR lib\net45\ru > nul 2> nul

IF EXIST %BIN%\%BUILD%35\ru\%1.resources.dll (
MKDIR lib\net35\ru > nul 2> nul
copy %BIN%\%BUILD%35\ru\%1.resources.dll lib\net35\ru > nul 2> nul
)
IF EXIST %BIN%\%BUILD%40\ru\%1.resources.dll (
MKDIR lib\net40\ru > nul 2> nul
copy %BIN%\%BUILD%40\ru\%1.resources.dll lib\net40\ru > nul 2> nul
)
IF EXIST %BIN%\%BUILD%45\ru\%1.resources.dll (
MKDIR lib\net45\ru > nul 2> nul
copy %BIN%\%BUILD%45\ru\%1.resources.dll lib\net45\ru > nul 2> nul
)

copy %BIN%\%BUILD%35\System.Threading.* lib\net35\ > nul

IF %2==core  copy %BIN%\%BUILD%Core\%1\bin\%BUILD%\netstandard1.6\%1.* lib\netstandard1.0 > nul
IF %3==sl    copy %BIN%\%BUILD%SL50\%1.* lib\sl50 > nul
IF %4==droid copy %BIN%\%BUILD%Droid\%1.* lib\MonoAndroid > nul

DEL lib\netstandard1.0\*.json > nul 2> nul

IF %1==AM.Rfid (
copy %BIN%\%BUILD%35\FeCom.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\FedmIscCoreVC80.dll      lib\net35 > nul
copy %BIN%\%BUILD%35\FedmIscMyAxxessVC80.dll  lib\net35 > nul
copy %BIN%\%BUILD%35\fefu.dll                 lib\net35 > nul
copy %BIN%\%BUILD%35\FeIsc.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\fetcl.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\fetcp.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\feusb.dll                lib\net35 > nul
copy %BIN%\%BUILD%35\OBIDISC4NET.dll          lib\net35 > nul
copy %BIN%\%BUILD%35\OBIDISC4NETnative.dll    lib\net35 > nul
copy %BIN%\%BUILD%35\pcsc-sharp.dll           lib\net35 > nul
copy %BIN%\%BUILD%35\pcsc-sharp.pdb           lib\net35 > nul
copy %BIN%\%BUILD%35\pcsc-sharp.xml           lib\net35 > nul

copy %BIN%\%BUILD%40\FeCom.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\FedmIscCoreVC100.dll     lib\net40 > nul
copy %BIN%\%BUILD%40\FedmIscMyAxxessVC100.dll lib\net40 > nul
copy %BIN%\%BUILD%40\fefu.dll                 lib\net40 > nul
copy %BIN%\%BUILD%40\FeIsc.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\fetcl.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\fetcp.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\feusb.dll                lib\net40 > nul
copy %BIN%\%BUILD%40\OBIDISC4NET.dll          lib\net40 > nul
copy %BIN%\%BUILD%40\OBIDISC4NETnative.dll    lib\net40 > nul
copy %BIN%\%BUILD%40\pcsc-sharp.dll           lib\net40 > nul
copy %BIN%\%BUILD%40\pcsc-sharp.pdb           lib\net40 > nul
copy %BIN%\%BUILD%40\pcsc-sharp.xml           lib\net40 > nul

copy %BIN%\%BUILD%45\FeCom.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\FedmIscCoreVC100.dll     lib\net45 > nul
copy %BIN%\%BUILD%45\FedmIscMyAxxessVC100.dll lib\net45 > nul
copy %BIN%\%BUILD%45\fefu.dll                 lib\net45 > nul
copy %BIN%\%BUILD%45\FeIsc.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\fetcl.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\fetcp.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\feusb.dll                lib\net45 > nul
copy %BIN%\%BUILD%45\OBIDISC4NET.dll          lib\net45 > nul
copy %BIN%\%BUILD%45\OBIDISC4NETnative.dll    lib\net45 > nul
copy %BIN%\%BUILD%45\pcsc-sharp.dll           lib\net45 > nul
copy %BIN%\%BUILD%45\pcsc-sharp.pdb           lib\net45 > nul
copy %BIN%\%BUILD%45\pcsc-sharp.xml           lib\net45 > nul
)

PatchNugetVersion.exe %BIN%\%BUILD%40\AM.Core.dll %1.nuspec

nuget.exe pack %1.nuspec

echo.

GOTO :END

:END

Edit packit.cmd

Edit packit.cmd


@echo off

set SCALA_VERSION=2.9.2

rem Figure out where the Spark framework is installed
set FWDIR=%~dp0

rem Export this as SPARK_HOME
set SPARK_HOME=%FWDIR%

rem Load environment variables from conf\spark-env.cmd, if it exists
if exist "%FWDIR%conf\spark-env.cmd" call "%FWDIR%conf\spark-env.cmd"

rem Test that an argument was given
if not "x%1"=="x" goto arg_given
  echo Usage: run ^<spark-class^> [^<args^>]
  goto exit
:arg_given

set RUNNING_DAEMON=0
if "%1"=="spark.deploy.master.Master" set RUNNING_DAEMON=1
if "%1"=="spark.deploy.worker.Worker" set RUNNING_DAEMON=1
if "x%SPARK_DAEMON_MEMORY%" == "x" set SPARK_DAEMON_MEMORY=512m
if "%RUNNING_DAEMON%"=="1" set SPARK_MEM=%SPARK_DAEMON_MEMORY%
if "%RUNNING_DAEMON%"=="1" set SPARK_JAVA_OPTS=%SPARK_DAEMON_JAVA_OPTS%

rem Check that SCALA_HOME has been specified
if not "x%SCALA_HOME%"=="x" goto scala_exists
  echo SCALA_HOME is not set
  goto exit
:scala_exists

rem If the user specifies a Mesos JAR, put it before our included one on the classpath
set MESOS_CLASSPATH=
if not "x%MESOS_JAR%"=="x" set MESOS_CLASSPATH=%MESOS_JAR%

rem Figure out how much memory to use per executor and set it as an environment
rem variable so that our process sees it and can report it to Mesos
if "x%SPARK_MEM%"=="x" set SPARK_MEM=512m

rem Set JAVA_OPTS to be able to load native libraries and to set heap size
set JAVA_OPTS=%SPARK_JAVA_OPTS% -Djava.library.path=%SPARK_LIBRARY_PATH% -Xms%SPARK_MEM% -Xmx%SPARK_MEM%
rem Load extra JAVA_OPTS from conf/java-opts, if it exists
if exist "%FWDIR%conf\java-opts.cmd" call "%FWDIR%conf\java-opts.cmd"

set CORE_DIR=%FWDIR%core
set REPL_DIR=%FWDIR%repl
set EXAMPLES_DIR=%FWDIR%examples
set BAGEL_DIR=%FWDIR%bagel
set STREAMING_DIR=%FWDIR%streaming
set PYSPARK_DIR=%FWDIR%python

rem Build up classpath
set CLASSPATH=%SPARK_CLASSPATH%;%MESOS_CLASSPATH%;%FWDIR%conf;%CORE_DIR%\target\scala-%SCALA_VERSION%\classes
set CLASSPATH=%CLASSPATH%;%CORE_DIR%\target\scala-%SCALA_VERSION%\test-classes;%CORE_DIR%\src\main\resources
set CLASSPATH=%CLASSPATH%;%STREAMING_DIR%\target\scala-%SCALA_VERSION%\classes;%STREAMING_DIR%\target\scala-%SCALA_VERSION%\test-classes
set CLASSPATH=%CLASSPATH%;%STREAMING_DIR%\lib\org\apache\kafka\kafka\0.7.2-spark\*
set CLASSPATH=%CLASSPATH%;%REPL_DIR%\target\scala-%SCALA_VERSION%\classes;%EXAMPLES_DIR%\target\scala-%SCALA_VERSION%\classes
set CLASSPATH=%CLASSPATH%;%FWDIR%lib_managed\jars\*
set CLASSPATH=%CLASSPATH%;%FWDIR%lib_managed\bundles\*
set CLASSPATH=%CLASSPATH%;%FWDIR%repl\lib\*
set CLASSPATH=%CLASSPATH%;%FWDIR%python\lib\*
set CLASSPATH=%CLASSPATH%;%BAGEL_DIR%\target\scala-%SCALA_VERSION%\classes

rem Figure out the JAR file that our examples were packaged into.
rem First search in the build path from SBT:
for /D %%d in ("%EXAMPLES_DIR%/target/scala-%SCALA_VERSION%/spark-examples*.jar") do (
  set SPARK_EXAMPLES_JAR=%%d
)
rem Then search in the build path from Maven:
for /D %%d in ("%EXAMPLES_DIR%/target/spark-examples*hadoop*.jar") do (
  set SPARK_EXAMPLES_JAR=%%d
)

rem Figure out whether to run our class with java or with the scala launcher.
rem In most cases, we'd prefer to execute our process with java because scala
rem creates a shell script as the parent of its Java process, which makes it
rem hard to kill the child with stuff like Process.destroy(). However, for
rem the Spark shell, the wrapper is necessary to properly reset the terminal
rem when we exit, so we allow it to set a variable to launch with scala.
if "%SPARK_LAUNCH_WITH_SCALA%" NEQ 1 goto java_runner
  set RUNNER=%SCALA_HOME%\bin\scala
  # Java options will be passed to scala as JAVA_OPTS
  set EXTRA_ARGS=
  goto run_spark
:java_runner
  set CLASSPATH=%CLASSPATH%;%SCALA_HOME%\lib\scala-library.jar;%SCALA_HOME%\lib\scala-compiler.jar;%SCALA_HOME%\lib\jline.jar
  set RUNNER=java
  if not "x%JAVA_HOME%"=="x" set RUNNER=%JAVA_HOME%\bin\java
  rem The JVM doesn't read JAVA_OPTS by default so we need to pass it in
  set EXTRA_ARGS=%JAVA_OPTS%
:run_spark

"%RUNNER%" -cp "%CLASSPATH%" %EXTRA_ARGS% %*
:exit

@echo off

set SCALA_VERSION=2.9.2

rem Figure out where the Spark framework is installed
set FWDIR=%~dp0

rem Export this as SPARK_HOME
set SPARK_HOME=%FWDIR%

rem Load environment variables from conf\spark-env.cmd, if it exists
if exist "%FWDIR%conf\spark-env.cmd" call "%FWDIR%conf\spark-env.cmd"

rem Test that an argument was given
if not "x%1"=="x" goto arg_given
  echo Usage: run ^<spark-class^> [^<args^>]
  goto exit
:arg_given

set RUNNING_DAEMON=0
if "%1"=="spark.deploy.master.Master" set RUNNING_DAEMON=1
if "%1"=="spark.deploy.worker.Worker" set RUNNING_DAEMON=1
if "x%SPARK_DAEMON_MEMORY%" == "x" set SPARK_DAEMON_MEMORY=512m
if "%RUNNING_DAEMON%"=="1" set SPARK_MEM=%SPARK_DAEMON_MEMORY%
if "%RUNNING_DAEMON%"=="1" set SPARK_JAVA_OPTS=%SPARK_DAEMON_JAVA_OPTS%

rem Check that SCALA_HOME has been specified
if not "x%SCALA_HOME%"=="x" goto scala_exists
  echo SCALA_HOME is not set
  goto exit
:scala_exists

rem If the user specifies a Mesos JAR, put it before our included one on the classpath
set MESOS_CLASSPATH=
if not "x%MESOS_JAR%"=="x" set MESOS_CLASSPATH=%MESOS_JAR%

rem Figure out how much memory to use per executor and set it as an environment
rem variable so that our process sees it and can report it to Mesos
if "x%SPARK_MEM%"=="x" set SPARK_MEM=512m

rem Set JAVA_OPTS to be able to load native libraries and to set heap size
set JAVA_OPTS=%SPARK_JAVA_OPTS% -Djava.library.path=%SPARK_LIBRARY_PATH% -Xms%SPARK_MEM% -Xmx%SPARK_MEM%
rem Load extra JAVA_OPTS from conf/java-opts, if it exists
if exist "%FWDIR%conf\java-opts.cmd" call "%FWDIR%conf\java-opts.cmd"

set CORE_DIR=%FWDIR%core
set REPL_DIR=%FWDIR%repl
set EXAMPLES_DIR=%FWDIR%examples
set BAGEL_DIR=%FWDIR%bagel
set STREAMING_DIR=%FWDIR%streaming
set PYSPARK_DIR=%FWDIR%python

rem Build up classpath
set CLASSPATH=%SPARK_CLASSPATH%;%MESOS_CLASSPATH%;%FWDIR%conf;%CORE_DIR%\target\scala-%SCALA_VERSION%\classes
set CLASSPATH=%CLASSPATH%;%CORE_DIR%\target\scala-%SCALA_VERSION%\test-classes;%CORE_DIR%\src\main\resources
set CLASSPATH=%CLASSPATH%;%STREAMING_DIR%\target\scala-%SCALA_VERSION%\classes;%STREAMING_DIR%\target\scala-%SCALA_VERSION%\test-classes
set CLASSPATH=%CLASSPATH%;%STREAMING_DIR%\lib\org\apache\kafka\kafka\0.7.2-spark\*
set CLASSPATH=%CLASSPATH%;%REPL_DIR%\target\scala-%SCALA_VERSION%\classes;%EXAMPLES_DIR%\target\scala-%SCALA_VERSION%\classes
set CLASSPATH=%CLASSPATH%;%FWDIR%lib_managed\jars\*
set CLASSPATH=%CLASSPATH%;%FWDIR%lib_managed\bundles\*
set CLASSPATH=%CLASSPATH%;%FWDIR%repl\lib\*
set CLASSPATH=%CLASSPATH%;%FWDIR%python\lib\*
set CLASSPATH=%CLASSPATH%;%BAGEL_DIR%\target\scala-%SCALA_VERSION%\classes

rem Figure out the JAR file that our examples were packaged into.
rem First search in the build path from SBT:
for %%d in ("examples/target/scala-%SCALA_VERSION%/spark-examples*.jar") do (
  set SPARK_EXAMPLES_JAR=examples/target/scala-%SCALA_VERSION%/%%d
)
rem Then search in the build path from Maven:
for %%d in ("examples/target/spark-examples*hadoop*.jar") do (
  set SPARK_EXAMPLES_JAR=examples/target/%%d
)

rem Figure out whether to run our class with java or with the scala launcher.
rem In most cases, we'd prefer to execute our process with java because scala
rem creates a shell script as the parent of its Java process, which makes it
rem hard to kill the child with stuff like Process.destroy(). However, for
rem the Spark shell, the wrapper is necessary to properly reset the terminal
rem when we exit, so we allow it to set a variable to launch with scala.
if "%SPARK_LAUNCH_WITH_SCALA%" NEQ 1 goto java_runner
  set RUNNER=%SCALA_HOME%\bin\scala
  # Java options will be passed to scala as JAVA_OPTS
  set EXTRA_ARGS=
  goto run_spark
:java_runner
  set CLASSPATH=%CLASSPATH%;%SCALA_HOME%\lib\scala-library.jar;%SCALA_HOME%\lib\scala-compiler.jar;%SCALA_HOME%\lib\jline.jar
  set RUNNER=java
  if not "x%JAVA_HOME%"=="x" set RUNNER=%JAVA_HOME%\bin\java
  rem The JVM doesn't read JAVA_OPTS by default so we need to pass it in
  set EXTRA_ARGS=%JAVA_OPTS%
:run_spark

"%RUNNER%" -cp "%CLASSPATH%" %EXTRA_ARGS% %*
:exit

Fix Windows script for finding examples JAR


@echo off
::ϵͳ
::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
::û
::HKEY_CURRENT_USER\Environment

set regOgrepath=HKEY_CURRENT_USER\Environment

::BINĿ¼
set regBINName=NFBIN_HOME
set regBINValue=D:\NoahGameFrame\trunk\_Out\Client\Bin
reg add "%regOgrepath%" /v "%regBINName%" /d "%regBINValue%" /f

::SERVER_BINĿ¼
set regSERVERBINName=NFBIN_SERVER
set regSERVERBINValue=D:\NoahGameFrame\trunk\_Out\Server
reg add "%regOgrepath%" /v "%regSERVERBINName%" /d "%regSERVERBINValue%" /f

::COMM_BINĿ¼
set regCOMMBINName=NFBIN_COMM
set regCOMMBINValue=D:\NoahGameFrame\trunk\_Out\Comm
reg add "%regOgrepath%" /v "%regCOMMBINName%" /d "%regCOMMBINValue%" /f

::NF_HOMEĿ¼
set regNF_HOMEName=NF_HOME
set regNF_HOMEValue=D:\NoahGameFrame\trunk\\
reg add "%regOgrepath%" /v "%regNF_HOMEName%" /d "%regNF_HOMEValue%" /f

::APP_LIBĿ¼
set regAPP_LIBName=APP_DEPLIB
set regAPP_LIBVALUE=D:\NoahGameFrame\trunk\Dependencies\lib\\
reg add "%regOgrepath%" /v "%regAPP_LIBName%" /d "%regAPP_LIBVALUE%" /f

::NF_NOSQL_NETĿ¼
set regNF_HOMEName=NF_NOSQL_NET
set regNF_HOMEValue=D:\NoahGameFrame\trunk\Dependencies\redis-cplusplus-client\msvc\anet_win32\\
reg add "%regOgrepath%" /v "%regNF_HOMEName%" /d "%regNF_HOMEValue%" /f

::BOOST
set regBOOSTName=BOOST_HOME
set regBOOSTValue=D:\NoahGameFrame\trunk\Dependencies\boost_1_53_0\\
reg add "%regOgrepath%" /v "%regBOOSTName%" /d "%regBOOSTValue%" /f

::BOOSTLIB
set regBOOSTLIBName=BOOST_LIB
set regBOOSTLIBValue=D:\NoahGameFrame\trunk\Dependencies\boost_1_53_0\stage\lib\x64\vs11_0
reg add "%regOgrepath%" /v "%regBOOSTLIBName%" /d "%regBOOSTLIBValue%" /f

::Dependencies
set regDEPName=NF_DEP
set regDEPNameValue=D:\NoahGameFrame\trunk\Dependencies\\
reg add "%regOgrepath%" /v "%regDEPName%" /d "%regDEPNameValue%" /f

::GLOGĿ¼
set regGLOGName=GLOG_HOME
set regGLOGValue=D:\NoahGameFrame\trunk\Dependencies\glog-0.3.3\src\windows\\
reg add "%regOgrepath%" /v "%regGLOGName%" /d "%regGLOGValue%" /f

::TheronĿ¼
set regTHERONName=THERON_HOME
set regTHERONValue=D:\NoahGameFrame\trunk\Dependencies\Theron-6.00.01\Include\\
reg add "%regOgrepath%" /v "%regTHERONName%" /d "%regTHERONValue%" /f

echo Set Environment end

rem ====================================================================================
echo Start to extract boost_1_53_0

cd Tool
7z x "..\Dependencies\boost_1_53_0.zip" -o"..\Dependencies\" -y

echo Extract boost_1_53_0 completed!
rem ====================================================================================

echo Start to extract nessasery lib

7z x "..\Dependencies\lib.zip" -o"..\Dependencies\" -y

echo Extract nessasery lib completed!
rem ====================================================================================

pause

@echo off
::ϵͳ
::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
::û
::HKEY_CURRENT_USER\Environment

REM set regOgrepath=HKEY_CURRENT_USER\Environment

REM ::BINĿ¼
REM set regBINName=NFBIN_HOME
REM set regBINValue=D:\NoahGameFrame\trunk\_Out\Client\Bin
REM reg add "%regOgrepath%" /v "%regBINName%" /d "%regBINValue%" /f

REM ::SERVER_BINĿ¼
REM set regSERVERBINName=NFBIN_SERVER
REM set regSERVERBINValue=D:\NoahGameFrame\trunk\_Out\Server
REM reg add "%regOgrepath%" /v "%regSERVERBINName%" /d "%regSERVERBINValue%" /f

REM ::COMM_BINĿ¼
REM set regCOMMBINName=NFBIN_COMM
REM set regCOMMBINValue=D:\NoahGameFrame\trunk\_Out\Comm
REM reg add "%regOgrepath%" /v "%regCOMMBINName%" /d "%regCOMMBINValue%" /f

REM ::NF_HOMEĿ¼
REM set regNF_HOMEName=NF_HOME
REM set regNF_HOMEValue=D:\NoahGameFrame\trunk\\
REM reg add "%regOgrepath%" /v "%regNF_HOMEName%" /d "%regNF_HOMEValue%" /f

REM ::APP_LIBĿ¼
REM set regAPP_LIBName=APP_DEPLIB
REM set regAPP_LIBVALUE=D:\NoahGameFrame\trunk\Dependencies\lib\\
REM reg add "%regOgrepath%" /v "%regAPP_LIBName%" /d "%regAPP_LIBVALUE%" /f

REM ::NF_NOSQL_NETĿ¼
REM set regNF_HOMEName=NF_NOSQL_NET
REM set regNF_HOMEValue=D:\NoahGameFrame\trunk\Dependencies\redis-cplusplus-client\msvc\anet_win32\\
REM reg add "%regOgrepath%" /v "%regNF_HOMEName%" /d "%regNF_HOMEValue%" /f

REM ::BOOST
REM set regBOOSTName=BOOST_HOME
REM set regBOOSTValue=D:\NoahGameFrame\trunk\Dependencies\boost_1_53_0\\
REM reg add "%regOgrepath%" /v "%regBOOSTName%" /d "%regBOOSTValue%" /f

REM ::BOOSTLIB
REM set regBOOSTLIBName=BOOST_LIB
REM set regBOOSTLIBValue=D:\NoahGameFrame\trunk\Dependencies\boost_1_53_0\stage\lib\x64\vs11_0
REM reg add "%regOgrepath%" /v "%regBOOSTLIBName%" /d "%regBOOSTLIBValue%" /f

REM ::Dependencies
REM set regDEPName=NF_DEP
REM set regDEPNameValue=D:\NoahGameFrame\trunk\Dependencies\\
REM reg add "%regOgrepath%" /v "%regDEPName%" /d "%regDEPNameValue%" /f

REM ::GLOGĿ¼
REM set regGLOGName=GLOG_HOME
REM set regGLOGValue=D:\NoahGameFrame\trunk\Dependencies\glog-0.3.3\src\windows\\
REM reg add "%regOgrepath%" /v "%regGLOGName%" /d "%regGLOGValue%" /f

REM ::TheronĿ¼
REM set regTHERONName=THERON_HOME
REM set regTHERONValue=D:\NoahGameFrame\trunk\Dependencies\Theron-6.00.01\Include\\
REM reg add "%regOgrepath%" /v "%regTHERONName%" /d "%regTHERONValue%" /f

REM echo Set Environment end

rem ====================================================================================
echo Start to extract boost_1_53_0

cd Tool
7z x "..\Dependencies\boost_1_53_0.zip" -o"..\Dependencies\" -y

echo Extract boost_1_53_0 completed!
rem ====================================================================================

echo Start to extract nessasery lib

7z x "..\Dependencies\lib.zip" -o"..\Dependencies\" -y

echo Extract nessasery lib completed!
rem ====================================================================================

pause

delete use reg to set Environment

delete use reg to set Environment


@echo off

Packages\xunit.runner.console.2.1.0\tools\xunit.console ^
	CarFuel.Facts\bin\Debug\CarFuel.Facts.dll ^
	-parallel all ^
    -verbose ^
	-html Result.html ^
	-nologo

@echo on

update test.bat

update test.bat


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

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

Update extensions/ringopengl/opengl21/buildvc.bat


:: call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
cl /MD /LD /Fe:arma3urlfetch_x64.dll^
    /I include\nlohmann^
    /I include\jsoncpp^
    include\jsoncpp.cpp^
    src\common.cpp^
    src\arguments.cpp^
    src\requests.cpp^
    src\clients.cpp^
    src\output.cpp^
    src\handler.cpp^
    src\main.cpp^
    /DCURL_STATICLIB^
    /I include\windows\x64^
    lib\windows\libcurl_a_x64.lib^
    /std:c++17
rm *.obj
rm *.lib
rm *.exp

update build_x64.bat

update build_x64.bat


@ECHO OFF

set ARCH=X64
set XPLM_LIB="XPLM_64.lib"

if "%1"=="386" (
set ARCH=X86
set XPLM_LIB="XPLM.lib"
)

:: this assumes we have the proper tag
:: if created via the github website then do $ git fetch --tags
:: this doesn't seem to work: git describe --abbrev=0 --tags
set GIT_VER="vX.Y.Z"
for /f "delims=" %%i in ('git describe --tags') do @set GIT_VER=%%i

echo -
echo -
echo ----------------------------------------------------
echo Building CommViewer %GIT_VER%
echo ARCH=%ARCH% XPLM_LIB=%XPLM_LIB%
echo ----------------------------------------------------
echo -
echo -

goto STARTCOMPILING
:: Visual Studio 2012
if defined VS120COMNTOOLS  (
	if exist "%VS120COMNTOOLS%\vsvars32.bat" (
		echo -
		echo - Visual C++ 2012 found.
		echo -
		call "%VS120COMNTOOLS%\..\..\VC\vsvarsall.bat" x86_amd64
		goto STARTCOMPILING
	)
)

:: Visual Studio 2010
if defined VS100COMNTOOLS  (
	if exist "%VS100COMNTOOLS%\vsvars32.bat" (
		echo -
		echo - Visual C++ 2010 found.
		echo -
		call "%VS100COMNTOOLS%\vsvars32.bat"
		goto STARTCOMPILING
	)
)

echo -
echo - No Visual C++ found, please set the enviroment variable
echo -
echo - VCToolkitInstallDir  or  VS71COMNTOOLS or VS80COMNTOOLS
echo -
echo - to your Visual Studio folder which contains vsvars32.bat.
echo -
echo - Or call the vsvars32.bat.
echo -

goto ERROR

:STARTCOMPILING

:: buid process
del *.xpl

set CL_OPTS=/c /GS /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /Ob1 /fp:precise /GF /WX- /Zc:forScope /Gd /MT /EHsc /nologo

:: /D TOGGLE_TEST_FEATURE
set CL_DEFS=/D "VERSION=%GIT_VER%" /D "NDEBUG" /D "WIN32" /D "_MBCS"  /D "XPLM200" /D "XPLM210" /D "_USRDLL" /D "_WINDLL" /D "APL=0" /D "IBM=1" /D "LIN=0" /D "WIN32" /D "_WINDOWS" /D "LOGPRINTF" /D "SIMDATA_EXPORTS" /D "_CRT_SECURE_NO_WARNINGS" /D "_VC80_UPGRADE=0x0600"

set CL_FILES="commviewer_win.cpp" /TP "commviewer.cpp"

:: /MACHINE:X86 /MACHINE:X64
set LINK_OPTS=/MACHINE:%ARCH% /OUT:win.xpl /INCREMENTAL:NO /NOLOGO /DLL /MANIFEST:NO /NXCOMPAT /DYNAMICBASE /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /LIBPATH:"SDK\Libraries\Win" /TLBID:1

:: "XPLM_64.lib" "XPLM.lib"
set LINK_LIBS=%XPLM_LIB% "user32.lib" "Opengl32.lib" "odbc32.lib" "odbccp32.lib" "kernel32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib"
set LINK_OBJS="commviewer.obj" "commviewer_win.obj"

@ECHO ON

cl.exe  %CL_OPTS% %CL_DEFS% %CL_FILES%
link.exe  %LINK_OPTS% %LINK_LIBS% %LINK_OBJS%

@ECHO OFF

del *.pdb *.exp *.obj

goto LEAVE

:ERROR
echo -
echo -
echo - An error occured. Compiling aborted.
echo -
pause

:LEAVE

@ECHO OFF

set ARCH=X64
set XPLM_LIB="XPLM_64.lib"
set vs_toolset=x86_amd64

if "%1"=="386" (
set ARCH=X86
set vs_toolset=x86
set XPLM_LIB="XPLM.lib"
)

:: this assumes we have the proper tag
:: if created via the github website then do $ git fetch --tags
:: this doesn't seem to work: git describe --abbrev=0 --tags
set GIT_VER="vX.Y.Z"
for /f "delims=" %%i in ('git describe --tags') do @set GIT_VER=%%i

echo -
echo -
echo ----------------------------------------------------
echo Building CommViewer %GIT_VER%
echo ARCH=%ARCH% XPLM_LIB=%XPLM_LIB%
echo ----------------------------------------------------
echo -
echo -

:: Visual Studio 2013
:vc-set-2013
if not defined VS120COMNTOOLS  goto vc-set-2012
if not exist "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2012
echo -
echo - Visual C++ 2013 found.
echo -
call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
goto STARTCOMPILING

:: Visual Studio 2012
:vc-set-2012
if not defined VS110COMNTOOLS  goto vc-set-notfound
if not exist "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat" vc-set-notfound
echo -
echo - Visual C++ 2011 found.
echo -
call "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
goto STARTCOMPILING

:vc-set-notfound
echo -
echo - No Visual C++ found, please set the enviroment variable
echo -
echo - VCToolkitInstallDir  or  VS71COMNTOOLS or VS80COMNTOOLS
echo -
echo - to your Visual Studio folder which contains vsvars32.bat.
echo -
echo - Or call the vsvars32.bat.
echo -

goto ERROR

:STARTCOMPILING

:: buid process

set CL_OPTS=/c /GS /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /Ob1 /fp:precise /GF /WX- /Zc:forScope /Gd /MT /EHsc /nologo

:: /D TOGGLE_TEST_FEATURE
set CL_DEFS=/D "VERSION=%GIT_VER%" /D "NDEBUG" /D "WIN32" /D "_MBCS"  /D "XPLM200" /D "XPLM210" /D "_USRDLL" /D "_WINDLL" /D "APL=0" /D "IBM=1" /D "LIN=0" /D "WIN32" /D "_WINDOWS" /D "LOGPRINTF" /D "SIMDATA_EXPORTS" /D "_CRT_SECURE_NO_WARNINGS" /D "_VC80_UPGRADE=0x0600"

set CL_FILES="commviewer_win.cpp" /TP "commviewer.cpp"

:: /MACHINE:X86 /MACHINE:X64  /MANIFEST:NO
set LINK_OPTS=/MACHINE:%ARCH% /OUT:win.xpl /INCREMENTAL:NO /NOLOGO /DLL /NXCOMPAT /DYNAMICBASE /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /LIBPATH:"SDK\Libraries\Win" /TLBID:1

:: "XPLM_64.lib" "XPLM.lib"
set LINK_LIBS=%XPLM_LIB% "user32.lib" "Opengl32.lib" "odbc32.lib" "odbccp32.lib" "kernel32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib"
set LINK_OBJS="commviewer.obj" "commviewer_win.obj"

@ECHO ON

cl.exe  %CL_OPTS% %CL_DEFS% %CL_FILES%
link.exe  %LINK_OPTS% %LINK_LIBS% %LINK_OBJS%

@ECHO OFF

del *.pdb *.exp *.obj

goto LEAVE

:ERROR
echo -
echo -
echo - An error occured. Compiling aborted.
echo -
pause

:LEAVE

fix batch file

fix batch file


@ECHO OFF
REM My DOS skills are horrid. Here comes the spaghetti...

IF "%GOPATH%"=="" GOTO NOGO
IF NOT EXIST %GOPATH%\bin\2carray.exe GOTO INSTALL
:POSTINSTALL
IF "%1"=="" GOTO NOICO
IF NOT EXIST %1 GOTO BADFILE
ECHO Creating platform\windows\icon.h
TYPE %1 | %GOPATH%\bin\2carray ICON_ICO > platform\windows\icon.h
GOTO DONE

:CREATEFAIL
ECHO Unable to create output file
GOTO DONE

ECHO %1
GOTO DONE

:INSTALL
ECHO Installing 2carray...
go get github.com/cratonica/2carray
IF ERRORLEVEL 1 GOTO GETFAIL
GOTO POSTINSTALL

:GETFAIL
ECHO Failure running go get github.com/cratonica/2carray.  Ensure that go and git are in PATH
GOTO DONE

:NOGO
ECHO GOPATH environment variable not set
GOTO DONE

:NOICO
ECHO Please specify a .ico file
GOTO DONE

:BADFILE
ECHO %1 is not a valid file
GOTO DONE

:DONE

@ECHO OFF
REM My DOS skills are horrid. Here comes the spaghetti...

IF "%GOPATH%"=="" GOTO NOGO
IF NOT EXIST %GOPATH%\bin\2carray.exe GOTO INSTALL
:POSTINSTALL
IF "%1"=="" GOTO NOICO
IF NOT EXIST %1 GOTO BADFILE
ECHO Creating platform\windows\icon.h
TYPE %1 | %GOPATH%\bin\2carray ICON_ICO > platform\windows\icon.h
GOTO DONE

:CREATEFAIL
ECHO Unable to create output file
GOTO DONE

:INSTALL
ECHO Installing 2carray...
go get github.com/cratonica/2carray
IF ERRORLEVEL 1 GOTO GETFAIL
GOTO POSTINSTALL

:GETFAIL
ECHO Failure running go get github.com/cratonica/2carray.  Ensure that go and git are in PATH
GOTO DONE

:NOGO
ECHO GOPATH environment variable not set
GOTO DONE

:NOICO
ECHO Please specify a .ico file
GOTO DONE

:BADFILE
ECHO %1 is not a valid file
GOTO DONE

:DONE

Remove dead code

Remove dead code


@rem Makes a build directory of the viewer, so that you can run the NSIS install script
@rem You should have a directory ..\viewerbuilddlls which has release versions of
@rem all dependency dlls, and also VS2008 redistributable (vcredist_x86.exe)
@echo off
rmdir build /S /Q
md build
copy readme.txt build
xcopy bin\*.* build /S /C /Y
del build\*.dll
del build\viewerd.exe
del build\modules\core\*d.dll
xcopy ..\viewerbuilddlls\*.* build /S /C /Y
del build\pymodules\*.pyc
del build\pymodules\apitest\*.pyc
del build\pymodules\circuits\*.pyc
del build\pymodules\circuits\core\*.pyc
del build\pymodules\circuits\net\*.pyc
del build\pymodules\circuits\tools\*.pyc
del build\pymodules\circuits\web\*.pyc
del build\pymodules\core\*.pyc
del build\pymodules\editgui\*.pyc
del build\pymodules\lib\*.pyc
del build\pymodules\lib\webdav\*.pyc
del build\pymodules\lib\webdav\acp\*.pyc
del build\pymodules\usr\*.pyc
del build\pymodules\webdavinventory\*.pyc
del build\pymodules\webserver\*.pyc
cd build\data
rmdir configuration /S /Q
mkdir configuration
cd ..\..

@rem Makes a build directory of the viewer, so that you can run the NSIS install script
@rem You should have a directory ..\viewerbuilddlls which has release versions of
@rem all dependency dlls, and also VS2008 redistributable (vcredist_x86.exe)
@echo off
rmdir build /S /Q
md build
copy readme.txt build
xcopy bin\*.* build /S /C /Y
del build\*.dll
del build\viewerd.exe
del build\modules\core\*d.dll
del build\pymodules\DLLs\*_d.pyd
xcopy ..\viewerbuilddlls\*.* build /S /C /Y
del build\pymodules\*.pyc
del build\pymodules\apitest\*.pyc
del build\pymodules\circuits\*.pyc
del build\pymodules\circuits\core\*.pyc
del build\pymodules\circuits\net\*.pyc
del build\pymodules\circuits\tools\*.pyc
del build\pymodules\circuits\web\*.pyc
del build\pymodules\core\*.pyc
del build\pymodules\editgui\*.pyc
del build\pymodules\lib\*.pyc
del build\pymodules\lib\webdav\*.pyc
del build\pymodules\lib\webdav\acp\*.pyc
del build\pymodules\usr\*.pyc
del build\pymodules\webdavinventory\*.pyc
del build\pymodules\webserver\*.pyc
cd build\data
rmdir configuration /S /Q
mkdir configuration
cd ..\..

delete debug mode python dlls when packaging release. are to be copied over from viewerdeps, and then this does "del build\pymodules\DLLs\*_d.pyd" leaving the release versions only.

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@1681 5b2332b8-efa3-11de-8684-7d64432d61a3


@echo off

IF NOT DEFINED VSVERSION SET VSVERSION=15.0

IF DEFINED MSBUILD (
  IF EXIST "%MSBUILD%" GOTO :eof
)

SET VSWHERE=..\packages\vswhere\tools\vswhere.exe
IF NOT EXIST "%VSWHERE%" nuget.exe install vswhere -NonInteractive -ExcludeVersion -Source https://www.nuget.org/api/v2 > nul

FOR /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -version %VSVERSION% -products * -requires Microsoft.Component.MSBuild -property installationPath`) DO (
  SET MSBUILD=%%i\MSBuild\%VSVERSION%\Bin\MSBuild.exe
)

IF NOT DEFINED MSBUILD (
  ECHO Could not find MSBuild %VSVERSION%. Please SET MSBUILD=^<path-to-MSBuild.exe^> and try again.
  GOTO :eof
)

IF NOT EXIST "%MSBUILD%" (
  ECHO vswhere.exe claims that MSBuild is at !MSBUILD! but it does not exist.
  ECHO Please SET MSBUILD=^<path-to-MSBuild.exe^> and try again.
  GOTO :eof
)

ECHO Using MSBuild from %MSBUILD%

revert echo off removal

revert echo off removal


@ECHO OFF
@SETLOCAL enableextensions enabledelayedexpansion

IF "x%SKIP%"=="x1" (
    ECHO SKIPPING: %*
    GOTO done
)

IF NOT DEFINED CMAKE_GENERATOR ( GOTO vstudio )
IF NOT "x%CMAKE_GENERATOR:MinGW=%"=="x%CMAKE_GENERATOR%" ( GOTO mingw )

:vstudio
    SET script=ci\appveyor\run-with-visual-studio.cmd
    GOTO run

:mingw
    SET script=ci\appveyor\run-with-mingw.cmd
    GOTO run

:run
    echo cmd /E:ON /V:ON /C %script% %*
    cmd /E:ON /V:ON /C %script% %* || EXIT 1

:done

ENDLOCAL

add a general %RUN% test script

add a general %RUN% test script


REM work in progress
REM Setup a non-production BigFix Eval Server with SQL Developer Edition.

REM http://software.bigfix.com/download/bes/95/BigFix-BES-9.5.9.62.exe
REM http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe

SET BASEFOLDER=C:\Windows\Temp

REM Open folder:
start "" %BASEFOLDER%

REM Download SQLServer Developer Edition:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe', '%BASEFOLDER%\SQLServer-SSEI-Dev.exe') }" -ExecutionPolicy Bypass
REM Install SQLServer Developer Edition:
REM https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017
%BASEFOLDER%\SQLServer-SSEI-Dev.exe

REM https://github.com/jgstew/bigfix-content/blob/f36708ebf7af38f84a286f3b79131faccb1d2e9c/fixlet/Install%20SQL%20Server%20Management%20Studio%2016.5.1%20-%20Windows.bes
REM Download SQL Server Management Studio:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/0/5/B/05B2AF8F-906F-4C57-A58E-5780F64F9D62/SSMS-Setup-ENU.exe', '%BASEFOLDER%\SSMS-Setup-ENU.exe') }" -ExecutionPolicy Bypass
REM https://download.microsoft.com/download/0/5/B/05B2AF8F-906F-4C57-A58E-5780F64F9D62/SSMS-Setup-ENU.exe
REM Install SQL Server Management Studio:
%BASEFOLDER%\SSMS-Setup-ENU.exe /install /quiet /norestart

REM for some reason, this didn't create a start menu shortcut it seems for SQL Server Management Studio

REM Download BigFix Root Server:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-9.5.9.62.exe', '%BASEFOLDER%\BigFix-BES.exe') }" -ExecutionPolicy Bypass
REM Install:
REM %BASEFOLDER%\BigFix-BES.exe

REM press any key to continue....
pause

REM work in progress
REM Setup a non-production BigFix Eval Server with SQL Developer Edition.

REM http://software.bigfix.com/download/bes/95/BigFix-BES-9.5.9.62.exe
REM http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe

SET BASEFOLDER=C:\tmp

REM Make folder if not existing:
if not exist "%BASEFOLDER%" mkdir %BASEFOLDER%

REM Open folder:
start "" %BASEFOLDER%

REM Download SQLServer Developer Edition:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://download.microsoft.com/download/2/5/0/2508F7B4-6DDE-4C3E-B1FA-E1EB66F2F79F/SQLServer2016-SSEI-Dev.exe', '%BASEFOLDER%\SQLServer-SSEI-Dev.exe') }" -ExecutionPolicy Bypass
REM Install SQLServer Developer Edition:
REM https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017
%BASEFOLDER%\SQLServer-SSEI-Dev.exe

REM https://github.com/jgstew/bigfix-content/blob/f36708ebf7af38f84a286f3b79131faccb1d2e9c/fixlet/Install%20SQL%20Server%20Management%20Studio%2016.5.1%20-%20Windows.bes
REM Download SQL Server Management Studio:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/0/5/B/05B2AF8F-906F-4C57-A58E-5780F64F9D62/SSMS-Setup-ENU.exe', '%BASEFOLDER%\SSMS-Setup-ENU.exe') }" -ExecutionPolicy Bypass
REM https://download.microsoft.com/download/0/5/B/05B2AF8F-906F-4C57-A58E-5780F64F9D62/SSMS-Setup-ENU.exe
REM Install SQL Server Management Studio:
%BASEFOLDER%\SSMS-Setup-ENU.exe /install /quiet /norestart

REM for some reason, this didn't create a start menu shortcut it seems for SQL Server Management Studio

REM Download BigFix Root Server:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://software.bigfix.com/download/bes/95/BigFix-BES-9.5.9.62.exe', '%BASEFOLDER%\BigFix-BES.exe') }" -ExecutionPolicy Bypass
REM Install:
REM %BASEFOLDER%\BigFix-BES.exe

REM press any key to continue....
pause

Update bigfix_setup_root_eval.bat

Update bigfix_setup_root_eval.bat