@echo off

REM   Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
REM   reserved.

if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"
set ANT_VERSION=1.6.0

if "%OS%"=="Windows_NT" @setlocal

rem %~dp0 is expanded pathname of the current script under NT
set DEFAULT_ANT_HOME=%~dp0..

if "%ANT_HOME%"=="" set ANT_HOME=%DEFAULT_ANT_HOME%
set DEFAULT_ANT_HOME=

rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).
set ANT_CMD_LINE_ARGS=%1
if ""%1""=="""" goto doneStart
shift
:setupArgs
if ""%1""=="""" goto doneStart
set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
shift
goto setupArgs
rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.

:doneStart
rem find ANT_HOME if it does not exist due to either an invalid value passed
rem by the user or the %0 problem on Windows 9x
if exist "%ANT_HOME%\lib\ant-%ANT_VERSION%.jar" goto checkJava

rem check for ant in Program Files
if not exist "%ProgramFiles%\ant" goto checkSystemDrive
set ANT_HOME=%ProgramFiles%\ant
goto checkJava

:checkSystemDrive
rem check for ant in root directory of system drive
if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive
set ANT_HOME=%SystemDrive%\ant
goto checkJava

:checkCDrive
rem check for ant in C:\ant for Win9X users
if not exist C:\ant\lib\ant.jar goto noAntHome
set ANT_HOME=C:\ant
goto checkJava

:noAntHome
echo ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.
goto end

:checkJava
set _JAVACMD=%JAVACMD%

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
goto checkJikes

:noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=java.exe

:checkJikes
if not "%JIKESPATH%"=="" goto runAntWithJikes

:runAnt
if not "%CLASSPATH%"=="" goto runAntWithClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%
goto end

:runAntWithClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -lib "%CLASSPATH%" %ANT_CMD_LINE_ARGS%
goto end

:runAntWithJikes
if not "%CLASSPATH%"=="" goto runAntWithJikesAndClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%
goto end

:runAntWithJikesAndClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS%  -lib "%CLASSPATH%" %ANT_CMD_LINE_ARGS%
goto end

:end
set _JAVACMD=
set ANT_CMD_LINE_ARGS=

if "%OS%"=="Windows_NT" @endlocal

:mainEnd
if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"

@echo off

REM   Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
REM   reserved.

if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"

if "%OS%"=="Windows_NT" @setlocal

rem %~dp0 is expanded pathname of the current script under NT
set DEFAULT_ANT_HOME=%~dp0..

if "%ANT_HOME%"=="" set ANT_HOME=%DEFAULT_ANT_HOME%
set DEFAULT_ANT_HOME=

rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).
set ANT_CMD_LINE_ARGS=%1
if ""%1""=="""" goto doneStart
shift
:setupArgs
if ""%1""=="""" goto doneStart
set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
shift
goto setupArgs
rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to.

:doneStart
rem find ANT_HOME if it does not exist due to either an invalid value passed
rem by the user or the %0 problem on Windows 9x
if exist "%ANT_HOME%\lib\ant.jar" goto checkJava

rem check for ant in Program Files
if not exist "%ProgramFiles%\ant" goto checkSystemDrive
set ANT_HOME=%ProgramFiles%\ant
goto checkJava

:checkSystemDrive
rem check for ant in root directory of system drive
if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive
set ANT_HOME=%SystemDrive%\ant
goto checkJava

:checkCDrive
rem check for ant in C:\ant for Win9X users
if not exist C:\ant\lib\ant.jar goto noAntHome
set ANT_HOME=C:\ant
goto checkJava

:noAntHome
echo ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.
goto end

:checkJava
set _JAVACMD=%JAVACMD%

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
goto checkJikes

:noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=java.exe

:checkJikes
if not "%JIKESPATH%"=="" goto runAntWithJikes

:runAnt
if not "%CLASSPATH%"=="" goto runAntWithClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%
goto end

:runAntWithClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -lib "%CLASSPATH%" %ANT_CMD_LINE_ARGS%
goto end

:runAntWithJikes
if not "%CLASSPATH%"=="" goto runAntWithJikesAndClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%
goto end

:runAntWithJikesAndClasspath
"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS%  -lib "%CLASSPATH%" %ANT_CMD_LINE_ARGS%
goto end

:end
set _JAVACMD=
set ANT_CMD_LINE_ARGS=

if "%OS%"=="Windows_NT" @endlocal

:mainEnd
if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"

Update to Apache Ant 1.6.0

Update to Apache Ant 1.6.0

git-svn-id: fea306228a0c821168c534b698c8fa2a33280b3b@9059 13f79535-47bb-0310-9956-ffa450edef68


@echo off
:: Copyright (c) 2012 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.
setlocal

:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used
:: standalone, but allow other PATH manipulations to take priority.
set PATH=%PATH%;%~dp0

:: Defer control.
python "%~dp0\download_from_google_storage.py" %*

@echo off
:: Copyright (c) 2012 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.
setlocal

:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used
:: standalone, but allow other PATH manipulations to take priority.
set PATH=%PATH%;%~dp0

:: Defer control.
python3 "%~dp0\download_from_google_storage.py" %*

use python3 for download_from_google_storage.bat

This is to fix
https://ci.chromium.org/ui/p/chromium/builders/ci/Win%20x64%20Builder%20(py2%20less)/1151/overview

Bug: 1327534
Change-Id: I3dcead03d0f4e213e1c4e610d8b90fe95ea843d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3670999
Commit-Queue: Josip Sokcevic <4606aec58cba917397ff2e4738f995e4758694f8@google.com>
Auto-Submit: Takuto Ikuta <71927f930fca81015e0f496c65cd126ab1a692e3@chromium.org>
Reviewed-by: Josip Sokcevic <4606aec58cba917397ff2e4738f995e4758694f8@google.com>


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

if "%OS%" == "Windows_NT" setlocal

python -V >nul 2>&1
if ERRORLEVEL 1 goto err

python "%~dp0\cqlsh" %*
goto finally

:err
echo Can't detect Python version!

:finally

ENDLOCAL

Add echo off to cqlsh.bat Patch by Mikhail Stepura, reviewed by brandonwilliams for CASSANDRA-6324


@echo off

go get github.com/go-yaml/yaml

go tool yacc -o %~dp0sqlparser\yacc.go -v %~dp0sqlparser\yacc.output %~dp0sqlparser\yacc.y && gofmt -w %~dp0sqlparser\yacc.go

rem build-darwin
set GOOS=darwin
go build -ldflags "-s -w" -o %~dp0bin/saashard_darwin github.com/berkaroad/saashard/cmd/saashard

rem build-linux
set GOOS=linux
go build -ldflags "-s -w" -o %~dp0bin/saashard_linux github.com/berkaroad/saashard/cmd/saashard

rem build-windows
set GOOS=windows
go build -ldflags "-s -w" -o %~dp0bin/saashard.exe github.com/berkaroad/saashard/cmd/saashard

@pause

build all platform

build all platform


@echo off
rem -------------------------------------------------------------------------
rem JBoss Bootstrap Script for Windows
rem -------------------------------------------------------------------------

rem $Id$

@if not "%ECHO%" == ""  echo %ECHO%
@if "%OS%" == "Windows_NT" setlocal

if "%OS%" == "Windows_NT" (
  set "DIRNAME=%~dp0%"
) else (
  set DIRNAME=.\
)

rem Read an optional configuration file.
if "x%DOMAIN_CONF%" == "x" (
   set "DOMAIN_CONF=%DIRNAME%domain.conf.bat"
)
if exist "%DOMAIN_CONF%" (
   echo Calling "%DOMAIN_CONF%"
   call "%DOMAIN_CONF%" %*
) else (
   echo Config file not found "%DOMAIN_CONF%"
)

pushd %DIRNAME%..
if "x%JBOSS_HOME%" == "x" (
  set "JBOSS_HOME=%CD%"
)
popd

set DIRNAME=

if "%OS%" == "Windows_NT" (
  set "PROGNAME=%~nx0%"
) else (
  set "PROGNAME=domain.bat"
)

rem Setup JBoss specific properties
set JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS%

if "x%JAVA_HOME%" == "x" (
  set  JAVA=java
  echo JAVA_HOME is not set. Unexpected results may occur.
  echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
) else (
  set "JAVA=%JAVA_HOME%\bin\java"
)

rem Add -server to the JVM options, if supported
"%JAVA%" -server -version 2>&1 | findstr /I hotspot > nul
if not errorlevel == 1 (
  set "JAVA_OPTS=%JAVA_OPTS% -server"
)

rem Find run.jar, or we can't continue
if exist "%JBOSS_HOME%\jboss-modules.jar" (
    set "RUNJAR=%JBOSS_HOME%\jboss-modules.jar"
) else (
  echo Could not locate "%JBOSS_HOME%\jboss-modules.jar".
  echo Please check that you are in the bin directory when running this script.
  goto END
)

rem Setup JBoss specific properties

rem Setup the java endorsed dirs
set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed

rem Set default module root paths
if "x%MODULEPATH%" == "x" (
  set  "MODULEPATH=%JBOSS_HOME%\modules"
)

echo ===============================================================================
echo.
echo   JBoss Bootstrap Environment
echo.
echo   JBOSS_HOME: %JBOSS_HOME%
echo.
echo   JAVA: %JAVA%
echo.
echo   JAVA_OPTS: %JAVA_OPTS%
echo.
echo ===============================================================================
echo.

:RESTART
"%JAVA%" %PROCESS_CONTROLLER_JAVA_OPTS% ^
 "-Dorg.jboss.boot.log.file=%JBOSS_HOME%\process-controller\log\boot.log" ^
 "-Dlogging.configuration=file:%JBOSS_HOME%/domain/configuration/logging.properties" ^
    -jar "%JBOSS_HOME%\jboss-modules.jar" ^
    -mp "%MODULEPATH%" ^
    -logmodule "org.jboss.logmanager" ^
     org.jboss.as.process-controller ^
    -jboss-home "%JBOSS_HOME%" ^
    -jvm "%JAVA%" ^
    -- ^
    "-Dorg.jboss.boot.log.file=%JBOSS_HOME%\domain\log\host-controller\boot.log" ^
    "-Dlogging.configuration=file:%JBOSS_HOME%/domain/configuration/logging.properties" ^
    %HOST_CONTROLLER_JAVA_OPTS% ^
    -- ^
    -default-jvm "%JAVA%" ^
    %*

if ERRORLEVEL 10 goto RESTART

:END
if "x%NOPAUSE%" == "x" pause

:END_NO_PAUSE

@echo off
rem -------------------------------------------------------------------------
rem JBoss Bootstrap Script for Windows
rem -------------------------------------------------------------------------

rem $Id$

@if not "%ECHO%" == ""  echo %ECHO%
@if "%OS%" == "Windows_NT" setlocal

if "%OS%" == "Windows_NT" (
  set "DIRNAME=%~dp0%"
) else (
  set DIRNAME=.\
)

rem Read an optional configuration file.
if "x%DOMAIN_CONF%" == "x" (
   set "DOMAIN_CONF=%DIRNAME%domain.conf.bat"
)
if exist "%DOMAIN_CONF%" (
   echo Calling "%DOMAIN_CONF%"
   call "%DOMAIN_CONF%" %*
) else (
   echo Config file not found "%DOMAIN_CONF%"
)

pushd %DIRNAME%..
if "x%JBOSS_HOME%" == "x" (
  set "JBOSS_HOME=%CD%"
)
popd

set DIRNAME=

if "%OS%" == "Windows_NT" (
  set "PROGNAME=%~nx0%"
) else (
  set "PROGNAME=domain.bat"
)

rem Setup JBoss specific properties
set JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS%

if "x%JAVA_HOME%" == "x" (
  set  JAVA=java
  echo JAVA_HOME is not set. Unexpected results may occur.
  echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
) else (
  set "JAVA=%JAVA_HOME%\bin\java"
)

rem Add -server to the JVM options, if supported
"%JAVA%" -server -version 2>&1 | findstr /I hotspot > nul
if not errorlevel == 1 (
  set "JAVA_OPTS=%JAVA_OPTS% -server"
)

rem Find run.jar, or we can't continue
if exist "%JBOSS_HOME%\jboss-modules.jar" (
    set "RUNJAR=%JBOSS_HOME%\jboss-modules.jar"
) else (
  echo Could not locate "%JBOSS_HOME%\jboss-modules.jar".
  echo Please check that you are in the bin directory when running this script.
  goto END
)

rem Setup JBoss specific properties

rem Setup the java endorsed dirs
set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed

rem Set default module root paths
if "x%MODULEPATH%" == "x" (
  set  "MODULEPATH=%JBOSS_HOME%\modules"
)

echo ===============================================================================
echo.
echo   JBoss Bootstrap Environment
echo.
echo   JBOSS_HOME: %JBOSS_HOME%
echo.
echo   JAVA: %JAVA%
echo.
echo   JAVA_OPTS: %JAVA_OPTS%
echo.
echo ===============================================================================
echo.

:RESTART
"%JAVA%" %PROCESS_CONTROLLER_JAVA_OPTS% ^
 "-Dorg.jboss.boot.log.file=%JBOSS_HOME%\domain\log\process-controller\boot.log" ^
 "-Dlogging.configuration=file:%JBOSS_HOME%/domain/configuration/logging.properties" ^
    -jar "%JBOSS_HOME%\jboss-modules.jar" ^
    -mp "%MODULEPATH%" ^
    -logmodule "org.jboss.logmanager" ^
     org.jboss.as.process-controller ^
    -jboss-home "%JBOSS_HOME%" ^
    -jvm "%JAVA%" ^
    -- ^
    "-Dorg.jboss.boot.log.file=%JBOSS_HOME%\domain\log\host-controller\boot.log" ^
    "-Dlogging.configuration=file:%JBOSS_HOME%/domain/configuration/logging.properties" ^
    %HOST_CONTROLLER_JAVA_OPTS% ^
    -- ^
    -default-jvm "%JAVA%" ^
    %*

if ERRORLEVEL 10 goto RESTART

:END
if "x%NOPAUSE%" == "x" pause

:END_NO_PAUSE

Fix the location of process-controller boot.log for Windows


@echo off
REM build and cache boost on Windows N.B. if no output for 10 minutes it's killed by travis.
if not exist "C:/local/boost/libs" (
        echo "Boost not cached, compiling it"
		wget -q -O boost.exe https://dl.bintray.com/boostorg/release/1.71.0/binaries/boost_1_71_0-msvc-14.1-64.exe
		echo "Boost downloaded"
		boost.exe /SILENT /DIR=C:\local\boost
		echo "Boost installed"
) else echo "Boost already installed"

@echo off
REM build and cache boost on Windows N.B. if no output for 10 minutes it's killed by travis.
if not exist "C:/local/boost/libs" (
        echo "Boost not cached, compiling it"
		wget -q -O boost.exe https://versaweb.dl.sourceforge.net/project/boost/boost-binaries/1.71.0/boost_1_71_0-msvc-14.1-64.exe
		echo "Boost downloaded"
		boost.exe /SILENT /DIR=C:\local\boost
		echo "Boost installed"
) else echo "Boost already installed"

change boost mirror

change boost mirror


@ECHO OFF
REM move-to-local-repo.bat.bat
REM Usage: move-to-local-repo.bat <project-path> <local-repo-path>

:TopOfScript
ECHO.
ECHO Starting...

IF "%~1"=="" (
  GOTO :Usage
)

IF "%~2"=="" (
  GOTO :Usage
)

SET projectPath=%~1
SET localRepoPath=%~2

IF NOT EXIST %projectPath%\NUL (
	ECHO No project directory found at given path '%projectPath%'.
  GOTO :EndOfScript
)

IF NOT EXIST %localRepoPath%\NUL (
	ECHO No local repository directory found at given path '%localRepoPath%'.
  GOTO :EndOfScript
)

SET outputDirRelativePath=bin\Debug
SET packageDirPath=%projectPath%\%outputDirRelativePath%

IF NOT EXIST %packageDirPath%\NUL (
	ECHO No package output directory found at given path '%packageDirPath%'.
  GOTO :EndOfScript
)

ECHO Moving packages from '%packageDirPath%' to '%localRepoPath%' ...

MOVE /Y "%packageDirPath%\*.nupkg" "%localRepoPath%"

GOTO :EndOfScript

:Usage
ECHO This command requires 2 input arguments.
ECHO.
ECHO Usage: move-to-local-repo.bat ^<project-path^> ^<local-repo-path^>

:EndOfScript
ECHO.
ECHO Finished

feat(scripts): add script to move package to local repo


git fetch --tags
for /f "delims=" %%a in ('git rev-list --tags --max-count=1') do @SET rev=%%a
for /f "delims=" %%a in ('git describe --tags %rev%') do @SET tag=%%a
ECHO Running on release %tag% (commit %rev%)
git checkout --force %tag%
(npm update)
ECHO Starting ScreenWerk
nwjs
ECHO uzredzēšanos!

git fetch --tags
for /f "delims=" %%a in ('git rev-list --tags --max-count=1') do @SET rev=%%a
for /f "delims=" %%a in ('git describe --tags %rev%') do @SET tag=%%a
ECHO Running on release %tag% (commit %rev%)
git checkout --force %tag%
call npm update
ECHO Starting ScreenWerk
nwjs
ECHO uzredzēšanos!

fix test

fix test


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

:: This self-contained Windows batch file creates a portable bash-funk (https://github.com/vegardit/bash-funk/)
:: installation based on Cygwin (https://cygwin.com/mirrors.html). It also automatically installs the
:: command-line package manager apt-cyg (https://github.com/transcode-open/apt-cyg).
::
:: You can customize the following variables to your needs before running the batch file:

:: change the URL to the closest mirror https://cygwin.com/mirrors.html
set CYGWIN_MIRROR=http://ftp.inf.tu-dresden.de/software/windows/cygwin32

:: select the packages to be installed automatically via apt-cyg
set CYGWIN_PACKAGES=bash-completion,bc,curl,expect,git,git-svn,gnupg,inetutils,mc,nc,openssh,openssl,perl,python,subversion,unzip,vim,zip

:: choose a user name under Cygwin
set CYGWIN_USERNAME=root

:: set proxy if required (unfortunately Cygwin setup.exe does not have commandline options to specify proxy user credentials)
set PROXY_HOST=
set PROXY_PORT=

echo.
echo ###########################################################
echo # Installing [bash-funk portable]...
echo ###########################################################
echo.

:: create VB script that can download files
set DOWNLOADER=%~dp0downloader.vbs
echo Creating [%DOWNLOADER%] script...
if "%PROXY%" == "" (
    set DOWNLOADER_PROXY=.
) else (
    set DOWNLOADER_PROXY= req.SetProxy 2, "%PROXY_HOST%:%PROXY_PORT%", ""
)

(
    echo url = Wscript.Arguments(0^)
    echo target = Wscript.Arguments(1^)
    echo WScript.Echo "Downloading '" ^& url ^& "' to '" ^& target ^& "'..."
    echo Set req = CreateObject("WinHttp.WinHttpRequest.5.1"^)
    echo%DOWNLOADER_PROXY%
    echo req.Open "GET", url, False
    echo req.Send
    echo If req.Status ^<^> 200 Then
    echo    WScript.Echo "FAILED to download: HTTP Status " ^& req.Status
    echo    WScript.Quit 1
    echo End If
    echo Set buff = CreateObject("ADODB.Stream"^)
    echo buff.Open
    echo buff.Type = 1
    echo buff.Write req.ResponseBody
    echo buff.Position = 0
    echo buff.SaveToFile target
    echo buff.Close
    echo.
) >"%DOWNLOADER%" || goto :fail

set CYGWIN_ROOT=%~dp0cygwin

if not exist "%CYGWIN_ROOT%" (
	md "%CYGWIN_ROOT%"
)
:: download Cygwin setup
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set CYGWIN_SETUP=setup-x86.exe || set CYGWIN_SETUP=setup-x86_64.exe
if exist "%CYGWIN_ROOT%\%CYGWIN_SETUP%" (
    del "%CYGWIN_ROOT%\%CYGWIN_SETUP%" || goto :fail
)
cscript //Nologo %DOWNLOADER% http://cygwin.org/%CYGWIN_SETUP% "%CYGWIN_ROOT%\%CYGWIN_SETUP%" || goto :fail
del "%DOWNLOADER%"

:: Cygwin command line options: https://cygwin.com/faq/faq.html#faq.setup.cli
if "%PROXY%" == "" (
    set CYGWIN_PROXY=
) else (
    set CYGWIN_PROXY=--proxy "%PROXY_HOST%:%PROXY_PORT%"
)

echo Running Cygwin setup...
"%CYGWIN_ROOT%\%CYGWIN_SETUP%" --no-admin ^
 --arch x86_64 ^
 --site http://ftp.inf.tu-dresden.de/software/windows/cygwin32 %CYGWIN_PROXY% ^
 --root "%CYGWIN_ROOT%" ^
 --local-package-dir "%CYGWIN_ROOT%-pkg-cache" ^
 --no-shortcuts ^
 --no-desktop ^
 --delete-orphans ^
 --upgrade-also ^
 --no-replaceonreboot ^
 --quiet-mode ^
 --packages dos2unix,wget,%CYGWIN_PACKAGES% || goto :fail

:configure

set Cygwin_bat=%CYGWIN_ROOT%\Cygwin.bat
if exist "%Cygwin_bat%" (
    echo Disabling [%Cygwin_bat%]...
    if exist "%Cygwin_bat%.disabled" (
        del "%Cygwin_bat%.disabled" || goto :fail
    )
    rename %Cygwin_bat% Cygwin.bat.disabled || goto :fail
)

set Init_sh=%CYGWIN_ROOT%\bash-funk-portable-init.sh
echo Creating [%Init_sh%]...
(
    echo #!/usr/bin/env bash
    echo.
    echo #
    echo # Map Current Windows User to root user
    echo #
    echo.
    echo # Check if current Windows user is in /etc/passwd
    echo USER_SID="$(mkpasswd -c | cut -d':' -f 5)"
    echo if ! grep -F "$USER_SID" /etc/passwd ^&^>/dev/null; then
    echo     echo "Mapping Windows user '$USER_SID' to cygwin '$USERNAME' in /etc/passwd..."
    echo     GID="$(mkpasswd -c | cut -d':' -f 4)"
    echo     echo $USERNAME:unused:1001:$GID:$USER_SID:$HOME:/bin/bash ^>^> /etc/passwd
    echo fi
    echo.
    echo #
    echo # Installing apt-cyg package manager if required
    echo #
    echo if ! [[ -x /usr/local/bin/apt-cyg ]]; then
    if not "%PROXY%" == "" (
        echo     # temporary proxy settings during initial installation
        echo     export http_proxy=http://%%PROXY_HOST%%:%%PROXY_PORT%%
        echo     export https_proxy=http://%%PROXY_HOST%%:%%PROXY_PORT%%
    )
    echo     echo "Installing apt-cyg..."
    echo     wget -O /usr/local/bin/apt-cyg https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
    echo     chmod +x /usr/local/bin/apt-cyg
    echo fi
    echo.
    echo #
    echo # disable cygwin's special ACL treatment which prevents apt-cyg from working
    echo #
    echo sed -i -e "s/cygdrive binary,posix/cygdrive binary,noacl,posix/" /etc/fstab
    echo mount -a
    echo.
    echo #
    echo # Installing bash-funk if required
    echo #
    echo if [[ ! -e /opt/bash-funk/bash-funk.sh ]]; then
    if not "%PROXY%" == "" (
        echo   # temporary proxy settings during initial installation
        echo   export http_proxy=http://%%PROXY_HOST%%:%%PROXY_PORT%%
        echo   export https_proxy=http://%%PROXY_HOST%%:%%PROXY_PORT%%
    )
    echo   echo Installing [bash-funk]...
    echo   if hash git ^&^>/dev/null; then
    echo     git clone https://github.com/vegardit/bash-funk --branch master --single-branch /opt/bash-funk
    echo   elif hash svn ^&^>/dev/null; then
    echo     svn checkout https://github.com/vegardit/bash-funk/trunk /opt/bash-funk
    echo   else
    echo     mkdir /opt/bash-funk ^&^& \
    echo     cd /opt/bash-funk ^&^& \
    echo     wget -qO- --show-progress https://github.com/vegardit/bash-funk/tarball/master ^| tar -xzv --strip-components 1
    echo   fi
    echo fi
) >"%Init_sh%" || goto :fail
"%CYGWIN_ROOT%\bin\dos2unix" "%Init_sh%" || goto :fail

set Start_cmd=%~dp0bash-funk.cmd
echo Creating [%Start_cmd%]...
(
    echo @echo off
    echo set CWD="%%cd%%"
    echo set CYGWIN_DRIVE=%%~d0
    echo set CYGWIN_ROOT=%%~dp0cygwin
    echo.
    echo set PATH=%%PATH%%;%%CYGWIN_ROOT%%\bin
    echo set ALLUSERSPROFILE=%%CYGWIN_ROOT%%.ProgramData
    echo set ProgramData=%%ALLUSERSPROFILE%%
    echo set CYGWIN=nodosfilewarning
    echo.
    echo set USERNAME=%CYGWIN_USERNAME%
    echo set HOME=/home/%%USERNAME%%
	echo set SHELL=/bin/bash
	echo set HOMEDRIVE=%%CYGWIN_DRIVE%%
	echo set HOMEPATH=%%CYGWIN_ROOT%%\home\%%USERNAME%%
    echo set GROUP=None
    echo set GRP=
    echo.
    echo %%CYGWIN_DRIVE%%
    echo chdir "%%CYGWIN_ROOT%%\bin"
    echo bash "%%CYGWIN_ROOT%%\bash-funk-portable-init.sh"
    echo.
    echo if "%%1" == "" (
	echo   mintty --option TERM=xterm-256color --size 160,50 --icon %CYGWIN_ROOT%\Cygwin-Terminal.ico -
    echo ^) else (
	echo   if "%%1" == "no-mintty" (
	echo     bash --login -i
	echo   ^) else (
    echo     bash --login -c %%*
	echo   ^)
    echo ^)
    echo.
    echo cd "%%cwd%%"
) >"%Start_cmd%" || goto :fail

:: launching bash once to initialize user home dir
call %Start_cmd% whoami

set BashFunkLoader_sh=%CYGWIN_ROOT%\home\%CYGWIN_USERNAME%\.bashfunk_loader
echo Creating [%BashFunkLoader_sh%]...
(
    echo #!/usr/bin/env bash
    echo if [[ ! -e /opt/bash-funk/bash-funk.sh ]]; then
    echo   echo Installing [bash-funk]...
    echo   if hash git ^&^>/dev/null; then
    echo     git clone https://github.com/vegardit/bash-funk --branch master --single-branch /opt/bash-funk
    echo   elif hash svn ^&^>/dev/null; then
    echo     svn checkout https://github.com/vegardit/bash-funk/trunk /opt/bash-funk
    echo   else
    echo     mkdir /opt/bash-funk ^&^& \
    echo     cd /opt/bash-funk ^&^& \
    echo     wget -qO- --show-progress https://github.com/vegardit/bash-funk/tarball/master ^| tar -xzv --strip-components 1
    echo   fi
    echo fi
    echo source /opt/bash-funk/bash-funk.sh
) >"%BashFunkLoader_sh%" || goto :fail
"%CYGWIN_ROOT%\bin\dos2unix" "%BashFunkLoader_sh%" || goto :fail

set Bashrc_sh=%CYGWIN_ROOT%\home\%CYGWIN_USERNAME%\.bashrc
echo Adding bash-funk to [/home/%CYGWIN_USERNAME%/.bashrc]...
find "bashfunk_loader" "%Bashrc_sh%" >NUL || (
    (
        echo.
        echo source ~/.bashfunk_loader
    ) >>"%Bashrc_sh%" || goto :fail
    "%CYGWIN_ROOT%\bin\dos2unix" "%Bashrc_sh%" || goto :fail
)
echo.
echo ###########################################################
echo # Installing [bash-funk portable] succeeded.
echo ###########################################################
echo.
echo Use [%Start_cmd%] to launch bash-funk portable.
echo.
pause
goto :eof

:fail
    if exist "%DOWNLOADER%" (
        del "%DOWNLOADER%"
    )
    echo.
    echo ###########################################################
    echo #Installing [bash-funk portable] FAILED!
    echo ###########################################################
    echo.
    pause
    exit /b 1

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

:: This self-contained Windows batch file creates a portable bash-funk (https://github.com/vegardit/bash-funk/)
:: installation based on Cygwin (https://cygwin.com/mirrors.html). It also automatically installs the
:: command-line package manager apt-cyg (https://github.com/transcode-open/apt-cyg).
::
:: You can customize the following variables to your needs before running the batch file:

:: change the URL to the closest mirror https://cygwin.com/mirrors.html
set CYGWIN_MIRROR=http://ftp.inf.tu-dresden.de/software/windows/cygwin32

:: select the packages to be installed automatically via apt-cyg
set CYGWIN_PACKAGES=bash-completion,bc,curl,expect,git,git-svn,gnupg,inetutils,mc,nc,openssh,openssl,perl,python,subversion,unzip,vim,zip

:: choose a user name under Cygwin
set CYGWIN_USERNAME=root

:: set proxy if required (unfortunately Cygwin setup.exe does not have commandline options to specify proxy user credentials)
set PROXY_HOST=surf.proxy.agis.allianz
set PROXY_PORT=8080

echo.
echo ###########################################################
echo # Installing [bash-funk portable]...
echo ###########################################################
echo.

:: create VB script that can download files
set DOWNLOADER=%~dp0downloader.vbs
echo Creating [%DOWNLOADER%] script...
if "%PROXY_HOST%" == "" (
    set DOWNLOADER_PROXY=.
) else (
    set DOWNLOADER_PROXY= req.SetProxy 2, "%PROXY_HOST%:%PROXY_PORT%", ""
)

(
    echo url = Wscript.Arguments(0^)
    echo target = Wscript.Arguments(1^)
    echo WScript.Echo "Downloading '" ^& url ^& "' to '" ^& target ^& "'..."
    echo Set req = CreateObject("WinHttp.WinHttpRequest.5.1"^)
    echo%DOWNLOADER_PROXY%
    echo req.Open "GET", url, False
    echo req.Send
    echo If req.Status ^<^> 200 Then
    echo    WScript.Echo "FAILED to download: HTTP Status " ^& req.Status
    echo    WScript.Quit 1
    echo End If
    echo Set buff = CreateObject("ADODB.Stream"^)
    echo buff.Open
    echo buff.Type = 1
    echo buff.Write req.ResponseBody
    echo buff.Position = 0
    echo buff.SaveToFile target
    echo buff.Close
    echo.
) >"%DOWNLOADER%" || goto :fail

set CYGWIN_ROOT=%~dp0cygwin

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

:: download Cygwin 32 or 64 setup exe

if "%PROCESSOR_ARCHITEW6432%" == "AMD64" (
    set CYGWIN_SETUP=setup-x86_64.exe
) else (
    if "%PROCESSOR_ARCHITECTURE%" == "x86" (
        set CYGWIN_SETUP=setup-x86.exe )
    else (
        set CYGWIN_SETUP=setup-x86_64.exe
    )
)

if exist "%CYGWIN_ROOT%\%CYGWIN_SETUP%" (
    del "%CYGWIN_ROOT%\%CYGWIN_SETUP%" || goto :fail
)
cscript //Nologo %DOWNLOADER% http://cygwin.org/%CYGWIN_SETUP% "%CYGWIN_ROOT%\%CYGWIN_SETUP%" || goto :fail
del "%DOWNLOADER%"

:: Cygwin command line options: https://cygwin.com/faq/faq.html#faq.setup.cli
if "%PROXY_HOST%" == "" (
    set CYGWIN_PROXY=
) else (
    set CYGWIN_PROXY=--proxy "%PROXY_HOST%:%PROXY_PORT%"
)

echo Running Cygwin setup...
"%CYGWIN_ROOT%\%CYGWIN_SETUP%" --no-admin ^
 --arch x86_64 ^
 --site http://ftp.inf.tu-dresden.de/software/windows/cygwin32 %CYGWIN_PROXY% ^
 --root "%CYGWIN_ROOT%" ^
 --local-package-dir "%CYGWIN_ROOT%-pkg-cache" ^
 --no-shortcuts ^
 --no-desktop ^
 --delete-orphans ^
 --upgrade-also ^
 --no-replaceonreboot ^
 --quiet-mode ^
 --packages dos2unix,wget,%CYGWIN_PACKAGES% || goto :fail

:configure

set Cygwin_bat=%CYGWIN_ROOT%\Cygwin.bat
if exist "%Cygwin_bat%" (
    echo Disabling [%Cygwin_bat%]...
    if exist "%Cygwin_bat%.disabled" (
        del "%Cygwin_bat%.disabled" || goto :fail
    )
    rename %Cygwin_bat% Cygwin.bat.disabled || goto :fail
)

set Init_sh=%CYGWIN_ROOT%\bash-funk-portable-init.sh
echo Creating [%Init_sh%]...
(
    echo #!/usr/bin/env bash
    echo.
    echo #
    echo # Map Current Windows User to root user
    echo #
    echo.
    echo # Check if current Windows user is in /etc/passwd
    echo USER_SID="$(mkpasswd -c | cut -d':' -f 5)"
    echo if ! grep -F "$USER_SID" /etc/passwd ^&^>/dev/null; then
    echo     echo "Mapping Windows user '$USER_SID' to cygwin '$USERNAME' in /etc/passwd..."
    echo     GID="$(mkpasswd -c | cut -d':' -f 4)"
    echo     echo $USERNAME:unused:1001:$GID:$USER_SID:$HOME:/bin/bash ^>^> /etc/passwd
    echo fi
    echo.
    echo #
    echo # Installing apt-cyg package manager if required
    echo #
    echo if ! [[ -x /usr/local/bin/apt-cyg ]]; then
    if not "%PROXY_HOST%" == "" (
        echo     # temporary proxy settings during initial installation
        echo     export http_proxy=http://%%PROXY_HOST%%:%%PROXY_PORT%%
        echo     export https_proxy=http://%%PROXY_HOST%%:%%PROXY_PORT%%
    )
    echo     echo "Installing apt-cyg..."
    echo     wget -O /usr/local/bin/apt-cyg https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
    echo     chmod +x /usr/local/bin/apt-cyg
    echo fi
    echo.
    echo #
    echo # disable cygwin's special ACL treatment which prevents apt-cyg from working
    echo #
    echo sed -i -e "s/cygdrive binary,posix/cygdrive binary,noacl,posix/" /etc/fstab
    echo mount -a
    echo.
    echo #
    echo # Installing bash-funk if required
    echo #
    echo if [[ ! -e /opt/bash-funk/bash-funk.sh ]]; then
    if not "%PROXY_HOST%" == "" (
        echo   # temporary proxy settings during initial installation
        echo   export http_proxy=http://%%PROXY_HOST%%:%%PROXY_PORT%%
        echo   export https_proxy=http://%%PROXY_HOST%%:%%PROXY_PORT%%
    )
    echo   echo Installing [bash-funk]...
    echo   if hash git ^&^>/dev/null; then
    echo     git clone https://github.com/vegardit/bash-funk --branch master --single-branch /opt/bash-funk
    echo   elif hash svn ^&^>/dev/null; then
    echo     svn checkout https://github.com/vegardit/bash-funk/trunk /opt/bash-funk
    echo   else
    echo     mkdir /opt/bash-funk ^&^& \
    echo     cd /opt/bash-funk ^&^& \
    echo     wget -qO- --show-progress https://github.com/vegardit/bash-funk/tarball/master ^| tar -xzv --strip-components 1
    echo   fi
    echo fi
) >"%Init_sh%" || goto :fail
"%CYGWIN_ROOT%\bin\dos2unix" "%Init_sh%" || goto :fail

set Start_cmd=%~dp0bash-funk.cmd
echo Creating [%Start_cmd%]...
(
    echo @echo off
    echo set CWD="%%cd%%"
    echo set CYGWIN_DRIVE=%%~d0
    echo set CYGWIN_ROOT=%%~dp0cygwin
    echo.
    echo set PATH=%%PATH%%;%%CYGWIN_ROOT%%\bin
    echo set ALLUSERSPROFILE=%%CYGWIN_ROOT%%.ProgramData
    echo set ProgramData=%%ALLUSERSPROFILE%%
    echo set CYGWIN=nodosfilewarning
    echo.
    echo set USERNAME=%CYGWIN_USERNAME%
    echo set HOME=/home/%%USERNAME%%
    echo set SHELL=/bin/bash
    echo set HOMEDRIVE=%%CYGWIN_DRIVE%%
    echo set HOMEPATH=%%CYGWIN_ROOT%%\home\%%USERNAME%%
    echo set GROUP=None
    echo set GRP=
    echo.
    echo %%CYGWIN_DRIVE%%
    echo chdir "%%CYGWIN_ROOT%%\bin"
    echo bash "%%CYGWIN_ROOT%%\bash-funk-portable-init.sh"
    echo.
    echo if "%%1" == "" (
    echo   mintty --option TERM=xterm-256color --size 160,50 --icon %CYGWIN_ROOT%\Cygwin-Terminal.ico -
    echo ^) else (
    echo   if "%%1" == "no-mintty" (
    echo     bash --login -i
    echo   ^) else (
    echo     bash --login -c %%*
    echo   ^)
    echo ^)
    echo.
    echo cd "%%cwd%%"
) >"%Start_cmd%" || goto :fail

:: launching bash once to initialize user home dir
call %Start_cmd% whoami

set BashFunkLoader_sh=%CYGWIN_ROOT%\home\%CYGWIN_USERNAME%\.bashfunk_loader
echo Creating [%BashFunkLoader_sh%]...
(
    echo #!/usr/bin/env bash
    echo if [[ ! -e /opt/bash-funk/bash-funk.sh ]]; then
    echo   echo Installing [bash-funk]...
    echo   if hash git ^&^>/dev/null; then
    echo     git clone https://github.com/vegardit/bash-funk --branch master --single-branch /opt/bash-funk
    echo   elif hash svn ^&^>/dev/null; then
    echo     svn checkout https://github.com/vegardit/bash-funk/trunk /opt/bash-funk
    echo   else
    echo     mkdir /opt/bash-funk ^&^& \
    echo     cd /opt/bash-funk ^&^& \
    echo     wget -qO- --show-progress https://github.com/vegardit/bash-funk/tarball/master ^| tar -xzv --strip-components 1
    echo   fi
    echo fi
    echo source /opt/bash-funk/bash-funk.sh
) >"%BashFunkLoader_sh%" || goto :fail
"%CYGWIN_ROOT%\bin\dos2unix" "%BashFunkLoader_sh%" || goto :fail

set Bashrc_sh=%CYGWIN_ROOT%\home\%CYGWIN_USERNAME%\.bashrc
echo Adding bash-funk to [/home/%CYGWIN_USERNAME%/.bashrc]...
find "bashfunk_loader" "%Bashrc_sh%" >NUL || (
    (
        echo.
        echo source ~/.bashfunk_loader
    ) >>"%Bashrc_sh%" || goto :fail
    "%CYGWIN_ROOT%\bin\dos2unix" "%Bashrc_sh%" || goto :fail
)
echo.
echo ###########################################################
echo # Installing [bash-funk portable] succeeded.
echo ###########################################################
echo.
echo Use [%Start_cmd%] to launch bash-funk portable.
echo.
pause
goto :eof

:fail
    if exist "%DOWNLOADER%" (
        del "%DOWNLOADER%"
    )
    echo.
    echo ###########################################################
    echo #Installing [bash-funk portable] FAILED!
    echo ###########################################################
    echo.
    pause
    exit /b 1

fix proxy support

fix proxy support


@echo off
setlocal

set "output=$null"
set "times=1"

goto :parsePackage

:help

:: TODO: put something here.

goto :eof

:usage

call :help 1>&2
exit /b 1

:parsePackage

if "%~1" == "" goto usage
set "package=%~1"
shift

:parseArgs

if "%~1" == "" goto main

if /i "%~1" == "-?" goto help
if /i "%~1" == "-h" goto help
if /i "%~1" == "--help" goto help

if /i "%~1" == "-t" (
    set "times=%~2"
    shift
)

if /i "%~1" == "--times" (
    set "times=%~2"
    shift
)

if /i "%~1" == "-o" (
    set "output=%~2"
    shift
)

if /i "%~1" == "--output" (
    set "output=%~2"
    shift
)

shift
goto parseArgs

:curl

@powershell -NoProfile "(New-Object Net.WebClient).DownloadString('%~1') > '%~2'"

goto :eof

:downloadPackage

set "url=https://www.nuget.org/api/v2/package/%~1"
call :curl "%url%" %2

goto :eof

:main

for /l %%i in (1, 1, %times%) do (
    call :downloadPackage "%package%" "%output%"
)

@echo off
setlocal

set "output=$null"
set "times=1"

goto :parsePackage

:help

type "%~dp0help\popcorn.txt"

goto :eof

:usage

call :help 1>&2
exit /b 1

:parsePackage

if "%~1" == "" goto usage
set "package=%~1"
shift

:parseArgs

if "%~1" == "" goto main

if /i "%~1" == "-?" goto help
if /i "%~1" == "-h" goto help
if /i "%~1" == "--help" goto help

if /i "%~1" == "-t" (
    set "times=%~2"
    shift
)

if /i "%~1" == "--times" (
    set "times=%~2"
    shift
)

if /i "%~1" == "-o" (
    set "output=%~2"
    shift
)

if /i "%~1" == "--output" (
    set "output=%~2"
    shift
)

shift
goto parseArgs

:curl

@powershell -NoProfile "(New-Object Net.WebClient).DownloadString('%~1') > '%~2'"

goto :eof

:downloadPackage

set "url=https://www.nuget.org/api/v2/package/%~1"
call :curl "%url%" %2

goto :eof

:main

for /l %%i in (1, 1, %times%) do (
    call :downloadPackage "%package%" "%output%"
)

add help for popcorn.cmd

add help for popcorn.cmd


Update batch file

Update batch file


@echo off

if not defined PHP_SDK_RUN_FROM_ROOT (
	echo This script should not be run directly.
	echo Use starter scripts looking like phpsdk-^<crt^>-^<arch^>.bat in the PHP SDK root instead.
	goto out_error
)

if "%1"=="" goto :help
if "%1"=="/?" goto :help
if "%1"=="-h" goto :help
if "%1"=="--help" goto :help
if "%2"=="" goto :help

set PHP_SDK_VC=%1
if /i not "%PHP_SDK_VC:~0,2%"=="vc" (
:malformed_vc_string
	echo Malformed CRT string "%1"
	set PHP_SDK_VC=
	goto out_error
)
if ""=="%PHP_SDK_VC:~2%" (
	goto malformed_vc_string
)
set /a TMP_CHK=%PHP_SDK_VC:~2%
if 14 gtr %TMP_CHK% (
	if "0"=="%TMP_CHK%" (
		if not "0"=="%PHP_SDK_VC:~2%" (
			set TMP_CHK=
			goto malformed_vc_string
		)
	)

	echo At least vc14 is required
	set PHP_SDK_VC=
	set TMP_CHK=
	goto out_error
)
set PHP_SDK_VC_NUM=%TMP_CHK%
set TMP_CHK=

if /i not "%2"=="x64" (
	if /i not "%2"=="x86" (
		echo Unsupported arch "%2"
		goto out_error
	)
)

set PHP_SDK_ARCH=%2

rem check OS arch
set TMPKEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion
reg query "%TMPKEY%" /v "ProgramFilesDir (x86)" >nul 2>nul
if not errorlevel 1 (
	set PHP_SDK_OS_ARCH=x64
) else (
	if /i "%PHP_SDK_ARCH%"=="x64" (
		echo 32-bit OS detected, native 64-bit toolchain is unavailable.
		goto out_error
	)
	set PHP_SDK_OS_ARCH=x86
)
set TMPKEY=

rem get vc base dir
if 15 gtr %PHP_SDK_VC_NUM% (
	if /i "%PHP_SDK_OS_ARCH%"=="x64" (
		set TMPKEY=HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%PHP_SDK_VC:~2%.0\Setup\VC
	) else (
		set TMPKEY=HKLM\SOFTWARE\Microsoft\VisualStudio\%PHP_SDK_VC:~2%.0\Setup\VC
	)
	reg query !TMPKEY! /v ProductDir >nul 2>&1
	if errorlevel 1 (
		echo Couldn't determine VC%PHP_SDK_VC:~2% directory
		goto out_error;
	)
	for /f "tokens=2*" %%a in ('reg query !TMPKEY! /v ProductDir') do set PHP_SDK_VC_DIR=%%b
) else (
	rem vc15 support only for now, could parse out and pass on later
	for /f "tokens=1* delims=: " %%a in ('%~dp0\vswhere -nologo -version %PHP_SDK_VC_NUM% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -format text') do set PHP_SDK_VC_DIR=%%b\VC
	set VSCMD_ARG_no_logo=nologo
	if not exist "!PHP_SDK_VC_DIR!" (
		echo Could not determine '%PHP_SDK_VC%' directory
		goto out_error;
	)
)
set TMPKEY=

if 15 gtr %PHP_SDK_VC_NUM% (
	rem get sdk dir
	if /i "%PHP_SDK_OS_ARCH%"=="x64" (
		set TMPKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1
	) else (
		set TMPKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1
	)
	for /f "tokens=2*" %%a in ('reg query "!TMPKEY!" /v InstallationFolder') do (
		if exist "%%b\Include\um\Windows.h" (
			set PHP_SDK_WIN_SDK_DIR=%%b
		)
	)
	if not defined PHP_SDK_WIN_SDK_DIR (
		echo Windows SDK not found.
		goto out_error;
	)
	set TMPKEY=
)

if /i "%PHP_SDK_ARCH%"=="x64" (
	if 15 gtr %PHP_SDK_VC_NUM% (
		set PHP_SDK_VC_SHELL_CMD="!PHP_SDK_VC_DIR!\vcvarsall.bat" amd64
	) else (
		set PHP_SDK_VC_SHELL_CMD="!PHP_SDK_VC_DIR!\Auxiliary\Build\vcvarsall.bat" amd64
	)
) else (
	if 15 gtr %PHP_SDK_VC_NUM% (
		set PHP_SDK_VC_SHELL_CMD="!PHP_SDK_VC_DIR!\vcvarsall.bat" x86
	) else (
		set PHP_SDK_VC_SHELL_CMD="!PHP_SDK_VC_DIR!\Auxiliary\Build\vcvarsall.bat" x86
	)
)

rem echo Visual Studio path %PHP_SDK_VC_DIR%
rem echo Windows SDK path %PHP_SDK_WIN_SDK_DIR%

goto out

:help
	echo "Start Visual Studio command line for PHP SDK"
	echo "Usage: %0 vc arch"
	echo nul

:out_error
	exit /b 3

:out
rem	echo Shell configuration complete
	exit /b 0

goto :eof

@echo off

if not defined PHP_SDK_RUN_FROM_ROOT (
	echo This script should not be run directly.
	echo Use starter scripts looking like phpsdk-^<crt^>-^<arch^>.bat in the PHP SDK root instead.
	goto out_error
)

if "%1"=="" goto :help
if "%1"=="/?" goto :help
if "%1"=="-h" goto :help
if "%1"=="--help" goto :help
if "%2"=="" goto :help

set PHP_SDK_VC=%1
if /i not "%PHP_SDK_VC:~0,2%"=="vc" (
:malformed_vc_string
	echo Malformed CRT string "%1"
	set PHP_SDK_VC=
	goto out_error
)
if ""=="%PHP_SDK_VC:~2%" (
	goto malformed_vc_string
)
set /a TMP_CHK=%PHP_SDK_VC:~2%
if 11 gtr %TMP_CHK% (
	if "0"=="%TMP_CHK%" (
		if not "0"=="%PHP_SDK_VC:~2%" (
			set TMP_CHK=
			goto malformed_vc_string
		)
	)

	echo At least vc14 is required
	set PHP_SDK_VC=
	set TMP_CHK=
	goto out_error
)
set PHP_SDK_VC_NUM=%TMP_CHK%
set TMP_CHK=

if /i not "%2"=="x64" (
	if /i not "%2"=="x86" (
		echo Unsupported arch "%2"
		goto out_error
	)
)

set PHP_SDK_ARCH=%2

rem check OS arch
set TMPKEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion
reg query "%TMPKEY%" /v "ProgramFilesDir (x86)" >nul 2>nul
if not errorlevel 1 (
	set PHP_SDK_OS_ARCH=x64
) else (
	if /i "%PHP_SDK_ARCH%"=="x64" (
		echo 32-bit OS detected, native 64-bit toolchain is unavailable.
		goto out_error
	)
	set PHP_SDK_OS_ARCH=x86
)
set TMPKEY=

rem get vc base dir
if 15 gtr %PHP_SDK_VC_NUM% (
	if /i "%PHP_SDK_OS_ARCH%"=="x64" (
		set TMPKEY=HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%PHP_SDK_VC:~2%.0\Setup\VC
	) else (
		set TMPKEY=HKLM\SOFTWARE\Microsoft\VisualStudio\%PHP_SDK_VC:~2%.0\Setup\VC
	)
	reg query !TMPKEY! /v ProductDir >nul 2>&1
	if errorlevel 1 (
		echo Couldn't determine VC%PHP_SDK_VC:~2% directory
		goto out_error;
	)
	for /f "tokens=2*" %%a in ('reg query !TMPKEY! /v ProductDir') do set PHP_SDK_VC_DIR=%%b
) else (
	rem vc15 support only for now, could parse out and pass on later
	for /f "tokens=1* delims=: " %%a in ('%~dp0\vswhere -nologo -version %PHP_SDK_VC_NUM% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -format text') do set PHP_SDK_VC_DIR=%%b\VC
	set VSCMD_ARG_no_logo=nologo
	if not exist "!PHP_SDK_VC_DIR!" (
		echo Could not determine '%PHP_SDK_VC%' directory
		goto out_error;
	)
)
set TMPKEY=

if 15 gtr %PHP_SDK_VC_NUM% (
	rem get sdk dir
	if /i "%PHP_SDK_OS_ARCH%"=="x64" (
		set TMPKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1
	) else (
		set TMPKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1
	)
	for /f "tokens=2*" %%a in ('reg query "!TMPKEY!" /v InstallationFolder') do (
		if exist "%%b\Include\um\Windows.h" (
			set PHP_SDK_WIN_SDK_DIR=%%b
		)
	)
	if not defined PHP_SDK_WIN_SDK_DIR (
		echo Windows SDK not found.
		goto out_error;
	)
	set TMPKEY=
)

if /i "%PHP_SDK_ARCH%"=="x64" (
	if 15 gtr %PHP_SDK_VC_NUM% (
		set PHP_SDK_VC_SHELL_CMD="!PHP_SDK_VC_DIR!\vcvarsall.bat" amd64
	) else (
		set PHP_SDK_VC_SHELL_CMD="!PHP_SDK_VC_DIR!\Auxiliary\Build\vcvarsall.bat" amd64
	)
) else (
	if 15 gtr %PHP_SDK_VC_NUM% (
		set PHP_SDK_VC_SHELL_CMD="!PHP_SDK_VC_DIR!\vcvarsall.bat" x86
	) else (
		set PHP_SDK_VC_SHELL_CMD="!PHP_SDK_VC_DIR!\Auxiliary\Build\vcvarsall.bat" x86
	)
)

rem echo Visual Studio path %PHP_SDK_VC_DIR%
rem echo Windows SDK path %PHP_SDK_WIN_SDK_DIR%

goto out

:help
	echo "Start Visual Studio command line for PHP SDK"
	echo "Usage: %0 vc arch"
	echo nul

:out_error
	exit /b 3

:out
rem	echo Shell configuration complete
	exit /b 0

goto :eof

Allow down to vc11

Allow down to vc11

It still can be coupled with sdk 8.1, so while no particularly practical
for PHP, still might be useful. We still keep on vc14 as lowest for PHP.


@echo off

NET SESSION >nul 2>&1
if %ERRORLEVEL% neq 0 (
    echo Not an admin, exiting.
    exit /B 1
)

setlocal EnableDelayedExpansion

reg import open_here.reg
reg import cmd.reg
call powershell.bat
if exist "C:\Program Files (x86)\Git" (
    reg import git_bash.reg
)
if exist "%CYGWIN_HOME%" (
    call cygwin.bat
)
if exist "C:\Program Files\Sublime Text 3" (
    reg import sublime_text.reg
)

@echo off

NET SESSION >nul 2>&1
if %ERRORLEVEL% neq 0 (
    echo Not an admin, exiting.
    exit /B 1
)

setlocal EnableDelayedExpansion

reg import open_here.reg
reg import cmd.reg
call powershell.bat
if exist "C:\Program Files\Git" (
    reg import git_bash.reg
)
if exist "%CYGWIN_HOME%" (
    call cygwin.bat
)
if exist "C:\Program Files\Sublime Text 3" (
    reg import sublime_text.reg
)

Check for correct folder

Check for correct folder


:: get_IPMI_SDR_info.bat
:: get_IPMI_SDR_info
::
:: Auther: luke.chen@aicipc.com.tw
:: Progream: get_IPMI_SDR_info every 10 sec
:: Lincese: CC0
:: History: 2021-07-20T13:34:04
:: note: init

@ECHO OFF

:: Get Date & Time
set hh=%time:~0,2%
if "%time:~0,1%"==" " set hh=0%hh:~1,1%
set day=%date:~10,4%-%date:~4,2%-%date:~7,2%
set dayHM=%day%_%hh%%time:~3,2%

:: Remove old log
:: del /Q log_*.txt

:: Set parameter
set ipaddr=192.168.11.11
set sleeptime=3
set /a count=0

:: Get user parameter
if not "%1" == "" set ipaddr=%1
if not "%2" == "" set sleeptime=%2

:: Set log file name
set logname=log_%ipaddr%_%dayHM%.txt

:: Create log
echo. > %logname%

:loop

    :: count add one
    set /a count+=1

    :: Get Date & Time
    set hh=%time:~0,2%
    if "%time:~0,1%"==" " set hh=0%hh:~1,1%
    set day=%date:~10,4%-%date:~4,2%-%date:~7,2%
    set dayHMS=%day%_%hh%:%time:~3,2%:%time:~6,2%

    :: Show and log: ipaddr & count
    echo ==== %ipaddr% (%count%) ====
    echo ==== %ipaddr% (%count%) ==== >> %logname%

    :: Show and log: date & time
    echo %dayHMS%
    echo.
    echo %dayHMS% >> %logname%
    echo. >> %logname%

    :: Get BMC SDR
    :: echo ipmitool -I lanplus -H %ipaddr% -U admin -P admin sdr
    ipmitool -I lanplus -H %ipaddr% -U admin -P admin sdr
    ipmitool -I lanplus -H %ipaddr% -U admin -P admin sdr >> %logname%

    ::
    echo.
    echo. >> %logname%

    :: Sleep %sleeptime% sec (default: 3 sec)
    ping 127.0.0.1 -w 1000 -n %sleeptime% > nul

goto loop

:: get_IPMI_SDR_info.bat
:: get_IPMI_SDR_info
::
:: Auther: luke.chen@aicipc.com.tw
:: Progream: get_IPMI_SDR_info every 3 sec
:: Lincese: CC0
:: History: 2021-07-20T13:34:04
:: note: init

@ECHO OFF

:: Get Date & Time
set hh=%time:~0,2%
if "%time:~0,1%"==" " set hh=0%hh:~1,1%
set day=%date:~10,4%-%date:~4,2%-%date:~7,2%
set dayHM=%day%_%hh%%time:~3,2%

:: Remove old log
:: del /Q log_*.txt

:: Set parameter
set ipaddr=192.168.11.11
set sleeptime=3
set /a count=0

:: Get user parameter
if not "%1" == "" set ipaddr=%1
if not "%2" == "" set sleeptime=%2

:: Set log file name
set logname=log_%ipaddr%_%dayHM%.txt

:: Create log
echo. > %logname%

:loop

    :: count add one
    set /a count+=1

    :: Get Date & Time
    set hh=%time:~0,2%
    if "%time:~0,1%"==" " set hh=0%hh:~1,1%
    set day=%date:~10,4%-%date:~4,2%-%date:~7,2%
    set dayHMS=%day%_%hh%:%time:~3,2%:%time:~6,2%

    :: Show and log: ipaddr & count
    echo ==== %ipaddr% (%count%) ====
    echo ==== %ipaddr% (%count%) ==== >> %logname%

    :: Show and log: date & time
    echo %dayHMS%
    echo.
    echo %dayHMS% >> %logname%
    echo. >> %logname%

    :: Get BMC SDR
    :: echo ipmitool -I lanplus -H %ipaddr% -U admin -P admin sdr
    ipmitool -I lanplus -H %ipaddr% -U admin -P admin sdr
    ipmitool -I lanplus -H %ipaddr% -U admin -P admin sdr >> %logname%

    ::
    echo.
    echo. >> %logname%

    :: Sleep %sleeptime% sec (default: 3 sec)
    ping 127.0.0.1 -w 1000 -n %sleeptime% > nul

goto loop

Change default sleep time 10 to 3 sec

Change default sleep time 10 to 3 sec


@echo off
::Enter in the Build directory
cd Build
::Check if the x64-Debug exist

goto :check-existance

:: check if the directories exist, and if not, create it
:check-existance
  for %%X in (x64-Debug x64-Release x64-Retail x64-Profile) do (
    if EXIST %%X (
      echo %%X  already exist.
      ) else (
        echo %%X  does not exist so has been generated.
        mkdir %%X
      )
  )
  :: go next operation
  goto :copycontext

:: copy opengl and sdl from vendor to all the target
:copycontext
  for %%X in (x64-Debug x64-Release x64-Retail x64-Profile) do (
    xcopy /y ..\Vendors\OpenGL\lib\x64\*.dll %%X
  )
  :: go next operation
  goto :copyassimp

:: copy assimp dll from vendrors to the target
:copyassimp
  for %%X in (x64-Debug x64-Release x64-Retail x64-Profile) do (
    xcopy /y ..\Vendors\assimp\x64\Release\*.dll %%X
  )
  :: go next operation
  goto :copyphysx

:: copy assimp dll from vendors to the target
:copyphysx
:: debug vendors
  xcopy /y ..\Vendors\PhysX\Binaries\x64\Debug\*.dll x64-Debug
  for %%X in (x64-Release x64-Retail x64-Profile) do (
:: relese vendors
    xcopy /y ..\Vendors\PhysX\Binaries\x64\Release\*.dll %%X
  )
  :: go next operation
  goto :revert

:revert
::come back in the current directory
  echo End of script
  cd ..
  goto :eof

copy dll script

copy dll script


java -Xmx521m -cp ./lib/cdms.jar;./lib/jgraph.jar gov.nih.nci.cbiit.cdms.formula.gui.FrameMain

use jgraph.jar

use jgraph.jar

SVN-Revision: 3120


@echo off
:: Copyright 2013 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.
setlocal

:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used
:: standalone, but allow other PATH manipulations to take priority.
set PATH=%PATH%;%~dp0

:: Defer control.
python3.bat "%~dp0\gn.py" %*

@echo off
:: Copyright 2013 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.
setlocal

:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used
:: standalone, but allow other PATH manipulations to take priority.
set PATH=%PATH%;%~dp0

:: Defer control.
python3 "%~dp0\gn.py" %*

Revert "Call python3.bat explicitly from gn.bat on Windows."

This reverts commit eb28118b7a61ec5c21906b6fceea657d66b4f004.

Reason for revert: This broke one of the v8 builders: https://ci.chromium.org/ui/p/devtools-frontend/builders/try/dtf_presubmit_win64/b8835470412847208097/overview, because it assumes that `python3.bat` is in $PATH. We need to change the CL to reference the python3.bat via ~dp0 instead, I think.

Original change's description:
> Call python3.bat explicitly from gn.bat on Windows.
>
> This ensures users running from a linux-style shell call through to
> the right Python interpreter.
>
> Bug: None
> Change-Id: I2e5f2d1a02537ee86f682607670199d37225cf15
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3168710
> Auto-Submit: Jamie Madill <jmadill@chromium.org>
> Commit-Queue: Dirk Pranke <6693ee08b084bb2ffa767f664c99b689395e0e4b@google.com>
> Reviewed-by: Dirk Pranke <6693ee08b084bb2ffa767f664c99b689395e0e4b@google.com>

Bug: None
Change-Id: I834e828c99e056887e0a84805c4c7a9e67220cfb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3173633
Auto-Submit: Dirk Pranke <6693ee08b084bb2ffa767f664c99b689395e0e4b@google.com>
Commit-Queue: Rubber Stamper <d516c4cc2192058ab8dae3d306acbdaf2ce6574f@appspot.gserviceaccount.com>
Commit-Queue: Dirk Pranke <6693ee08b084bb2ffa767f664c99b689395e0e4b@google.com>
Bot-Commit: Rubber Stamper <d516c4cc2192058ab8dae3d306acbdaf2ce6574f@appspot.gserviceaccount.com>


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

@echo off
call %~dp0..\..\..\..\..\..\..\tools\generate.cmd cognitiveservices/data-plane/CustomImageSearch %*

Create generate.cmd

Create generate.cmd

Adding generate.cmd


@echo off

set pythonPath=
call findpython.bat

if ()==(%pythonPath%) goto NoPython

"%pythonPath%" "%~dp0titanium.py" %*
goto Exit

:NoPython
exit /b 1

:Exit

Fix CRLF issue

Fix CRLF issue


rem @echo off

setlocal

if exist run.bat goto exec
 echo run.bat must be run from its folder

:exec
tasklist /nh|find /i "dreamgo.exe"

if ERRORLEVEL 1 goto reload else(
    goto stop
    goto reload
    )

:reload
call install.bat
if exist bin\dreamgo.exe go run else echo install fail...

:run
echo running success...
bin\dreamgo.exe

:stop
 taskkill /im "dreamgo.exe"

update run.bat file

update run.bat file


REM - Place this file in the root of your CIVE4500/5602 folders
REM - Double-click to run the jupyter notebook

C:\Anaconda\python.exe -m jupyter notebook

add windows startup cmd file

add windows startup cmd file


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

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

SET BASEFOLDER=C:\tmp

REM Make folder if not existing:  https://stackoverflow.com/questions/4165387/create-folder-with-batch-but-only-if-it-doesnt-already-exist
if not exist "%BASEFOLDER%" mkdir %BASEFOLDER%

REM Open folder:
start "" %BASEFOLDER%

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

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

REM Download SQLServer Developer Edition:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/5/A/7/5A7065A2-C81C-4A31-9972-8A31AC9388C1/SQLServer2017-SSEI-Dev.exe', '%BASEFOLDER%\SQLServer-SSEI-Dev.exe') }" -ExecutionPolicy Bypass
REM Install SQLServer Developer Edition:
REM https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017
REM Download Commnad:
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /MEDIAPATH="%BASEFOLDER%" /ACTION=Download /LANGUAGE=en-US /MEDIATYPE=CAB /QUIET

REM Install Command: (interactive)
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /ACTION=Install /MEDIAPATH=C:\tmp /IACCEPTSQLSERVERLICENSETERMS /LANGUAGE=en-US

REM https://download.microsoft.com/download/0/5/B/05B2AF8F-906F-4C57-A58E-5780F64F9D62/SSMS-Setup-ENU.exe
REM Install SQL Server Management Studio:
%BASEFOLDER%\SSMS-Setup-ENU.exe /install /quiet /norestart

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

REM press any key to continue....
pause

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

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

SET BASEFOLDER=C:\tmp

REM Make folder if not existing:  https://stackoverflow.com/questions/4165387/create-folder-with-batch-but-only-if-it-doesnt-already-exist
if not exist "%BASEFOLDER%" mkdir %BASEFOLDER%

REM Open folder:
start "" %BASEFOLDER%

REM https://github.com/jgstew/bigfix-content/blob/master/fixlet/Install%20SQL%20Server%20Management%20Studio%2016.5.1%20-%20Windows.bes
REM Download SQL Server Management Studio:
start "" powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/f/e/b/feb0e6be-21ce-4f98-abee-d74065e32d0a/SSMS-Setup-ENU.exe', '%BASEFOLDER%\SSMS-Setup-ENU.exe') }" -ExecutionPolicy Bypass

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

REM Download SQLServer Developer Edition:
powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/5/A/7/5A7065A2-C81C-4A31-9972-8A31AC9388C1/SQLServer2017-SSEI-Dev.exe', '%BASEFOLDER%\SQLServer-SSEI-Dev.exe') }" -ExecutionPolicy Bypass
REM Install SQLServer Developer Edition:
REM https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017
REM Download Commnad:
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /MEDIAPATH="%BASEFOLDER%" /ACTION=Download /LANGUAGE=en-US /MEDIATYPE=CAB /QUIET

REM Install Command: (interactive)
%BASEFOLDER%\SQLServer-SSEI-Dev.exe /ACTION=Install /MEDIAPATH=C:\tmp /IACCEPTSQLSERVERLICENSETERMS /LANGUAGE=en-US

REM https://download.microsoft.com/download/0/5/B/05B2AF8F-906F-4C57-A58E-5780F64F9D62/SSMS-Setup-ENU.exe
REM Install SQL Server Management Studio:
%BASEFOLDER%\SSMS-Setup-ENU.exe /install /quiet /norestart

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

REM press any key to continue....
pause

Update bigfix_setup_root_eval.bat

Update bigfix_setup_root_eval.bat

update download to sql server management studio 18.5


:: This batch file expects a valid CMake generator string passed as the first parameter, or no parameters at all.
:: If no CMake generator is provided, the default generator (VS 2010 x86 currently) is used. All of the parameters
:: provided, if any, are passed to the CMake invocation.

@echo off
echo.

:: Enable the delayed environment variable expansion needed in VSConfig.cmd.
setlocal EnableDelayedExpansion

call VSConfig.cmd %1

cd ..\..

:: Print user-defined variables
cecho {0A}Script configuration:{# #}{\n}
echo CMake Generator = %GENERATOR%
echo All arguments   = %*

echo.

SET TUNDRA_DEP_PATH=%DEPS%
SET URHO3D_HOME=%DEPS%\urho3d
SET BUILD_PATH=build-%VS_VER%-%TARGET_ARCH%

IF NOT EXIST %BUILD_PATH% mkdir %BUILD_PATH%
cd %BUILD_PATH%

IF NOT EXIST tundra-urho3d.sln. (
    IF EXIST CMakeCache.txt. del /Q CMakeCache.txt
    cecho {0D}Running CMake for Tundra.{# #}{\n}
    IF "%2"=="" (
        REM No extra arguments provided, trust that GENERATOR is set properly.
        cmake.exe .. -G %GENERATOR%
    ) ELSE (
        REM Extra arguments has been provided. As CMake options are typically of format -DINSTALL_BINARIES_ONLY:BOOL=ON,
        REM i.e. they contain an equal sign, they will mess up the batch file argument parsing if the arguments are passed on
        REM by splitting them %2 %3 %4 %5 %6 %7 %8 %9. In the extra argument case trust that user has provided the generator
        REM as the first argument as pass all arguments as is by using %*.
        cmake.exe .. -G %*
    )
    IF NOT %ERRORLEVEL%==0 GOTO :ERROR
) ELSE (
    cecho {0A}tundra-urho3d.sln exists. Skipping CMake call for Tundra.{# #}{\n}
    cecho {0A}Delete %CD%\tundra-urho3d.sln to trigger a CMake rerun.{# #}{\n}
)
echo.

:: Finish in same directory we started in.
cd ..\tools\Windows
set PATH=%ORIGINAL_PATH%
GOTO :EOF

:ERROR
echo.
cecho {0C}An error occurred! Aborting!{# #}{\n}
:: Finish in same directory we started in.
cd ..\tools\Windows
set PATH=%ORIGINAL_PATH%

endlocal

:: This batch file expects a valid CMake generator string passed as the first parameter, or no parameters at all.
:: If no CMake generator is provided, the default generator (VS 2010 x86 currently) is used. All of the parameters
:: provided, if any, are passed to the CMake invocation.

@echo off
echo.

:: Enable the delayed environment variable expansion needed in VSConfig.cmd.
setlocal EnableDelayedExpansion

call VSConfig.cmd %1

cd ..\..

:: Print user-defined variables
cecho {0A}Script configuration:{# #}{\n}
echo CMake Generator = %GENERATOR%
echo All arguments   = %*

echo.

SET BUILD_PATH=build-%VS_VER%-%TARGET_ARCH%

IF NOT EXIST %BUILD_PATH% mkdir %BUILD_PATH%
cd %BUILD_PATH%

IF NOT EXIST tundra-urho3d.sln. (
    IF EXIST CMakeCache.txt. del /Q CMakeCache.txt
    cecho {0D}Running CMake for Tundra.{# #}{\n}
    IF "%2"=="" (
        REM No extra arguments provided, trust that GENERATOR is set properly.
        cmake.exe .. -G %GENERATOR% -DURHO3D_HOME=%DEPS%\urho3d -DMATHGEOLIB_HOME=%DEPS%\MathGeoLib\build
    ) ELSE (
        REM Extra arguments has been provided. As CMake options are typically of format -DINSTALL_BINARIES_ONLY:BOOL=ON,
        REM i.e. they contain an equal sign, they will mess up the batch file argument parsing if the arguments are passed on
        REM by splitting them %2 %3 %4 %5 %6 %7 %8 %9. In the extra argument case trust that user has provided the generator
        REM as the first argument as pass all arguments as is by using %*.
        cmake.exe .. -G %*
    )
    IF NOT %ERRORLEVEL%==0 GOTO :ERROR
) ELSE (
    cecho {0A}tundra-urho3d.sln exists. Skipping CMake call for Tundra.{# #}{\n}
    cecho {0A}Delete %CD%\tundra-urho3d.sln to trigger a CMake rerun.{# #}{\n}
)
echo.

:: Finish in same directory we started in.
cd ..\tools\Windows
set PATH=%ORIGINAL_PATH%
GOTO :EOF

:ERROR
echo.
cecho {0C}An error occurred! Aborting!{# #}{\n}
:: Finish in same directory we started in.
cd ..\tools\Windows
set PATH=%ORIGINAL_PATH%

endlocal

Update windows cmake script. TUNDRA_DEP_PATH is gone and its preferred to pass URHO/MGL_HOME via cmake params not env variables. Makes things a lot cleaner and more compatible with other OS build scripts.


@ECHO OFF
SETLOCAL
TITLE Building Notepad2...
SET NOTEPAD_VERSION=4.1.24
SET PERL_PATH=G:\Installation Programs\Programs\Compiling Stuff\Other\ActivePerl-5.12.2.1202-MSWin32-x86-293621

SET TOOLS_PATH=..\..\distrib\tools

CALL build.cmd
CALL build_x64.cmd

rem Get the revision
FOR /f "tokens=3,4 delims= " %%K IN (
  'FINDSTR /I /L /C:"define VERSION_REV" "..\src\Version_rev.h"') DO (
  SET "buildnum=%%K"&Call :SubRevNumber %%buildnum:*Z=%%)

CALL :SubZipFiles Release x86-32
CALL :SubZipFiles Release_x64 x86-64

CALL :SubInstaller

rem Calulate md5/sha1 hashes
PUSHD packages
"%TOOLS_PATH%\md5sum.exe" *.7z *.zip *.exe >md5hashes
"%TOOLS_PATH%\sha1sum.exe" *.7z *.zip *.exe >sha1hashes

rem Compress everything into a single ZIP file
DEL Notepad2-mod.zip >NUL 2>&1
START "" /B /WAIT "%TOOLS_PATH%\7za.exe" a -tzip -mx=9 Notepad2-mod.zip * -x!md5hashes -x!sha1hashes >NUL
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
ECHO:Notepad2-mod.zip created successfully!

POPD
GOTO :END

:END
TITLE Finished!
ECHO. && ECHO.
ENDLOCAL && PAUSE
EXIT

:SubZipFiles
TITLE Creating the ZIP files...
ECHO.

MD "temp_zip" >NUL 2>&1
MD "packages" >NUL 2>&1
COPY "..\License.txt" "temp_zip\" /Y /V
COPY "..\%1\Notepad2.exe" "temp_zip\" /Y /V
COPY "..\distrib\res\cabinet\notepad2.ini" "temp_zip\Notepad2.ini" /Y /V
COPY "..\Notepad2.txt" "temp_zip\" /Y /V
COPY "..\ReadMe-mod.txt" "temp_zip\Readme.txt" /Y /V

PUSHD "temp_zip"
START "" /B /WAIT "%TOOLS_PATH%\7za.exe" a -tzip -mx=9^
 "Notepad2-mod.%NOTEPAD_VERSION%_r%buildnum%_%2.zip" "License.txt" "Notepad2.exe"^
 "Notepad2.ini" "Notepad2.txt" "ReadMe.txt" >NUL
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected

ECHO:Notepad2-mod.%NOTEPAD_VERSION%_r%buildnum%_%2.zip created successfully!
MOVE /Y "Notepad2-mod.%NOTEPAD_VERSION%_r%buildnum%_%2.zip" "..\packages" >NUL 2>&1
ECHO.
POPD
RD /S /Q "temp_zip" >NUL 2>&1
GOTO :EOF

:SubInstaller
IF NOT DEFINED VS100COMNTOOLS (
  ECHO:Visual Studio 2010 NOT FOUND!!! && PAUSE
  ECHO.
  GOTO :ErrorDetected
)

TITLE Building installer...
ECHO:Building installer...

PUSHD ..\distrib
MD binaries\x86-32 >NUL 2>&1
MD binaries\x86-64 >NUL 2>&1

COPY /B /V /Y ..\Release\Notepad2.exe binaries\x86-32\notepad2.exe
COPY /B /V /Y ..\License.txt binaries\x86-32\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf binaries\x86-32\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini binaries\x86-32\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini binaries\x86-32\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt binaries\x86-32\notepad2.txt
COPY /B /V /Y ..\Readme-mod.txt binaries\x86-32\readme.txt
rem Set the revision for the DisplayVersion
CALL tools\BatchSubstitute.bat "0.0.0.0" %NOTEPAD_VERSION%.%buildnum% binaries\x86-32\notepad2.inf >notepad2.inf.temp
COPY /Y binaries\x86-32\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.temp binaries\x86-32\notepad2.inf >NUL
tools\cabutcd.exe binaries\x86-32 res\cabinet.x86-32.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S binaries\x86-32 >NUL 2>&1

COPY /B /V /Y ..\Release_x64\Notepad2.exe binaries\x86-64\notepad2.exe
COPY /B /V /Y ..\License.txt binaries\x86-64\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf binaries\x86-64\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini binaries\x86-64\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini binaries\x86-64\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt binaries\x86-64\notepad2.txt
COPY /B /V /Y ..\Readme-mod.txt binaries\x86-64\readme.txt
rem Set the revision for the DisplayVersion
CALL tools\BatchSubstitute.bat "0.0.0.0" %NOTEPAD_VERSION%.%buildnum% binaries\x86-64\notepad2.inf >notepad2.inf.temp
COPY /Y binaries\x86-64\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.temp binaries\x86-64\notepad2.inf >NUL
tools\cabutcd.exe binaries\x86-64 res\cabinet.x86-64.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S binaries\x86-64 >NUL 2>&1
RD /q binaries >NUL 2>&1

CALL "%VS100COMNTOOLS%vsvars32.bat" >NUL
devenv setup.sln /Rebuild "Full|Win32"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
devenv setup.sln /Rebuild "Full|x64"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
devenv setup.sln /Rebuild "Lite|Win32"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
devenv setup.sln /Rebuild "Lite|x64"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected

"%PERL_PATH%\perl\bin\perl.exe" addon_build.pl

MD ..\wdkbuild\packages >NUL 2>&1
MOVE setup.x86-32\addon.7z      ..\wdkbuild\packages\Notepad2-mod_Addon.x86-32.7z >NUL
MOVE setup.x86-32\setupfull.exe ..\wdkbuild\packages\Notepad2-mod_Setup.x86-32.exe >NUL
MOVE setup.x86-32\setuplite.exe ..\wdkbuild\packages\Notepad2-mod_Setup_Silent.x86-32.exe >NUL
MOVE setup.x86-64\addon.7z      ..\wdkbuild\packages\Notepad2-mod_Addon.x86-64.7z >NUL
MOVE setup.x86-64\setupfull.exe ..\wdkbuild\packages\Notepad2-mod_Setup.x86-64.exe >NUL
MOVE setup.x86-64\setuplite.exe ..\wdkbuild\packages\Notepad2-mod_Setup_Silent.x86-64.exe >NUL

RD setup.x86-32 setup.x86-64 >NUL 2>&1
RD setup.x86-32 setup.x86-64 >NUL 2>&1
RD /Q /S addon >NUL 2>&1
RD /Q /S obj >NUL 2>&1

POPD
GOTO :EOF

:SubRevNumber
SET buildnum=%*
GOTO :EOF

:ErrorDetected
ECHO. && ECHO.
ECHO:Compilation FAILED!!!
ECHO. && ECHO.
ENDLOCAL
PAUSE
EXIT

@ECHO OFF
SETLOCAL
TITLE Building Notepad2...
SET PERL_PATH=G:\Installation Programs\Programs\Compiling Stuff\Other\ActivePerl-5.12.2.1202-MSWin32-x86-293621

SET TOOLS_PATH=..\..\distrib\tools

CALL build.cmd
CALL build_x64.cmd

rem Get the version
FOR /f "tokens=3,4 delims= " %%K IN (
  'FINDSTR /I /L /C:"define VERSION_MAJOR" "..\src\Version.h"') DO (
  SET "VerMajor=%%K"&Call :SubVerMajor %%VerMajor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%L IN (
  'FINDSTR /I /L /C:"define VERSION_MINOR" "..\src\Version.h"') DO (
  SET "VerMinor=%%L"&Call :SubVerMinor %%VerMinor:*Z=%%)
FOR /f "tokens=3,4 delims= " %%M IN (
  'FINDSTR /I /L /C:"define VERSION_BUILD" "..\src\Version.h"') DO (
  SET "VerBuild=%%M"&Call :SubVerBuild %%VerBuild:*Z=%%)
FOR /f "tokens=3,4 delims= " %%N IN (
  'FINDSTR /I /L /C:"define VERSION_REV" "..\src\Version_rev.h"') DO (
  SET "VerRev=%%N"&Call :SubVerRev %%VerRev:*Z=%%)

SET NOTEPAD_VERSION=%VerMajor%.%VerMinor%.%VerBuild%

CALL :SubZipFiles Release x86-32
CALL :SubZipFiles Release_x64 x86-64

CALL :SubInstaller

rem Calulate md5/sha1 hashes
PUSHD packages
"%TOOLS_PATH%\md5sum.exe" *.7z *.zip *.exe >md5hashes
"%TOOLS_PATH%\sha1sum.exe" *.7z *.zip *.exe >sha1hashes

rem Compress everything into a single ZIP file
DEL Notepad2-mod.zip >NUL 2>&1
START "" /B /WAIT "%TOOLS_PATH%\7za.exe" a -tzip -mx=9 Notepad2-mod.zip * -x!md5hashes -x!sha1hashes >NUL
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
ECHO:Notepad2-mod.zip created successfully!

POPD
GOTO :END

:END
TITLE Finished!
ECHO. && ECHO.
ENDLOCAL && PAUSE
EXIT

:SubZipFiles
TITLE Creating the ZIP files...
ECHO.

MD "temp_zip" >NUL 2>&1
MD "packages" >NUL 2>&1
COPY "..\License.txt" "temp_zip\" /Y /V
COPY "..\%1\Notepad2.exe" "temp_zip\" /Y /V
COPY "..\distrib\res\cabinet\notepad2.ini" "temp_zip\Notepad2.ini" /Y /V
COPY "..\Notepad2.txt" "temp_zip\" /Y /V
COPY "..\ReadMe-mod.txt" "temp_zip\Readme.txt" /Y /V

PUSHD "temp_zip"
START "" /B /WAIT "%TOOLS_PATH%\7za.exe" a -tzip -mx=9^
 "Notepad2-mod.%NOTEPAD_VERSION%_r%VerRev%_%2.zip" "License.txt" "Notepad2.exe"^
 "Notepad2.ini" "Notepad2.txt" "ReadMe.txt" >NUL
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected

ECHO:Notepad2-mod.%NOTEPAD_VERSION%_r%VerRev%_%2.zip created successfully!
MOVE /Y "Notepad2-mod.%NOTEPAD_VERSION%_r%VerRev%_%2.zip" "..\packages" >NUL 2>&1
ECHO.
POPD
RD /S /Q "temp_zip" >NUL 2>&1
GOTO :EOF

:SubInstaller
IF NOT DEFINED VS100COMNTOOLS (
  ECHO:Visual Studio 2010 NOT FOUND!!! && PAUSE
  ECHO.
  GOTO :ErrorDetected
)

TITLE Building installer...
ECHO:Building installer...

PUSHD ..\distrib
MD binaries\x86-32 >NUL 2>&1
MD binaries\x86-64 >NUL 2>&1

COPY /B /V /Y ..\Release\Notepad2.exe binaries\x86-32\notepad2.exe
COPY /B /V /Y ..\License.txt binaries\x86-32\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf binaries\x86-32\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini binaries\x86-32\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini binaries\x86-32\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt binaries\x86-32\notepad2.txt
COPY /B /V /Y ..\Readme-mod.txt binaries\x86-32\readme.txt
rem Set the version for the DisplayVersion registry value
CALL tools\BatchSubstitute.bat "0.0.0.0" %NOTEPAD_VERSION%.%VerRev% binaries\x86-32\notepad2.inf >notepad2.inf.temp
COPY /Y binaries\x86-32\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.temp binaries\x86-32\notepad2.inf >NUL
tools\cabutcd.exe binaries\x86-32 res\cabinet.x86-32.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S binaries\x86-32 >NUL 2>&1

COPY /B /V /Y ..\Release_x64\Notepad2.exe binaries\x86-64\notepad2.exe
COPY /B /V /Y ..\License.txt binaries\x86-64\license.txt
COPY /B /V /Y res\cabinet\notepad2.inf binaries\x86-64\notepad2.inf
COPY /B /V /Y res\cabinet\notepad2.ini binaries\x86-64\notepad2.ini
COPY /B /V /Y res\cabinet\notepad2.redir.ini binaries\x86-64\notepad2.redir.ini
COPY /B /V /Y ..\Notepad2.txt binaries\x86-64\notepad2.txt
COPY /B /V /Y ..\Readme-mod.txt binaries\x86-64\readme.txt
rem Set the version for the DisplayVersion registry value
CALL tools\BatchSubstitute.bat "0.0.0.0" %NOTEPAD_VERSION%.%VerRev% binaries\x86-64\notepad2.inf >notepad2.inf.temp
COPY /Y binaries\x86-64\notepad2.inf notepad2.inf.orig >NUL
MOVE /Y notepad2.inf.temp binaries\x86-64\notepad2.inf >NUL
tools\cabutcd.exe binaries\x86-64 res\cabinet.x86-64.cab
DEL notepad2.inf.orig >NUL 2>&1
RD /Q /S binaries\x86-64 >NUL 2>&1
RD /q binaries >NUL 2>&1

CALL "%VS100COMNTOOLS%vsvars32.bat" >NUL
devenv setup.sln /Rebuild "Full|Win32"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
devenv setup.sln /Rebuild "Full|x64"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
devenv setup.sln /Rebuild "Lite|Win32"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected
devenv setup.sln /Rebuild "Lite|x64"
IF %ERRORLEVEL% NEQ 0 GOTO :ErrorDetected

"%PERL_PATH%\perl\bin\perl.exe" addon_build.pl

MD ..\wdkbuild\packages >NUL 2>&1
MOVE setup.x86-32\addon.7z      ..\wdkbuild\packages\Notepad2-mod_Addon.x86-32.7z >NUL
MOVE setup.x86-32\setupfull.exe ..\wdkbuild\packages\Notepad2-mod_Setup.x86-32.exe >NUL
MOVE setup.x86-32\setuplite.exe ..\wdkbuild\packages\Notepad2-mod_Setup_Silent.x86-32.exe >NUL
MOVE setup.x86-64\addon.7z      ..\wdkbuild\packages\Notepad2-mod_Addon.x86-64.7z >NUL
MOVE setup.x86-64\setupfull.exe ..\wdkbuild\packages\Notepad2-mod_Setup.x86-64.exe >NUL
MOVE setup.x86-64\setuplite.exe ..\wdkbuild\packages\Notepad2-mod_Setup_Silent.x86-64.exe >NUL

RD setup.x86-32 setup.x86-64 >NUL 2>&1
RD setup.x86-32 setup.x86-64 >NUL 2>&1
RD /Q /S addon >NUL 2>&1
RD /Q /S obj >NUL 2>&1

POPD
GOTO :EOF

:SubVerMajor
SET VerMajor=%*
GOTO :EOF
:SubVerMinor
SET VerMinor=%*
GOTO :EOF
:SubVerBuild
SET VerBuild=%*
GOTO :EOF
:SubVerRev
SET VerRev=%*
GOTO :EOF

:ErrorDetected
ECHO. && ECHO.
ECHO:Compilation FAILED!!!
ECHO. && ECHO.
ENDLOCAL
PAUSE
EXIT

update make_packages.bat to get Notepad2's version automatically

git-svn-id: 756506b3b0ea8c31733a8f0a5bb416c7e269da3d@108 28bd50df-7adb-d945-0439-6e466c6a13cc


set PYTHONPATH=../lib
cd /d %~dp0
python anki
rem pause

tweak .bat

tweak .bat


rem dennyhalim.com
rem this will be copied after first reboot and then run after next reboot

rem replace defaultlayouts before it gets created
move "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml" "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.dennyhalim"
copy /y "%WINDIR%\Setup\Files\DefaultLayouts.xml" "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml"
move "%SystemRoot%\SysWOW64\OneDriveSetup.exe" "%SystemRoot%\SysWOW64\OneDriveSetup.dennyhalim"
move "%SystemRoot%\System32\OneDriveSetup.exe" "%SystemRoot%\System32\OneDriveSetup.dennyhalim"
rem move "%windir%\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy" "%windir%\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy.dennyhalim"
rem startmenu disabled if shellex disabled
rem move "%windir%\SystemApps\ShellExperienceHost_cw5n1h2txyewy" "%windir%\SystemApps\ShellExperienceHost_cw5n1h2txyewy.dennyhalim"

wmic.exe USERACCOUNT WHERE "Name='admin'" set PasswordExpires=FALSE
wmic.exe USERACCOUNT WHERE "Name='user'" set PasswordExpires=FALSE

reg.exe load HKLM\DEFAULT "%Public%\..\default\ntuser.dat"
reg.exe add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People /v PeopleBand /t REG_DWORD /d 0 /f
reg.exe add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f
reg.exe add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_TrackProgs /t REG_DWORD /d 1 /f
reg.exe add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v Enabled /t REG_DWORD /d 0 /f
reg.exe add "HKLM\DEFAULT\Software\Microsoft\Input\TIPC" /v Enabled /t REG_DWORD /d 0 /f
reg.exe add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v GlobalUserDisabled /t REG_DWORD /d 1 /f
reg.exe add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{A8804298-2D5F-42E3-9531-9C8C39EB29CE}" /v Value /d Deny /f
reg.exe delete "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /F
reg.exe unload HKLM\DEFAULT

reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v LetAppsRunInBackground /t REG_DWORD /d 0 /f
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v AllowTelemetry /t REG_DWORD /d 0 /f
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferUpgrade /t REG_DWORD /d 1 /f
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v BranchReadinessLevel /t REG_DWORD /d 32 /f
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdates /t REG_DWORD /d 1 /f
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdatesPeriodinDays /t REG_DWORD /d 365 /f
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowCortana /t REG_DWORD /d 0 /f
reg.exe add "HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" /v WiFiSenseCredShared /t REG_DWORD /d 0 /f
reg.exe add "HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" /v WiFiSenseOpen /t REG_DWORD /d 0 /f
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers" /v 1 /t REG_SZ /d pool.ntp.org /f

cscript.exe "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "Canon LBP2900" -i "%WINDIR%\Setup\Drivers\CanonLBP2900\CNAB4STD.inf"
cscript.exe "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "Canon G2000 series Printer" -i "%WINDIR%\Setup\Drivers\CanonG2000\Driver\G2000P6.inf"
rem move "%WINDIR%\Setup\Drivers\*" "%WINDIR%\INF"

schtasks.exe /change /TN "\Microsoft\Windows\Setup\SetupCleanupTask" /DISABLE
schtasks.exe /change /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /DISABLE
schtasks.exe /change /TN "\Microsoft\Windows\Application Experience\ProgramDataUpdater" /DISABLE
schtasks.exe /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /DISABLE
schtasks.exe /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /DISABLE
schtasks.exe /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /DISABLE

"%WINDIR%\Setup\Files\chocolatey.exe" /S
"%WINDIR%\Setup\Files\Firefox Setup 52.6.0esr.exe" -ms
"%WINDIR%\Setup\Files\vlc-3.0.1-win64.exe" /L=1033 /S
"%WINDIR%\Setup\Files\SumatraPDF-3.1.2-64-install.exe" /S
msiexec.exe /q /I "%WINDIR%\Setup\Files\just-install.msi"
msiexec.exe /q /I "%WINDIR%\Setup\Files\NpackdCL-1.23.2.msi"
msiexec.exe /q /I "%WINDIR%\Setup\Files\7z1805-x64.msi"
msiexec.exe /q /I "%WINDIR%\Setup\Files\qalculate-2.4.0a.msi"
msiexec.exe /q /I "%WINDIR%\Setup\Files\GoogleChromeStandaloneEnterprise64.msi"
msiexec.exe /q /I "%WINDIR%\Setup\Files\LibreOffice_5.4.6_Win_x64.msi"
rem "%WINDIR%\Setup\Files\avira_pc_cleaner_en.exe" /s
"%WINDIR%\Setup\Files\mb3-setup-consumer-3.4.5.2467-1.0.342-1.0.4664.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
"%WINDIR%\Setup\Files\avast_business_antivirus_managed_setup_offline_silent.exe"

powershell.exe -ExecutionPolicy Bypass -File "%WINDIR%\Setup\Progs\OpenSSH\install-sshd.ps1"
PowerShell.exe -ExecutionPolicy Bypass -File "%WINDIR%\Setup\Files\setup.ps1"

sc.exe config wuauserv start= demand
sc.exe config DiagTrack start= disabled
sc.exe config dmwappushservice start= disabled
sc.exe config RetailDemo start= disabled
sc.exe config lfsvc start= disabled
sc.exe config ssh-agent start= auto
sc.exe config sshd start= auto

netsh advfirewall firewall add rule dir=in action=allow profile=any protocol=TCP localport=2222 name="sshd"

mkdir "%Public%\Desktop.dennyhalim"
move "%Public%\Desktop\*.*" "%Public%\Desktop.dennyhalim"

rem use powershell for w10 only features
dism.exe /online /norestart /Enable-Feature /FeatureName:TelnetClient
dism.exe /online /norestart /Disable-Feature /FeatureName:MediaPlayback
dism.exe /online /norestart /Disable-Feature /FeatureName:WindowsMediaPlayer
dism.exe /online /norestart /Disable-Feature /FeatureName:WindowsGadgetPlatform
dism.exe /online /norestart /Disable-Feature /FeatureName:Indexing-Service-Package
dism.exe /online /norestart /Disable-Feature /FeatureName:Internet-Explorer-Optional-x86
dism.exe /online /norestart /Disable-Feature /FeatureName:Internet-Explorer-Optional-amd64

rem "%WINDIR%\Setup-githubbox.exe"

rem dennyhalim.com
rem this will be copied after first reboot and then run after next reboot

rem replace defaultlayouts before it gets created
move "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml" "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.dennyhalim"
copy /y "%WINDIR%\Setup\Files\DefaultLayouts.xml" "%Public%\..\Default\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml"
move "%SystemRoot%\SysWOW64\OneDriveSetup.exe" "%SystemRoot%\SysWOW64\OneDriveSetup.dennyhalim"
move "%SystemRoot%\System32\OneDriveSetup.exe" "%SystemRoot%\System32\OneDriveSetup.dennyhalim"
rem move "%windir%\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy" "%windir%\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy.dennyhalim"
rem startmenu disabled if shellex disabled
rem move "%windir%\SystemApps\ShellExperienceHost_cw5n1h2txyewy" "%windir%\SystemApps\ShellExperienceHost_cw5n1h2txyewy.dennyhalim"

wmic.exe USERACCOUNT WHERE "Name='admin'" set PasswordExpires=FALSE
wmic.exe USERACCOUNT WHERE "Name='user'" set PasswordExpires=FALSE

reg.exe load HKLM\DEFAULT "%Public%\..\default\ntuser.dat"
reg.exe add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People /v PeopleBand /t REG_DWORD /d 0 /f
reg.exe add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f
reg.exe add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_TrackProgs /t REG_DWORD /d 1 /f
reg.exe add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v Enabled /t REG_DWORD /d 0 /f
reg.exe add "HKLM\DEFAULT\Software\Microsoft\Input\TIPC" /v Enabled /t REG_DWORD /d 0 /f
reg.exe add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v GlobalUserDisabled /t REG_DWORD /d 1 /f
reg.exe add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{A8804298-2D5F-42E3-9531-9C8C39EB29CE}" /v Value /d Deny /f
reg.exe delete "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /F
reg.exe unload HKLM\DEFAULT

reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v LetAppsRunInBackground /t REG_DWORD /d 0 /f
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v AllowTelemetry /t REG_DWORD /d 0 /f
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferUpgrade /t REG_DWORD /d 1 /f
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v BranchReadinessLevel /t REG_DWORD /d 32 /f
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdates /t REG_DWORD /d 1 /f
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdatesPeriodinDays /t REG_DWORD /d 365 /f
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowCortana /t REG_DWORD /d 0 /f
reg.exe add "HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" /v WiFiSenseCredShared /t REG_DWORD /d 0 /f
reg.exe add "HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features" /v WiFiSenseOpen /t REG_DWORD /d 0 /f
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers" /v 1 /t REG_SZ /d pool.ntp.org /f

cscript.exe "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "Canon LBP2900" -i "%WINDIR%\Setup\Drivers\CanonLBP2900\CNAB4STD.inf"
cscript.exe "%WINDIR%\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "Canon G2000 series Printer" -i "%WINDIR%\Setup\Drivers\CanonG2000\Driver\G2000P6.inf"
rem move "%WINDIR%\Setup\Drivers\*" "%WINDIR%\INF"

schtasks.exe /change /TN "\Microsoft\Windows\Setup\SetupCleanupTask" /DISABLE
schtasks.exe /change /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /DISABLE
schtasks.exe /change /TN "\Microsoft\Windows\Application Experience\ProgramDataUpdater" /DISABLE
schtasks.exe /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /DISABLE
schtasks.exe /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /DISABLE
schtasks.exe /change /TN "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /DISABLE

"%WINDIR%\Setup\Files\chocolatey.exe" /S
"%WINDIR%\Setup\Files\Firefox Setup 52.6.0esr.exe" -ms
"%WINDIR%\Setup\Files\vlc-3.0.1-win64.exe" /L=1033 /S
"%WINDIR%\Setup\Files\SumatraPDF-3.1.2-64-install.exe" /S
msiexec.exe /qb /I "%WINDIR%\Setup\Files\just-install.msi"
msiexec.exe /qb /I "%WINDIR%\Setup\Files\NpackdCL-1.23.2.msi"
msiexec.exe /qb /I "%WINDIR%\Setup\Files\7z1805-x64.msi"
msiexec.exe /qb /I "%WINDIR%\Setup\Files\qalculate-2.4.0a.msi"
msiexec.exe /qb /I "%WINDIR%\Setup\Files\GoogleChromeStandaloneEnterprise64.msi"
msiexec.exe /qb /I "%WINDIR%\Setup\Files\LibreOffice_5.4.6_Win_x64.msi"
rem "%WINDIR%\Setup\Files\avira_pc_cleaner_en.exe" /s
"%WINDIR%\Setup\Files\mb3-setup-consumer-3.4.5.2467-1.0.342-1.0.4664.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
"%WINDIR%\Setup\Files\avast_business_antivirus_managed_setup_offline_silent.exe"

powershell.exe -ExecutionPolicy Bypass -File "%WINDIR%\Setup\Progs\OpenSSH\install-sshd.ps1"
PowerShell.exe -ExecutionPolicy Bypass -File "%WINDIR%\Setup\Files\setup.ps1"

sc.exe config wuauserv start= demand
sc.exe config DiagTrack start= disabled
sc.exe config dmwappushservice start= disabled
sc.exe config RetailDemo start= disabled
sc.exe config lfsvc start= disabled
sc.exe config ssh-agent start= auto
sc.exe config sshd start= auto

netsh advfirewall firewall add rule dir=in action=allow profile=any protocol=TCP localport=2222 name="sshd"

mkdir "%Public%\Desktop.dennyhalim"
move "%Public%\Desktop\*.*" "%Public%\Desktop.dennyhalim"

rem use powershell for w10 only features
dism.exe /online /norestart /Enable-Feature /FeatureName:TelnetClient
dism.exe /online /norestart /Disable-Feature /FeatureName:MediaPlayback
dism.exe /online /norestart /Disable-Feature /FeatureName:WindowsMediaPlayer
dism.exe /online /norestart /Disable-Feature /FeatureName:WindowsGadgetPlatform
dism.exe /online /norestart /Disable-Feature /FeatureName:Indexing-Service-Package
dism.exe /online /norestart /Disable-Feature /FeatureName:Internet-Explorer-Optional-x86
dism.exe /online /norestart /Disable-Feature /FeatureName:Internet-Explorer-Optional-amd64

rem "%WINDIR%\Setup-githubbox.exe"

Update SetupComplete.cmd

Update SetupComplete.cmd


@echo off
net session >nul 2>&1
if %errorLevel% == 0 (
    echo ok
) else (
    echo This program must be run from an administrator cmd prompt
    exit
)

@echo on

pyinstaller --onefile driver.spec

taskkill /f /im {{cookiecutter.model_name}}.exe

timeout 3

set driverdir="c:\Program Files (x86)\QualiSystems\CloudShell\Server\Drivers"
IF EXIST %driverdir% GOTO :havecs
set driverdir="c:\Program Files (x86)\QualiSystems\TestShell\Server\Drivers"
:havecs

copy dist\{{cookiecutter.model_name}}.exe                     %driverdir%
copy {{cookiecutter.project_slug}}_runtime_configuration.json %driverdir%

copy {{cookiecutter.project_slug}}_datamodel.xml               release\
copy dist\{{cookiecutter.model_name}}.exe                      release\
copy {{cookiecutter.project_slug}}_runtime_configuration.json  release\

@echo off
net session >nul 2>&1
if %errorLevel% == 0 (
    echo ok
) else (
    echo This program must be run from an administrator cmd prompt
    goto :fail
)

@echo on

pyinstaller --onefile driver.spec

taskkill /f /im {{cookiecutter.model_name}}.exe

timeout 3

set driverdir="c:\Program Files (x86)\QualiSystems\CloudShell\Server\Drivers"
IF EXIST %driverdir% GOTO :havecs
set driverdir="c:\Program Files (x86)\QualiSystems\TestShell\Server\Drivers"
:havecs

copy dist\{{cookiecutter.model_name}}.exe                     %driverdir%
copy {{cookiecutter.project_slug}}_runtime_configuration.json %driverdir%

copy {{cookiecutter.project_slug}}_datamodel.xml               release\
copy dist\{{cookiecutter.model_name}}.exe                      release\
copy {{cookiecutter.project_slug}}_runtime_configuration.json  release\

:fail

Update compile_driver.bat

Update compile_driver.bat


Add cordova run batch

Add cordova run batch


@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

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

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

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

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega

Add gradle wrapper for Windows

Add gradle wrapper for Windows