@echo off
@echo GDI-BY Downloadclient
@echo ===============================================
@echo Setting up an environment.

SET "SYS_PATH=%PATH%"
SET dlc=%~dp0
SET dlc=%dlc:\\=\%
SET "PATH=%dlcbin%;%dlcdll%;%PATH%"
SET dlstep=%~f1
SET arguments=%*

@echo --Setting up GDAL -----------------------------
call %dlc%bin\gisinternals\SDKShell.bat setenv
@echo -----------------------------------------------

@echo -----------------------------------------------
@echo Using "%dlstep%" as Download-Step file
@echo Arguments: "%arguments%"
@echo Starting the downloadclient.
@echo -----------------------------------------------

where java >nul 2>nul
if %errorlevel%==1 (
    @echo "No Java Runtime (JRE/JDK) installed! Please read the documentation for further information."
    goto exit
)
  for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
    set JAVAVER=%%g
  )
  set JAVAVER=%JAVAVER:"=%
  @echo Java version=%JAVAVER%

  IF "%JAVAVER:~0,3%"=="1.8" (
    @echo "Starting GDI-BY Downloadclient using Java version 1.8"
    java -jar downloadclient.jar --headless %dlstep% --config=config %arguments%
    goto exit
  ) else (
    IF "%JAVAVER:~0,4%"=="11.0" (
      IF "%JAVAFX_HOME%"=="" (
        @echo "JAVAFX_HOME is not set. Please read the documentation for further information."
        goto exit
      ) else (
        @echo "Starting GDI-BY Downloadclient using Java version 11"
        java --module-path %JAVAFX_HOME%\lib --add-modules=javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.web --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=javafx.graphics/javafx.application=ALL-UNNAMED --add-opens=javafx.graphics/javafx.geometry=ALL-UNNAMED --add-opens=javafx.web/javafx.scene.web=ALL-UNNAMED --add-opens=javafx.web/com.sun.webkit=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.sg.prism=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.util=ALL-UNNAMED --add-exports javafx.base/com.sun.javafx.logging=ALL-UNNAMED --add-exports javafx.graphics/com.sun.prism=ALL-UNNAMED --add-exports javafx.graphics/com.sun.glass.ui=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.geom.transform=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED --add-exports javafx.graphics/com.sun.glass.utils=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.font=ALL-UNNAMED --add-exports javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.scene.input=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.geom=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.application=ALL-UNNAMED --add-exports javafx.graphics/com.sun.prism.paint=ALL-UNNAMED --add-exports javafx.graphics/com.sun.scenario.effect=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.text=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.iio=ALL-UNNAMED -jar downloadclient.jar --headless %dlstep% --config=config %arguments%
        goto exit
      )
    ) else (
      @echo "No suitable Java version found. Please read the documentation for further information."
      goto exit
    )
  )

:exit
@set "PATH=%SYS_PATH%"
@set SYS_PATH=
@set _path=

@echo off
@echo GDI-BY Downloadclient
@echo ===============================================
@echo Setting up an environment.

SET "SYS_PATH=%PATH%"
SET dlc=%~dp0
SET dlc=%dlc:\\=\%
SET "PATH=%dlcbin%;%dlcdll%;%PATH%"
SET dlstep=%~f1
SET arguments=%*

@echo --Setting up GDAL -----------------------------
call %dlc%bin\gisinternals\SDKShell.bat setenv
@echo -----------------------------------------------

@echo -----------------------------------------------
@echo Using "%dlstep%" as Download-Step file
@echo Arguments: "%arguments%"
@echo Starting the downloadclient.
@echo -----------------------------------------------

where java >nul 2>nul
if %errorlevel%==1 (
    @echo "No Java Runtime (JRE/JDK) installed! Please read the documentation for further information."
    goto exit
)
  for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
    set JAVAVER=%%g
  )
  set JAVAVER=%JAVAVER:"=%
  @echo Java version=%JAVAVER%

  IF "%JAVAVER:~0,3%"=="1.8" (
    @echo "Starting GDI-BY Downloadclient using Java version 1.8"
    java -jar downloadclient.jar --headless %dlstep% --config=config %arguments%
    goto exit
  ) else (
    IF "%JAVAVER:~0,4%"=="11.0" (
      IF "%JAVAFX_HOME%"=="" (
        @echo "JAVAFX_HOME is not set. Please read the documentation for further information."
        goto exit
      ) else (
        @echo "Starting GDI-BY Downloadclient using Java version 11"
        java --module-path "%JAVAFX_HOME%\lib" --add-modules=javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.web --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=javafx.graphics/javafx.application=ALL-UNNAMED --add-opens=javafx.graphics/javafx.geometry=ALL-UNNAMED --add-opens=javafx.web/javafx.scene.web=ALL-UNNAMED --add-opens=javafx.web/com.sun.webkit=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.sg.prism=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.util=ALL-UNNAMED --add-exports javafx.base/com.sun.javafx.logging=ALL-UNNAMED --add-exports javafx.graphics/com.sun.prism=ALL-UNNAMED --add-exports javafx.graphics/com.sun.glass.ui=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.geom.transform=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED --add-exports javafx.graphics/com.sun.glass.utils=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.font=ALL-UNNAMED --add-exports javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.scene.input=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.geom=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.application=ALL-UNNAMED --add-exports javafx.graphics/com.sun.prism.paint=ALL-UNNAMED --add-exports javafx.graphics/com.sun.scenario.effect=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.text=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.iio=ALL-UNNAMED -jar downloadclient.jar --headless %dlstep% --config=config %arguments%
        goto exit
      )
    ) else (
      @echo "No suitable Java version found. Please read the documentation for further information."
      goto exit
    )
  )

:exit
@set "PATH=%SYS_PATH%"
@set SYS_PATH=
@set _path=

Update startup-headless.bat

Update startup-headless.bat

Set %JAVAFX_HOME%\lib in Quotes (line 45)


ECHO CHOCO INSTALL
choco install docfx --version 2.48.0 --allow-downgrade  -y || exit /b
ECHO NUGET RESTORE
nuget restore mapsui.sln
ECHO DOCFX
docfx docfx\docfx.json || exit /b
ECHO DELETE docs
del docs /s /q || exit /b
REM the CNAME file is generated in the doc folder when added through the github
REM settings page. Apparently github uses this file to determine the custom
REM domain. The line above deletes the whole docs folder so we need to copy it
REM from the docfx folder. If we ever want to change the custom domain settings
REM we need to alter the docfx\CNAME file and not use the github settings page.
ECHO COPY CNAME
copy docfx\CNAME docs /Y || exit /b
ECHO COPY _site TO docs
xcopy docfx\_site docs /E /Y || exit /b

ECHO CHOCO INSTALL
choco install docfx --version 2.58.9 --allow-downgrade  -y || exit /b
ECHO NUGET RESTORE
nuget restore mapsui.sln
ECHO DOCFX
docfx docfx\docfx.json || exit /b
ECHO DELETE docs
del docs /s /q || exit /b
REM the CNAME file is generated in the doc folder when added through the github
REM settings page. Apparently github uses this file to determine the custom
REM domain. The line above deletes the whole docs folder so we need to copy it
REM from the docfx folder. If we ever want to change the custom domain settings
REM we need to alter the docfx\CNAME file and not use the github settings page.
ECHO COPY CNAME
copy docfx\CNAME docs /Y || exit /b
ECHO COPY _site TO docs
xcopy docfx\_site docs /E /Y || exit /b

Use docfx 2.58.9

Use docfx 2.58.9


REM perform 32-bit build
if "%1" == "clean" rmdir /s /q build
mkdir build
cd build
del CMakeCache.txt
rmdir /s /q build\_CPack_Packages
cmake -G"MinGW Makefiles" -DRSTUDIO_TARGET=Desktop -DCMAKE_BUILD_TYPE=Release ..\..\..
mingw32-make
cd ..

REM perform 64-bit build and install it into the 32-bit tree
REM (but only do this if we are on win64)
IF DEFINED PROGRAMW6432 call make-install-win64.bat "%CD%\build\src\cpp\session" %1

REM create packages
cd build
cpack -G NSIS
REM cpack -G ZIP
cd ..

REM perform 32-bit build
if "%1" == "clean" rmdir /s /q build
mkdir build
cd build
del CMakeCache.txt
rmdir /s /q build\_CPack_Packages
cmake -G"MinGW Makefiles" -DRSTUDIO_TARGET=Desktop -DCMAKE_BUILD_TYPE=Release ..\..\..
mingw32-make
cd ..

REM perform 64-bit build and install it into the 32-bit tree
REM (but only do this if we are on win64)
IF "%PROCESSOR_ARCHITECTURE%" == "AMD64" call make-install-win64.bat "%CD%\build\src\cpp\session" %1

REM create packages
cd build
cpack -G NSIS
REM cpack -G ZIP
cd ..

Make Win x64 build work on versions of Windows earlier than Win7/2008R2


@echo off
set CDP=%~dp0
set PWD
setlocal

set TOP_LEVEL_PACKAGE=hx.concurrent
set OWNER=http://vegardit.com

REM extract GIT URL from haxelib.json
for /f "tokens=*" %%a in ( 'findstr url "%CDP%haxelib.json"' ) do (set textLine=%%a)
set REPO_URL=%textLine:"url": "=%
set REPO_URL=%REPO_URL:",=%
set REPO_URL=%REPO_URL:"=%
echo REPO_URL=%REPO_URL%

REM extract project version from haxelib.json
for /f "tokens=*" %%a in ( 'findstr version "%CDP%haxelib.json"' ) do (set textLine=%%a)
set PROJECT_VERSION=%textLine:"version": "=%
set PROJECT_VERSION=%PROJECT_VERSION:",=%
set PROJECT_VERSION=%PROJECT_VERSION:"=%

REM extract project name from haxelib.json
for /f "tokens=*" %%a in ( 'findstr name "%CDP%haxelib.json"' ) do (set textLine=%%a)
set PROJECT_NAME=%textLine:"name": "=%
set PROJECT_NAME=%PROJECT_NAME:",=%
set PROJECT_NAME=%PROJECT_NAME:"=%

REM extract project description from haxelib.json
for /f "tokens=*" %%a in ( 'findstr description "%CDP%haxelib.json"' ) do (set textLine=%%a)
set PROJECT_DESCRIPTION=%textLine:"description": "=%
set PROJECT_DESCRIPTION=%PROJECT_DESCRIPTION:",=%
set PROJECT_DESCRIPTION=%PROJECT_DESCRIPTION:"=%

haxelib list | findstr dox >NUL
if %errorlevel% neq 0 (
    echo Installing [dox]...
    haxelib install dox
)

if exist "%CDP%target\site" (
    echo Cleaning %CDP%target\site...
    rd /s /q "%CDP%target\site"
)

echo Analyzing source code...
set PWD=%CD%
cd %CDP%
haxe -cp "src" --no-output -D doc-gen -xml "%CDP%target/doc.xml" --macro include('%TOP_LEVEL_PACKAGE%')
cd %PWD%

REM https://github.com/HaxeFoundation/dox/wiki/Commandline-arguments-overview
echo Generating HTML files...
haxelib run dox ^
 --title "%PROJECT_NAME% %PROJECT_VERSION% API documentation" ^
 --toplevel-package "%TOP_LEVEL_PACKAGE%" ^
 -D description "%PROJECT_NAME%: %PROJECT_DESCRIPTION%" ^
 -D source-path "%REPO_URL%/tree/master/src" ^
 -D themeColor 0x00658F ^
 -D version "%PROJECT_VERSION%" ^
 -D website "%OWNER%" ^
 -ex "^%OWNER:.=\.%\.internal" ^
 -i "%CDP%target\doc.xml" ^
 -o "%CDP%target\site"

set pwd=%~dp0
echo.
echo Documentation generated at [file:///%pwd:\=/%target/site/index.html]...

endlocal

@echo off
set CDP=%~dp0

pushd .
cd "%CDP%..\target"
set TARGET=%CD%
popd

setlocal

set TOP_LEVEL_PACKAGE=hx.concurrent
set OWNER=http://vegardit.com

REM extract GIT URL from haxelib.json
for /f "tokens=*" %%a in ( 'findstr url "%CDP%..\haxelib.json"' ) do (set textLine=%%a)
set REPO_URL=%textLine:"url": "=%
set REPO_URL=%REPO_URL:",=%
set REPO_URL=%REPO_URL:"=%
echo REPO_URL=%REPO_URL%

REM extract project version from haxelib.json
for /f "tokens=*" %%a in ( 'findstr version "%CDP%..\haxelib.json"' ) do (set textLine=%%a)
set PROJECT_VERSION=%textLine:"version": "=%
set PROJECT_VERSION=%PROJECT_VERSION:",=%
set PROJECT_VERSION=%PROJECT_VERSION:"=%

REM extract project name from haxelib.json
for /f "tokens=*" %%a in ( 'findstr name "%CDP%..\haxelib.json"' ) do (set textLine=%%a)
set PROJECT_NAME=%textLine:"name": "=%
set PROJECT_NAME=%PROJECT_NAME:",=%
set PROJECT_NAME=%PROJECT_NAME:"=%

REM extract project description from haxelib.json
for /f "tokens=*" %%a in ( 'findstr description "%CDP%..\haxelib.json"' ) do (set textLine=%%a)
set PROJECT_DESCRIPTION=%textLine:"description": "=%
set PROJECT_DESCRIPTION=%PROJECT_DESCRIPTION:",=%
set PROJECT_DESCRIPTION=%PROJECT_DESCRIPTION:"=%

haxelib list | findstr dox >NUL
if %errorlevel% neq 0 (
    echo Installing [dox]...
    haxelib install dox
)

if exist "%TARGET%\site" (
    echo Cleaning %TARGET%\site...
    rd /s /q "%TARGET%\site"
)

echo Analyzing source code...
haxe -cp "%CDP%..\src" --no-output -D doc-gen -xml "%TARGET%\doc.xml" --macro include('%TOP_LEVEL_PACKAGE%')

REM https://github.com/HaxeFoundation/dox/wiki/Commandline-arguments-overview
echo Generating HTML files...
haxelib run dox ^
 --title "%PROJECT_NAME% %PROJECT_VERSION% API documentation" ^
 --toplevel-package "%TOP_LEVEL_PACKAGE%" ^
 -D description "%PROJECT_NAME%: %PROJECT_DESCRIPTION%" ^
 -D source-path "%REPO_URL%/tree/master/src" ^
 -D themeColor 0x00658F ^
 -D version "%PROJECT_VERSION%" ^
 -D website "%OWNER%" ^
 -ex "^%OWNER:.=\.%\.internal" ^
 -i "%TARGET%\doc.xml" ^
 -o "%TARGET%\site"

echo.
echo Documentation generated at [file:///%TARGET:\=/%/site/index.html]...

endlocal

improve api gen

improve api gen


@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe"  "%~dp0\..\apm\bin\apm" %*
) ELSE (
  node  "%~dp0\..\apm\bin\apm" %*
)

Add apm.cmd.

Add apm.cmd.


Create execute.bat

Create execute.bat


@ECHO OFF

:: === Usage ===
:: This script builds a primesieve binary that is suitable for
:: distribution on the internet. The built primesieve binary
:: will only depend on kernel32.dll.
::
:: 1) Open a Visual Studio Command Prompt
:: 2) cd into primesieve repo
:: 3) Run: scripts/build_msvc.bat

rmdir /s /q build-msvc
mkdir build-msvc
cd build-msvc

cl /O2 /EHsc /W3 /D NDEBUG /I ../include ../src/*.cpp ../src/app/*.cpp /Feprimesieve.exe

Add MSVC build script

Add MSVC build script


@echo off
set local
rem Signing pattern taken from:
rem https://textslashplain.com/2016/01/10/authenticode-in-2016/

rem Add path for signtool
set path=%path%;C:\Program Files (x86)\Windows Kits\10\bin\x64

rem So far I see no indications that SHA1 signing is actually needed.
rem signtool sign /d "UIforETW" /du "https://github.com/google/UIforETW/releases" /n "Bruce Dawson" /tr http://timestamp.digicert.com /fd SHA1 %~dp0bin\UIforETW.exe %~dp0bin\UIforETW32.exe
rem @if not %errorlevel% equ 0 goto failure

rem Sign both 64-bit and 32-bit versions of UIforETW with the same description.
signtool sign /d "UIforETW" /du "https://github.com/google/UIforETW/releases" /n "Bruce Dawson" /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 %~dp0bin\UIforETW.exe %~dp0bin\UIforETW32.exe
@if not %errorlevel% equ 0 goto failure
exit /b

:failure
echo Signing failed!

Add batch file to sign main executables

Add batch file to sign main executables

All future releases of UIforETW will have the two main executables
signed. This is particularly important since these two are run as
administrator.

SHA1 signing is currently not used because it does not seem to add any
value for the operating systems (Windows 7 and above, and maybe Windows
Vista, but probably not) that UIforETW targets. If SHA1 is needed I can
add it - but I hate having to type the signing-key password twice.


REM Add other things if could be automated, RUN THIS AS ADMIN

REM Everything is added, including PowerShell command execution and "wget" lol

REM Admin checking...

@echo off
echo Checking if script contains Administrative rights...
net sessions
if %errorlevel%==0 (
echo Success!
) else (
echo No admin, please run with Administrative rights...
pause
exit
)

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

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

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

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

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

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

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

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

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

PAUSE

REM Add other things if could be automated, RUN THIS AS ADMIN

REM Everything is added, including PowerShell command execution and "wget" lol

REM Admin checking...

@echo off
echo Checking if script contains Administrative rights...
net sessions
if %errorlevel%==0 (
echo Success!
) else (
echo No admin, please run with Administrative rights...
pause
exit
)

:MENU

echo Choose An option:
echo 1. Windows Defender Scan
echo 2. List Processes
echo 3. Changing Password Policies
echo 4. Enable UAC
echo 5. Disable Remote Desktop
echo 6. Enable Auto-Update
echo 7. Disable Weak services
echo 8. System Integrity Scan
echo 9. Powershell rootkit detection

SET /p choice=Enter your choice:
IF %choice%==1
GOTO ONE

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

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

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

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

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

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

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

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

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

PAUSE

Update Main.bat

Update Main.bat


Create Main.bat

Create Main.bat


@echo off
set IGN_RENDERING_PLUGIN_PATH=%CONDA_PREFIX%\Library\lib\gz-rendering-6\engine-plugins
set OGRE_RESOURCE_PATH=%CONDA_PREFIX%\Library\bin
set OGRE2_RESOURCE_PATH=%CONDA_PREFIX%\Library\bin\OGRE-Next
set IGN_RENDERING_RESOURCE_PATH=%CONDA_PREFIX%\Library\share\gz\gz-rendering6

@echo off
set GZ_RENDERING_PLUGIN_PATH=%CONDA_PREFIX%\Library\lib\gz-rendering-6\engine-plugins
set OGRE_RESOURCE_PATH=%CONDA_PREFIX%\Library\bin
set OGRE2_RESOURCE_PATH=%CONDA_PREFIX%\Library\bin\OGRE-Next
set GZ_RENDERING_RESOURCE_PATH=%CONDA_PREFIX%\Library\share\gz\gz-rendering6

Update activate.bat

Update activate.bat


Build 65

Build 65


@echo off

echo Building dependencies...

if exist lib (rd lib /q /s)
md lib
cd lib
md Debug
md Release
cd ../
REM ######################################################################################################
echo Building protobuf...

if exist protobuf (rd protobuf /q /s)
git clone -b 2.7.0 https://github.com/google/protobuf.git

cd protobuf/cmake
md build
cd build
cmake -G "Visual Studio 14 Win64" -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF ..
"%VS140COMNTOOLS%..\IDE\Devenv" protobuf.sln /build "Debug|x64"
"%VS140COMNTOOLS%..\IDE\Devenv" protobuf.sln /build "Release|x64"
copy Debug\*.dll ..\..\..\lib\Debug /Y
copy Debug\*.lib ..\..\..\lib\Debug /Y
copy Release\*.dll ..\..\..\lib\Release /Y
copy Release\*.lib ..\..\..\lib\Release /Y

copy Release\libprotobuf.dll ..\..\..\..\Frame\SDK\Proto\proto-gen /Y
copy Release\libprotoc.dll ..\..\..\..\Frame\SDK\Proto\proto-gen /Y
copy Release\protoc.exe ..\..\..\..\Frame\SDK\Proto\proto-gen /Y

cd ..\..\..\
REM ######################################################################################################
echo Building libevent...

if exist libevent (rd libevent /q /s)
git clone -b master https://github.com/libevent/libevent.git

cd libevent
md build
cd build
cmake -G "Visual Studio 14 Win64" -DEVENT__DISABLE_OPENSSL=ON ..
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_core_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_core_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_extra_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_extra_static.vcxproj
copy lib\Debug\*.lib ..\..\lib\Debug /Y
copy lib\Release\*.lib ..\..\lib\Release /Y
cd ..\..\
REM ######################################################################################################
echo Building glog...
if exist glog (rd glog /q /s)
git clone -b v035 https://github.com/google/glog.git

cd glog
md build
cd build
cmake -G "Visual Studio 14 Win64" ..
"%VS140COMNTOOLS%..\IDE\Devenv" google-glog.sln /build "Debug|x64"
"%VS140COMNTOOLS%..\IDE\Devenv" google-glog.sln /build "Release|x64"
copy Debug\*.lib ..\..\lib\Debug /Y
copy Release\*.lib ..\..\lib\Release /Y
cd ..\..\
REM ######################################################################################################
echo Building evpp...
if exist evpp (rd evpp /q /s)
git clone -b master https://github.com/ArkGame/evpp.git

cd evpp
cd vsprojects
"%VS140COMNTOOLS%..\IDE\Devenv" libevpp.sln /build "Debug|x64" /project libevpp.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevpp.sln /build "Release|x64" /project libevpp.vcxproj
copy x64\Debug\*.lib ..\..\lib\Debug /Y
copy x64\Release\*.lib ..\..\lib\Release /Y

cd ..\..\
REM ####################################################################################################
REM back to root dir
cd ../

@echo off

echo Building dependencies...

if exist lib (rd lib /q /s)
md lib
cd lib
md Debug
md Release
cd ../
REM ######################################################################################################
echo Building protobuf...

if exist protobuf (rd protobuf /q /s)
git clone -b 2.7.0 https://github.com/google/protobuf.git

cd protobuf/cmake
md build
cd build
cmake -G "Visual Studio 14 Win64" -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF ..
"%VS140COMNTOOLS%..\IDE\Devenv" protobuf.sln /build "Debug|x64"
"%VS140COMNTOOLS%..\IDE\Devenv" protobuf.sln /build "Release|x64"
copy Debug\*.dll ..\..\..\lib\Debug /Y
copy Debug\*.lib ..\..\..\lib\Debug /Y
copy Release\*.dll ..\..\..\lib\Release /Y
copy Release\*.lib ..\..\..\lib\Release /Y

copy Release\libprotobuf.dll ..\..\..\..\Frame\SDK\Proto\proto-gen /Y
copy Release\libprotoc.dll ..\..\..\..\Frame\SDK\Proto\proto-gen /Y
copy Release\protoc.exe ..\..\..\..\Frame\SDK\Proto\proto-gen /Y

cd ..\..\..\
REM ######################################################################################################
echo Building libevent...

if exist libevent (rd libevent /q /s)
git clone -b master https://github.com/libevent/libevent.git

cd libevent
md build
cd build
cmake -G "Visual Studio 14 Win64" -DEVENT__DISABLE_OPENSSL=ON ..
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_core_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_core_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Debug|x64" /project event_extra_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevent.sln /build "Release|x64" /project event_extra_static.vcxproj
copy lib\Debug\*.lib ..\..\lib\Debug /Y
copy lib\Release\*.lib ..\..\lib\Release /Y
cd ..\..\
REM ######################################################################################################
echo Building glog...
if exist glog (rd glog /q /s)
git clone -b v035 https://github.com/google/glog.git

cd glog
md build
cd build
cmake -G "Visual Studio 14 Win64" ..
"%VS140COMNTOOLS%..\IDE\Devenv" google-glog.sln /build "Debug|x64"
"%VS140COMNTOOLS%..\IDE\Devenv" google-glog.sln /build "Release|x64"
copy Debug\*.lib ..\..\lib\Debug /Y
copy Release\*.lib ..\..\lib\Release /Y
cd ..\..\
REM ######################################################################################################
echo Building evpp...
if exist evpp (rd evpp /q /s)
git clone -b master https://github.com/ArkGame/evpp.git

cd evpp
md build
cd build
cmake -G "Visual Studio 14 Win64" ..
"%VS140COMNTOOLS%..\IDE\Devenv" safe-evpp.sln /build "Debug|x64" /project evpp/evpp_static.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" safe-evpp.sln /build "Release|x64" /project evpp/evpp_static.vcxproj
copy lib\Debug\*.lib ..\..\lib\Debug /Y
copy lib\Release\*.lib ..\..\lib\Release /Y

cd ..\..\
REM ####################################################################################################
REM back to root dir
cd ..\

use self-define CMakeLists.txt for evpp

use self-define CMakeLists.txt for evpp

Former-commit-id: df112f098dca7a3161aeae4d60693c5b053064d5 [formerly 696e52440f3a51caaa523f8a404d4fdf0160ee38] [formerly bf4d775cff84df90b235add100e4bfd88974754c [formerly b0d5c8019dfb9a904c2fd6c5099a77f0418433b0]]
Former-commit-id: e31bdf9b1a67ed9cd956701a53c5a3ab4aad9c40 [formerly ab22f17709941ff621301747504f387d29fb0e05]
Former-commit-id: a76858e695aa43eda95d163179a749d3e6f4bf29
Former-commit-id: bdff88f46086209b5bef93deb433ccf1d638fcf4


use self-define CMakeLists.txt for evpp

use self-define CMakeLists.txt for evpp

Former-commit-id: df112f098dca7a3161aeae4d60693c5b053064d5 [formerly 696e52440f3a51caaa523f8a404d4fdf0160ee38] [formerly bf4d775cff84df90b235add100e4bfd88974754c [formerly b0d5c8019dfb9a904c2fd6c5099a77f0418433b0]]
Former-commit-id: e31bdf9b1a67ed9cd956701a53c5a3ab4aad9c40 [formerly ab22f17709941ff621301747504f387d29fb0e05]
Former-commit-id: a76858e695aa43eda95d163179a749d3e6f4bf29
Former-commit-id: 2cac4871432db16989d1a8d12cf6703dfe26019f


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

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

if exist make.bat goto ok
echo Must run make.bat from Go src directory.
goto fail
:ok

:: Grab default GOROOT_FINAL and set GOROOT for build.
:: The expression %VAR:\=\\% means to take %VAR%
:: and apply the substitution \ = \\, escaping the
:: backslashes.  Then we wrap that in quotes to create
:: a C string.
cd ..
set GOROOT=%CD%
cd src
if "x%GOROOT_FINAL%"=="x" set GOROOT_FINAL=%GOROOT%
set DEFGOROOT=-DGOROOT_FINAL="\"%GOROOT_FINAL:\=\\%\""

echo # Building C bootstrap tool.
echo cmd/dist
if not exist ..\bin\tool mkdir ..\bin\tool
:: Windows has no glob expansion, so spell out cmd/dist/*.c.
gcc -O2 -Wall -Werror -o cmd/dist/dist.exe -Icmd/dist %DEFGOROOT% cmd/dist/buf.c cmd/dist/build.c cmd/dist/buildgc.c cmd/dist/buildruntime.c cmd/dist/goc2c.c cmd/dist/main.c cmd/dist/windows.c
if errorlevel 1 goto fail
.\cmd\dist\dist env -wp >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

echo # Building compilers and Go bootstrap tool.
set buildall=-a
if x%1==x--no-clean set buildall=
.\cmd\dist\dist bootstrap %buildall% -v
if errorlevel 1 goto fail
:: Delay move of dist tool to now, because bootstrap cleared tool directory.
move .\cmd\dist\dist.exe "%GOTOOLDIR%\dist.exe"
"%GOTOOLDIR%\go_bootstrap" clean -i std
echo.

if not %GOHOSTARCH% == %GOARCH% goto localbuild
if not %GOHOSTOS% == %GOOS% goto localbuild
goto mainbuild

:localbuild
echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH%
setlocal
set GOOS=%GOHOSTOS%
set GOARCH=%GOHOSTARCH%
"%GOTOOLDIR%\go_bootstrap" install -v std
endlocal
if errorlevel 1 goto fail
echo.

:mainbuild
echo # Building packages and commands.
"%GOTOOLDIR%\go_bootstrap" install -a -v std
if errorlevel 1 goto fail
del "%GOTOOLDIR%\go_bootstrap.exe"
echo.

if x%1==x--no-banner goto nobanner
"%GOTOOLDIR%\dist" banner
:nobanner

goto end

:fail
set GOBUILDFAIL=1

:end

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

:: Keep environment variables within this script
:: unless invoked with --no-local.
if x%1==x--no-local goto nolocal
if x%2==x--no-local goto nolocal
setlocal
:nolocal

set GOBUILDFAIL=0

if exist make.bat goto ok
echo Must run make.bat from Go src directory.
goto fail
:ok

:: Grab default GOROOT_FINAL and set GOROOT for build.
:: The expression %VAR:\=\\% means to take %VAR%
:: and apply the substitution \ = \\, escaping the
:: backslashes.  Then we wrap that in quotes to create
:: a C string.
cd ..
set GOROOT=%CD%
cd src
if "x%GOROOT_FINAL%"=="x" set GOROOT_FINAL=%GOROOT%
set DEFGOROOT=-DGOROOT_FINAL="\"%GOROOT_FINAL:\=\\%\""

:: Clean old generated file that will cause problems in the build.
del /F ".\pkg\runtime\runtime_defs.go"

echo # Building C bootstrap tool.
echo cmd/dist
if not exist ..\bin\tool mkdir ..\bin\tool
:: Windows has no glob expansion, so spell out cmd/dist/*.c.
gcc -O2 -Wall -Werror -o cmd/dist/dist.exe -Icmd/dist %DEFGOROOT% cmd/dist/buf.c cmd/dist/build.c cmd/dist/buildgc.c cmd/dist/buildruntime.c cmd/dist/goc2c.c cmd/dist/main.c cmd/dist/windows.c
if errorlevel 1 goto fail
.\cmd\dist\dist env -wp >env.bat
if errorlevel 1 goto fail
call env.bat
del env.bat
echo.

echo # Building compilers and Go bootstrap tool.
set buildall=-a
if x%1==x--no-clean set buildall=
.\cmd\dist\dist bootstrap %buildall% -v
if errorlevel 1 goto fail
:: Delay move of dist tool to now, because bootstrap cleared tool directory.
move .\cmd\dist\dist.exe "%GOTOOLDIR%\dist.exe"
"%GOTOOLDIR%\go_bootstrap" clean -i std
echo.

if not %GOHOSTARCH% == %GOARCH% goto localbuild
if not %GOHOSTOS% == %GOOS% goto localbuild
goto mainbuild

:localbuild
echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH%
setlocal
set GOOS=%GOHOSTOS%
set GOARCH=%GOHOSTARCH%
"%GOTOOLDIR%\go_bootstrap" install -v std
endlocal
if errorlevel 1 goto fail
echo.

:mainbuild
echo # Building packages and commands.
"%GOTOOLDIR%\go_bootstrap" install -a -v std
if errorlevel 1 goto fail
del "%GOTOOLDIR%\go_bootstrap.exe"
echo.

if x%1==x--no-banner goto nobanner
"%GOTOOLDIR%\dist" banner
:nobanner

goto end

:fail
set GOBUILDFAIL=1

:end

Fix for old files

make.bat: Fix for old files

Same fix as applied here: http://codereview.appspot.com/5761044

Fixes issue 3222.

R=golang-dev, alex.brainman, rsc
CC=golang-dev
http://codereview.appspot.com/5838043

Committer: Alex Brainman <54ba58c8441b5eff861de6b4e5ee46baf086b142@gmail.com>


@echo off
SET CURDIR=%CD%

Set /P version=Enter release version number (e.g. 1.2.3):
If "%version%"=="" goto :err
goto:noerr

:err
echo No release version entered
goto:end

:noerr
SET SRC=https://metageta.googlecode.com/svn/trunk
SET DST=https://metageta.googlecode.com/svn/tags/%version%

svn copy %SRC% %DST% -m "Tagging version %version%"
svn checkout --depth=empty %DST% %TEMP%\metageta-%version%
cd %TEMP%\metageta-%version%
svn propset displayversion %version% .
svn propset version %version%.$Revision$ .
svn commit -m "Updating version properties %version%"
cd %CURDIR%
del /f /q %TEMP%\metageta-%version%

:end
pause

@echo off
SET CURDIR=%CD%

Set /P version=Enter release version number (e.g. 1.2.3):
If "%version%"=="" goto :err
goto:noerr

:err
echo No release version entered
goto:end

:noerr
SET SRC=https://metageta.googlecode.com/svn/trunk
SET DST=https://metageta.googlecode.com/svn/tags/%version%

rmdir /s /q %TEMP%\metageta-%version% > nul 2>&1
svn copy %SRC% %DST% -m "Tagging version %version%"
svn checkout --depth=empty %DST% %TEMP%\metageta-%version%
cd %TEMP%\metageta-%version%
svn propset displayversion %version% .
svn propset version %version%.$Revision$ .
svn commit -m "Updating version properties %version%"
cd %CURDIR%
rem Sleep for 3 seconds
ping 127.0.0.1 -n 3 > nul 2>&1
rmdir /s /q %TEMP%\metageta-%version%

:end
pause

Fix tag_new_release.bat

Fix tag_new_release.bat


add commandline parameter

add commandline parameter


@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.
rem

set SCALA_VERSION=2.10

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

rem Export this as SPARK_HOME
set SPARK_HOME=%FWDIR%

rem Test whether the user has built Spark
if exist "%FWDIR%RELEASE" goto skip_build_test
set FOUND_JAR=0
for %%d in ("%FWDIR%assembly\target\scala-%SCALA_VERSION%\spark-assembly*hadoop*.jar") do (
  set FOUND_JAR=1
)
if [%FOUND_JAR%] == [0] (
  echo Failed to find Spark assembly JAR.
  echo You need to build Spark before running this program.
  goto exit
)
:skip_build_test

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

rem Figure out which Python to use.
if [%PYSPARK_PYTHON%] == [] set PYSPARK_PYTHON=python

set PYTHONPATH=%FWDIR%python;%PYTHONPATH%
set PYTHONPATH=%FWDIR%python\lib\py4j-0.8.2.1-src.zip;%PYTHONPATH%

set OLD_PYTHONSTARTUP=%PYTHONSTARTUP%
set PYTHONSTARTUP=%FWDIR%python\pyspark\shell.py
set PYSPARK_SUBMIT_ARGS=%*

echo Running %PYSPARK_PYTHON% with PYTHONPATH=%PYTHONPATH%

rem Check whether the argument is a file
for /f %%i in ('echo %1^| findstr /R "\.py"') do (
  set PYTHON_FILE=%%i
)

if [%PYTHON_FILE%] == [] (
  %PYSPARK_PYTHON%
) else (
  echo.
  echo WARNING: Running python applications through ./bin/pyspark.cmd is deprecated as of Spark 1.0.
  echo Use ./bin/spark-submit ^<python file^>
  echo.
  "%FWDIR%\bin\spark-submit.cmd" %PYSPARK_SUBMIT_ARGS%
)

:exit

@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.
rem

set SCALA_VERSION=2.10

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

rem Export this as SPARK_HOME
set SPARK_HOME=%FWDIR%

rem Test whether the user has built Spark
if exist "%FWDIR%RELEASE" goto skip_build_test
set FOUND_JAR=0
for %%d in ("%FWDIR%assembly\target\scala-%SCALA_VERSION%\spark-assembly*hadoop*.jar") do (
  set FOUND_JAR=1
)
if [%FOUND_JAR%] == [0] (
  echo Failed to find Spark assembly JAR.
  echo You need to build Spark before running this program.
  goto exit
)
:skip_build_test

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

rem Figure out which Python to use.
if [%PYSPARK_PYTHON%] == [] set PYSPARK_PYTHON=python

set PYTHONPATH=%FWDIR%python;%PYTHONPATH%
set PYTHONPATH=%FWDIR%python\lib\py4j-0.8.2.1-src.zip;%PYTHONPATH%

set OLD_PYTHONSTARTUP=%PYTHONSTARTUP%
set PYTHONSTARTUP=%FWDIR%python\pyspark\shell.py
set PYSPARK_SUBMIT_ARGS=%*

echo Running %PYSPARK_PYTHON% with PYTHONPATH=%PYTHONPATH%

rem Check whether the argument is a file
for /f %%i in ('echo %1^| findstr /R "\.py"') do (
  set PYTHON_FILE=%%i
)

if [%PYTHON_FILE%] == [] (
  set PYSPARK_SHELL=1
  if [%IPYTHON%] == [1] (
	ipython %IPYTHON_OPTS%
  ) else (
	%PYSPARK_PYTHON%
  )
) else (
  echo.
  echo WARNING: Running python applications through ./bin/pyspark.cmd is deprecated as of Spark 1.0.
  echo Use ./bin/spark-submit ^<python file^>
  echo.
  "%FWDIR%\bin\spark-submit.cmd" %PYSPARK_SUBMIT_ARGS%
)

:exit

Add check for IPython on Windows

[SPARK-4065] Add check for IPython on Windows

This issue employs logic similar to the bash launcher (pyspark) to check
if IPTYHON=1, and if so launch ipython with options in IPYTHON_OPTS.
This fix assumes that ipython is available in the system Path, and can
be invoked with a plain "ipython" command.

Author: Michael Griffiths <msjgriffiths@gmail.com>

Closes #2910 from msjgriffiths/pyspark-windows and squashes the following commits:

ef34678 [Michael Griffiths] Change build message to comply with [SPARK-3775]
361e3d8 [Michael Griffiths] [SPARK-4065] Add check for IPython on Windows
9ce72d1 [Michael Griffiths] [SPARK-4065] Add check for IPython on Windows


:: A one-shot, first-time Windows configuration script that disables some
:: Windows misfeatures and sets paths to my usual preferences. I wish this
:: script could do more, especially to disable Windows' built-in adware and
:: spyware, but following Microsoft's usual mediocrity, Windows remains a
:: toy operating system with most configuration inaccessible to scripts.

:: Annoyances
set key="HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
reg add "%key%" /f /v TaskbarGlomLevel          /t REG_DWORD /d 2
reg add "%key%" /f /v HideFileExt               /t REG_DWORD /d 0
reg add "%key%" /f /v ShowCortanaButton         /t REG_DWORD /d 0
reg add "%key%" /f /v ShowTaskViewButton        /t REG_DWORD /d 0
reg add "%key%" /f /v StoreAppsOnTaskbar        /t REG_DWORD /d 0
reg add "%key%" /f /v MultiTaskingAltTabFilter  /t REG_DWORD /d 3
reg add "%key%" /f /v JointResize               /t REG_DWORD /d 0
reg add "%key%" /f /v SnapFill                  /t REG_DWORD /d 0
reg add "%key%" /f /v SnapAssist                /t REG_DWORD /d 0
set key="HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds"
reg add "%key%" /f /v ShellFeedsTaskbarViewMode /t REG_DWORD /d 2
set key="HKCU\Software\Microsoft\Windows\CurrentVersion\Search"
reg add "%key%" /f /v SearchboxTaskbarMode      /t REG_DWORD /d 0
set key="HKCU\Control Panel\Desktop"
reg add "%key%" /f /v CursorBlinkRate           /t REG_SZ    /d -1
set key="HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband"
reg delete "%key%" /f /v Favorites

:: Paths
setx GOBIN "%USERPROFILE%\bin"
setx GOPATH "%TEMP%\go"
setx PATH "%PATH%;%USERPROFILE%\bin;%USERPROFILE%\go\bin"

:: Reload
taskkill /f /im explorer.exe
start explorer.exe

:: A one-shot, first-time Windows configuration script that disables some
:: Windows misfeatures and sets paths to my usual preferences. I wish this
:: script could do more, especially to disable Windows' built-in adware and
:: spyware, but following Microsoft's usual mediocrity, Windows remains a
:: toy operating system with most configuration inaccessible to scripts.

:: Annoyances
set key="HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer"
reg add "%key%" /f /v AltTabSettings            /t REG_DWORD /d 1
set key="HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
reg add "%key%" /f /v TaskbarGlomLevel          /t REG_DWORD /d 2
reg add "%key%" /f /v HideFileExt               /t REG_DWORD /d 0
reg add "%key%" /f /v ShowCortanaButton         /t REG_DWORD /d 0
reg add "%key%" /f /v ShowTaskViewButton        /t REG_DWORD /d 0
reg add "%key%" /f /v StoreAppsOnTaskbar        /t REG_DWORD /d 0
reg add "%key%" /f /v MultiTaskingAltTabFilter  /t REG_DWORD /d 3
reg add "%key%" /f /v JointResize               /t REG_DWORD /d 0
reg add "%key%" /f /v SnapFill                  /t REG_DWORD /d 0
reg add "%key%" /f /v SnapAssist                /t REG_DWORD /d 0
set key="HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds"
reg add "%key%" /f /v ShellFeedsTaskbarViewMode /t REG_DWORD /d 2
set key="HKCU\Software\Microsoft\Windows\CurrentVersion\Search"
reg add "%key%" /f /v SearchboxTaskbarMode      /t REG_DWORD /d 0
set key="HKCU\Control Panel\Desktop"
reg add "%key%" /f /v CursorBlinkRate           /t REG_SZ    /d -1
set key="HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband"
reg delete "%key%" /f /v Favorites

:: Paths
setx GOBIN "%USERPROFILE%\bin"
setx GOPATH "%TEMP%\go"
setx PATH "%PATH%;%USERPROFILE%\bin;%USERPROFILE%\go\bin"

:: Reload
taskkill /f /im explorer.exe
start explorer.exe

Fix Windows 10 broken alt-tab behavior

init.bat: Fix Windows 10 broken alt-tab behavior

Minimized windows now go to the end of the alt-tab queue. Any other
behavior is idiotic and merely the result of not thinking.

Microsoft has gone back and forth on this one over the years across
multiple versions of Windows, fixing it and then breaking it again. I
suspect someone who knows better fixes it, then later someone who
doesn't understand UI design breaks it again later, stuck in an endless
cycle. (GitHub's stealing of the "/" key follows a similar pattern, and
in that case I have proof the above explanation is the cause.)


rem Display settings at startup
set CATALINA_OPTS=%CATALINA_OPTS% -XX:+PrintCommandLineFlags

rem Discourage address map swapping by setting Xms and Xmx to the same value
rem http://confluence.atlassian.com/display/DOC/Garbage+Collector+Performance+Issues
set CATALINA_OPTS=%CATALINA_OPTS% -Xms64m
set CATALINA_OPTS=%CATALINA_OPTS% -Xmx512m

rem Prevent "Unrecognized Name" SSL warning
set CATALINA_OPTS=%CATALINA_OPTS% -Djsse.enableSNIExtension=false

rem Checking if anyother garbage collectors have been defined. If no other garbage
rem collector is present, default to G1GC
rem List of options taken from:
rem http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html
rem Help with findstr and envir vars:
rem https://stackoverflow.com/questions/5491383/find-out-whether-an-environment-variable-contains-a-substring
echo.%CATALINA_OPTS%|findstr /C:"-XX:+UseSerialGC" /C:"-XX:+UseParallelGC" /C:"-XX:ParallelGCThreads" /C:"-XX:+UseParallelOldGC" /C:"-XX:+UseConcMarkSweepGC" /C:"-XX:+UseParNewGC" /C:"-XX:+CMSParallelRemarkEnabled" /C:"-XX:CMSInitiatingOccupancyFraction" /C:"-XX:+UseCMSInitiatingOccupancyOnly" /C:"-XX:+UseG1GC" >nul 2>&1
if not errorlevel 1 (
    echo Already declared a garbage collector
) else (
    set CATALINA_OPTS=%CATALINA_OPTS% -XX:UseG1GC
)

rem We need to send a 'portal.home' system property to the JVM;  use the value of PORTAL_HOME, if
rem present, or fall back to a value calculated from %CATALINA_BASE%
if not "%PORTAL_HOME%" == "" goto gotPortalHome
set "PORTAL_HOME=%CATALINA_BASE%\portal"
:gotPortalHome
set CATALINA_OPTS=%CATALINA_OPTS% -Dportal.home=%PORTAL_HOME%

rem Display settings at startup
set CATALINA_OPTS=%CATALINA_OPTS% -XX:+PrintCommandLineFlags

rem Discourage address map swapping by setting Xms and Xmx to the same value
rem http://confluence.atlassian.com/display/DOC/Garbage+Collector+Performance+Issues
set CATALINA_OPTS=%CATALINA_OPTS% -Xms64m
set CATALINA_OPTS=%CATALINA_OPTS% -Xmx512m

rem Prevent "Unrecognized Name" SSL warning
set CATALINA_OPTS=%CATALINA_OPTS% -Djsse.enableSNIExtension=false

rem Checking if anyother garbage collectors have been defined. If no other garbage
rem collector is present, default to G1GC
rem List of options taken from:
rem http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html
rem Help with findstr and envir vars:
rem https://stackoverflow.com/questions/5491383/find-out-whether-an-environment-variable-contains-a-substring
echo.%CATALINA_OPTS%|findstr /C:"-XX:+UseSerialGC" /C:"-XX:+UseParallelGC" /C:"-XX:ParallelGCThreads" /C:"-XX:+UseParallelOldGC" /C:"-XX:+UseConcMarkSweepGC" /C:"-XX:+UseParNewGC" /C:"-XX:+CMSParallelRemarkEnabled" /C:"-XX:CMSInitiatingOccupancyFraction" /C:"-XX:+UseCMSInitiatingOccupancyOnly" /C:"-XX:+UseG1GC" >nul 2>&1
if not errorlevel 1 (
    echo Already declared a garbage collector
) else (
    set CATALINA_OPTS=%CATALINA_OPTS% -XX:+UseG1GC
)

rem We need to send a 'portal.home' system property to the JVM;  use the value of PORTAL_HOME, if
rem present, or fall back to a value calculated from %CATALINA_BASE%
if not "%PORTAL_HOME%" == "" goto gotPortalHome
set "PORTAL_HOME=%CATALINA_BASE%\portal"
:gotPortalHome
set CATALINA_OPTS=%CATALINA_OPTS% -Dportal.home=%PORTAL_HOME%

Add missing '+' character within '-XX:+UseG1GC' inside setenv.bat


@echo off
set PDIR=%~dp0
cd %PDIR%RobustToolbox\Bin\Client
start SS14.Client.exe %*
cd %PDIR%
set PDIR=

@echo off
set PDIR=%~dp0
cd %PDIR%RobustToolbox\Bin\Client
start Robust.Client.exe %*
cd %PDIR%
set PDIR=

update client bat

update client bat


@REM  ----------------------
@REM |rbar (rebuild and run)|
@REM  ----------------------
@REM Script to clean the build/libs directory, build the project with gradle (after a git pull, maybe)
@REM and then run the newly built HubTurbo. User information, such as cached repos and boards, will stay
@REM the same during the process.

@echo off

REM An endlocal only affects the most recent setlocal, so we can nest setlocals. This ensures local variables
REM do not persist within the cmd window running the script.
setlocal

REM This gets the name of the HubTurbo .jar file in build/libs. The expected format is HubTurbo-X.X.X-all.jar, but
REM any file that fits the format HubTurbo-(*).jar will be accepted.
for /r build\libs %%i in (*.jar) do @set versionLine=%%~ni
REM Based on the .jar file name, close relevant processes.
echo ^> Closing all javaw processes with window title format: HubTurbo V%versionLine:~9,5%*.
taskkill /fi "Windowtitle eq HubTurbo V%versionLine:~9,5%*" /im "javaw.exe"
echo(
echo ^> Closing all java processes with window title format: HubTurbo V%versionLine:~9,5%*.
taskkill /fi "Windowtitle eq HubTurbo V%versionLine:~9,5%*" /im "java.exe"
echo(

REM rbar-ex.txt tells xcopy to avoid backing up any .jar and .exe files.
REM (we avoid copying HubTurbo .jar and the chromedriver executable)
REM It is used as the exclusion list when xcopy backs up the user cache.
REM The temporary backup location of the user cache is the folder rbar.
echo ^> Backing up your files. Any jar or exe files will not be backed up.
echo .jar>>rbar-ex.txt
echo .exe>>rbar-ex.txt
xcopy build\libs rbar /i /s /exclude:rbar-ex.txt
del rbar-ex.txt
echo(

echo ^> Starting Gradle build. This will take a while...
echo(
call gradlew clean shadowJar --no-daemon
echo(

REM After rebuilding the project, we move the backup cache back to build/libs
REM and then delete the temporary rbar folder.
echo ^> Moving your files files back to build/libs.
xcopy rbar build\libs /i /s
rmdir /S /Q rbar

REM We find the new version number in our build.gradle file by getting the
REM line containing it, and then calling a substring operation on the line to
REM get the version number. Note that the length of the version number changes
REM e.g. 3.1.0 vs 3.10.0, so we have to find the string length to get the correct
REM substring.
for /F "delims=" %%a in ('findstr /rc:"^    version" build.gradle') do @set versionLine=%%a
call:strLen versionLine versionLineLength
set startIndex=15
set /a versionStrLength=%versionLineLength%-%startIndex%-1
setlocal EnableDelayedExpansion
set versionStr=!versionLine:~%startIndex%,%versionStrlength%!
endlocal & set versionNumber=%versionStr%

REM We use the new version number to run the correct (newly built) HubTurbo .jar file.
cd build\libs
echo(
echo ^> Starting HubTurbo V%versionNumber%. You can close this cmd window once HubTurbo begins launching.
start "" javaw -jar HubTurbo-%versionNumber%-all.jar
cd ..\..
endlocal
exit /B

REM  -----------------------
REM |Finds length of string.|
REM  -----------------------
REM Mechanism: Start with a length value of 0, then flip bits when appropriate, starting from the largest one.
REM Similar to binary search.
:strLen inputStr lengthOfStr
setlocal EnableDelayedExpansion
set "inputString=#!%~1!"
set "curr=0"
for /l %%p in (12, -1, 0) do (
    REM Bitwise OR of "curr" with 2^a, which starts at 4024 (2^12), then 2048 (2^11),...until 1 (2^0).
    set /a "curr|=1<<%%p"
    REM Not an actual loop, the "for" is used to inject the value of "curr" into the substring operation.
    REM The if-statement means, if curr does not point to a valid character in the inputString i.e. curr is still larger
    REM than the length of inputString, then perform a bitwise AND on curr with -2^a to erase the effect of the current loop's
    REM bitwise OR operation.
    for %%b in (!curr!) do if "!inputString:~%%b,1!"=="" set /a "curr&=~1<<%%p"
)
endlocal & set %~2=%curr%

@REM  ----------------------
@REM |rbar (rebuild and run)|
@REM  ----------------------
@REM Script to clean the build/libs directory, build the project with gradle (after a git pull, maybe)
@REM and then run the newly built HubTurbo. User information, such as cached repos and boards, will stay
@REM the same during the process.

@echo off

REM An endlocal only affects the most recent setlocal, so we can nest setlocals. This ensures local variables
REM do not persist within the cmd window running the script.
setlocal

REM This gets the name of the HubTurbo .jar file in build/libs. The expected format is HubTurbo-X.X.X-all.jar, but
REM any file that fits the format HubTurbo-(*).jar will be accepted.
for /r build\libs %%i in (*.jar) do @set versionLine=%%~ni
REM Based on the .jar file name, close relevant processes. The /t option specifies tree kill mode, which also
REM targets child chromedriver processes.
echo ^> Closing all javaw processes with window title format: HubTurbo V%versionLine:~9,5%*.
taskkill /fi "Windowtitle eq HubTurbo V%versionLine:~9,5%*" /im "javaw.exe" /t
echo(
echo ^> Closing all java processes with window title format: HubTurbo V%versionLine:~9,5%*.
taskkill /fi "Windowtitle eq HubTurbo V%versionLine:~9,5%*" /im "java.exe" /t
echo(

REM rbar-ex.txt tells xcopy to avoid backing up any .jar and .exe files.
REM (we avoid copying HubTurbo .jar and the chromedriver executable)
REM It is used as the exclusion list when xcopy backs up the user cache.
REM The temporary backup location of the user cache is the folder rbar.
echo ^> Backing up your files. Any jar or exe files will not be backed up.
echo .jar>>rbar-ex.txt
echo .exe>>rbar-ex.txt
xcopy build\libs rbar /i /s /exclude:rbar-ex.txt
del rbar-ex.txt
echo(

echo ^> Starting Gradle build. This will take a while...
echo(
call gradlew clean shadowJar --no-daemon
echo(

REM After rebuilding the project, we move the backup cache back to build/libs
REM and then delete the temporary rbar folder.
echo ^> Moving your files files back to build/libs.
xcopy rbar build\libs /i /s
rmdir /S /Q rbar

REM We find the new version number in our build.gradle file by getting the
REM line containing it, and then calling a substring operation on the line to
REM get the version number. Note that the length of the version number changes
REM e.g. 3.1.0 vs 3.10.0, so we have to find the string length to get the correct
REM substring.
for /F "delims=" %%a in ('findstr /rc:"^    version" build.gradle') do @set versionLine=%%a
call:strLen versionLine versionLineLength
set startIndex=15
set /a versionStrLength=%versionLineLength%-%startIndex%-1
setlocal EnableDelayedExpansion
set versionStr=!versionLine:~%startIndex%,%versionStrlength%!
endlocal & set versionNumber=%versionStr%

REM We use the new version number to run the correct (newly built) HubTurbo .jar file.
cd build\libs
echo(
echo ^> Starting HubTurbo V%versionNumber%. You can close this cmd window once HubTurbo begins launching.
start "" javaw -jar HubTurbo-%versionNumber%-all.jar
cd ..\..
endlocal
exit /B

REM  -----------------------
REM |Finds length of string.|
REM  -----------------------
REM Mechanism: Start with a length value of 0, then flip bits when appropriate, starting from the largest one.
REM Similar to binary search.
:strLen inputStr lengthOfStr
setlocal EnableDelayedExpansion
set "inputString=#!%~1!"
set "curr=0"
for /l %%p in (12, -1, 0) do (
    REM Bitwise OR of "curr" with 2^a, which starts at 4024 (2^12), then 2048 (2^11),...until 1 (2^0).
    set /a "curr|=1<<%%p"
    REM Not an actual loop, the "for" is used to inject the value of "curr" into the substring operation.
    REM The if-statement means, if curr does not point to a valid character in the inputString i.e. curr is still larger
    REM than the length of inputString, then perform a bitwise AND on curr with -2^a to erase the effect of the current loop's
    REM bitwise OR operation.
    for %%b in (!curr!) do if "!inputString:~%%b,1!"=="" set /a "curr&=~1<<%%p"
)
endlocal & set %~2=%curr%

Use treekill to close chromedriver

Use treekill to close chromedriver


if exist "C:\Program Files\R\R-3.0.0\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.0.0\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.0.1\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.0.1\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.0.2\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.0.2\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.0.3\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.0.3\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.1.0\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.1.0\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.1.1\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.1.1\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.1.2\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.1.2\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.2.0\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.2.0\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.2.1\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.2.1\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.2.2\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.2.2\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.2.3\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.2.3\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.2.4\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.2.4\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.2.5\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.2.5\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.3.3\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.3.3\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.4.3\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.4.3\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.4.4\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.4.4\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.5.0\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.5.0\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.5.1\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.5.1\bin\i386\R.exe"
if exist "C:\Program Files\R\R-3.5.2\bin\i386\R.exe" set R_HOME="C:\Program Files\R\R-3.5.2\bin\i386\R.exe"

Update setup.bat

Update setup.bat

added latest versions of R


@echo off
echo ============================
echo ====== Build Zip File ======
echo ============================
if EXIST MarkdownEdit.zip del MarkdownEdit.zip
if NOT EXIST "%ProgramFiles%\7-Zip\7z.exe" echo 7-Zip not installed
pushd src\MarkdownEdit\bin\Release
"%ProgramFiles%\7-Zip\7z.exe" a -x!*.vshost.* -x!*.xml -x!lib/*.*  -r ..\..\..\..\MarkdownEdit.zip *.* -mmt
popd

@echo off
echo ============================
echo ====== Build Zip File ======
echo ============================
if EXIST MarkdownEdit.zip del MarkdownEdit.zip
pushd src\MarkdownEdit\bin\Release
7z.exe" a -x!*.vshost.* -x!*.xml -x!lib/*.*  -r ..\..\..\..\MarkdownEdit.zip *.* -mmt
popd

use appveyor 7z

use appveyor 7z


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
:: All rights reserved.
:: Contact: Nokia Corporation (qt-info@nokia.com)
::
:: This file is part of the Qt Mobility Components.
::
:: $QT_BEGIN_LICENSE:LGPL$
:: No Commercial Usage
:: This file contains pre-release code and may not be distributed.
:: You may use this file in accordance with the terms and conditions
:: contained in the Technology Preview License Agreement accompanying
:: this package.
::
:: GNU Lesser General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU Lesser
:: General Public License version 2.1 as published by the Free Software
:: Foundation and appearing in the file LICENSE.LGPL included in the
:: packaging of this file.  Please review the following information to
:: ensure the GNU Lesser General Public License version 2.1 requirements
:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
::
:: In addition, as a special exception, Nokia gives you certain additional
:: rights.  These rights are described in the Nokia Qt LGPL Exception
:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
::
:: If you have questions regarding the use of this file, please contact
:: Nokia at qt-info@nokia.com.
::
::
::
::
::
::
::
::
:: $QT_END_LICENSE$
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

@echo off

set QT_MOBILITY_PREFIX= C:\QtMobility
set BUILD_PATH=%CD%
set SOURCE_PATH= %~dp0
cd /D %SOURCE_PATH%
set SOURCE_PATH=%CD%
cd /D %BUILD_PATH%

set PROJECT_CONFIG= %BUILD_PATH%\config.in
set PROJECT_LOG= %BUILD_PATH%\config.log
set RELEASEMODE=release
set QT_MOBILITY_LIB=
set BUILD_UNITTESTS=no
set BUILD_EXAMPLES=no
set BUILD_DOCS=yes
set MOBILITY_MODULES=bearer location contacts multimedia publishsubscribe versit messaging systeminfo
set MOBILITY_MODULES_UNPARSED=
set VC_TEMPLATE_OPTION=
set QT_PATH=
set QMAKE_CACHE=%BUILD_PATH%\.qmake.cache

if exist "%QMAKE_CACHE%" del %QMAKE_CACHE%
if exist "%PROJECT_LOG%" del %PROJECT_LOG%
if exist "%PROJECT_CONFIG%" del %PROJECT_CONFIG%

echo QT_MOBILITY_SOURCE_TREE = %SOURCE_PATH% > %QMAKE_CACHE%
echo QT_MOBILITY_BUILD_TREE = %BUILD_PATH% >> %QMAKE_CACHE%
set QMAKE_CACHE=

:cmdline_parsing

if "%1" == ""               goto startProcessing
if "%1" == "-debug"         goto debugTag
if "%1" == "-release"       goto releaseTag
if "%1" == "-silent"        goto silentTag
if "%1" == "-prefix"        goto prefixTag
if "%1" == "-libdir"        goto libTag
if "%1" == "-bindir"        goto binTag
if "%1" == "-headerdir"     goto headerTag
if "%1" == "-tests"         goto testTag
if "%1" == "-examples"      goto exampleTag
if "%1" == "-qt"            goto qtTag
if "%1" == "-vc"            goto vcTag
if "%1" == "-nodocs"        goto nodocsTag
if "%1" == "-docs"          goto docsTag
if "%1" == "-modules"       goto modulesTag
if "%1" == "/?"             goto usage
if "%1" == "-h"             goto usage
if "%1" == "-help"          goto usage
if "%1" == "--help"         goto usage

echo Unknown option: "%1"
goto usage

:usage
echo Usage: configure.bat [-prefix (dir)] [headerdir (dir)] [libdir (dir)]
    echo                  [-bindir (dir)] [-tests] [-examples]
    echo                  [-debug] [-release] [-silent]
    echo.
    echo Options:
    echo.
    echo -prefix (dir) ..... This will install everything relative to dir
    echo                     (default prefix: C:\QtMobility)
    echo -headerdir (dir) .. Header files will be installed to dir
    echo                     (default prefix: PREFIX/include)
    echo -libdir (dir) ..... Libraries will be installed to dir
    echo                     (default PREFIX/lib)
    echo -bindir (dir) ..... Executables will be installed to dir
    echo                     (default PREFIX/bin)
    echo -debug ............ Build with debugging symbols
    echo -release .......... Build without debugging symbols
    echo -silent ........... Reduces build output
    echo -tests ............ Build unit tests (not build by default)
    echo                     Note, this adds test symbols to all libraries
    echo                     and should not be used for release builds.
    echo -examples ......... Build example applications
    echo -nodocs ........... Do not build documentation
    echo -docs ............. Build documentation (default)
    echo -modules ^<list^> ... Build only the specified modules (default all)
    echo                     Choose from: bearer location publishsubscribe location
    echo                     multimedia contacts versit messaging systeminfo
    echo                     Modules should be separated by a space. If a
    echo                     selected module depends on other modules they
    echo                     will automatically be enabled.
    echo -vc ............... Generate Visual Studio make files

if exist "%PROJECT_CONFIG%" del %PROJECT_CONFIG%
goto exitTag

:qtTag
shift
set QT_PATH=%1\
shift
goto cmdline_parsing

:debugTag
if "%RELEASEMODE%" == "release" set RELEASEMODE=debug
shift
goto cmdline_parsing

:releaseTag
if "%RELEASEMODE%" == "debug"   set RELEASEMODE=release
shift
goto cmdline_parsing

:silentTag
echo CONFIG += silent > %PROJECT_CONFIG%
shift
goto cmdline_parsing

:prefixTag
shift
set QT_MOBILITY_PREFIX=%1
shift
goto cmdline_parsing

:libTag
shift
echo QT_MOBILITY_LIB = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:binTag
shift
echo QT_MOBILITY_BIN = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:headerTag
shift
echo QT_MOBILITY_INCLUDE = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:testTag
set BUILD_UNITTESTS=yes
shift
goto cmdline_parsing

:exampleTag
set BUILD_EXAMPLES=yes
shift
goto cmdline_parsing

:vcTag
shift
set VC_TEMPLATE_OPTION=-tp vc
goto cmdline_parsing

:docsTag
set BUILD_DOCS=yes
shift
goto cmdline_parsing

:nodocsTag
set BUILD_DOCS=no
shift
goto cmdline_parsing

:modulesTag
shift
if "%1" == "" (
    echo >&2 "The -modules option requires a list of modules."
    goto usage
)
set MOBILITY_MODULES_UNPARSED=%1
shift
goto cmdline_parsing

:startProcessing

echo CONFIG += %RELEASEMODE% >> %PROJECT_CONFIG%
set RELEASEMODE=

set CURRENTDIR=%CD%
echo %CURRENTDIR%
if exist %QT_MOBILITY_PREFIX% goto prefixExists
mkdir %QT_MOBILITY_PREFIX%
if errorlevel 1 goto invalidPrefix
cd /D %QT_MOBILITY_PREFIX%
set QT_MOBILITY_PREFIX=%CD%
cd /D %CURRENTDIR%
rd /S /Q %QT_MOBILITY_PREFIX%
goto endprefixProcessing

:invalidPrefix
echo "%QT_MOBILITY_PREFIX%" is not a valid directory path.
goto :exitTag

:prefixExists
cd /D %QT_MOBILITY_PREFIX%
set QT_MOBILITY_PREFIX=%CD%
cd /D %CURRENTDIR%

:endprefixProcessing
echo QT_MOBILITY_PREFIX = %QT_MOBILITY_PREFIX% >> %PROJECT_CONFIG%

echo build_unit_tests = %BUILD_UNITTESTS% >> %PROJECT_CONFIG%
set BUILD_UNITTESTS=

echo build_examples = %BUILD_EXAMPLES% >> %PROJECT_CONFIG%
set BUILD_EXAMPLES=

echo build_docs = %BUILD_DOCS% >> %PROJECT_CONFIG%
set BUILD_DOCS=

echo qmf_enabled = no >> %PROJECT_CONFIG%

echo isEmpty($$QT_MOBILITY_INCLUDE):QT_MOBILITY_INCLUDE=$$QT_MOBILITY_PREFIX/include >> %PROJECT_CONFIG%
echo isEmpty($$QT_MOBILITY_LIB):QT_MOBILITY_LIB=$$QT_MOBILITY_PREFIX/lib >> %PROJECT_CONFIG%
echo isEmpty($$QT_MOBILITY_BIN):QT_MOBILITY_BIN=$$QT_MOBILITY_PREFIX/bin >> %PROJECT_CONFIG%

REM now the modules
if not "%MOBILITY_MODULES_UNPARSED%" == "" (
    REM error checking would be nice (e.g. for %%m in (%MOBILITY_MODULES) ... , with an "if" switch like the cmdline arg parsing
    set MOBILITY_MODULES=%MOBILITY_MODULES_UNPARSED%
)

echo mobility_modules = %MOBILITY_MODULES%  >> %PROJECT_CONFIG%
echo maemo:mobility_modules -= systeminfo  >> %PROJECT_CONFIG%
echo contains(mobility_modules,versit): mobility_modules *= contacts  >> %PROJECT_CONFIG%

echo Checking available Qt
%QT_PATH%qmake -v >> %PROJECT_LOG% 2>&1
if errorlevel 1 goto qmakeNotFound
goto qmakeFound
:qmakeNotFound
echo ... Not found  >> %PROJECT_LOG% 2>&1
if "%QT_PATH%" == "" (
    echo >&2Cannot find 'qmake' in your PATH.
    echo >&2Your PATH is: %PATH%
) else (
    echo >&2Cannot find 'qmake' in %QT_PATH%.
)
echo >&2 "Aborting."
goto errorTag

:qmakeFound
%QT_PATH%qmake -query QT_VERSION

goto checkMake

:makeTest
setlocal
    set CURRENT_PWD=%CD%

    if %BUILD_PATH% == %SOURCE_PATH% (
        cd %SOURCE_PATH%\config.tests\make
        if exist make del make
    ) else (
        rmdir /S /Q config.tests\make
        mkdir config.tests\make
        cd config.tests\make
    )

    for /f "tokens=3" %%i in ('%QT_PATH%qmake %SOURCE_PATH%\config.tests\make\make.pro 2^>^&1 1^>NUL') do set BUILDSYSTEM=%%i

    if %BUILDSYSTEM% == symbian-abld (
        make -h >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... Symbian abld make found.
            set MAKE=make
        )
    ) else if %BUILDSYSTEM% == symbian-sbsv2 (
        make -h >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... Symbian sbsv2 make found.
            set MAKE=make
        )
    ) else if %BUILDSYSTEM% == win32-nmake (
        nmake /? >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... nmake found.
            set MAKE=nmake
        )
    ) else if %BUILDSYSTEM% == win32-mingw (
        mingw32-make -v >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... mingw32-make found.
            set MAKE=mingw32-make
        )
    ) else (
        echo ... Unknown target environment %BUILDSYSTEM%.
    )
    cd %CURRENT_PWD%
endlocal&set %1=%MAKE%&set %2=%BUILDSYSTEM%&goto :EOF

:checkMake
echo Checking make
call :makeTest MOBILITY_MAKE MOBILITY_BUILDSYSTEM
if not "%MOBILITY_MAKE%" == "" goto compileTests

echo >&2 "Cannot find 'nmake', 'mingw32-make' or 'make' in your PATH"
echo >&2 "Aborting."
goto errorTag

:compileTest
setlocal
    echo Checking %1
    set CURRENT_PWD=%CD%

    if %BUILD_PATH% == %SOURCE_PATH% (
        cd %SOURCE_PATH%\config.tests\%2
        if exist %2 del %2
    ) else (
        rmdir /S /Q config.tests\%2
        mkdir config.tests\%2
        cd config.tests\%2
    )

    %QT_PATH%qmake %SOURCE_PATH%\config.tests\%2\%2.pro >> %PROJECT_LOG% 2>&1
    %MOBILITY_MAKE% clean >> %PROJECT_LOG% 2>&1
    %MOBILITY_MAKE% >> %PROJECT_LOG% 2>&1

    set FAILED=0
    if %MOBILITY_BUILDSYSTEM% == symbian-sbsv2 (
        for /f "tokens=2" %%i in ('%MOBILITY_MAKE% SBS^="@sbs --check"') do set FAILED=1
    ) else if %MOBILITY_BUILDSYSTEM% == symbian-abld (
        for /f "tokens=2" %%i in ('%MOBILITY_MAKE% ABLD^="@ABLD.BAT -c" 2^>^&1') do if not %%i == bldfiles set FAILED=1
    ) else if errorlevel 1 (
        set FAILED=1
    )

    if %FAILED% == 0 (
        echo ... OK
        echo %2_enabled = yes >> %PROJECT_CONFIG%
    ) else (
        echo ... Not Found
        echo %2_enabled = no >> %PROJECT_CONFIG%
    )

    cd %CURRENT_PWD%
endlocal&goto :EOF

:compileTests

echo.
echo Start of compile tests
REM compile tests go here.
call :compileTest LBT lbt
echo End of compile tests
echo.
echo.

REM we could skip generating headers if a module is not enabled
if not exist "%BUILD_PATH%\features" mkdir %BUILD_PATH%\features
echo "Generating Mobility Headers..."
rd /s /q %BUILD_PATH%\include
mkdir %BUILD_PATH%\include
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\global
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\bearer
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\publishsubscribe
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\location
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\serviceframework
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\systeminfo
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\contacts
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\multimedia
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\messaging

if exist config.pri del config.pri
ren %PROJECT_CONFIG% config.pri

echo.
echo Running qmake...
%QT_PATH%qmake -recursive %VC_TEMPLATE_OPTION% %SOURCE_PATH%\qtmobility.pro
if errorlevel 1 goto qmakeRecError
echo.
echo configure has finished. You may run %MOBILITY_MAKE% to build the project now.
goto exitTag

:qmakeRecError
echo.
echo configure failed.
goto errorTag

:errorTag
set BUILD_PATH=
set CURRENTDIR=
set MOBILITY_MAKE=
set MOBILITY_BUILDSYSTEM=
set PROJECT_CONFIG=
set PROJECT_LOG=
set QT_MOBILITY_PREFIX=
set QT_PATH=
set SOURCE_PATH=
set MOBILITY_MODULES=
set MOBILITY_MODULES_UNPARSED=
exit /b 1

:exitTag
set BUILD_PATH=
set CURRENTDIR=
set MOBILITY_MAKE=
set MOBILITY_BUILDSYSTEM=
set PROJECT_CONFIG=
set PROJECT_LOG=
set QT_MOBILITY_PREFIX=
set QT_PATH=
set SOURCE_PATH=
set MOBILITY_MODULES=
set MOBILITY_MODULES_UNPARSED=
exit /b 0

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
:: All rights reserved.
:: Contact: Nokia Corporation (qt-info@nokia.com)
::
:: This file is part of the Qt Mobility Components.
::
:: $QT_BEGIN_LICENSE:LGPL$
:: No Commercial Usage
:: This file contains pre-release code and may not be distributed.
:: You may use this file in accordance with the terms and conditions
:: contained in the Technology Preview License Agreement accompanying
:: this package.
::
:: GNU Lesser General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU Lesser
:: General Public License version 2.1 as published by the Free Software
:: Foundation and appearing in the file LICENSE.LGPL included in the
:: packaging of this file.  Please review the following information to
:: ensure the GNU Lesser General Public License version 2.1 requirements
:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
::
:: In addition, as a special exception, Nokia gives you certain additional
:: rights.  These rights are described in the Nokia Qt LGPL Exception
:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
::
:: If you have questions regarding the use of this file, please contact
:: Nokia at qt-info@nokia.com.
::
::
::
::
::
::
::
::
:: $QT_END_LICENSE$
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

@echo off

set QT_MOBILITY_PREFIX= C:\QtMobility
set BUILD_PATH=%CD%
set SOURCE_PATH= %~dp0
cd /D %SOURCE_PATH%
set SOURCE_PATH=%CD%
cd /D %BUILD_PATH%

set PROJECT_CONFIG= %BUILD_PATH%\config.in
set PROJECT_LOG= %BUILD_PATH%\config.log
set RELEASEMODE=release
set QT_MOBILITY_LIB=
set BUILD_UNITTESTS=no
set BUILD_EXAMPLES=no
set BUILD_DOCS=yes
set MOBILITY_MODULES=bearer location contacts multimedia publishsubscribe versit messaging systeminfo
set MOBILITY_MODULES_UNPARSED=
set VC_TEMPLATE_OPTION=
set QT_PATH=
set QMAKE_CACHE=%BUILD_PATH%\.qmake.cache

if exist "%QMAKE_CACHE%" del %QMAKE_CACHE%
if exist "%PROJECT_LOG%" del %PROJECT_LOG%
if exist "%PROJECT_CONFIG%" del %PROJECT_CONFIG%

echo QT_MOBILITY_SOURCE_TREE = %SOURCE_PATH% > %QMAKE_CACHE%
echo QT_MOBILITY_BUILD_TREE = %BUILD_PATH% >> %QMAKE_CACHE%
set QMAKE_CACHE=

:cmdline_parsing

if "%1" == ""               goto startProcessing
if "%1" == "-debug"         goto debugTag
if "%1" == "-release"       goto releaseTag
if "%1" == "-silent"        goto silentTag
if "%1" == "-prefix"        goto prefixTag
if "%1" == "-libdir"        goto libTag
if "%1" == "-bindir"        goto binTag
if "%1" == "-headerdir"     goto headerTag
if "%1" == "-tests"         goto testTag
if "%1" == "-examples"      goto exampleTag
if "%1" == "-qt"            goto qtTag
if "%1" == "-vc"            goto vcTag
if "%1" == "-nodocs"        goto nodocsTag
if "%1" == "-docs"          goto docsTag
if "%1" == "-modules"       goto modulesTag
if "%1" == "/?"             goto usage
if "%1" == "-h"             goto usage
if "%1" == "-help"          goto usage
if "%1" == "--help"         goto usage

echo Unknown option: "%1"
goto usage

:usage
echo Usage: configure.bat [-prefix (dir)] [headerdir (dir)] [libdir (dir)]
    echo                  [-bindir (dir)] [-tests] [-examples]
    echo                  [-debug] [-release] [-silent]
    echo.
    echo Options:
    echo.
    echo -prefix (dir) ..... This will install everything relative to dir
    echo                     (default prefix: C:\QtMobility)
    echo -headerdir (dir) .. Header files will be installed to dir
    echo                     (default prefix: PREFIX/include)
    echo -libdir (dir) ..... Libraries will be installed to dir
    echo                     (default PREFIX/lib)
    echo -bindir (dir) ..... Executables will be installed to dir
    echo                     (default PREFIX/bin)
    echo -debug ............ Build with debugging symbols
    echo -release .......... Build without debugging symbols
    echo -silent ........... Reduces build output
    echo -tests ............ Build unit tests (not build by default)
    echo                     Note, this adds test symbols to all libraries
    echo                     and should not be used for release builds.
    echo -examples ......... Build example applications
    echo -nodocs ........... Do not build documentation
    echo -docs ............. Build documentation (default)
    echo -modules ^<list^> ... Build only the specified modules (default all)
    echo                     Choose from: bearer location publishsubscribe location
    echo                     multimedia contacts versit messaging systeminfo
    echo                     Modules should be separated by a space. If a
    echo                     selected module depends on other modules they
    echo                     will automatically be enabled.
    echo -vc ............... Generate Visual Studio make files

if exist "%PROJECT_CONFIG%" del %PROJECT_CONFIG%
goto exitTag

:qtTag
shift
set QT_PATH=%1\
shift
goto cmdline_parsing

:debugTag
if "%RELEASEMODE%" == "release" set RELEASEMODE=debug
shift
goto cmdline_parsing

:releaseTag
if "%RELEASEMODE%" == "debug"   set RELEASEMODE=release
shift
goto cmdline_parsing

:silentTag
echo CONFIG += silent > %PROJECT_CONFIG%
shift
goto cmdline_parsing

:prefixTag
shift
set QT_MOBILITY_PREFIX=%1
shift
goto cmdline_parsing

:libTag
shift
echo QT_MOBILITY_LIB = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:binTag
shift
echo QT_MOBILITY_BIN = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:headerTag
shift
echo QT_MOBILITY_INCLUDE = %1 >> %PROJECT_CONFIG%
shift
goto cmdline_parsing

:testTag
set BUILD_UNITTESTS=yes
shift
goto cmdline_parsing

:exampleTag
set BUILD_EXAMPLES=yes
shift
goto cmdline_parsing

:vcTag
shift
set VC_TEMPLATE_OPTION=-tp vc
goto cmdline_parsing

:docsTag
set BUILD_DOCS=yes
shift
goto cmdline_parsing

:nodocsTag
set BUILD_DOCS=no
shift
goto cmdline_parsing

:modulesTag
shift
if "%1" == "" (
    echo. >&2
    echo >&2The -modules option requires a list of modules.
    echo. >&2
    goto usage
)
set MOBILITY_MODULES_UNPARSED=%1
shift
goto cmdline_parsing

:startProcessing

echo CONFIG += %RELEASEMODE% >> %PROJECT_CONFIG%
set RELEASEMODE=

set CURRENTDIR=%CD%
echo %CURRENTDIR%
if exist %QT_MOBILITY_PREFIX% goto prefixExists
mkdir %QT_MOBILITY_PREFIX%
if errorlevel 1 goto invalidPrefix
cd /D %QT_MOBILITY_PREFIX%
set QT_MOBILITY_PREFIX=%CD%
cd /D %CURRENTDIR%
rd /S /Q %QT_MOBILITY_PREFIX%
goto endprefixProcessing

:invalidPrefix
echo "%QT_MOBILITY_PREFIX%" is not a valid directory path.
goto :exitTag

:prefixExists
cd /D %QT_MOBILITY_PREFIX%
set QT_MOBILITY_PREFIX=%CD%
cd /D %CURRENTDIR%

:endprefixProcessing
echo QT_MOBILITY_PREFIX = %QT_MOBILITY_PREFIX% >> %PROJECT_CONFIG%

echo build_unit_tests = %BUILD_UNITTESTS% >> %PROJECT_CONFIG%
set BUILD_UNITTESTS=

echo build_examples = %BUILD_EXAMPLES% >> %PROJECT_CONFIG%
set BUILD_EXAMPLES=

echo build_docs = %BUILD_DOCS% >> %PROJECT_CONFIG%
set BUILD_DOCS=

echo qmf_enabled = no >> %PROJECT_CONFIG%

echo isEmpty($$QT_MOBILITY_INCLUDE):QT_MOBILITY_INCLUDE=$$QT_MOBILITY_PREFIX/include >> %PROJECT_CONFIG%
echo isEmpty($$QT_MOBILITY_LIB):QT_MOBILITY_LIB=$$QT_MOBILITY_PREFIX/lib >> %PROJECT_CONFIG%
echo isEmpty($$QT_MOBILITY_BIN):QT_MOBILITY_BIN=$$QT_MOBILITY_PREFIX/bin >> %PROJECT_CONFIG%

REM now the modules
if not "%MOBILITY_MODULES_UNPARSED%" == "" (
    REM error checking would be nice (e.g. for %%m in (%MOBILITY_MODULES) ... , with an "if" switch like the cmdline arg parsing
    set MOBILITY_MODULES=%MOBILITY_MODULES_UNPARSED%
)

echo mobility_modules = %MOBILITY_MODULES%  >> %PROJECT_CONFIG%
echo maemo:mobility_modules -= systeminfo  >> %PROJECT_CONFIG%
echo contains(mobility_modules,versit): mobility_modules *= contacts  >> %PROJECT_CONFIG%

echo Checking available Qt
%QT_PATH%qmake -v >> %PROJECT_LOG% 2>&1
if errorlevel 1 goto qmakeNotFound
goto qmakeFound
:qmakeNotFound
echo ... Not found  >> %PROJECT_LOG% 2>&1
if "%QT_PATH%" == "" (
    echo >&2Cannot find 'qmake' in your PATH.
    echo >&2Your PATH is: %PATH%
) else (
    echo >&2Cannot find 'qmake' in %QT_PATH%.
)
echo >&2Aborting.
goto errorTag

:qmakeFound
%QT_PATH%qmake -query QT_VERSION

goto checkMake

:makeTest
setlocal
    set CURRENT_PWD=%CD%

    if %BUILD_PATH% == %SOURCE_PATH% (
        cd %SOURCE_PATH%\config.tests\make
        if exist make del make
    ) else (
        rmdir /S /Q config.tests\make
        mkdir config.tests\make
        cd config.tests\make
    )

    for /f "tokens=3" %%i in ('%QT_PATH%qmake %SOURCE_PATH%\config.tests\make\make.pro 2^>^&1 1^>NUL') do set BUILDSYSTEM=%%i

    if %BUILDSYSTEM% == symbian-abld (
        make -h >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... Symbian abld make found.
            set MAKE=make
        )
    ) else if %BUILDSYSTEM% == symbian-sbsv2 (
        make -h >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... Symbian sbsv2 make found.
            set MAKE=make
        )
    ) else if %BUILDSYSTEM% == win32-nmake (
        nmake /? >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... nmake found.
            set MAKE=nmake
        )
    ) else if %BUILDSYSTEM% == win32-mingw (
        mingw32-make -v >> %PROJECT_LOG% 2>&1
        if not errorlevel 1 (
            echo ... mingw32-make found.
            set MAKE=mingw32-make
        )
    ) else (
        echo ... Unknown target environment %BUILDSYSTEM%.
    )
    cd %CURRENT_PWD%
endlocal&set %1=%MAKE%&set %2=%BUILDSYSTEM%&goto :EOF

:checkMake
echo Checking make
call :makeTest MOBILITY_MAKE MOBILITY_BUILDSYSTEM
if not "%MOBILITY_MAKE%" == "" goto compileTests

echo >&2Cannot find 'nmake', 'mingw32-make' or 'make' in your PATH
echo >&2Aborting.
goto errorTag

:compileTest
setlocal
    echo Checking %1
    set CURRENT_PWD=%CD%

    if %BUILD_PATH% == %SOURCE_PATH% (
        cd %SOURCE_PATH%\config.tests\%2
        if exist %2 del %2
    ) else (
        rmdir /S /Q config.tests\%2
        mkdir config.tests\%2
        cd config.tests\%2
    )

    %QT_PATH%qmake %SOURCE_PATH%\config.tests\%2\%2.pro >> %PROJECT_LOG% 2>&1
    %MOBILITY_MAKE% clean >> %PROJECT_LOG% 2>&1
    %MOBILITY_MAKE% >> %PROJECT_LOG% 2>&1

    set FAILED=0
    if %MOBILITY_BUILDSYSTEM% == symbian-sbsv2 (
        for /f "tokens=2" %%i in ('%MOBILITY_MAKE% SBS^="@sbs --check"') do set FAILED=1
    ) else if %MOBILITY_BUILDSYSTEM% == symbian-abld (
        for /f "tokens=2" %%i in ('%MOBILITY_MAKE% ABLD^="@ABLD.BAT -c" 2^>^&1') do if not %%i == bldfiles set FAILED=1
    ) else if errorlevel 1 (
        set FAILED=1
    )

    if %FAILED% == 0 (
        echo ... OK
        echo %2_enabled = yes >> %PROJECT_CONFIG%
    ) else (
        echo ... Not Found
        echo %2_enabled = no >> %PROJECT_CONFIG%
    )

    cd %CURRENT_PWD%
endlocal&goto :EOF

:compileTests

echo.
echo Start of compile tests
REM compile tests go here.
call :compileTest LBT lbt
echo End of compile tests
echo.
echo.

REM we could skip generating headers if a module is not enabled
if not exist "%BUILD_PATH%\features" mkdir %BUILD_PATH%\features
echo Generating Mobility Headers...
rd /s /q %BUILD_PATH%\include
mkdir %BUILD_PATH%\include
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\global
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\bearer
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\publishsubscribe
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\location
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\serviceframework
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\systeminfo
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\contacts
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\multimedia
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\messaging

if exist config.pri del config.pri
ren %PROJECT_CONFIG% config.pri

echo.
echo Running qmake...
%QT_PATH%qmake -recursive %VC_TEMPLATE_OPTION% %SOURCE_PATH%\qtmobility.pro
if errorlevel 1 goto qmakeRecError
echo.
echo configure has finished. You may run %MOBILITY_MAKE% to build the project now.
goto exitTag

:qmakeRecError
echo.
echo configure failed.
goto errorTag

:errorTag
set BUILD_PATH=
set CURRENTDIR=
set MOBILITY_MAKE=
set MOBILITY_BUILDSYSTEM=
set PROJECT_CONFIG=
set PROJECT_LOG=
set QT_MOBILITY_PREFIX=
set QT_PATH=
set SOURCE_PATH=
set MOBILITY_MODULES=
set MOBILITY_MODULES_UNPARSED=
exit /b 1

:exitTag
set BUILD_PATH=
set CURRENTDIR=
set MOBILITY_MAKE=
set MOBILITY_BUILDSYSTEM=
set PROJECT_CONFIG=
set PROJECT_LOG=
set QT_MOBILITY_PREFIX=
set QT_PATH=
set SOURCE_PATH=
set MOBILITY_MODULES=
set MOBILITY_MODULES_UNPARSED=
exit /b 0

Remove extra quotes and spaces in some echo lines.

Unneeded and unwanted.
(cherry picked from commit b3cb68d8469a42f3fe82a9242d2d53e1672e8750)


call lein uberjar
halite -d "240 160" "java -jar target/MyBot.jar" "java -jar target/MyBot.jar"

update clojure run_game.bat to call lein

Windows by default transfers execution to a called bat file and does not
return control back when that bat file completes.  Added the call
command to the first line of the bat file so that the second line call
to halite.exe will be executed.