echo TODO: This is a mess. The CsoundQt build system needs some work and then this should be brought into appveyor.yaml.
cd staging\CsoundQt
echo "INCLUDE:" %INCLUDE%
set INCLUDE=%INCLUDE%%VCPKGDir%\\installed\\x64-windows\\include;
echo "INCLUDE:" %INCLUDE%
echo "CSOUND_LIBRARY_DIR:" %~dp0csound-vs\Release
dir %~dp0csound-vs\Release
qmake.exe qcs.pro ^
    CONFIG+=html_webengine ^
    CONFIG+=thread ^
    CONFIG+=csound6 ^
    CONFIG+=build64 ^
    CONFIG+=QCS_QT59 ^
    QT+=xml ^
    DEFINES+="USE_DOUBLE=1" ^
    DEFINES+="USE_QT_GT_58=1" ^
    CSOUND_API_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\interfaces" ^
    CSOUND_LIBRARY_DIR="%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release" ^
    DEFAULT_CSOUND_LIBS=csound64.lib ^
    CSOUND_LIBRARY=csound64.lib ^
    -after ^
    LCSOUND=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release\\csound64.lib ^
    LIBS+="%VCPKGDir%\\installed\\x64-windows\\lib\\libsndfile-1.lib" ^
    LIBS+="%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release\\csound64.lib" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%~dp0deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%APPVEYOR_BUILD_FOLDER%\\deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%VCPKGDir%\\installed\\x64-windows\\include" ^
    INCLUDEPATH+="%VCPKGDir%\\installed\\x64-windows\\include"
nmake.exe
copy "bin\\CsoundQt*.*" "..\\..\\csound-vs\\Release\\"
cd ..\..

echo TODO: This is a mess. The CsoundQt build system needs some work and then this should be brought into appveyor.yaml.
cd staging\CsoundQt
echo "INCLUDE:" %INCLUDE%
set INCLUDE=%INCLUDE%%VCPKGDir%\\installed\\x64-windows\\include;
echo "INCLUDE:" %INCLUDE%
echo "CSOUND_LIBRARY_DIR:" %~dp0csound-vs\Release
dir %~dp0csound-vs\Release
qmake.exe qcs.pro ^
    CONFIG+=html_webengine ^
    CONFIG+=thread ^
    CONFIG+=perfThread_build ^
    CONFIG+=csound6 ^
    CONFIG+=build64 ^
    CONFIG+=QCS_QT59 ^
    QT+=xml ^
    DEFINES+="USE_DOUBLE=1" ^
    DEFINES+="USE_QT_GT_58=1" ^
    CSOUND_API_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR="%APPVEYOR_BUILD_FOLDER%\\interfaces" ^
    CSOUND_LIBRARY_DIR="%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release" ^
    DEFAULT_CSOUND_LIBS=csound64.lib ^
    CSOUND_LIBRARY=csound64.lib ^
    -after ^
    LCSOUND=%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release\\csound64.lib ^
    LIBS+="%VCPKGDir%\\installed\\x64-windows\\lib\\libsndfile-1.lib" ^
    LIBS+="%APPVEYOR_BUILD_FOLDER%\\msvc\\csound-vs\\Release\\csound64.lib" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%~dp0deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%APPVEYOR_BUILD_FOLDER%\\deps\\include" ^
    CSOUND_INTERFACES_INCLUDE_DIR+="%VCPKGDir%\\installed\\x64-windows\\include" ^
    INCLUDEPATH+="%VCPKGDir%\\installed\\x64-windows\\include"
nmake.exe
copy "bin\\CsoundQt*.*" "..\\..\\csound-vs\\Release\\"
cd ..\..

Support for MSVS 2017 for AppVeyor build.


SET GEOIPDATADIR=%LIBRARY_PREFIX%\share\GeoIP
SET INSTDIR=%LIBRARY_PREFIX%

nmake /f Makefile.vc
nmake /f Makefile.vc test
nmake /f Makefile.vc install

copy

SET GEOIPDATADIR=%LIBRARY_PREFIX%\\share\\GeoIP
SET INSTDIR=%LIBRARY_PREFIX%

nmake /f Makefile.vc
nmake /f Makefile.vc test
nmake /f Makefile.vc install

copy libGeoIP\\GeoIP.dll %LIBRARY_BIN%

copy to library bin [skip travis] [circle skip]


cmake ^
      -G "%CMAKE_GENERATOR%" ^
      -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
      -DWITH_INCHI=ON ^
      -DPYTHON_EXECUTABLE=%PYTHON% ^
      -DPYTHON_BINDINGS=ON ^
      -DRUN_SWIG=ON ^
      -DCMAKE_BUILD_TYPE=Release ^
      .

cmake --build . --target install --config Release

:: Where should BABEL_DATADIR go?
xcopy %PREFIX%\bin\data %PREFIX%\share\openbabel /e /c
rmdir /s /q %PREFIX%\bin\data

cmake ^
      -G "%CMAKE_GENERATOR%" ^
      -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
      -DWITH_INCHI=ON ^
      -DPYTHON_EXECUTABLE=%PYTHON% ^
      -DPYTHON_BINDINGS=ON ^
      -DRUN_SWIG=ON ^
      -DCMAKE_BUILD_TYPE=Release ^
      .

cmake --build . --target install --config Release

xcopy %PREFIX%\bin\data %PREFIX%\share\openbabel /e /c
rmdir /s /q %PREFIX%\bin\data

Update bld.bat

Update bld.bat


SET CMAKE_GENERATOR="NMake Makefiles"

%PYTHON% -m pip install . -vv
if errorlevel 1 exit 1

SET "CMAKE_GENERATOR=NMake Makefiles"

%PYTHON% -m pip install . -vv
if errorlevel 1 exit 1

Correct Cmake generator specification

Correct Cmake generator specification


REM SET "CMAKE_GENERATOR=NMake Makefiles"

mkdir tmp-build
cd tmp-build
cmake ../pythonfmu/pythonfmu-export -DPython3_EXECUTABLE:FILEPATH="%PYTHON%" -DCMAKE_BUILD_TYPE=Release -A x64
cmake --build . --config Release
cd ..

%PYTHON% -m pip install . -vv

if errorlevel 1 exit 1

REM SET "CMAKE_GENERATOR=NMake Makefiles"

mkdir tmp-build
cd tmp-build
cmake ../pythonfmu/pythonfmu-export -DPython3_EXECUTABLE:FILEPATH="%PYTHON%" -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
cd ..

%PYTHON% -m pip install . -vv

if errorlevel 1 exit 1

Remove unrecognized cmake option

Remove unrecognized cmake option


if %VS_MAJOR% == 9 (
    set "PATH=C:\Windows\Microsoft.NET\Framework\v4.0.30319;%PATH%"
)

%PYTHON% -m pip install . -vv

:: Nasty hack to force the newer MSBuild from .NET is still used for the older
:: Visual Studio build. Without this an older MSBuild will be picked up by accident on
:: AppVeyor after running `vcvars32.bat`, which fails to process our solution files.
::
:: ref: https://github.com/conda-forge/staged-recipes/pull/194#issuecomment-203577297
:: ref: https://github.com/conda-forge/libsodium-feedstock/commit/b411740e0f439d5a5d257f74f74945f86585684a#diff-d04c86b6bb20341f5f7c53165501a393R12
:: ref: https://stackoverflow.com/q/2709279
::
:: Also there is some bug using MSBuild from .NET to build with VS 2008 64-bit, which
:: we workaround as well.
::
:: ref: https://social.msdn.microsoft.com/Forums/vstudio/en-US/19bb86ab-258a-40a9-b9fc-3bf36cac46bc/team-build-error-msb4018-the-quotresolvevcprojectoutputquot-task-failed-unexpectedly?forum=tfsbuild
if %VS_MAJOR% == 9 (
    set "PATH=C:\Windows\Microsoft.NET\Framework\v4.0.30319;%PATH%"
    set VC_PROJECT_ENGINE_NOT_USING_REGISTRY_FOR_INIT=1
)

%PYTHON% -m pip install . -vv

Add more hacks for Appveyor

Add more hacks for Appveyor

Taken from
https://github.com/conda-forge/apr-feedstock/blob/master/recipe/bld.bat


@set __e=%1
@if "%1" == "" set __e=off
@echo %__e%
rem builder_custom_init

set VC_VER=14.0
set BUILDER_CFG_PLATFORM=Win64
set BUILDER_CFG_BUILD_TYPE=Release
set PYTHON_VERSION=3.6
set PYTHON_FILE_VERSION=36

rem if Win64 then setup path to include the 64bit CL.exe
rem when called in place this can fork bomb (lots of CMD.exe in task manager)
if exist "C:\Program Files (x86)\Microsoft Visual Studio %VC_VER%\VC\bin\amd64\vcvars64.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio %VC_VER%\VC\bin\amd64\vcvars64.bat"
)
if exist "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" (
    call "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
)
@echo %__e%

set PYTHON=c:\python%PYTHON_FILE_VERSION%.%BUILDER_CFG_PLATFORM%\python
PATH c:\python%PYTHON_FILE_VERSION%.%BUILDER_CFG_PLATFORM%;c:\Program Files\gettext-iconv\bin;%PATH%
%PYTHON% -c "import sys;print( 'Python:', sys.version )"

@set __e=%1
@if "%1" == "" set __e=off
@echo %__e%
rem builder_custom_init

set VC_VER=14.0
set BUILDER_CFG_PLATFORM=Win64
set BUILDER_CFG_BUILD_TYPE=Release
set PYTHON_VERSION=3.7
set PYTHON_FILE_VERSION=37

rem if Win64 then setup path to include the 64bit CL.exe
rem when called in place this can fork bomb (lots of CMD.exe in task manager)
if exist "C:\Program Files (x86)\Microsoft Visual Studio %VC_VER%\VC\bin\amd64\vcvars64.bat" (
    call "C:\Program Files (x86)\Microsoft Visual Studio %VC_VER%\VC\bin\amd64\vcvars64.bat"
)
if exist "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" (
    call "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
)
@echo %__e%

set PYTHON=c:\python%PYTHON_FILE_VERSION%.%BUILDER_CFG_PLATFORM%\python
PATH c:\python%PYTHON_FILE_VERSION%.%BUILDER_CFG_PLATFORM%;c:\Program Files\gettext-iconv\bin;%PATH%
%PYTHON% -c "import sys;print( 'Python:', sys.version )"

change to python 3.7

change to python 3.7


@echo on

set PYTHONIOENCODING="UTF-8"
set PYTHONUTF8=1
set RUST_BACKTRACE=1
set TEMP=%SRC_DIR%\tmpbuild_%PY_VER%

mkdir %TEMP%

rustc --version

IF %PKG_NAME% eq "oxigraph-server" (
    cd server
        cargo build --release || exit 1
    cd %SRC_DIR%

    dir target/release

    copy target/release/oxigraph_server %SCRIPTS%
)

IF %PKG_NAME% eq "oxigraph-wikibase" (
    cd wikibase
        cargo build --release || exit 1
    cd %SRC_DIR%

    dir target/release

    copy target/release/oxigraph_wikibase %SCRIPTS%
)

IF %PKG_NAME% eq "pyoxigraph" (
    cd %SRC_DIR%\python
        maturin build --release -i %PYTHON% || exit 1
    cd %SRC_DIR%

    dir target/wheels

    cd target/wheels
        chcp 65001
        FOR %%w IN (*.whl) DO (
            %PYTHON% -m pip install %%w --build tmpbuild_%PY_VER%
        )
    cd %SRC_DIR%
)

@echo on

set PYTHONIOENCODING="UTF-8"
set PYTHONUTF8=1
set RUST_BACKTRACE=1
set TEMP=%SRC_DIR%\tmpbuild_%PY_VER%

mkdir %TEMP%

rustc --version

IF "%PKG_NAME%" == "oxigraph-server" (
    cd server
        cargo build --release || exit 1
    cd %SRC_DIR%

    dir target/release

    copy target/release/oxigraph_server %SCRIPTS%
)

IF "%PKG_NAME%" == "oxigraph-wikibase" (
    cd wikibase
        cargo build --release || exit 1
    cd %SRC_DIR%

    dir target/release

    copy target/release/oxigraph_wikibase %SCRIPTS%
)

IF "%PKG_NAME%" == "pyoxigraph" (
    cd %SRC_DIR%\python
        maturin build --release -i %PYTHON% || exit 1
    cd %SRC_DIR%

    dir target/wheels

    cd target/wheels
        chcp 65001
        FOR %%w IN (*.whl) DO (
            %PYTHON% -m pip install %%w --build tmpbuild_%PY_VER%
        )
    cd %SRC_DIR%
)

fix bat file

fix bat file


@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


@echo off
@rem ******************************************
@rem **** Command file to invoke build.xml ****
@rem ******************************************
setlocal
set DEVPROPFILE=C:\NCI-Projects\ncit-properties\properties\dev-upgrade.properties
set CIPROPFILE=C:\NCI-Projects\ncit-properties\properties\ci-upgrade.properties
set QAPROPFILE=C:\NCI-Projects\ncit-properties\properties\qa-upgrade.properties
set DATAQAPROPFILE=C:\NCI-Projects\ncit-properties\properties\data-qa-upgrade.properties
cls
if "%1" == "" (
    echo.
    echo Available targets are:
    echo.
    echo   clean        -- Remove classes directory for clean build
    echo   all          -- Normal build of application
    echo   upgrade      -- Build and upgrade application
    echo   install      -- Builds, installs JBoss locally
    echo   dev          -- Builds, upgrades JBoss on DEV
    echo   qa           -- Builds, upgrades JBoss on QA
    echo   data-qa      -- Builds, upgrades JBoss on Data QA
    echo   deploy       -- Redeploy application
    goto DONE
)
if "%1" == "all" (
    ant -Danthill.build.tag_built=desktop build:all
    goto DONE
)
if "%1" == "upgrade" (
    ant -Danthill.build.tag_built=desktop deploy:local:upgrade
    goto DONE
)
if "%1" == "install" (
    ant -Danthill.build.tag_built=desktop deploy:local:install
    goto DONE
)
if "%1" == "deploy" (
    ant -Danthill.build.tag_built=desktop deploy:hot
    goto DONE
)
if "%1" == "clean" (
    ant clean
    if exist ..\target\*.* (
       rmdir /Q /S ..\target
    )
    goto DONE
)
if "%1" == "dev" (
    ant -Dproperties.file=%DEVPROPFILE% -Danthill.build.tag_built=desktop deploy:remote:upgrade
    goto DONE
)
if "%1" == "ci" (
    ant -Dproperties.file=%CIPROPFILE% -Danthill.build.tag_built=desktop deploy:remote:upgrade
    goto DONE
)
if "%1" == "qa" (
    ant -Dproperties.file=%QAPROPFILE% -Danthill.build.tag_built=desktop deploy:remote:upgrade
    goto DONE
)
if "%1" == "data-qa" (
    ant -Dproperties.file=%DATAQAPROPFILE% -Danthill.build.tag_built=desktop deploy:remote:upgrade
    goto DONE
)

:DONE
endlocal

@echo off
@rem ******************************************
@rem **** Command file to invoke build.xml ****
@rem ******************************************
setlocal
set DEVPROPFILE=C:\NCI-Projects\ncit-properties\properties\dev-upgrade.properties
set CIPROPFILE=C:\NCI-Projects\ncit-properties\properties\ci-upgrade.properties
set QAPROPFILE=C:\NCI-Projects\ncit-properties\properties\qa-upgrade.properties
set DATAQAPROPFILE=C:\NCI-Projects\ncit-properties\properties\data-qa-upgrade.properties
cls
if "%1" == "" (
    echo.
    echo Available targets are:
    echo.
    echo   clean        -- Remove classes directory for clean build
    echo   all          -- Normal build of application
    echo   upgrade      -- Build and upgrade application
    echo   install      -- Builds, installs JBoss locally
    echo   dev          -- Builds, upgrades JBoss on DEV
    echo   ci           -- Builds, upgrades JBoss on CI
    echo   qa           -- Builds, upgrades JBoss on QA
    echo   data-qa      -- Builds, upgrades JBoss on Data QA
    echo   deploy       -- Redeploy application
    goto DONE
)
if "%1" == "all" (
    ant -Danthill.build.tag_built=desktop build:all
    goto DONE
)
if "%1" == "upgrade" (
    ant -Danthill.build.tag_built=desktop deploy:local:upgrade
    goto DONE
)
if "%1" == "install" (
    ant -Danthill.build.tag_built=desktop deploy:local:install
    goto DONE
)
if "%1" == "deploy" (
    ant -Danthill.build.tag_built=desktop deploy:hot
    goto DONE
)
if "%1" == "clean" (
    ant clean
    if exist ..\target\*.* (
       rmdir /Q /S ..\target
    )
    goto DONE
)
if "%1" == "dev" (
    ant -Dproperties.file=%DEVPROPFILE% -Danthill.build.tag_built=desktop deploy:remote:upgrade
    goto DONE
)
if "%1" == "ci" (
    ant -Dproperties.file=%CIPROPFILE% -Danthill.build.tag_built=desktop deploy:remote:upgrade
    goto DONE
)
if "%1" == "qa" (
    ant -Dproperties.file=%QAPROPFILE% -Danthill.build.tag_built=desktop deploy:remote:upgrade
    goto DONE
)
if "%1" == "data-qa" (
    ant -Dproperties.file=%DATAQAPROPFILE% -Danthill.build.tag_built=desktop deploy:remote:upgrade
    goto DONE
)

:DONE
endlocal

Comment explaining how to invoke CI remote build.

SVN-Revision: 1297


@echo off
"%~dp0\resources\python35\win32\python.exe" "%~dp0DecoraterBot.py" 2>resources\Logs\unhandled_tracebacks.txt
pause - stop

Edit - Pause

Edit - Pause

Added - stop so it releases the actual meaning eg.. it looks at it properally, and does the pause instantly.


@REM @file
@REM   Windows batch file to setup a WORKSPACE environment
@REM
@REM Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
@REM This program and the accompanying materials
@REM are licensed and made available under the terms and conditions of the BSD License
@REM which accompanies this distribution.  The full text of the license may be found at
@REM http://opensource.org/licenses/bsd-license.php
@REM
@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@REM

@REM set CYGWIN_HOME=C:\cygwin

@REM usage:
@REM   edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]
@REM if the argument, skip is present, only the paths and the
@REM test and set of environment settings are performed.

@REM ##############################################################
@REM # You should not have to modify anything below this line
@REM #

@echo off

@REM
@REM Set the WORKSPACE to the current working directory
@REM
pushd .
cd %~dp0

if not defined WORKSPACE (
  @goto SetWorkSpace
)

if %WORKSPACE% == %CD% (
  @REM Workspace is not changed.
  @goto ParseArgs
)

:SetWorkSpace
@REM set new workspace
@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace
set WORKSPACE=%CD%
set EFI_SOURCE=
set EDK_SOURCE=

:ParseArgs
@if /I "%1"=="-h" goto Usage
@if /I "%1"=="-help" goto Usage
@if /I "%1"=="--help" goto Usage
@if /I "%1"=="/h" goto Usage
@if /I "%1"=="/?" goto Usage
@if /I "%1"=="/help" goto Usage

@if /I not "%1"=="--nt32" goto no_nt32

@REM Flag, --nt32 is set
@REM The Nt32 Emluation Platform requires Microsoft Libraries
@REM and headers to interface with Windows.

if not defined VCINSTALLDIR (
  if defined VS100COMNTOOLS (
    call "%VS100COMNTOOLS%\vsvars32.bat"
  ) else (
    if defined VS90COMNTOOLS (
      call "%VS90COMNTOOLS%\vsvars32.bat"
    ) else (
      if defined VS80COMNTOOLS (
        call "%VS80COMNTOOLS%\vsvars32.bat"
      ) else (
	if defined VS71COMNTOOLS (
          call "%VS71COMNTOOLS%\vsvars32.bat"
        ) else (
          echo.
          echo !!! WARNING !!! Cannot find Visual Studio !!!
          echo.
        )
      )
    )
  )
)
shift

:no_nt32
@if /I "%1"=="NewBuild" shift
@if not defined EDK_TOOLS_PATH set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
@IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools
@call %EDK_TOOLS_PATH%\toolsetup.bat %*
@if /I "%1"=="Reconfig" shift
@goto check_cygwin

:BadBaseTools
  @REM
  @REM Need the BaseTools Package in order to build
  @REM
  echo.
  echo !!! ERROR !!! The BaseTools Package was not found !!!
  echo.
  echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,
  echo For example,
  echo   set EDK_TOOLS_PATH=C:\MyTools\BaseTools
  echo The setup script, toolsetup.bat must reside in this folder.
  echo.
  @goto end

:check_cygwin
  @if exist c:\cygwin (
    @set CYGWIN_HOME=c:\cygwin
  ) else (
    @echo.
    @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!
    @echo.
  )

@if NOT "%1"=="" goto Usage
@goto end

:Usage
  @echo.
  @echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32] [Reconfig]"
  @echo         --nt32         Call vsvars32.bat for NT32 platform build.
  @echo.
  @echo         Reconfig       Reinstall target.txt, tools_def.txt and build_rule.txt.
  @echo.
  @echo  Note that target.template, tools_def.template and build_rules.template
  @echo  will be only copied to target.txt, tools_def.txt and build_rule.txt
  @echo  respectively if they do not exist. Using option [Reconfig] to force the copy.
  @echo.
  @goto end

:end
  @popd
  @echo on

@REM @file
@REM   Windows batch file to setup a WORKSPACE environment
@REM
@REM Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
@REM This program and the accompanying materials
@REM are licensed and made available under the terms and conditions of the BSD License
@REM which accompanies this distribution.  The full text of the license may be found at
@REM http://opensource.org/licenses/bsd-license.php
@REM
@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@REM

@REM set CYGWIN_HOME=C:\cygwin

@REM usage:
@REM   edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]
@REM if the argument, skip is present, only the paths and the
@REM test and set of environment settings are performed.

@REM ##############################################################
@REM # You should not have to modify anything below this line
@REM #

@echo off

@REM
@REM Set the WORKSPACE to the current working directory
@REM
pushd .
cd %~dp0

if not defined WORKSPACE (
  @goto SetWorkSpace
)

if %WORKSPACE% == %CD% (
  @REM Workspace is not changed.
  @goto ParseArgs
)

:SetWorkSpace
@REM set new workspace
@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace
set WORKSPACE=%CD%
set EFI_SOURCE=
set EDK_SOURCE=

:ParseArgs
@if /I "%1"=="-h" goto Usage
@if /I "%1"=="-help" goto Usage
@if /I "%1"=="--help" goto Usage
@if /I "%1"=="/h" goto Usage
@if /I "%1"=="/?" goto Usage
@if /I "%1"=="/help" goto Usage

@if /I not "%1"=="--nt32" goto no_nt32

@REM Flag, --nt32 is set
@REM The Nt32 Emluation Platform requires Microsoft Libraries
@REM and headers to interface with Windows.

if not defined VCINSTALLDIR (
  if defined VS110COMNTOOLS (
    call "%VS110COMNTOOLS%\vsvars32.bat"
  ) else (
    if defined VS100COMNTOOLS (
      call "%VS100COMNTOOLS%\vsvars32.bat"
    ) else (
      if defined VS90COMNTOOLS (
        call "%VS90COMNTOOLS%\vsvars32.bat"
      ) else (
        if defined VS80COMNTOOLS (
          call "%VS80COMNTOOLS%\vsvars32.bat"
        ) else (
          if defined VS71COMNTOOLS (
            call "%VS71COMNTOOLS%\vsvars32.bat"
          ) else (
            echo.
            echo !!! WARNING !!! Cannot find Visual Studio !!!
            echo.
          )
        )
      )
    )
  )
)
shift

:no_nt32
@if /I "%1"=="NewBuild" shift
@if not defined EDK_TOOLS_PATH set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
@IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools
@call %EDK_TOOLS_PATH%\toolsetup.bat %*
@if /I "%1"=="Reconfig" shift
@goto check_cygwin

:BadBaseTools
  @REM
  @REM Need the BaseTools Package in order to build
  @REM
  echo.
  echo !!! ERROR !!! The BaseTools Package was not found !!!
  echo.
  echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,
  echo For example,
  echo   set EDK_TOOLS_PATH=C:\MyTools\BaseTools
  echo The setup script, toolsetup.bat must reside in this folder.
  echo.
  @goto end

:check_cygwin
  @if exist c:\cygwin (
    @set CYGWIN_HOME=c:\cygwin
  ) else (
    @echo.
    @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!
    @echo.
  )

@if NOT "%1"=="" goto Usage
@goto end

:Usage
  @echo.
  @echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32] [Reconfig]"
  @echo         --nt32         Call vsvars32.bat for NT32 platform build.
  @echo.
  @echo         Reconfig       Reinstall target.txt, tools_def.txt and build_rule.txt.
  @echo.
  @echo  Note that target.template, tools_def.template and build_rules.template
  @echo  will be only copied to target.txt, tools_def.txt and build_rule.txt
  @echo  respectively if they do not exist. Using option [Reconfig] to force the copy.
  @echo.
  @goto end

:end
  @popd
  @echo on

Update edksetup.bat to check VS2012

Update edksetup.bat to check VS2012

Signed-off-by: Liming Gao <liming.gao@intel.com>

git-svn-id: 3158a46dfd52e07d1fda3e32e1ab2e353a00b20f@14626 6f19259b-4bc3-4df7-8a09-765794883524


md include
md include\google
md include\google\protobuf
md include\google\protobuf\stubs
md include\google\protobuf\io
md include\google\protobuf\compiler
md include\google\protobuf\compiler\cpp
md include\google\protobuf\compiler\java
md include\google\protobuf\compiler\python
copy ..\src\google\protobuf\stubs\common.h include\google\protobuf\stubs\common.h
copy ..\src\google\protobuf\stubs\once.h include\google\protobuf\stubs\once.h
copy ..\src\google\protobuf\descriptor.h include\google\protobuf\descriptor.h
copy ..\src\google\protobuf\descriptor.pb.h include\google\protobuf\descriptor.pb.h
copy ..\src\google\protobuf\descriptor_database.h include\google\protobuf\descriptor_database.h
copy ..\src\google\protobuf\dynamic_message.h include\google\protobuf\dynamic_message.h
copy ..\src\google\protobuf\extension_set.h include\google\protobuf\extension_set.h
copy ..\src\google\protobuf\generated_message_util.h include\google\protobuf\generated_message_util.h
copy ..\src\google\protobuf\generated_message_reflection.h include\google\protobuf\generated_message_reflection.h
copy ..\src\google\protobuf\message.h include\google\protobuf\message.h
copy ..\src\google\protobuf\message_lite.h include\google\protobuf\message_lite.h
copy ..\src\google\protobuf\reflection_ops.h include\google\protobuf\reflection_ops.h
copy ..\src\google\protobuf\repeated_field.h include\google\protobuf\repeated_field.h
copy ..\src\google\protobuf\service.h include\google\protobuf\service.h
copy ..\src\google\protobuf\text_format.h include\google\protobuf\text_format.h
copy ..\src\google\protobuf\unknown_field_set.h include\google\protobuf\unknown_field_set.h
copy ..\src\google\protobuf\wire_format.h include\google\protobuf\wire_format.h
copy ..\src\google\protobuf\wire_format_lite.h include\google\protobuf\wire_format_lite.h
copy ..\src\google\protobuf\wire_format_lite_inl.h include\google\protobuf\wire_format_lite_inl.h
copy ..\src\google\protobuf\io\coded_stream.h include\google\protobuf\io\coded_stream.h
copy ..\src\google\protobuf\io\gzip_stream.h include\google\protobuf\io\gzip_stream.h
copy ..\src\google\protobuf\io\printer.h include\google\protobuf\io\printer.h
copy ..\src\google\protobuf\io\tokenizer.h include\google\protobuf\io\tokenizer.h
copy ..\src\google\protobuf\io\zero_copy_stream.h include\google\protobuf\io\zero_copy_stream.h
copy ..\src\google\protobuf\io\zero_copy_stream_impl.h include\google\protobuf\io\zero_copy_stream_impl.h
copy ..\src\google\protobuf\io\zero_copy_stream_impl_lite.h include\google\protobuf\io\zero_copy_stream_impl_lite.h
copy ..\src\google\protobuf\compiler\code_generator.h include\google\protobuf\compiler\code_generator.h
copy ..\src\google\protobuf\compiler\command_line_interface.h include\google\protobuf\compiler\command_line_interface.h
copy ..\src\google\protobuf\compiler\importer.h include\google\protobuf\compiler\importer.h
copy ..\src\google\protobuf\compiler\parser.h include\google\protobuf\compiler\parser.h
copy ..\src\google\protobuf\compiler\cpp\cpp_generator.h include\google\protobuf\compiler\cpp\cpp_generator.h
copy ..\src\google\protobuf\compiler\java\java_generator.h include\google\protobuf\compiler\java\java_generator.h
copy ..\src\google\protobuf\compiler\python\python_generator.h include\google\protobuf\compiler\python\python_generator.h
copy ..\src\google\protobuf\compiler\plugin.h include\google\protobuf\compiler\plugin.h

Add missing plugin.h into extract_includes.bat script.

git-svn-id: 54a00c96d7caad0f188abf6e0ebede48f6547068@387 630680e5-0e50-0410-840e-4b1c322b438d


setlocal
call settings.bat

rem svn checkout http://svn.osgeo.org/geos/trunk geos-svn
git clone --depth 1 https://github.com/alacarte-maps/alacarte.git

cd alacarte

mkdir build
cd build

cmake .. %GENERATOR% -DCMAKE_BUILD_TYPE=%VARIANT% -DCMAKE_INSTALL_PREFIX=%PREFIX1% -DBOOST_ROOT=%BOOST_ROOT% -DBoost_USE_STATIC_LIBS=ON -DBoost_ADDITIONAL_VERSIONS=1.58;1.59
%ER%
%MSBUILDINSTALL%
%ER%
%MSBUILD% tests.vcxproj
%ER%

cd ..\..

add alacarte

add alacarte


"%PREFIX%\Scripts\npm.cmd" install -g npm@latest --no-spin && "%PREFIX%\Scripts\npm.cmd" install . --no-spin --no-progress && "%PREFIX%\Scripts\npm.cmd" run test --no-progress --no-spin && if errorlevel 1 exit 1

"%PREFIX%\node_modules\npm\npm.cmd" install . --no-spin --no-progress && "%PREFIX%\node_modules\npm\npm.cmd" run test --no-progress --no-spin && if errorlevel 1 exit 1

Use most canonical location for npm

Use most canonical location for npm


@REM
@REM Copyright (c) 2006, Intel Corporation
@REM All rights reserved. This program and the accompanying materials
@REM are licensed and made available under the terms and conditions of the BSD License
@REM which accompanies this distribution.  The full text of the license may be found at
@REM http://opensource.org/licenses/bsd-license.php
@REM
@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@REM

@echo off

:check_java
if "%JAVA_HOME%"=="" goto no_jdk
:check_wks
if "%WORKSPACE%"=="" goto no_wks
:check_ant
if "%ANT_HOME%"=="" goto no_ant
:check_xmlbeans
if "%XMLBEANS_HOME%"=="" goto no_xmlbeans
:check_surfacearea
if not exist %WORKSPACE%\Tools\Jars\SurfaceArea.jar (
  goto no_surfacearea
)
:check_ContextTool
if not exist %WORKSPACE%\Tools\Jars\ContextTool.jar (
  goto no_ContextTool
)

@REM Run Framework Wizard
call "java" -cp %CLASSPATH%;%WORKSPACE%\Tools\Jars\ContextTool.jar org.tianocore.context.ContextMain %*

goto end

:no_jdk
@echo.
@echo !!! Please set JAVA_HOME !!!
@echo.
goto check_wks

:no_wks
@echo.
@echo !!! Please set WORKSPACE !!!
@echo.
goto check_ant

:no_ant
@echo.
@echo !!! Please set ANT_HOME !!!
@echo.
goto check_xmlbeans

:no_xmlbeans
@echo.
@echo !!! Please set XMLBEANS_HOME !!!
@echo.
goto end

:no_surfacearea
@echo.
@echo !!! Please run edksetup.bat to build SurfaceArea.jar !!!
@echo.
goto end

:no_ContextTool
@echo.
@echo !!! Please run edksetup.bat to build ContextTool.jar !!!
@echo.
goto end

:end
@echo on

@REM
@REM Copyright (c) 2006, Intel Corporation
@REM All rights reserved. This program and the accompanying materials
@REM are licensed and made available under the terms and conditions of the BSD License
@REM which accompanies this distribution.  The full text of the license may be found at
@REM http://opensource.org/licenses/bsd-license.php
@REM
@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@REM

@echo off

:check_java
if "%JAVA_HOME%"=="" goto no_jdk
:check_wks
if "%WORKSPACE%"=="" goto no_wks
:check_ant
if "%ANT_HOME%"=="" goto no_ant
:check_xmlbeans
if "%XMLBEANS_HOME%"=="" goto no_xmlbeans
:check_surfacearea
if not exist %WORKSPACE%\Tools\Jars\SurfaceArea.jar (
  goto no_surfacearea
)
:check_ContextTool
if not exist %WORKSPACE%\Tools\Jars\ContextTool.jar (
  goto no_ContextTool
)

@REM Run Framework Wizard
call "java" -cp "%WORKSPACE%\Tools\Jars\ContextTool.jar" org.tianocore.context.ContextMain %*

goto end

:no_jdk
@echo.
@echo !!! Please set JAVA_HOME !!!
@echo.
goto check_wks

:no_wks
@echo.
@echo !!! Please set WORKSPACE !!!
@echo.
goto check_ant

:no_ant
@echo.
@echo !!! Please set ANT_HOME !!!
@echo.
goto check_xmlbeans

:no_xmlbeans
@echo.
@echo !!! Please set XMLBEANS_HOME !!!
@echo.
goto end

:no_surfacearea
@echo.
@echo !!! Please run edksetup.bat to build SurfaceArea.jar !!!
@echo.
goto end

:no_ContextTool
@echo.
@echo !!! Please run edksetup.bat to build ContextTool.jar !!!
@echo.
goto end

:end
@echo on

Fix the CLASSPATH

Fix the CLASSPATH

git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@1805 6f19259b-4bc3-4df7-8a09-765794883524


dotnet publish -c Release -r win7-x64 -o bin/win7 Infinni.Northwind.csproj
dotnet publish -c Release -r win81-x64 -o bin/win81 Infinni.Northwind.csproj
dotnet publish -c Release -r win10-x64 -o bin/win10 Infinni.Northwind.csproj

dotnet publish -c Release -r win7-x64 -o bin/win7
dotnet publish -c Release -r win81-x64 -o bin/win81
dotnet publish -c Release -r win10-x64 -o bin/win10

Remove project name from publish script

Remove project name from publish script


REM Add other things if could be automated, RUN THIS AS ADMIN
REM Everything is added, including PowerShell command execution and "wget" lol
@echo off
echo Checking if script contains Administrative rights...
net sessions
if %errorlevel%==0 (
echo Success!
) else (
echo No admin, please run with Administrative rights...
pause
exit
)
REM Windows Defender scan
echo "SCANNING WITH DEFAULT WINDOWS DEFENDER!"
cd C:\Program Files\Windows Defender\
MpCmdRun.exe -Scan 2
REM Listing possible penetrations
cd C:\
echo "STARTING TO OUTPUT PROCESS FILES DIRECTLY TO THE C:\ DRIVE!"
wmic process list brief > BriefProcesses.txt
if %errorlevel%==1 echo Brief Processes failed to write
wmic process list full >FullProcesses.txt
if %errorlevel%==1 echo Full Processes failed to write
wmic startup list full > StartupLists.txt
if %errorlevel%==1 echo Startup Processes failed to write
net start > StartedProcesses.txt
if %errorlevel%==1 echo Started processes failed to write
reg export HKLM\Software\Microsoft\Windows\CurrentVersion\Run  Run.reg
if %errorlevel%==1 echo Run processes failed to write
echo "OUTPUT DONE, CHANGING PASSWORD POLICIES!"
REM Passwords must be 10 digits
net accounts /minpwlen:10
REM Passwords must be changed every 30 days
net accounts /maxpwage:30
REM Passwords can only be changed after 1 day has passed
net accounts /minpwage:1
REM Display current password policy
net accounts
REM Turn on UAC
echo "TURNING ON UAC"
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f
REM No Remote Desktop
echo "DISABLING REMOTE DESKTOP"
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f
REM Windows auomatic updates
echo "ENABLING AUTO-UPDATES"
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 3 /f
REM Removing good ol' insecure stuff
echo "DISABLING WEAK SERVICES"
dism /online /disable-feature /featurename:IIS-WebServerRole >NUL
dism /online /disable-feature /featurename:IIS-WebServer >NUL
dism /online /disable-feature /featurename:IIS-CommonHttpFeatures >NUL
dism /online /disable-feature /featurename:IIS-HttpErrors >NUL
dism /online /disable-feature /featurename:IIS-HttpRedirect >NUL
dism /online /disable-feature /featurename:IIS-ApplicationDevelopment >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility >NUL
dism /online /disable-feature /featurename:IIS-NetFxExtensibility45 >NUL
dism /online /disable-feature /featurename:IIS-HealthAndDiagnostics >NUL
dism /online /disable-feature /featurename:IIS-HttpLogging >NUL
dism /online /disable-feature /featurename:IIS-LoggingLibraries >NUL
dism /online /disable-feature /featurename:IIS-RequestMonitor >NUL
dism /online /disable-feature /featurename:IIS-HttpTracing >NUL
dism /online /disable-feature /featurename:IIS-Security >NUL
dism /online /disable-feature /featurename:IIS-URLAuthorization >NUL
dism /online /disable-feature /featurename:IIS-RequestFiltering >NUL
dism /online /disable-feature /featurename:IIS-IPSecurity >NUL
dism /online /disable-feature /featurename:IIS-Performance >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionDynamic >NUL
dism /online /disable-feature /featurename:IIS-WebServerManagementTools >NUL
dism /online /disable-feature /featurename:IIS-ManagementScriptingTools >NUL
dism /online /disable-feature /featurename:IIS-IIS6ManagementCompatibility >NUL
dism /online /disable-feature /featurename:IIS-Metabase >NUL
dism /online /disable-feature /featurename:IIS-HostableWebCore >NUL
dism /online /disable-feature /featurename:IIS-StaticContent >NUL
dism /online /disable-feature /featurename:IIS-DefaultDocument >NUL
dism /online /disable-feature /featurename:IIS-DirectoryBrowsing >NUL
dism /online /disable-feature /featurename:IIS-WebDAV >NUL
dism /online /disable-feature /featurename:IIS-WebSockets >NUL
dism /online /disable-feature /featurename:IIS-ApplicationInit >NUL
dism /online /disable-feature /featurename:IIS-ASPNET >NUL
dism /online /disable-feature /featurename:IIS-ASPNET45 >NUL
dism /online /disable-feature /featurename:IIS-ASP >NUL
dism /online /disable-feature /featurename:IIS-CGI >NUL
dism /online /disable-feature /featurename:IIS-ISAPIExtensions >NUL
dism /online /disable-feature /featurename:IIS-ISAPIFilter >NUL
dism /online /disable-feature /featurename:IIS-ServerSideIncludes >NUL
dism /online /disable-feature /featurename:IIS-CustomLogging >NUL
dism /online /disable-feature /featurename:IIS-BasicAuthentication >NUL
dism /online /disable-feature /featurename:IIS-HttpCompressionStatic >NUL
dism /online /disable-feature /featurename:IIS-ManagementConsole >NUL
dism /online /disable-feature /featurename:IIS-ManagementService >NUL
dism /online /disable-feature /featurename:IIS-WMICompatibility >NUL
dism /online /disable-feature /featurename:IIS-LegacyScripts >NUL
dism /online /disable-feature /featurename:IIS-LegacySnapIn >NUL
dism /online /disable-feature /featurename:IIS-FTPServer >NUL
dism /online /disable-feature /featurename:IIS-FTPSvc >NUL
dism /online /disable-feature /featurename:IIS-FTPExtensibility >NUL
dism /online /disable-feature /featurename:TFTP >NUL
dism /online /disable-feature /featurename:TelnetClient >NUL
dism /online /disable-feature /featurename:TelnetServer >NUL
REM START SYS INTEG SCAN!
echo "STARTING SYSTEM INTERGRITY SCAN"
Sfc.exe /scannow
REM PowerShell RootKit detection start
echo "POWERSHELL ROOTKIT DETECTION WITH MALWAREBYTES ROOTKIT BETA"
powershell Invoke-WebRequest -OutFile MBRTKit.exe https://data-cdn.mbamupdates.com/web/mbar-1.09.3.1001.exe
MBRTKit.exe
PAUSE

REM Add other things if could be automated, RUN THIS AS ADMIN
REM Everything is added, including PowerShell command execution and "wget" lol
REM Admin checking...
@echo off
echo Checking if script contains Administrative rights...
net sessions
if %errorlevel%==0 (
echo Success!
) else (
echo No admin, please run with Administrative rights...
pause
exit
)

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

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

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

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

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

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

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

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

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

PAUSE

Update Main.bat

Update Main.bat


SET SCRIPTPATH=%~dp0
CD /D %~dp0

SET platform=win_32
if defined ProgramFiles(x86) (
	SET platform=win_64
)

if defined TARGET (
	SET platform=%TARGET%
)

if not exist "%platform%" (
	md "%platform%"
)

if not exist "%platform%\build" (
	md "%platform%\build"
)

if "%platform%" == "win_64" (
	SET URL=http://download.icu-project.org/files/icu4c/55.1/icu4c-55_1-Win64-msvc10.zip
) else (
	SET URL=http://download.icu-project.org/files/icu4c/55.1/icu4c-55_1-Win32-msvc10.zip
)

if exist "%SCRIPTPATH%%platform%\icu.zip" (
    echo "icu already downloaded"
) else (
    Powershell.exe Invoke-WebRequest -OutFile %platform%\icu.zip -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox "%URL%"
)

SET UNSIP_PROGRAMM="C:\Program Files\7-Zip\7z.exe"
SET UNSIP_PROGRAMM2="C:\Program Files (x86)\7-Zip\7z.exe"
if exist %UNSIP_PROGRAMM2% (
	SET UNSIP_PROGRAMM=%UNSIP_PROGRAMM2%
)

if exist "%SCRIPTPATH%%platform%\icu\" (
	echo "icu already extracted"
) else (
    call %UNSIP_PROGRAMM% x "%SCRIPTPATH%%platform%\icu.zip" -o"%SCRIPTPATH%%platform%\"
)

if "%platform%" == "win_64" (
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin64\icudt55.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin64\icuuc55.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib64\icudt.lib" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib64\icuuc.lib" "%SCRIPTPATH%%platform%\build\"
) else (
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin\icudt55.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin\icuuc55.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib\icudt.lib" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib\icuuc.lib" "%SCRIPTPATH%%platform%\build\"
)

SET SCRIPTPATH=%~dp0
CD /D %~dp0

SET platform=win_32
if defined ProgramFiles(x86) (
	SET platform=win_64
)

if defined TARGET (
	SET platform=%TARGET%
)

if "%TARGET%" == "win_32" (
  SET MACHINE=x86
)

if "%TARGET%" == "win_64" (
  SET MACHINE=x64
)

if not exist "%platform%" (
	md "%platform%"
)

if not exist "%platform%\build" (
	md "%platform%\build"
)

cd "%SCRIPTPATH%%platform%"

if exist "%SCRIPTPATH%%platform%\icu\" (
	echo "icu already exported"
) else (
	svn export http://source.icu-project.org/repos/icu/tags/release-60-2/icu4c ./icu
)

SET VC=%ProgramFiles%\Microsoft Visual Studio 14.0\VC
SET VC64=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC
if exist %VC64% (
	SET VC=%VC64%
)

call "%VC%\vcvarsall.bat" %MACHINE%

if "%platform%" == "win_64" (
	devenv.com icu\source\allinone\allinone.sln /build "Release|x64"
) else (
	devenv.com icu\source\allinone\allinone.sln /build "Release|Win32"
)

if "%platform%" == "win_64" (
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin64\icudt60.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin64\icuuc60.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib64\icudt.lib" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib64\icuuc.lib" "%SCRIPTPATH%%platform%\build\"
) else (
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin\icudt60.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\bin\icuuc60.dll" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib\icudt.lib" "%SCRIPTPATH%%platform%\build\"
XCOPY /Y "%SCRIPTPATH%%platform%\icu\lib\icuuc.lib" "%SCRIPTPATH%%platform%\build\"
)

Add icu building from source code on windows


OverdriveNTool.exe -r0 -r1 -r2 -p0Vega56 -p1Vega56 -p2Vega64

Create run-over.bat

Create run-over.bat


@echo off
:: 32-bit shared build
if not exist glfw-Win32 mkdir glfw-Win32
pushd glfw-Win32
cmake -G"Visual Studio 14 2015" -DBUILD_SHARED_LIBS=ON ..\glfw-3.1.1
msbuild /v:m /p:Configuration="Release";OutDir="..\mercury-Win32\" src\glfw.vcxproj
popd

:: 64-bit shared build
if not exist glfw-x64 mkdir glfw-x64
pushd glfw-x64
cmake -G"Visual Studio 14 2015 Win64" -DBUILD_SHARED_LIBS=ON ..\glfw-3.1.1
msbuild /v:m /p:Configuration="Release";OutDir="..\mercury-x64\" src\glfw.vcxproj
popd

@echo off
:: 32-bit shared build
if not exist glfw-Win32 mkdir glfw-Win32
pushd glfw-Win32
cmake -G"Visual Studio 14 2015" -DBUILD_SHARED_LIBS=ON ..\glfw-3.1.1
msbuild /v:m /p:Configuration="Release";OutDir=..\..\mercury-Win32\ src\glfw.vcxproj
popd

:: 64-bit shared build
if not exist glfw-x64 mkdir glfw-x64
pushd glfw-x64
cmake -G"Visual Studio 14 2015 Win64" -DBUILD_SHARED_LIBS=ON ..\glfw-3.1.1
msbuild /v:m /p:Configuration="Release";OutDir=..\..\mercury-x64\ src\glfw.vcxproj
popd

Fix OutDir

Fix OutDir


set PIP_FIND_LINKS="https://whls.blob.core.windows.net/unstable/index.html"
pip install lytest simphony sax jax sklearn klayout devsim
pip install "jaxlib[cuda111]" -f https://whls.blob.core.windows.net/unstable/index.html --use-deprecated legacy-resolver
pip install gdsfactory==5.54.0
gf tool install

cd ..\condabin
call conda activate
call conda install -c conda-forge git -y
if exist "%USERPROFILE%\Desktop\gdsfactory" (goto SKIP_INSTALL)
cd %USERPROFILE%\Desktop
call git clone https://github.com/SkandanC/gdsfactory.git

cd gdsfactory
python shortcuts.py

:SKIP_INSTALL
echo gdsfactory installed

set PIP_FIND_LINKS="https://whls.blob.core.windows.net/unstable/index.html"
pip install lytest simphony sax jax sklearn klayout devsim
pip install "jaxlib[cuda111]" -f https://whls.blob.core.windows.net/unstable/index.html --use-deprecated legacy-resolver
pip install gdsfactory==5.54.0
gf tool install

cd ..\condabin
call conda activate
call conda install -c conda-forge git -y
if exist "%USERPROFILE%\Desktop\gdsfactory" (goto SKIP_INSTALL)
cd %USERPROFILE%\Desktop
call git clone https://github.com/SkandanC/gdsfactory.git -b Add-shortcut-during-installation

cd gdsfactory
python shortcuts.py

:SKIP_INSTALL
echo gdsfactory installed

Update install.bat

Update install.bat


@ECHO OFF
:: don't leak env variables into the calling interpreter...
setlocal
:: better defaults for dealing with quotes...
:: You need to escape ! afterwards with ^^! or "^!"
SETLOCAL enabledelayedexpansion

:: A comment on quotes around file path variables:
:: only add quotes around the variable when you use the variable
:: as a file path (exists, type, pipe,...) and the parenthesis of a
:: for, not when used as a string (-> setting variables)

:: more does not work if the codepage is set to unicode 65001
for /F "tokens=*" %%F in ('chcp') do (
    for %%A in (%%F) do (set _last=%%A)
)
SET CP=%_last:~0,-1%
chcp 850 > NUL
:: echo %CP%

:: not so sane default...
SET PREFIX=C:\SCM\PortableGit\mingw64

:: find a git.exe in path and use that as a default dir
where /Q git.exe
if errorlevel 1 goto :defaultpath

for /F "delims=" %%F in ('where git.exe') do (
    set bindir=%%~dpF
    rem break after the first, so that we get the first in path
    goto :break
)
goto :defaultpath

:break
rem remove the last slash
SET bindir=%bindir:~0,-1%
for %%G in ("%bindir%") do set installdir=%%~dpG
set PREFIX=%installdir%mingw64
goto :foundprefix

:defaultpath
:: default for Git for Windows 2.x
if exist "%ProgramFiles%\Git" (
    set PREFIX=%ProgramFiles%\Git\mingw64
)

:foundprefix
:: overwrite with whatever the user supplied...
IF NOT "%~1"=="" (
    REM make it easier for the user to specify a prefix:
    REM just supplying the git dir is enough...
    if exist "%~1\mingw64" (
        set PREFIX=%~1\mingw64
    ) else (
        echo Using git install path "%~1" as PREFIX, please make sure it's really a
        echo path to the mingw64 directory...
        echo.
        SET PREFIX=%~1
    )
)
:: remove a trailing slash, but only after removing quotes...
set PREFIX=!PREFIX:"=!
IF %PREFIX:~-1%==\ SET PREFIX=%PREFIX:~0,-1%

for %%H in ("%PREFIX%") do set GIT_INSTALL_DIR=%%~dpH

set GIT_INSTALL_DIR=!GIT_INSTALL_DIR:"=!
IF %GIT_INSTALL_DIR:~-1%==\ SET GIT_INSTALL_DIR=%GIT_INSTALL_DIR:~0,-1%

if not exist "%GIT_INSTALL_DIR%\mingw64" (
    echo No mingw64 folder found in %GIT_INSTALL_DIR%.
    echo.
    echo Please supply a proper "Git for Windows 2.x" install path:
    echo "install.cmd c:\[git-install-path]"
    set ERROR=1
    goto :exit
)

echo Installing to %PREFIX%
SET HTMLDIR=%PREFIX%\share\doc\git-doc
SET GITEXTRAS=%~dp0

IF NOT EXIST "%PREFIX%\bin" MKDIR "%PREFIX%\bin"

:: Check that we can install into that dir or need admin rights...
set _testfile=%PREFIX%\bin\testfile_to_check_if_dir_is_writeable-577423947123.~
copy NUL "%_testfile%" >NUL 2>&1
IF EXIST "%_testfile%" (
    set IS_WRITEABLE=yes
    del "%_testfile%"
) else (
    set IS_WRITEABLE=no
)
if "%IS_WRITEABLE%"=="no" (
    echo.
    echo Directory for binaries ["%PREFIX%\bin"] is not writeable by install.cmd.
    echo.
    echo You probably need to run install.cmd from an admin prompt.
    set ERROR=1
    goto :exit
)

SET COMMANDS_WITHOUT_REPO=git-alias git-extras git-fork git-setup

echo Installing binaries...
FOR /R "%GITEXTRAS%\bin" %%i in (*.*) DO (
    ECHO #^^!/usr/bin/env bash > "%PREFIX%\bin\%%~ni"
    TYPE "%GITEXTRAS%\helper\reset-env" >> "%PREFIX%\bin\%%~ni"
    TYPE "%GITEXTRAS%\helper\git-extra-utility" >> "%PREFIX%\bin\%%~ni"
    TYPE "%GITEXTRAS%\helper\is-git-repo" >> "%PREFIX%\bin\%%~ni"
    MORE +2 "%GITEXTRAS%\bin\%%~ni" >> "%PREFIX%\bin\%%~ni"
)

FOR %%i in (%COMMANDS_WITHOUT_REPO%) DO (
    ECHO #^^!/usr/bin/env bash > "%PREFIX%\bin\%%i"
    TYPE "%GITEXTRAS%\helper\reset-env" >> "%PREFIX%\bin\%%i"
    TYPE "%GITEXTRAS%\helper\git-extra-utility" >> "%PREFIX%\bin\%%i"
    MORE +2 "%GITEXTRAS%\bin\%%i" >> "%PREFIX%\bin\%%i"
)

echo Installing man pages...
set _QUIET=/NP /NFL /NDL /NJS /NJH
ROBOCOPY %_QUIET% /IS "%GITEXTRAS%\man" "%HTMLDIR%" *.html
IF %ERRORLEVEL% GTR 7 (
    echo Not all html docs could be copied to "%GITEXTRAS%\man".
    echo.
    echo You probably need to run the install.cmd script from an admin prompt.
    set ERROR=1
    goto :exit
)
echo done

if not exist "%GIT_INSTALL_DIR%\usr\bin\column.exe" (
    where /Q column.exe
    if errorlevel 1 (
        echo.
        echo column.exe is missing: Not in "%GIT_INSTALL_DIR%\usr\bin" or in PATH!
        echo.
        echo "git summary", "git summary-line" and "git ignore-io" do not work without.
        echo If you need these commands, please install Git for Windows > 2.7.0.
        echo.
    )
)

:exit
@chcp %CP% > NUL
@endlocal enabledelayedexpansion
@endlocal
@exit /b %ERROR%

@ECHO OFF
:: don't leak env variables into the calling interpreter...
setlocal
:: better defaults for dealing with quotes...
:: You need to escape ! afterwards with ^^! or "^!"
SETLOCAL enabledelayedexpansion

:: A comment on quotes around file path variables:
:: only add quotes around the variable when you use the variable
:: as a file path (exists, type, pipe,...) and the parenthesis of a
:: for, not when used as a string (-> setting variables)

:: more does not work if the codepage is set to unicode 65001
for /F "tokens=*" %%F in ('chcp') do (
    for %%A in (%%F) do (set _last=%%A)
)
SET CP=%_last:~0%
chcp 850 > NUL
:: echo %CP%

:: not so sane default...
SET PREFIX=C:\SCM\PortableGit\mingw64

:: find a git.exe in path and use that as a default dir
where /Q git.exe
if errorlevel 1 goto :defaultpath

for /F "delims=" %%F in ('where git.exe') do (
    set bindir=%%~dpF
    rem break after the first, so that we get the first in path
    goto :break
)
goto :defaultpath

:break
rem remove the last slash
SET bindir=%bindir:~0,-1%
for %%G in ("%bindir%") do set installdir=%%~dpG
set PREFIX=%installdir%mingw64
goto :foundprefix

:defaultpath
:: default for Git for Windows 2.x
if exist "%ProgramFiles%\Git" (
    set PREFIX=%ProgramFiles%\Git\mingw64
)

:foundprefix
:: overwrite with whatever the user supplied...
IF NOT "%~1"=="" (
    REM make it easier for the user to specify a prefix:
    REM just supplying the git dir is enough...
    if exist "%~1\mingw64" (
        set PREFIX=%~1\mingw64
    ) else (
        echo Using git install path "%~1" as PREFIX, please make sure it's really a
        echo path to the mingw64 directory...
        echo.
        SET PREFIX=%~1
    )
)
:: remove a trailing slash, but only after removing quotes...
set PREFIX=!PREFIX:"=!
IF %PREFIX:~-1%==\ SET PREFIX=%PREFIX:~0,-1%

for %%H in ("%PREFIX%") do set GIT_INSTALL_DIR=%%~dpH

set GIT_INSTALL_DIR=!GIT_INSTALL_DIR:"=!
IF %GIT_INSTALL_DIR:~-1%==\ SET GIT_INSTALL_DIR=%GIT_INSTALL_DIR:~0,-1%

if not exist "%GIT_INSTALL_DIR%\mingw64" (
    echo No mingw64 folder found in %GIT_INSTALL_DIR%.
    echo.
    echo Please supply a proper "Git for Windows 2.x" install path:
    echo "install.cmd c:\[git-install-path]"
    set ERROR=1
    goto :exit
)

echo Installing to %PREFIX%
SET HTMLDIR=%PREFIX%\share\doc\git-doc
SET GITEXTRAS=%~dp0

IF NOT EXIST "%PREFIX%\bin" MKDIR "%PREFIX%\bin"

:: Check that we can install into that dir or need admin rights...
set _testfile=%PREFIX%\bin\testfile_to_check_if_dir_is_writeable-577423947123.~
copy NUL "%_testfile%" >NUL 2>&1
IF EXIST "%_testfile%" (
    set IS_WRITEABLE=yes
    del "%_testfile%"
) else (
    set IS_WRITEABLE=no
)
if "%IS_WRITEABLE%"=="no" (
    echo.
    echo Directory for binaries ["%PREFIX%\bin"] is not writeable by install.cmd.
    echo.
    echo You probably need to run install.cmd from an admin prompt.
    set ERROR=1
    goto :exit
)

SET COMMANDS_WITHOUT_REPO=git-alias git-extras git-fork git-setup

echo Installing binaries...
FOR /R "%GITEXTRAS%\bin" %%i in (*.*) DO (
    ECHO #^^!/usr/bin/env bash > "%PREFIX%\bin\%%~ni"
    TYPE "%GITEXTRAS%\helper\reset-env" >> "%PREFIX%\bin\%%~ni"
    TYPE "%GITEXTRAS%\helper\git-extra-utility" >> "%PREFIX%\bin\%%~ni"
    TYPE "%GITEXTRAS%\helper\is-git-repo" >> "%PREFIX%\bin\%%~ni"
    MORE +2 "%GITEXTRAS%\bin\%%~ni" >> "%PREFIX%\bin\%%~ni"
)

FOR %%i in (%COMMANDS_WITHOUT_REPO%) DO (
    ECHO #^^!/usr/bin/env bash > "%PREFIX%\bin\%%i"
    TYPE "%GITEXTRAS%\helper\reset-env" >> "%PREFIX%\bin\%%i"
    TYPE "%GITEXTRAS%\helper\git-extra-utility" >> "%PREFIX%\bin\%%i"
    MORE +2 "%GITEXTRAS%\bin\%%i" >> "%PREFIX%\bin\%%i"
)

echo Installing man pages...
set _QUIET=/NP /NFL /NDL /NJS /NJH
ROBOCOPY %_QUIET% /IS "%GITEXTRAS%\man" "%HTMLDIR%" *.html
IF %ERRORLEVEL% GTR 7 (
    echo Not all html docs could be copied to "%GITEXTRAS%\man".
    echo.
    echo You probably need to run the install.cmd script from an admin prompt.
    set ERROR=1
    goto :exit
)
echo done

if not exist "%GIT_INSTALL_DIR%\usr\bin\column.exe" (
    where /Q column.exe
    if errorlevel 1 (
        echo.
        echo column.exe is missing: Not in "%GIT_INSTALL_DIR%\usr\bin" or in PATH!
        echo.
        echo "git summary", "git summary-line" and "git ignore-io" do not work without.
        echo If you need these commands, please install Git for Windows > 2.7.0.
        echo.
    )
)

:exit
@chcp %CP% > NUL
@endlocal enabledelayedexpansion
@endlocal
@exit /b %ERROR%

Fix 'Invalid code page' error when resetting code page at end of script


@echo off

if "%~3" == "" (
  echo few arguments!
  echo Usage:
  echo   ^$ swords.bat ^<design^>.c ^<conf^>.json ^<proj_name^> [^<operation_mode^>]
  exit /b 1
)

set toolchainpath=%~dp0
call %toolchainpath%\setenv.bat

if not "%~4" == "" (
  set opmode=%~4
) else (
  echo Info: [^<operation_mode^>] can select {all,divide,ifmake,hls,hwsyn,swbuild}
  set opmode=all
)

if not "%opmode%" == "all" (
  if not "%opmode%" == "divide" (
    if not "%opmode%" == "ifmake" (
      if not "%opmode%" == "hls" (
        if not "%opmode%" == "hwsyn" (
          if not "%opmode%" == "swbuild" (
            echo Error: [^<operation_mode^>] cannot be selected as %opmode%.
            exit /b 1
          )
        )
      )
    )
  )
)

echo Operation mode is set to %opmode%.

set cfile=%~1
set jsonfile=%~2
set projectname=%~3

if not exist "%cfile%" (
  echo Error: %cfile% does not exist
  exit /b 1
)

if not exist "%jsonfile%" (
  echo Error: %jsonfile% does not exist
  exit /b 1
)

if not exist "%projectname%" (
  mkdir %projectname%
)
cd %projectname%

set divide=False
if "%opmode%" == "all" set divide=True
if "%opmode%" == "divide" set divide=True

if "%divide%" == "True" (
  copy /Y ..\%cfile% .
  copy /Y ..\%jsonfile% .
  if not "%llvmfilepath%" == "" (
    call %toolchainpath%\batch\divide.bat %cfile% %jsonfile% %llvmfilepath%
  ) else (
    call %toolchainpath%\batch\divide.bat %cfile% %jsonfile%
  )
)

set ifmake=False
if "%opmode%" == "all" set ifmake=True
if "%opmode%" == "ifmake" set ifmake=True

if "%ifmake%" == "True" (
  if not exist "%cfile:~0,-2%_sw.c" (
    echo Error: ifmake process cannot be operated because divide has not been done.
    cd ..\
    exit /b 1
  )
  if not "%llvmfilepath%" == "" (
    call %toolchainpath%\batch\ifmake.bat %cfile% %jsonfile% %toolchainpath% %llvmfilepath%
  ) else (
    call %toolchainpath%\batch\ifmake.bat %cfile% %jsonfile% %toolchainpath%
  )
)

set hls=False
if "%opmode%" == "all" set hls=True
if "%opmode%" == "hls" set hls=True

set cfile=%~1
if "%hls%" == "True" (
  set hwcfile=%cfile:~0,-2%_hwif.c
  if not exist "%hwcfile%" (
    echo Error: hls process cannot be operated because ifmake has not been done.
    cd ..\
    exit /b 1
  )
  call %toolchainpath%\batch\runhls.bat %hwcfile% %jsonfile% %projectname% %toolchainpath%
)

set hwsyn=False
if "%opmode%" == "all" set hwsyn=True
if "%opmode%" == "hwsyn" set hwsyn=True

if "%hwsyn%" == "True" (
  if not exist "%projectname%_hls\solution1\impl" (
    echo Error: hwsyn process cannot be operated because hls has not been done.
    cd ..\
    exit /b 1
  )
  call %toolchainpath%\batch\runvivado.bat %jsonfile% %projectname% %projectname%_hls %cd% %toolchainpath%
)

set build=False
if "%opmode%" == "all" set build=True
if "%opmode%" == "swbuild" set build=True

set cfile=%~1
if "%build%" == "True" (
  if not exist "%projectname%_vivado\%projectname%.sdk" (
    echo Error: swbuild process cannot be operated because hwsyn has not been done.
    cd ..\
    exit /b 1
  )
  call %toolchainpath%\batch\runsdk.bat %cfile% %jsonfile% %projectname% %toolchainpath%
)

cd ..\

@echo off

if "%~3" == "" (
  echo few arguments!
  echo Usage:
  echo   ^$ swords.bat ^<design^>.c ^<conf^>.json ^<proj_name^> [^<operation_mode^>]
  exit /b 1
)

set toolchainpath=%~dp0
call %toolchainpath%\setenv.bat

if not "%~4" == "" (
  set opmode=%~4
) else (
  echo Info: [^<operation_mode^>] can select {all,divide,ifmake,hls,hwsyn,swbuild}
  set opmode=all
)

if not "%opmode%" == "all" (
  if not "%opmode%" == "divide" (
    if not "%opmode%" == "ifmake" (
      if not "%opmode%" == "hls" (
        if not "%opmode%" == "hwsyn" (
          if not "%opmode%" == "swbuild" (
            echo Error: [^<operation_mode^>] cannot be selected as %opmode%.
            exit /b 1
          )
        )
      )
    )
  )
)

echo Operation mode is set to %opmode%.

set cfile=%~1
set jsonfile=%~2
set projectname=%~3

if not exist "%cfile%" (
  echo Error: %cfile% does not exist
  exit /b 1
)

if not exist "%jsonfile%" (
  echo Error: %jsonfile% does not exist
  exit /b 1
)

if not exist "%projectname%" (
  mkdir %projectname%
)
cd %projectname%

set divide=False
if "%opmode%" == "all" set divide=True
if "%opmode%" == "divide" set divide=True

if "%divide%" == "True" (
  copy /Y ..\%cfile% .
  copy /Y ..\%jsonfile% .
  if not "%llvmfilepath%" == "" (
    call %toolchainpath%\batch\divide.bat %cfile% %jsonfile% %llvmfilepath%
  ) else (
    call %toolchainpath%\batch\divide.bat %cfile% %jsonfile%
  )
)

set ifmake=False
if "%opmode%" == "all" set ifmake=True
if "%opmode%" == "ifmake" set ifmake=True

if "%ifmake%" == "True" (
  if not exist "%cfile:~0,-2%_sw.c" (
    echo Error: ifmake process cannot be operated because divide has not been done.
    cd ..\
    exit /b 1
  )
  call %toolchainpath%\batch\ifmake.bat %cfile% %jsonfile% %toolchainpath%
)

set hls=False
if "%opmode%" == "all" set hls=True
if "%opmode%" == "hls" set hls=True

set cfile=%~1
if "%hls%" == "True" (
  set hwcfile=%cfile:~0,-2%_hwif.c
  if not exist "%hwcfile%" (
    echo Error: hls process cannot be operated because ifmake has not been done.
    cd ..\
    exit /b 1
  )
  call %toolchainpath%\batch\runhls.bat %hwcfile% %jsonfile% %projectname% %toolchainpath%
)

set hwsyn=False
if "%opmode%" == "all" set hwsyn=True
if "%opmode%" == "hwsyn" set hwsyn=True

if "%hwsyn%" == "True" (
  if not exist "%projectname%_hls\solution1\impl" (
    echo Error: hwsyn process cannot be operated because hls has not been done.
    cd ..\
    exit /b 1
  )
  call %toolchainpath%\batch\runvivado.bat %jsonfile% %projectname% %projectname%_hls %cd% %toolchainpath%
)

set build=False
if "%opmode%" == "all" set build=True
if "%opmode%" == "swbuild" set build=True

set cfile=%~1
if "%build%" == "True" (
  if not exist "%projectname%_vivado\%projectname%.sdk" (
    echo Error: swbuild process cannot be operated because hwsyn has not been done.
    cd ..\
    exit /b 1
  )
  call %toolchainpath%\batch\runsdk.bat %cfile% %jsonfile% %projectname% %toolchainpath%
)

cd ..\

Delete llvm usage

Delete llvm usage


:: Sign keybase.exe and generate a signed installer, with an embedded signed uninsaller
:: $1 is full path to keybase.exe
:: todo: specify output?
::
set GOARCH=386

echo %KEYBASE_SECRET_STORE_FILE%
:: This has to be reset too for a separate batch command
if DEFINED BUILD_NUMBER set KEYBASE_WINBUILD=%BUILD_NUMBER%
set SIGNTOOL=signtool
set CERTISSUER=DigiCert

::
:: get the target build folder. Assume winresource.exe has been built.
:: If not, go there and do "go generate"
set Folder=%GOPATH%\src\github.com\keybase\client\go\keybase\
set PathName=%Folder%keybase.exe

if NOT DEFINED DOKAN_PATH set DOKAN_PATH=c:\work\bin\dokan-dev\build81
echo DOKAN_PATH %DOKAN_PATH%

for /F delims^=^"^ tokens^=2 %%x in ('findstr ProductCodeX64 %DOKAN_PATH%\dokan_wix\version.xml') do set DokanProductCodeX64=%%x
for /F delims^=^"^ tokens^=2 %%x in ('findstr ProductCodeX86 %DOKAN_PATH%\dokan_wix\version.xml') do set DokanProductCodeX86=%%x

pushd %GOPATH%\src\github.com\keybase\client\packaging\windows

:: Capture the windows style version
for /f %%i in ('%Folder%winresource.exe -w') do set KEYBASE_WINVER=%%i
echo KEYBASE_WINVER %KEYBASE_WINVER%

:: Capture keybase's semantic version
for /f "tokens=3" %%i in ('%PathName% -version') do set SEMVER=%%i
echo %SEMVER%
::Set this again for Jenkins
set KEYBASE_VERSION=%SEMVER%

echo KEYBASE_VERSION %KEYBASE_VERSION%

:: dokan source binaries.
:: There are 8 (4 windows versions times 32/64 bit) but they all seem to have the same version.
for /f %%i in ('PowerShell "(Get-Item %DOKAN_PATH%\Win32\Win10Release\dokan1.sys).VersionInfo.FileVersion"') do set DOKANVER=%%i
echo DOKANVER %DOKANVER%
IF %DOKANVER%=="" (
  EXIT /B 1
)

:: Other alternate time servers:
::   http://timestamp.verisign.com/scripts/timstamp.dll
::   http://timestamp.globalsign.com/scripts/timestamp.dll
::   http://tsa.starfieldtech.com
::   http://timestamp.comodoca.com/authenticode
::   http://timestamp.digicert.com
SignTool.exe sign /i digicert /a /tr http://timestamp.digicert.com %PathName%
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)
SignTool.exe sign /i digicert  /a /tr http://timestamp.digicert.com %GOPATH%\src\github.com\keybase\kbfs\kbfsdokan\kbfsdokan.exe
IF %ERRORLEVEL% NEQ 0 (k
  EXIT /B 1
)
SignTool.exe sign /i digicert /a /tr http://timestamp.digicert.com %GOPATH%\src\github.com\keybase\go-updater\service\upd.exe
IF %ERRORLEVEL% NEQ 0 (k
  EXIT /B 1
)
SignTool.exe sign /i digicert /a /tr http://timestamp.digicert.com %GOPATH%\src\github.com\keybase\client\go\tools\runquiet\runquiet.exe
IF %ERRORLEVEL% NEQ 0 (k
  EXIT /B 1
)
SignTool.exe sign /i digicert /a /tr http://timestamp.digicert.com %GOPATH%\src\github.com\keybase\client\go\tools\dokanclean\dokanclean.exe
IF %ERRORLEVEL% NEQ 0 (k
  EXIT /B 1
)
SignTool.exe sign /i digicert /a /tr http://timestamp.digicert.com %GOPATH%\src\github.com\keybase\client\shared\desktop\release\win32-ia32\Keybase-win32-ia32\Keybase.exe
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

:: Double check that keybase is codesigned
signtool verify /pa %PathName%
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

:: Double check that kbfs is codesigned
signtool verify /pa %GOPATH%\src\github.com\keybase\kbfs\kbfsdokan\kbfsdokan.exe
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

:: Double check that updater is codesigned
signtool verify /pa %GOPATH%\src\github.com\keybase\go-updater\service\upd.exe
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

:: Double check that Keybase.exe gui is codesigned
signtool verify /pa %GOPATH%\src\github.com\keybase\client\shared\desktop\release\win32-ia32\Keybase-win32-ia32\Keybase.exe
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

if NOT DEFINED BUILD_TAG set BUILD_TAG=%SEMVER%

pushd %GOPATH%\src\github.com\keybase\client\packaging\windows\WIXInstallers

echo ^<?xml version=^"1.0^" encoding=^"utf-8^"?^> > dokanver.xml
echo ^<Include^> >> dokanver.xml
echo ^<?define DokanProductCodeX86=^"%DokanProductCodeX86%^" ?^> >> dokanver.xml
echo ^<?define DokanProductCodeX64=^"%DokanProductCodeX64%^" ?^> >> dokanver.xml
echo ^<?define DOKAN_PATH=^"%DOKAN_PATH%^" ?^> >> dokanver.xml
echo ^</Include^>  >> dokanver.xml

msbuild WIX_Installers.sln  /p:Configuration=Release /p:Platform=x86 /t:Build
popd
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

:: Here we rely on the previous steps checking out and building release.exe
set ReleaseBin=%GOPATH%\src\github.com\keybase\release\release.exe

if not EXIST %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG% mkdir %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG%
pushd %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG%

move %GOPATH%\src\github.com\keybase\client\packaging\windows\WIXInstallers\KeybaseBundle\bin\Release\*.exe %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG%
for /f %%i in ('dir /od /b *.exe') do set KEYBASE_INSTALLER_NAME=%%i

:: Double check that the installer is codesigned
signtool verify /pa %KEYBASE_INSTALLER_NAME%
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

:: Run keybase sign to get signature of update
set KeybaseBin="%LOCALAPPDATA%\Keybase\keybase.exe"
set SigFile=sig.txt
%KeybaseBin% sign -d -i %KEYBASE_INSTALLER_NAME% -o %SigFile%
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

:: UpdateChannel is a Jenkins select parameter, one of: Smoke, Test, None
echo UpdateChannel: %UpdateChannel%

:: Test means to skip smoke
IF %UpdateChannel% EQU Test (
  GOTO set_test_channel
)

:: We need a test channel updater .json in all smoke cases
IF "%UpdateChannel:~0,5%"=="Smoke" (
  %ReleaseBin% update-json --version=%SEMVER% --src=%KEYBASE_INSTALLER_NAME% --uri=https://prerelease.keybase.io/windows --signature=%SigFile% --description=%GOPATH%\src\github.com\keybase\client\shared\desktop\CHANGELOG.txt --prop=DokanProductCodeX64:%DokanProductCodeX64% --prop=DokanProductCodeX86:%DokanProductCodeX86% > update-windows-prod-%KEYBASE_VERSION%.json
  :: All smoke builds go in the test channel too except Smoke2
  IF %UpdateChannel% NEQ Smoke2 GOTO set_test_channel
  :: Don't make a production json either for smoke2
  GOTO end_update_json
)
set JSON_UPDATE_FILENAME=update-windows-prod-v2.json

GOTO end_test_channel

:set_test_channel
set JSON_UPDATE_FILENAME=update-windows-prod-test-v2.json

:end_test_channel

echo %JSON_UPDATE_FILENAME%

%ReleaseBin% update-json --version=%SEMVER% --src=%KEYBASE_INSTALLER_NAME% --uri=https://prerelease.keybase.io/windows --signature=%SigFile% --description=%GOPATH%\src\github.com\keybase\client\shared\desktop\CHANGELOG.txt --prop=DokanProductCodeX64:%DokanProductCodeX64% --prop=DokanProductCodeX86:%DokanProductCodeX86% > %JSON_UPDATE_FILENAME%

:end_update_json

:: Sign keybase.exe and generate a signed installer, with an embedded signed uninsaller
:: $1 is full path to keybase.exe
:: todo: specify output?
::
set GOARCH=386

echo %KEYBASE_SECRET_STORE_FILE%
:: This has to be reset too for a separate batch command
if DEFINED BUILD_NUMBER set KEYBASE_WINBUILD=%BUILD_NUMBER%
set SIGNTOOL=signtool
set CERTISSUER=DigiCert

::
:: get the target build folder. Assume winresource.exe has been built.
:: If not, go there and do "go generate"
set Folder=%GOPATH%\src\github.com\keybase\client\go\keybase\
set PathName=%Folder%keybase.exe

if NOT DEFINED DOKAN_PATH set DOKAN_PATH=c:\work\bin\dokan-dev\build81
echo DOKAN_PATH %DOKAN_PATH%

for /F delims^=^"^ tokens^=2 %%x in ('findstr ProductCodeX64 %DOKAN_PATH%\dokan_wix\version.xml') do set DokanProductCodeX64=%%x
for /F delims^=^"^ tokens^=2 %%x in ('findstr ProductCodeX86 %DOKAN_PATH%\dokan_wix\version.xml') do set DokanProductCodeX86=%%x

pushd %GOPATH%\src\github.com\keybase\client\packaging\windows

:: Capture the windows style version
for /f %%i in ('%Folder%winresource.exe -w') do set KEYBASE_WINVER=%%i
echo KEYBASE_WINVER %KEYBASE_WINVER%

:: Capture keybase's semantic version
for /f "tokens=3" %%i in ('%PathName% -version') do set SEMVER=%%i
echo %SEMVER%
::Set this again for Jenkins
set KEYBASE_VERSION=%SEMVER%

echo KEYBASE_VERSION %KEYBASE_VERSION%

:: dokan source binaries.
:: There are 8 (4 windows versions times 32/64 bit) but they all seem to have the same version.
for /f %%i in ('PowerShell "(Get-Item %DOKAN_PATH%\Win32\Win10Release\dokan1.sys).VersionInfo.FileVersion"') do set DOKANVER=%%i
echo DOKANVER %DOKANVER%
IF %DOKANVER%=="" (
  EXIT /B 1
)

call:dosignexe %PathName%
call:dosignexe %GOPATH%\src\github.com\keybase\kbfs\kbfsdokan\kbfsdokan.exe
call:dosignexe %GOPATH%\src\github.com\keybase\go-updater\service\upd.exe
call:dosignexe %GOPATH%\src\github.com\keybase\client\go\tools\runquiet\runquiet.exe
call:dosignexe %GOPATH%\src\github.com\keybase\client\go\tools\dokanclean\dokanclean.exe
call:dosignexe %GOPATH%\src\github.com\keybase\client\shared\desktop\release\win32-ia32\Keybase-win32-ia32\Keybase.exe

:: Double check that keybase is codesigned
signtool verify /pa %PathName%
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

:: Double check that kbfs is codesigned
signtool verify /pa %GOPATH%\src\github.com\keybase\kbfs\kbfsdokan\kbfsdokan.exe
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

:: Double check that updater is codesigned
signtool verify /pa %GOPATH%\src\github.com\keybase\go-updater\service\upd.exe
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

:: Double check that Keybase.exe gui is codesigned
signtool verify /pa %GOPATH%\src\github.com\keybase\client\shared\desktop\release\win32-ia32\Keybase-win32-ia32\Keybase.exe
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

if NOT DEFINED BUILD_TAG set BUILD_TAG=%SEMVER%

pushd %GOPATH%\src\github.com\keybase\client\packaging\windows\WIXInstallers

echo ^<?xml version=^"1.0^" encoding=^"utf-8^"?^> > dokanver.xml
echo ^<Include^> >> dokanver.xml
echo ^<?define DokanProductCodeX86=^"%DokanProductCodeX86%^" ?^> >> dokanver.xml
echo ^<?define DokanProductCodeX64=^"%DokanProductCodeX64%^" ?^> >> dokanver.xml
echo ^<?define DOKAN_PATH=^"%DOKAN_PATH%^" ?^> >> dokanver.xml
echo ^</Include^>  >> dokanver.xml

msbuild WIX_Installers.sln  /p:Configuration=Release /p:Platform=x86 /t:Build
popd
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

:: Here we rely on the previous steps checking out and building release.exe
set ReleaseBin=%GOPATH%\src\github.com\keybase\release\release.exe

if not EXIST %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG% mkdir %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG%
pushd %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG%

move %GOPATH%\src\github.com\keybase\client\packaging\windows\WIXInstallers\KeybaseBundle\bin\Release\*.exe %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG%
for /f %%i in ('dir /od /b *.exe') do set KEYBASE_INSTALLER_NAME=%%i

:: Double check that the installer is codesigned
signtool verify /pa %KEYBASE_INSTALLER_NAME%
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

:: Run keybase sign to get signature of update
set KeybaseBin="%LOCALAPPDATA%\Keybase\keybase.exe"
set SigFile=sig.txt
%KeybaseBin% sign -d -i %KEYBASE_INSTALLER_NAME% -o %SigFile%
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

:: UpdateChannel is a Jenkins select parameter, one of: Smoke, Test, None
echo UpdateChannel: %UpdateChannel%

:: Test means to skip smoke
IF %UpdateChannel% EQU Test (
  GOTO set_test_channel
)

:: We need a test channel updater .json in all smoke cases
IF "%UpdateChannel:~0,5%"=="Smoke" (
  %ReleaseBin% update-json --version=%SEMVER% --src=%KEYBASE_INSTALLER_NAME% --uri=https://prerelease.keybase.io/windows --signature=%SigFile% --description=%GOPATH%\src\github.com\keybase\client\shared\desktop\CHANGELOG.txt --prop=DokanProductCodeX64:%DokanProductCodeX64% --prop=DokanProductCodeX86:%DokanProductCodeX86% > update-windows-prod-%KEYBASE_VERSION%.json
  :: All smoke builds go in the test channel too except Smoke2
  IF %UpdateChannel% NEQ Smoke2 GOTO set_test_channel
  :: Don't make a production json either for smoke2
  GOTO end_update_json
)
set JSON_UPDATE_FILENAME=update-windows-prod-v2.json

GOTO end_test_channel

:set_test_channel
set JSON_UPDATE_FILENAME=update-windows-prod-test-v2.json

:end_test_channel

echo %JSON_UPDATE_FILENAME%

%ReleaseBin% update-json --version=%SEMVER% --src=%KEYBASE_INSTALLER_NAME% --uri=https://prerelease.keybase.io/windows --signature=%SigFile% --description=%GOPATH%\src\github.com\keybase\client\shared\desktop\CHANGELOG.txt --prop=DokanProductCodeX64:%DokanProductCodeX64% --prop=DokanProductCodeX86:%DokanProductCodeX86% > %JSON_UPDATE_FILENAME%

:end_update_json

goto:eof

:dosignexe
:: Other alternate time servers:
::   http://timestamp.verisign.com/scripts/timstamp.dll
::   http://timestamp.globalsign.com/scripts/timestamp.dll
::   http://tsa.starfieldtech.com
::   http://timestamp.comodoca.com/authenticode
::   http://timestamp.digicert.com

SignTool.exe sign /i digicert /a /tr http://timestamp.digicert.com %~1
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)
SignTool.exe sign /i digicert /a /as /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 %~1
IF %ERRORLEVEL% NEQ 0 (
  EXIT /B 1
)

goto:eof

add SHA256 to .exe codesigning (#6027)

add SHA256 to .exe codesigning (#6027)


@echo off

rem This script provides the command and control utility for starting
rem Rio services and the Rio command line interface

rem Use local variables
setLocal EnableDelayedExpansion

rem Set local variables
if "%RIO_HOME%" == "" set RIO_HOME=%~dp0..

set SLF4J_CLASSPATH="%RIO_HOME%\lib\logging\*";"%RIO_HOME%\config\logging"
set RIO_LIB=%RIO_HOME%\lib

rem Set Versions
set rioVersion=5.0-M3
set riverVersion=2.1.1
set groovyVersion=2.0.6

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
set JAVACMD=%JAVA_HOME%\bin\java.exe
goto endOfJavaHome

:noJavaHome
set JAVACMD=java.exe
:endOfJavaHome

if "%JAVA_MEM_OPTIONS%" == "" set JAVA_MEM_OPTIONS="-XX:MaxPermSize=256m"

rem Parse command line
if "%1"=="" goto interactive
if "%1"=="start" goto start
if "%1"=="create-project" goto create-project

:interactive
rem set cliExt="%RIO_HOME%"\config\rio_cli.groovy
rem set cliExt=""
set command_line=%*
set launchTarget=org.rioproject.tools.cli.CLI
set classpath=-cp "%RIO_HOME%\lib\rio-cli-%rioVersion%.jar";"%SLF4J_CLASSPATH%";
set props="-DRIO_HOME=%RIO_HOME%"
"%JAVACMD%" %classpath% -Xms256m -Xmx256m -Djava.protocol.handler.pkgs=org.rioproject.url -DRIO_HOME="%RIO_HOME%" -Djava.security.policy="%RIO_HOME%"\policy\policy.all %launchTarget% %cliExt% %command_line%
goto end

:create-project
mvn archetype:generate -DarchetypeGroupId=org.rioproject -DarchetypeGroupId=org.rioproject -DarchetypeRepository=http://www.rio-project.org/maven2 -DarchetypeVersion=5.0-SNAPSHOT
goto end

:start

rem Get the service starter
shift
if "%1"=="" goto noService
set service=%1
set starterConfig=%RIO_HOME%\config\start-%1.groovy
if not exist "%starterConfig%" goto noStarter
shift

rem Call the install script, do not assume that Groovy has been installed.
set groovyClasspath=-cp "%RIO_HOME%\lib\groovy-all-%groovyVersion%.jar"
"%JAVA_HOME%\bin\java" %groovyClasspath% org.codehaus.groovy.tools.GroovyStarter --main groovy.ui.GroovyMain "%RIO_HOME%\bin\install.groovy" "%JAVA_HOME%" "%RIO_HOME%"

echo starter config [%starterConfig%]
set RIO_LOG_DIR="%RIO_HOME%"\logs\
if "%RIO_NATIVE_DIR%" == "" set RIO_NATIVE_DIR="%RIO_HOME%"\lib\native
set PATH=%PATH%;"%RIO_NATIVE_DIR%"

set classpath=-cp "%RIO_HOME%\lib\rio-start-%rioVersion%.jar";"%JAVA_HOME%\lib\tools.jar";"%RIO_HOME%\lib\groovy-all-%groovyVersion%.jar";"%SLF4J_CLASSPATH%";
set agentpath=-javaagent:"%RIO_HOME%\lib\rio-start.jar"

set launchTarget=com.sun.jini.start.ServiceStarter

set loggingConfig="%RIO_HOME%\config\logging\rio-logging.properties"

"%JAVA_HOME%\bin\java" -server %JAVA_MEM_OPTIONS% %classpath% %agentpath% -Djava.protocol.handler.pkgs=org.rioproject.url -Djava.util.logging.config.file=%loggingConfig% -Dorg.rioproject.service=%service% -Djava.security.policy="%RIO_HOME%"\policy\policy.all -Djava.library.path=%RIO_NATIVE_DIR% -DRIO_HOME="%RIO_HOME%" -Dorg.rioproject.home="%RIO_HOME%" -DRIO_NATIVE_DIR=%RIO_NATIVE_DIR% -DRIO_LOG_DIR=%RIO_LOG_DIR% -Drio.script.mainClass=%launchTarget% %launchTarget% "%starterConfig%"
goto end

:noStarter
echo Cannot locate expected service starter file [start-%1.config] in [%RIO_HOME%\config], exiting"
goto exitWithError

:noService
echo "A service to start is required, exiting"

:exitWithError
exit /B 1

:end
endlocal
title Command Prompt
if "%OS%"=="Windows_NT" @endlocal
if "%OS%"=="WINNT" @endlocal
exit /B 0

@echo off

rem This script provides the command and control utility for starting
rem Rio services and the Rio command line interface

rem Use local variables
setLocal EnableDelayedExpansion

rem Set local variables
if "%RIO_HOME%" == "" set RIO_HOME=%~dp0..

set SLF4J_CLASSPATH="%RIO_HOME%\lib\logging\*";"%RIO_HOME%\config\logging"
set RIO_LIB=%RIO_HOME%\lib

rem Set Versions
set rioVersion=5.0-M3
set riverVersion=2.1.1
set groovyVersion=2.0.6

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
set JAVACMD=%JAVA_HOME%\bin\java.exe
goto endOfJavaHome

:noJavaHome
set JAVACMD=java.exe
:endOfJavaHome

if "%JAVA_MEM_OPTIONS%" == "" set JAVA_MEM_OPTIONS="-XX:MaxPermSize=256m"

rem Parse command line
if "%1"=="" goto interactive
if "%1"=="start" goto start
if "%1"=="create-project" goto create-project

:interactive
rem set cliExt="%RIO_HOME%"\config\rio_cli.groovy
rem set cliExt=""
set command_line=%*
set launchTarget=org.rioproject.tools.cli.CLI
set classpath=-cp "%RIO_HOME%\lib\rio-cli-%rioVersion%.jar";"%SLF4J_CLASSPATH%";
set props="-DRIO_HOME=%RIO_HOME%"
"%JAVACMD%" %classpath% -Xms256m -Xmx256m -Djava.protocol.handler.pkgs=org.rioproject.url -DRIO_HOME="%RIO_HOME%" -Djava.security.policy="%RIO_HOME%"\policy\policy.all %launchTarget% %cliExt% %command_line%
goto end

:create-project
mvn archetype:generate -DarchetypeGroupId=org.rioproject -DarchetypeGroupId=org.rioproject -DarchetypeRepository=http://www.rio-project.org/maven2 -DarchetypeVersion=5.0-SNAPSHOT
goto end

:start

rem Get the service starter
shift
if "%1"=="" goto noService
set service=%1
set starterConfig=%RIO_HOME%\config\start-%1.groovy
if not exist "%starterConfig%" goto noStarter
shift

rem Call the install script, do not assume that Groovy has been installed.
set groovyClasspath=-cp "%RIO_HOME%\lib\groovy-all-%groovyVersion%.jar"
"%JAVA_HOME%\bin\java" %groovyClasspath% org.codehaus.groovy.tools.GroovyStarter --main groovy.ui.GroovyMain "%RIO_HOME%\bin\install.groovy" "%JAVA_HOME%" "%RIO_HOME%"

echo starter config [%starterConfig%]
set RIO_LOG_DIR="%RIO_HOME%"\logs\
if "%RIO_NATIVE_DIR%" == "" set RIO_NATIVE_DIR="%RIO_HOME%"\lib\native
set PATH=%PATH%;"%RIO_NATIVE_DIR%"

set classpath=-cp "%RIO_HOME%\lib\rio-start-%rioVersion%.jar";"%JAVA_HOME%\lib\tools.jar";"%RIO_HOME%\lib\groovy-all-%groovyVersion%.jar";"%SLF4J_CLASSPATH%";
set agentpath=-javaagent:"%RIO_HOME%\lib\rio-start-%rioVersion%.jar"

set launchTarget=org.rioproject.start.ServiceStarter

set loggingConfig="%RIO_HOME%\config\logging\rio-logging.properties"

"%JAVA_HOME%\bin\java" -server %JAVA_MEM_OPTIONS% %classpath% %agentpath% -Djava.protocol.handler.pkgs=org.rioproject.url -Djava.util.logging.config.file=%loggingConfig% -Dorg.rioproject.service=%service% -Djava.security.policy="%RIO_HOME%"\policy\policy.all -Djava.library.path=%RIO_NATIVE_DIR% -DRIO_HOME="%RIO_HOME%" -Dorg.rioproject.home="%RIO_HOME%" -DRIO_NATIVE_DIR=%RIO_NATIVE_DIR% -DRIO_LOG_DIR=%RIO_LOG_DIR% -Drio.script.mainClass=%launchTarget% %launchTarget% "%starterConfig%"
goto end

:noStarter
echo Cannot locate expected service starter file [start-%1.config] in [%RIO_HOME%\config], exiting"
goto exitWithError

:noService
echo "A service to start is required, exiting"

:exitWithError
exit /B 1

:end
endlocal
title Command Prompt
if "%OS%"=="Windows_NT" @endlocal
if "%OS%"=="WINNT" @endlocal
exit /B 0

Fix service starter class to use for Windows script


@echo off
echo Downloading CUDA toolkit 8
appveyor DownloadFile  https://developer.nvidia.com/compute/cuda/8.0/Prod2/network_installers/cuda_8.0.61_win10_network-exe -FileName setup.exe
rem appveyor DownloadFile  https://www.dropbox.com/s/ll2ay531hw3i1p7/cuda.zip?dl=1
rem 7z x cuda.zip -ocuda
rem cd cuda
echo Installing CUDA toolkit 8
setup.exe -s compiler_8.0 ^
                           cublas_8.0 ^
                           cublas_dev_8.0 ^
                           cudart_8.0 ^
                           curand_8.0 ^
                           curand_dev_8.0

if NOT EXIST "%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\cudart64_80.dll" (
echo "Failed to install CUDA"
exit /B 1
)

echo Installing VS integration
copy _vs\*.* "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations"

cd ..

echo Downloading cuDNN
appveyor DownloadFile https://www.dropbox.com/s/9t56hoewk7p0hfj/cudnn-8.0-windows7-x64-v5.1.zip?dl=1
7z x cudnn-8.0-windows7-x64-v5.1.zip -ocudnn

copy cudnn\cuda\bin\*.* "%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin"
copy cudnn\cuda\lib\x64\*.* "%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64"
copy cudnn\cuda\include\*.* "%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include"

set PATH=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin;%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\libnvvp;%PATH%
set CUDA_PATH=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0
set CUDA_PATH_V8_0=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0

nvcc -V

rem cd ..
rem git clone https://github.com/Microsoft/vcpkg.git vcpkg
rem cd vcpkg
rem mkdir downloads
rem copy nul downloads\AlwaysAllowDownloads
rem powershell -exec bypass scripts\bootstrap.ps1
rem vcpkg integrate install
rem vcpkg install gtest:x64-windows

cd "%APPVEYOR_BUILD_FOLDER%"

@echo off
echo Downloading CUDA toolkit 8
rem appveyor DownloadFile  https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda_8.0.44_windows-exe -FileName cuda_8.0.44_windows.exe
appveyor DownloadFile  https://www.dropbox.com/s/ll2ay531hw3i1p7/cuda.zip?dl=1
7z x cuda.zip -ocuda
cd cuda
echo Installing CUDA toolkit 8
setup.exe -s compiler_8.0 ^
                           cublas_8.0 ^
                           cublas_dev_8.0 ^
                           cudart_8.0 ^
                           curand_8.0 ^
                           curand_dev_8.0

if NOT EXIST "%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\cudart64_80.dll" (
echo "Failed to install CUDA"
exit /B 1
)

echo Installing VS integration
copy _vs\*.* "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations"

cd ..

echo Downloading cuDNN
appveyor DownloadFile https://www.dropbox.com/s/9t56hoewk7p0hfj/cudnn-8.0-windows7-x64-v5.1.zip?dl=1
7z x cudnn-8.0-windows7-x64-v5.1.zip -ocudnn

copy cudnn\cuda\bin\*.* "%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin"
copy cudnn\cuda\lib\x64\*.* "%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64"
copy cudnn\cuda\include\*.* "%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include"

set PATH=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin;%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\libnvvp;%PATH%
set CUDA_PATH=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0
set CUDA_PATH_V8_0=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0

nvcc -V

rem cd ..
rem git clone https://github.com/Microsoft/vcpkg.git vcpkg
rem cd vcpkg
rem mkdir downloads
rem copy nul downloads\AlwaysAllowDownloads
rem powershell -exec bypass scripts\bootstrap.ps1
rem vcpkg integrate install
rem vcpkg install gtest:x64-windows

cd "%APPVEYOR_BUILD_FOLDER%"

Revert "Trying to use network CUDA distro"

This reverts commit 981d3435e2c9de0ba2802f5a1be210f880a712c2.


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

@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM     e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM ----------------------------------------------------------------------------

@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%

set CLASSWORLDS_VERSION=1.1-SNAPSHOT

@REM Execute a user defined script before this one
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"

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

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

echo.
echo ERROR: JAVA_HOME not found in your environment.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
goto end

:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome

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

:chkMHome
if not "%M2_HOME%"=="" goto valMHome

if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0\..
if not "%M2_HOME%"=="" goto valMHome

echo.
echo ERROR: M2_HOME not found in your environment.
echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation
echo.
goto end

:valMHome
if exist "%M2_HOME%\bin\m2.bat" goto init

echo.
echo ERROR: M2_HOME is set to an invalid directory.
echo M2_HOME = %M2_HOME%
echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation
echo.
goto end
@REM ==== END VALIDATION ====

:init
@REM Decide how to startup depending on the version of windows

@REM -- Win98ME
if NOT "%OS%"=="Windows_NT" goto Win9xArg

@REM -- 4NT shell
if "%eval[2+2]" == "4" goto 4NTArgs

@REM -- Regular WinNT shell
set MAVEN_CMD_LINE_ARGS=%*
goto endInit

@REM The 4NT Shell from jp software
:4NTArgs
set MAVEN_CMD_LINE_ARGS=%$
goto endInit

:Win9xArg
@REM Slurp the command line arguments.  This loop allows for an unlimited number
@REM of agruments (up to the command line limit, anyway).
set MAVEN_CMD_LINE_ARGS=
:Win9xApp
if %1a==a goto endInit
set MAVEN_CMD_LINE_ARGS=%MAVEN_CMD_LINE_ARGS% %1
shift
goto Win9xApp

@REM Reaching here means variables are defined and arguments have been captured
:endInit
if "%MAVEN_OPTS%"=="" SET MAVEN_OPTS="-Xmx256m"
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
SET MAVEN_CLASSPATH="%M2_HOME%\core\boot\classworlds-%CLASSWORLDS_VERSION%.jar"
SET MAVEN_MAIN_CLASS=org.codehaus.classworlds.Launcher
SET CLASSWORLDS_CONF="%M2_HOME%\bin\classworlds.conf"

@REM Start MAVEN2
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% "-Dclassworlds.conf=%CLASSWORLDS_CONF%" "-Dmaven.home=%M2_HOME%" %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS%
goto :end

:end
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" goto endNT

@REM For old DOS remove the set variables from ENV - we assume they were not set
@REM before we started - at least we don't leave any baggage around
set MAVEN_JAVA_EXE=
set MAVEN_CLASSPATH=
set MAVEN_MAIN_CLASS=
set MAVEN_CMD_LINE_ARGS=
set CLASSWORLDS_VERSION=
goto postExec

:endNT
@endlocal

:postExec
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
@REM pause the batch file if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause

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

@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM     e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM ----------------------------------------------------------------------------

@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%

@REM Execute a user defined script before this one
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"

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

@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome

echo.
echo ERROR: JAVA_HOME not found in your environment.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
goto end

:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome

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

:chkMHome
if not "%M2_HOME%"=="" goto valMHome

if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0\..
if not "%M2_HOME%"=="" goto valMHome

echo.
echo ERROR: M2_HOME not found in your environment.
echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation
echo.
goto end

:valMHome
if exist "%M2_HOME%\bin\m2.bat" goto init

echo.
echo ERROR: M2_HOME is set to an invalid directory.
echo M2_HOME = %M2_HOME%
echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation
echo.
goto end
@REM ==== END VALIDATION ====

:init
@REM Decide how to startup depending on the version of windows

@REM -- Win98ME
if NOT "%OS%"=="Windows_NT" goto Win9xArg

@REM -- 4NT shell
if "%eval[2+2]" == "4" goto 4NTArgs

@REM -- Regular WinNT shell
set MAVEN_CMD_LINE_ARGS=%*
goto endInit

@REM The 4NT Shell from jp software
:4NTArgs
set MAVEN_CMD_LINE_ARGS=%$
goto endInit

:Win9xArg
@REM Slurp the command line arguments.  This loop allows for an unlimited number
@REM of agruments (up to the command line limit, anyway).
set MAVEN_CMD_LINE_ARGS=
:Win9xApp
if %1a==a goto endInit
set MAVEN_CMD_LINE_ARGS=%MAVEN_CMD_LINE_ARGS% %1
shift
goto Win9xApp

@REM Reaching here means variables are defined and arguments have been captured
:endInit
if "%MAVEN_OPTS%"=="" SET MAVEN_OPTS="-Xmx256m"
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"

@REM Start MAVEN2
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %M2_HOME%\core\boot\classworlds-*.jar "-Dclassworlds.conf=%M2_HOME%\bin\classworlds.conf" "-Dmaven.home=%M2_HOME%" org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS%
goto :end

:end
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" goto endNT

@REM For old DOS remove the set variables from ENV - we assume they were not set
@REM before we started - at least we don't leave any baggage around
set MAVEN_JAVA_EXE=
set MAVEN_CMD_LINE_ARGS=
goto postExec

:endNT
@endlocal

:postExec
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
@REM pause the batch file if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause

Make the script resilient to changes in the classworlds JAR. It works ONLY if M2_HOME doesn't contains spaces.

If we use double quote around %M2_HOME%\\core\\boot\\classworlds-*.jar for classpath, '*' isn't interpreted by dos.

git-svn-id: 2c527eb49caa05e19d6b2be874bf74fa9d7ea670@163225 13f79535-47bb-0310-9956-ffa450edef68