set CFG=%USERPROFILE%\pydistutils.cfg
echo [config] > "%CFG%"
echo compiler=mingw32 >> "%CFG%"
echo [build] >> "%CFG%"
echo compiler=mingw32 >> "%CFG%"
echo [build_ext] >> "%CFG%"
echo compiler=mingw32 >> "%CFG%"

"%PYTHON%" setup.py install --single-version-externally-managed --record=record.txt
if errorlevel 1 exit 1

set CFG=%USERPROFILE%\pydistutils.cfg
echo [config] > "%CFG%"
echo compiler=mingw32 >> "%CFG%"
echo [build] >> "%CFG%"
echo compiler=mingw32 >> "%CFG%"
echo [build_ext] >> "%CFG%"
echo compiler=mingw32 >> "%CFG%"

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

Switch all recipes to pip install instead of setup.py install

(This has nothing to do with land surface modeling)


@echo off
setlocal

if "%1"=="/?" (
    goto usage
) else if "%1"=="" (
    set _bootimage_version=latest
) else if "%1"=="latest" (
    set _bootimage_version=latest
) else if "%1"=="clean" (
    set _bootimage_version=clean
) else goto usage

if not exist Nmakefile goto wrongdir

call cl 2>&1 | find "x86" >nul
if not errorlevel 1 (
    echo x86-32 cl.exe detected.
    set _target=x86-32
    set _bootimage=boot.windows-x86.32.image
) else (
    call cl 2>&1 | find "x64" >nul
    if not errorlevel 1 (
        echo x86-64 cl.exe detected.
        set _target=x86-64
        set _bootimage=boot.windows-x86.64.image
    ) else goto nocl
)

if %_bootimage_version%==clean (
    set _git_branch=clean-windows-%_target%
    set _bootimage_path=clean/windows-%_target%
) else (
    set _git_branch=master
    set _bootimage_path=latest
)

echo Updating working copy from %_git_branch%...
call git pull http://factorcode.org/git/factor.git %_git_branch%
if errorlevel 1 goto fail

echo Building vm...
nmake /nologo /f Nmakefile clean
if errorlevel 1 goto fail
nmake /nologo /f Nmakefile %_target%
if errorlevel 1 goto fail

echo Fetching %_bootimage_version% boot image...
cscript /nologo build-support\http-get.vbs http://downloads.factorcode.org/images/%_bootimage_path%/%_bootimage% %_bootimage%
if errorlevel 1 goto fail

echo Bootstrapping...
.\factor.com -i=%_bootimage%
if errorlevel 1 goto fail

echo Copying fresh factor.image to factor.image.fresh.
copy factor.image factor.image.fresh
if errorlevel 1 goto fail

echo Build complete.
goto :EOF

:fail
echo Build failed.
goto :EOF

:wrongdir
echo build-support\factor.cmd must be run from the root of the Factor source tree.
goto :EOF

:nocl
echo Unable to detect cl.exe target platform.
echo Make sure you're running within the Visual Studio or Windows SDK environment.
goto :EOF

:usage
echo Usage: build-support\factor.cmd [latest/clean]
echo     Updates the working copy, cleans and builds the vm using nmake,
echo     fetches a boot image, and bootstraps factor.
echo     If latest is specified, then the working copy is updated to the
echo     upstream "master" branch and the boot image corresponding to the
echo     most recent factor build is downloaded. This is the default.
echo     If clean is specified, then the working copy is updated to the
echo     upstream "clean-windows-*" branch corresponding to the current
echo     platform and the corresponding boot image is downloaded.
goto :EOF

@echo off
setlocal

if "%1"=="/?" (
    goto usage
) else if "%1"=="" (
    set _bootimage_version=latest
) else if "%1"=="latest" (
    set _bootimage_version=latest
) else if "%1"=="clean" (
    set _bootimage_version=clean
) else goto usage

if not exist Nmakefile goto wrongdir

call cl 2>&1 | find "x86" >nul
if not errorlevel 1 (
    echo x86-32 cl.exe detected.
    set _target=x86-32
    set _bootimage=boot.windows-x86.32.image
) else (
    call cl 2>&1 | find "x64" >nul
    if not errorlevel 1 (
        echo x86-64 cl.exe detected.
        set _target=x86-64
        set _bootimage=boot.windows-x86.64.image
    ) else goto nocl
)

if %_bootimage_version%==clean (
    set _git_branch=clean-windows-%_target%
    set _bootimage_path=clean/windows-%_target%
) else (
    set _git_branch=master
    set _bootimage_path=latest
)

echo Deleting staging images from temp/...
del temp\staging.*.image
if errorlevel 1 goto fail

echo Updating working copy from %_git_branch%...
call git pull http://factorcode.org/git/factor.git %_git_branch%
if errorlevel 1 goto fail

echo Building vm...
nmake /nologo /f Nmakefile clean
if errorlevel 1 goto fail
nmake /nologo /f Nmakefile %_target%
if errorlevel 1 goto fail

echo Fetching %_bootimage_version% boot image...
cscript /nologo build-support\http-get.vbs http://downloads.factorcode.org/images/%_bootimage_path%/%_bootimage% %_bootimage%
if errorlevel 1 goto fail

echo Bootstrapping...
.\factor.com -i=%_bootimage%
if errorlevel 1 goto fail

echo Copying fresh factor.image to factor.image.fresh.
copy factor.image factor.image.fresh
if errorlevel 1 goto fail

echo Build complete.
goto :EOF

:fail
echo Build failed.
goto :EOF

:wrongdir
echo build-support\factor.cmd must be run from the root of the Factor source tree.
goto :EOF

:nocl
echo Unable to detect cl.exe target platform.
echo Make sure you're running within the Visual Studio or Windows SDK environment.
goto :EOF

:usage
echo Usage: build-support\factor.cmd [latest/clean]
echo     Updates the working copy, cleans and builds the vm using nmake,
echo     fetches a boot image, and bootstraps factor.
echo     If latest is specified, then the working copy is updated to the
echo     upstream "master" branch and the boot image corresponding to the
echo     most recent factor build is downloaded. This is the default.
echo     If clean is specified, then the working copy is updated to the
echo     upstream "clean-windows-*" branch corresponding to the current
echo     platform and the corresponding boot image is downloaded.
goto :EOF

Delete staging images when running factor.cmd. Fixes #104.


cd %APPVEYOR_BUILD_FOLDER%
:: Download and compile Lua
appveyor DownloadFile %LUAURL%/lua-%LUA_VER%.tar.gz
7z x lua-%LUA_VER%.tar.gz
7z x lua-%LUA_VER%.tar
cd lua-%LUA_VER%
appveyor DownloadFile https://github.com/Tieske/luawinmake/archive/master.zip
7z x master.zip
if not exist etc mkdir etc
mv luawinmake-master\etc\winmake.bat %APPVEYOR_BUILD_FOLDER%\lua-%LUA_VER%\etc\winmake.bat
call etc\winmake.bat
call etc\winmake.bat install c:\lua%LUA_VER%
:: defines LUA_DIR so Cmake can find this Lua install
set LUA_DIR=c:\lua%LUA_VER%
set PATH=%PATH%;c:\lua%LUA_VER%\bin
lua -v
:: Downloads and installs LuaRocks
cd %APPVEYOR_BUILD_FOLDER%
appveyor DownloadFile %LUAROCKS_URL%/luarocks-%LUAROCKS_VER%-win32.zip
7z x luarocks-%LUAROCKS_VER%-win32.zip
cd luarocks-%LUAROCKS_VER%-win32
call install.bat /LUA c:\lua%LUA_VER% /Q /LV %LUA_SHORTV%
set PATH=%PATH%;%ProgramFiles(x86)%\LuaRocks\%LUAROCKS_SHORTV%\
set LUA_PATH=%ProgramFiles(x86)%\LuaRocks\%LUAROCKS_SHORTV%\lua\?.lua;%ProgramFiles(x86)%\LuaRocks\%LUAROCKS_SHORTV%\lua\?\init.lua;%ProgramFiles(x86)%\LuaRocks\systree\share\lua\%LUA_SHORTV%\?.lua;%ProgramFiles(x86)%\LuaRocks\systree\share\lua\%LUA_SHORTV%\?\init.lua
set LUA_CPATH=%ProgramFiles(x86)%\LuaRocks\systree\lib\lua\%LUA_SHORTV%\?.dll
luarocks --version
:: Install lunitx
luarocks install lunitx

cd %APPVEYOR_BUILD_FOLDER%
:: Download and compile Lua
appveyor DownloadFile %LUAURL%/lua-%LUA_VER%.tar.gz
7z x lua-%LUA_VER%.tar.gz
7z x lua-%LUA_VER%.tar
cd lua-%LUA_VER%
appveyor DownloadFile https://github.com/Tieske/luawinmake/archive/master.zip
7z x master.zip
if not exist etc mkdir etc
mv luawinmake-master\etc\winmake.bat %APPVEYOR_BUILD_FOLDER%\lua-%LUA_VER%\etc\winmake.bat
call etc\winmake.bat
call etc\winmake.bat install c:\lua%LUA_VER%
:: defines LUA_DIR so Cmake can find this Lua install
set LUA_DIR=c:\lua%LUA_VER%
set PATH=%PATH%;c:\lua%LUA_VER%\bin
lua -v
:: Downloads and installs LuaRocks
cd %APPVEYOR_BUILD_FOLDER%
appveyor DownloadFile %LUAROCKS_URL%/luarocks-%LUAROCKS_VER%-win32.zip
7z x luarocks-%LUAROCKS_VER%-win32.zip
cd luarocks-%LUAROCKS_VER%-win32
call install.bat /LUA c:\lua%LUA_VER% /Q /LV %LUA_SHORTV%
set PATH=%PATH%;%ProgramFiles(x86)%\LuaRocks\%LUAROCKS_SHORTV%\
set LUA_PATH=%ProgramFiles(x86)%\LuaRocks\%LUAROCKS_SHORTV%\lua\?.lua;%ProgramFiles(x86)%\LuaRocks\%LUAROCKS_SHORTV%\lua\?\init.lua;%ProgramFiles(x86)%\LuaRocks\systree\share\lua\%LUA_SHORTV%\?.lua;%ProgramFiles(x86)%\LuaRocks\systree\share\lua\%LUA_SHORTV%\?\init.lua
set LUA_CPATH=%ProgramFiles(x86)%\LuaRocks\systree\lib\lua\%LUA_SHORTV%\?.dll
call luarocks --version
:: Install lunitx
luarocks install lunitx

work 7

work 7


@echo off

cd %APPVEYOR_BUILD_FOLDER%

:: =========================================================
:: Set some defaults. Infer some variables.
::
:: These are set globally
if "%LUA_VER%" NEQ "" (
	set LUA=lua
	set LUA_SHORTV=%LUA_VER:~0,3%
) else (
	set LUA=luajit
	set LJ_SHORTV=%LJ_VER:~0,3%
	set LUA_SHORTV=5.1
)

:: defines LUA_DIR so Cmake can find this Lua install
if "%LUA%"=="luajit" (
	set LUA_DIR=c:\lua\%platform%\lj%LJ_SHORTV%
) else (
	set LUA_DIR=c:\lua\%platform%\%LUA_VER%
)

:: Now we declare a scope
Setlocal EnableDelayedExpansion EnableExtensions

if "%LUAROCKS_VER%" NEQ "HEAD" (
	set LUAROCKS_SHORTV=%LUAROCKS_VER:~0,3%
) else (
	:: Assume 2.2 for the time being. TODO: fix this
	set LUAROCKS_SHORTV=2.2
)

if not defined LUAROCKS_URL set LUAROCKS_URL=http://keplerproject.github.io/luarocks/releases
if not defined LUAROCKS_REPO set LUAROCKS_REPO=https://luarocks.org
if not defined LUA_URL set LUA_URL=http://www.lua.org/ftp
if defined NOCOMPAT (
	set COMPATFLAG=--nocompat
) else (
	set COMPATFLAG=
)
if not defined LUAJIT_GIT_REPO set LUAJIT_GIT_REPO=http://luajit.org/git/luajit-2.0.git
if not defined LUAJIT_URL set LUAJIT_URL=http://luajit.org/download

if not defined LR_EXTERNAL set LR_EXTERNAL=c:\external
if not defined LUAROCKS_INSTALL set LUAROCKS_INSTALL=%LUA_DIR%\LuaRocks
if not defined LR_ROOT set LR_ROOT=%LUAROCKS_INSTALL%\%LUAROCKS_SHORTV%
if not defined LR_SYSTREE set LR_SYSTREE=%LUAROCKS_INSTALL%\systree

if not defined SEVENZIP set SEVENZIP=7z
::
:: =========================================================

:: first create some necessary directories:
mkdir downloads 2>NUL

:: Download and compile Lua (or LuaJIT)
if "%LUA%"=="luajit" (
	if not exist %LUA_DIR% (
		if "%LJ_SHORTV%"=="2.1" (
			:: Clone repository and checkout 2.1 branch
			set lj_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luajit-%LJ_VER%
			if not exist !lj_source_folder! (
				echo Cloning git repo %LUAJIT_GIT_REPO% !lj_source_folder!
				git clone %LUAJIT_GIT_REPO% !lj_source_folder! || call :die "Failed to clone repository"
			) else (
				cd !lj_source_folder!
				git pull || call :die "Failed to update repository"
			)
			cd !lj_source_folder!\src
			git checkout v2.1 || call :die
		) else (
			set lj_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luajit-%LJ_VER%
			if not exist !lj_source_folder! (
				echo Downloading... %LUAJIT_URL%/LuaJIT-%LJ_VER%.tar.gz
				curl --silent --fail --max-time 120 --connect-timeout 30 %LUAJIT_URL%/LuaJIT-%LJ_VER%.tar.gz | %SEVENZIP% x -si -so -tgzip | %SEVENZIP% x -si -ttar -aoa -odownloads
			)
			cd !lj_source_folder!\src
		)
		:: Compiles LuaJIT
		if "%Configuration%"=="MinGW" (
			call mingw32-make
		) else (
			call msvcbuild.bat
		)

		mkdir %LUA_DIR% 2> NUL
		for %%a in (bin bin\lua bin\lua\jit include lib) do ( mkdir "%LUA_DIR%\%%a" )

		for %%a in (luajit.exe lua51.dll) do ( move "!lj_source_folder!\src\%%a" "%LUA_DIR%\bin" )
		copy "%LUA_DIR%\bin\luajit.exe" "%LUA_DIR%\bin\lua.exe"

		move "!lj_source_folder!\src\lua51.lib" "%LUA_DIR%\lib"
		for %%a in (lauxlib.h lua.h lua.hpp luaconf.h lualib.h luajit.h) do (
			copy "!lj_source_folder!\src\%%a" "%LUA_DIR%\include"
		)

		copy "!lj_source_folder!\src\jit\*.lua" "%LUA_DIR%\bin\lua\jit"

	) else (
		echo LuaJIT %LJ_VER% already installed at %LUA_DIR%
	)
) else (
	if not exist %LUA_DIR% (
		:: Download and compile Lua
		if not exist downloads\lua-%LUA_VER% (
			curl --silent --fail --max-time 120 --connect-timeout 30 %LUA_URL%/lua-%LUA_VER%.tar.gz | %SEVENZIP% x -si -so -tgzip | %SEVENZIP% x -si -ttar -aoa -odownloads
		)

		mkdir downloads\lua-%LUA_VER%\etc 2> NUL
		copy %~dp0\winmake.bat downloads\lua-%LUA_VER%\etc\winmake.bat

		cd downloads\lua-%LUA_VER%
		call etc\winmake %COMPATFLAG%
		call etc\winmake install %LUA_DIR%
	) else (
		echo Lua %LUA_VER% already installed at %LUA_DIR%
	)
)

if not exist %LUA_DIR%\bin\%LUA%.exe call :die "Missing Lua interpreter at %LUA_DIR%\bin\%LUA%.exe"

set PATH=%LUA_DIR%\bin;%PATH%
call !LUA! -v

:: ==========================================================
:: LuaRocks
:: ==========================================================

if not exist "%LR_ROOT%" (
	:: Downloads and installs LuaRocks
	cd %APPVEYOR_BUILD_FOLDER%

	if %LUAROCKS_VER%==HEAD (
		set lr_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luarocks-%LUAROCKS_VER%-win32
		if not exist !lr_source_folder! (
			git clone https://github.com/keplerproject/luarocks.git --single-branch --depth 1 !lr_source_folder! || call :die "Failed to clone LuaRocks repository"
		) else (
			cd !lr_source_folder!
			git pull || call :die "Failed to update LuaRocks repository"
		)
	) else (
		if not exist downloads\luarocks-%LUAROCKS_VER%-win32.zip (
			echo Downloading LuaRocks...
			curl --silent --fail --max-time 120 --connect-timeout 30 --output downloads\luarocks-%LUAROCKS_VER%-win32.zip %LUAROCKS_URL%/luarocks-%LUAROCKS_VER%-win32.zip
			%SEVENZIP% x -aoa -odownloads downloads\luarocks-%LUAROCKS_VER%-win32.zip
		)
	)

	cd downloads\luarocks-%LUAROCKS_VER%-win32
	if "%Configuration%"=="MinGW" (
		call install.bat /LUA %LUA_DIR% /Q /LV %LUA_SHORTV% /P "%LUAROCKS_INSTALL%" /TREE "%LR_SYSTREE%" /MW
	) else (
		call install.bat /LUA %LUA_DIR% /Q /LV %LUA_SHORTV% /P "%LUAROCKS_INSTALL%" /TREE "%LR_SYSTREE%"
	)
)

if not exist "%LR_ROOT%" call :die "LuaRocks not found at %LR_ROOT%"

set PATH=%LR_ROOT%;%LR_SYSTREE%\bin;%PATH%

:: Lua will use just the system rocks
set LUA_PATH=%LR_ROOT%\lua\?.lua;%LR_ROOT%\lua\?\init.lua
set LUA_PATH=%LUA_PATH%;%LR_SYSTREE%\share\lua\%LUA_SHORTV%\?.lua
set LUA_PATH=%LUA_PATH%;%LR_SYSTREE%\share\lua\%LUA_SHORTV%\?\init.lua
set LUA_PATH=%LUA_PATH%;.\?.lua;.\?\init.lua
set LUA_CPATH=%LR_SYSTREE%\lib\lua\%LUA_SHORTV%\?.dll;.\?.dll

call luarocks --version || call :die "Error with LuaRocks installation"
call luarocks list

if not exist "%LR_EXTERNAL%" (
	mkdir "%LR_EXTERNAL%"
	mkdir "%LR_EXTERNAL%\lib"
	mkdir "%LR_EXTERNAL%\include"
)

set PATH=%LR_EXTERNAL%;%PATH%

:: Exports the following variables:
:: (beware of whitespace between & and ^ below)
endlocal & set PATH=%PATH%&^
set LR_SYSTREE=%LR_SYSTREE%&^
set LUA_PATH=%LUA_PATH%&^
set LUA_CPATH=%LUA_CPATH%&^
set LR_EXTERNAL=%LR_EXTERNAL%

echo.
echo ======================================================
if "%LUA%"=="luajit" (
	echo Installation of LuaJIT %LJ_VER% and LuaRocks %LUAROCKS_VER% done.
) else (
	echo Installation of Lua %LUA_VER% and LuaRocks %LUAROCKS_VER% done.
	if defined NOCOMPAT echo Lua was built with compatibility flags disabled.
)
echo Platform         - %platform%
echo LUA              - %LUA%
echo LUA_SHORTV       - %LUA_SHORTV%
echo LJ_SHORTV        - %LJ_SHORTV%
echo LUA_PATH         - %LUA_PATH%
echo LUA_CPATH        - %LUA_CPATH%
echo.
echo LR_EXTERNAL      - %LR_EXTERNAL%
echo ======================================================
echo.

goto :eof

:: This blank space is intentional. If you see errors like "The system cannot find the batch label specified 'foo'"
:: then try adding or removing blank lines lines above.
:: Yes, really.
:: http://stackoverflow.com/questions/232651/why-the-system-cannot-find-the-batch-label-specified-is-thrown-even-if-label-e

:: helper functions:

:: for bailing out when an error occurred
:die %1
echo %1
exit /B 1
goto :eof

@echo off

cd %APPVEYOR_BUILD_FOLDER%

:: =========================================================
:: Set some defaults. Infer some variables.
::
:: These are set globally
if "%LUA_VER%" NEQ "" (
	set LUA=lua
	set LUA_SHORTV=%LUA_VER:~0,3%
) else (
	set LUA=luajit
	set LJ_SHORTV=%LJ_VER:~0,3%
	set LUA_SHORTV=5.1
)

:: defines LUA_DIR so Cmake can find this Lua install
if "%LUA%"=="luajit" (
	set LUA_DIR=c:\lua\%platform%\lj%LJ_SHORTV%
) else (
	set LUA_DIR=c:\lua\%platform%\%LUA_VER%
)

:: Now we declare a scope
Setlocal EnableDelayedExpansion EnableExtensions

if "%LUAROCKS_VER%" NEQ "HEAD" (
	set LUAROCKS_SHORTV=%LUAROCKS_VER:~0,3%
) else (
	:: Assume 2.2 for the time being. TODO: fix this
	set LUAROCKS_SHORTV=2.2
)

if not defined LUAROCKS_URL set LUAROCKS_URL=http://keplerproject.github.io/luarocks/releases
if not defined LUAROCKS_REPO set LUAROCKS_REPO=https://luarocks.org
if not defined LUA_URL set LUA_URL=http://www.lua.org/ftp
if defined NOCOMPAT (
	set COMPATFLAG=--nocompat
) else (
	set COMPATFLAG=
)
if not defined LUAJIT_GIT_REPO set LUAJIT_GIT_REPO=http://luajit.org/git/luajit-2.0.git
if not defined LUAJIT_URL set LUAJIT_URL=http://luajit.org/download

if not defined LR_EXTERNAL set LR_EXTERNAL=c:\external
if not defined LUAROCKS_INSTALL set LUAROCKS_INSTALL=%LUA_DIR%\LuaRocks
if not defined LR_ROOT set LR_ROOT=%LUAROCKS_INSTALL%\%LUAROCKS_SHORTV%
if not defined LR_SYSTREE set LR_SYSTREE=%LUAROCKS_INSTALL%\systree

if not defined SEVENZIP set SEVENZIP=7z
::
:: =========================================================

:: first create some necessary directories:
mkdir downloads 2>NUL

:: Download and compile Lua (or LuaJIT)
if "%LUA%"=="luajit" (
	if not exist %LUA_DIR% (
		if "%LJ_SHORTV%"=="2.1" (
			:: Clone repository and checkout 2.1 branch
			set lj_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luajit-%LJ_VER%
			if not exist !lj_source_folder! (
				echo Cloning git repo %LUAJIT_GIT_REPO% !lj_source_folder!
				git clone %LUAJIT_GIT_REPO% !lj_source_folder! || call :die "Failed to clone repository"
			) else (
				cd !lj_source_folder!
				git pull || call :die "Failed to update repository"
			)
			cd !lj_source_folder!\src
			git checkout v2.1 || call :die
		) else (
			set lj_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luajit-%LJ_VER%
			if not exist !lj_source_folder! (
				echo Downloading... %LUAJIT_URL%/LuaJIT-%LJ_VER%.tar.gz
				curl --silent --fail --max-time 120 --connect-timeout 30 %LUAJIT_URL%/LuaJIT-%LJ_VER%.tar.gz | %SEVENZIP% x -si -so -tgzip | %SEVENZIP% x -si -ttar -aoa -odownloads
			)
			cd !lj_source_folder!\src
		)
		:: Compiles LuaJIT
		if "%Configuration%"=="MinGW" (
			call mingw32-make
		) else (
			call msvcbuild.bat
		)

		mkdir %LUA_DIR% 2> NUL
		for %%a in (bin bin\lua bin\lua\jit include lib) do ( mkdir "%LUA_DIR%\%%a" )

		for %%a in (luajit.exe lua51.dll) do ( move "!lj_source_folder!\src\%%a" "%LUA_DIR%\bin" )
		copy "%LUA_DIR%\bin\luajit.exe" "%LUA_DIR%\bin\lua.exe"

		move "!lj_source_folder!\src\lua51.lib" "%LUA_DIR%\lib"
		for %%a in (lauxlib.h lua.h lua.hpp luaconf.h lualib.h luajit.h) do (
			copy "!lj_source_folder!\src\%%a" "%LUA_DIR%\include"
		)

		copy "!lj_source_folder!\src\jit\*.lua" "%LUA_DIR%\bin\lua\jit"

	) else (
		echo LuaJIT %LJ_VER% already installed at %LUA_DIR%
	)
) else (
	if not exist %LUA_DIR% (
		:: Download and compile Lua
		if not exist downloads\lua-%LUA_VER% (
			curl --silent --fail --max-time 120 --connect-timeout 30 %LUA_URL%/lua-%LUA_VER%.tar.gz | %SEVENZIP% x -si -so -tgzip | %SEVENZIP% x -si -ttar -aoa -odownloads
		)

		mkdir downloads\lua-%LUA_VER%\etc 2> NUL
		copy %~dp0\winmake.bat downloads\lua-%LUA_VER%\etc\winmake.bat

		cd downloads\lua-%LUA_VER%
		call etc\winmake %COMPATFLAG%
		call etc\winmake install %LUA_DIR%
	) else (
		echo Lua %LUA_VER% already installed at %LUA_DIR%
	)
)

if not exist %LUA_DIR%\bin\%LUA%.exe call :die "Missing Lua interpreter at %LUA_DIR%\bin\%LUA%.exe"

set PATH=%LUA_DIR%\bin;%PATH%
call !LUA! -v

:: ==========================================================
:: LuaRocks
:: ==========================================================

if not exist "%LR_ROOT%" (
	:: Downloads and installs LuaRocks
	cd %APPVEYOR_BUILD_FOLDER%

	if %LUAROCKS_VER%==HEAD (
		set lr_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luarocks-%LUAROCKS_VER%-win32
		if not exist !lr_source_folder! (
			git clone https://github.com/keplerproject/luarocks.git --single-branch --depth 1 !lr_source_folder! || call :die "Failed to clone LuaRocks repository"
		) else (
			cd !lr_source_folder!
			git pull || call :die "Failed to update LuaRocks repository"
		)
	) else (
		if not exist downloads\luarocks-%LUAROCKS_VER%-win32.zip (
			echo Downloading LuaRocks...
			curl --silent --fail --max-time 120 --connect-timeout 30 --output downloads\luarocks-%LUAROCKS_VER%-win32.zip %LUAROCKS_URL%/luarocks-%LUAROCKS_VER%-win32.zip
			%SEVENZIP% x -aoa -odownloads downloads\luarocks-%LUAROCKS_VER%-win32.zip
		)
	)

	cd downloads\luarocks-%LUAROCKS_VER%-win32
	if "%Configuration%"=="MinGW" (
		call install.bat /LUA %LUA_DIR% /Q /LV %LUA_SHORTV% /P "%LUAROCKS_INSTALL%" /TREE "%LR_SYSTREE%" /MW
	) else (
		call install.bat /LUA %LUA_DIR% /Q /LV %LUA_SHORTV% /P "%LUAROCKS_INSTALL%" /TREE "%LR_SYSTREE%"
	)

	:: Configures LuaRocks to instruct CMake the correct generator to use. Else, CMake will pick the highest
	:: Visual Studio version installed
	if "%Configuration%"=="MinGW" (
		echo cmake_generator = "MinGW Makefiles" >> %LUAROCKS_INSTALL%\config.lua
	)
	if "%Configuration%"=="2015" (
		echo cmake_generator = "Visual Studio 14 2015" >> %LUAROCKS_INSTALL%\config.lua
	)
	if "%Configuration%"=="2013" (
		echo cmake_generator = "Visual Studio 12 2013" >> %LUAROCKS_INSTALL%\config.lua
	)
	if "%Configuration%"=="2012" (
		echo cmake_generator = "Visual Studio 11 2011" >> %LUAROCKS_INSTALL%\config.lua
	)
	if "%Configuration%"=="2010" (
		echo cmake_generator = "Visual Studio 10 2010" >> %LUAROCKS_INSTALL%\config.lua
	)
	if "%Configuration%"=="2008" (
		echo cmake_generator = "Visual Studio 9 2008" >> %LUAROCKS_INSTALL%\config.lua
	)
)

if not exist "%LR_ROOT%" call :die "LuaRocks not found at %LR_ROOT%"

set PATH=%LR_ROOT%;%LR_SYSTREE%\bin;%PATH%

:: Lua will use just the system rocks
set LUA_PATH=%LR_ROOT%\lua\?.lua;%LR_ROOT%\lua\?\init.lua
set LUA_PATH=%LUA_PATH%;%LR_SYSTREE%\share\lua\%LUA_SHORTV%\?.lua
set LUA_PATH=%LUA_PATH%;%LR_SYSTREE%\share\lua\%LUA_SHORTV%\?\init.lua
set LUA_PATH=%LUA_PATH%;.\?.lua;.\?\init.lua
set LUA_CPATH=%LR_SYSTREE%\lib\lua\%LUA_SHORTV%\?.dll;.\?.dll

call luarocks --version || call :die "Error with LuaRocks installation"
call luarocks list

if not exist "%LR_EXTERNAL%" (
	mkdir "%LR_EXTERNAL%"
	mkdir "%LR_EXTERNAL%\lib"
	mkdir "%LR_EXTERNAL%\include"
)

set PATH=%LR_EXTERNAL%;%PATH%

:: Exports the following variables:
:: (beware of whitespace between & and ^ below)
endlocal & set PATH=%PATH%&^
set LR_SYSTREE=%LR_SYSTREE%&^
set LUA_PATH=%LUA_PATH%&^
set LUA_CPATH=%LUA_CPATH%&^
set LR_EXTERNAL=%LR_EXTERNAL%

echo.
echo ======================================================
if "%LUA%"=="luajit" (
	echo Installation of LuaJIT %LJ_VER% and LuaRocks %LUAROCKS_VER% done.
) else (
	echo Installation of Lua %LUA_VER% and LuaRocks %LUAROCKS_VER% done.
	if defined NOCOMPAT echo Lua was built with compatibility flags disabled.
)
echo Platform         - %platform%
echo LUA              - %LUA%
echo LUA_SHORTV       - %LUA_SHORTV%
echo LJ_SHORTV        - %LJ_SHORTV%
echo LUA_PATH         - %LUA_PATH%
echo LUA_CPATH        - %LUA_CPATH%
echo.
echo LR_EXTERNAL      - %LR_EXTERNAL%
echo ======================================================
echo.

goto :eof

:: This blank space is intentional. If you see errors like "The system cannot find the batch label specified 'foo'"
:: then try adding or removing blank lines lines above.
:: Yes, really.
:: http://stackoverflow.com/questions/232651/why-the-system-cannot-find-the-batch-label-specified-is-thrown-even-if-label-e

:: helper functions:

:: for bailing out when an error occurred
:die %1
echo %1
exit /B 1
goto :eof

Configure LuaRocks to use a specific cmake generator.

After installing LuaRocks, sets the generator to use according to the
chosen compiler. If we don't do that, CMake will try to autodetect and
use the newest compiler it finds.


@echo off

rem Copyright 2015 - 2017 AZYVA INC. INC.
rem
rem This file is part of Dragom.
rem
rem Dragom is free software: you can redistribute it and/or modify
rem it under the terms of the GNU Affero General Public License as published by
rem the Free Software Foundation, either version 3 of the License, or
rem (at your option) any later version.
rem
rem Dragom is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rem GNU Afferp General Public License for more details.
rem
rem You should have received a copy of the GNU Affero General Public License
rem along with Dragom.  If not, see <http://www.gnu.org/licenses/>.

rem Main start script for Dragom tools. It launches the JVM starting
rem org.azyva.dragom.tool.DragomToolInvoker.
rem
rem This script calls set-env.cmd which can set various variables to configure the
rem Dragom execution environment. See the comments in set-env.sh for more
rem information.
rem
rem Additional parameters can be passed to the JVM with one or more --jvm-option
rem cli option specified as the first arguments to the script, before the Dragom
rem tool name.
rem
rem Synopsis:
rem
rem dragom [ [ --jvm-option <jvm-option> ] ... ] <dragom-tool> [argument] ...

setlocal EnableDelayedExpansion

set DRAGOM_HOME_DIR=%~dp0%..

call %DRAGOM_HOME_DIR%\bin\set-env.cmd

if "%JAVA_HOME%" == "" (
  echo JAVA_HOME not set.
  exit /b 1
)

rem We use a temporary file for getting variable lists in order to redirect errors
rem (when a variable does not exist) in nul, which is not possible with the
rem "for /f" command.

:retry-temp-file
set TEMP_FILE=%TEMP%\dragom-temp-%RANDOM%.tmp
if exist %TEMP_FILE% goto retry-temp-file

set SYSTEM_PROPERTIES_JVM_OPTIONS=

set SYSTEM_PROPERTY_ 2>nul 1>%TEMP_FILE%

for /f "tokens=1* delims==" %%P in (%TEMP_FILE%) do (
  set PROPERTY=%%P
  set PROPERTY=!PROPERTY:SYSTEM_PROPERTY_=!
  set SYSTEM_PROPERTIES_JVM_OPTIONS=!SYSTEM_PROPERTIES_JVM_OPTIONS! -D!PROPERTY!=%%Q
)

del %TEMP_FILE%

set DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS=

set DRAGOM_SYSTEM_PROPERTY_ 2>nul 1>%TEMP_FILE%

for /f "tokens=1* delims==" %%P in (%TEMP_FILE%) do (
  set PROPERTY=%%P
  set PROPERTY=!PROPERTY:DRAGOM_SYSTEM_PROPERTY_=!
  set DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS=!DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS! -Dorg.azyva.dragom.!PROPERTY!=%%Q
)

del %TEMP_FILE%

set INIT_PROPERTIES_JVM_OPTIONS=

set INIT_PROPERTY_ 2>nul 1>%TEMP_FILE%

for /f "tokens=1* delims==" %%P in (%TEMP_FILE%) do (
  set PROPERTY=%%P
  set PROPERTY=!PROPERTY:INIT_PROPERTY_=!
  set INIT_PROPERTIES_JVM_OPTIONS=!INIT_PROPERTIES_JVM_OPTIONS! -Dorg.azyva.dragom.init-property.!PROPERTY!=%%Q
)

del %TEMP_FILE%

rem Extracting and handling some arguments, while leaving the remaining arguments
rem as is is difficult for various reasons, including:
rem - %* does not take into account shifted-out arguments
rem - Windows interprets = as an argument separator when parsing a command line
rem   into the positional variables %1, %2, etc.
rem The solution is to take the whole command line (%*) and parse it explicitly.
rem Here again, this is difficult since a for loop breaks on lines, not tokens. So
rem we replace spaces with newlines.

set STATE=
set CLI_JVM_OPTIONS=
set ARGS=

set "ORG_ARGS=%*"

rem The 2 empty lines after this set are important. This solution was found here:
rem http://stackovervlow.com/questions/2524928/dos-batch-iterate-through-a-delimited-string
set NEWLINE=^

rem When a variable is empty, its evaluation with replacement (see below in for)
rem does not work correctly.
if "%ORG_ARGS%" == "" goto continue1

for /f %%A in ("%ORG_ARGS: =!NEWLINE!%") do (
  if "!STATE!" == "" (
    if "%%A" == "--jvm-option" (
      set STATE=jvm-option
    ) else (
      set "ARGS=!ARGS! %%A"
      set STATE=arg
    )
  ) else if "!STATE!" == "jvm-option" (
    set CLI_JVM_OPTIONS=!CLI_JVM_OPTIONS! %%A
    set STATE=
  ) else if "!STATE!" == "arg" (
    set "ARGS=!ARGS! %%A"
  )
)

:continue1

rem The computed arguments and options could very well include reserved characters
rem which would need to be escaped. We neglect handling them, except for ARGS
rem which could include a --reference-path-matcher option that includes ">".

set "ARGS=%ARGS:>=^>%"

%JAVA_HOME%/bin/java ^
  %JVM_OPTIONS% ^
  %SYSTEM_PROPERTIES_JVM_OPTIONS% ^
  %DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS% ^
  %INIT_PROPERTIES_JVM_OPTIONS% ^
  %CLI_JVM_OPTIONS% ^
  -classpath "%DRAGOM_HOME_DIR%\classpath;%DRAGOM_HOME_DIR%\lib\*" ^
  org.azyva.dragom.tool.DragomToolInvoker %ARGS%

@echo off

rem Copyright 2015 - 2017 AZYVA INC. INC.
rem
rem This file is part of Dragom.
rem
rem Dragom is free software: you can redistribute it and/or modify
rem it under the terms of the GNU Affero General Public License as published by
rem the Free Software Foundation, either version 3 of the License, or
rem (at your option) any later version.
rem
rem Dragom is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rem GNU Afferp General Public License for more details.
rem
rem You should have received a copy of the GNU Affero General Public License
rem along with Dragom.  If not, see <http://www.gnu.org/licenses/>.

rem Main start script for Dragom tools. It launches the JVM starting
rem org.azyva.dragom.tool.DragomToolInvoker.
rem
rem This script calls set-env.cmd which can set various variables to configure the
rem Dragom execution environment. See the comments in set-env.sh for more
rem information.
rem
rem Additional parameters can be passed to the JVM with one or more --jvm-option
rem cli option specified as the first arguments to the script, before the Dragom
rem tool name.
rem
rem Synopsis:
rem
rem dragom [ [ --jvm-option <jvm-option> ] ... ] <dragom-tool> [argument] ...

setlocal EnableDelayedExpansion

set DRAGOM_HOME_DIR=%~dp0%..

call %DRAGOM_HOME_DIR%\bin\set-env.cmd

if "%JAVA_HOME%" == "" (
  echo JAVA_HOME not set.
  exit /b 1
)

rem We use a temporary file for getting variable lists in order to redirect errors
rem (when a variable does not exist) in nul, which is not possible with the
rem "for /f" command.

:retry-temp-file
set TEMP_FILE=%TEMP%\dragom-temp-%RANDOM%.tmp
if exist %TEMP_FILE% goto retry-temp-file

set SYSTEM_PROPERTIES_JVM_OPTIONS=

set SYSTEM_PROPERTY_ 2>nul 1>%TEMP_FILE%

for /f "tokens=1* delims==" %%P in (%TEMP_FILE%) do (
  set PROPERTY=%%P
  set PROPERTY=!PROPERTY:SYSTEM_PROPERTY_=!
  set SYSTEM_PROPERTIES_JVM_OPTIONS=!SYSTEM_PROPERTIES_JVM_OPTIONS! -D!PROPERTY!=%%Q
)

del %TEMP_FILE%

set DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS=

set DRAGOM_SYSTEM_PROPERTY_ 2>nul 1>%TEMP_FILE%

for /f "tokens=1* delims==" %%P in (%TEMP_FILE%) do (
  set PROPERTY=%%P
  set PROPERTY=!PROPERTY:DRAGOM_SYSTEM_PROPERTY_=!
  set DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS=!DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS! -Dorg.azyva.dragom.!PROPERTY!=%%Q
)

del %TEMP_FILE%

set INIT_PROPERTIES_JVM_OPTIONS=

set INIT_PROPERTY_ 2>nul 1>%TEMP_FILE%

for /f "tokens=1* delims==" %%P in (%TEMP_FILE%) do (
  set PROPERTY=%%P
  set PROPERTY=!PROPERTY:INIT_PROPERTY_=!
  set INIT_PROPERTIES_JVM_OPTIONS=!INIT_PROPERTIES_JVM_OPTIONS! -Dorg.azyva.dragom.init-property.!PROPERTY!=%%Q
)

del %TEMP_FILE%

rem Extracting and handling some arguments, while leaving the remaining arguments
rem as is is difficult for various reasons, including:
rem - %* does not take into account shifted-out arguments
rem - Windows interprets = as an argument separator when parsing a command line
rem   into the positional variables %1, %2, etc.
rem The solution is to take the whole command line (%*) and parse it explicitly.
rem Here again, this is difficult since a for loop breaks on lines, not tokens. So
rem we replace spaces with newlines.

set STATE=
set CLI_JVM_OPTIONS=
set ARGS=

set "ORG_ARGS=%*"

rem The 2 empty lines after this set are important. This solution was found here:
rem http://stackovervlow.com/questions/2524928/dos-batch-iterate-through-a-delimited-string
set NEWLINE=^

rem When a variable is empty, its evaluation with replacement (see below in for)
rem does not work correctly.
if "%ORG_ARGS%" == "" goto continue1

for /f %%A in ("%ORG_ARGS: =!NEWLINE!%") do (
  if "!STATE!" == "" (
    if "%%A" == "--jvm-option" (
      set STATE=jvm-option
    ) else (
      set "ARGS=!ARGS! %%A"
      set STATE=arg
    )
  ) else if "!STATE!" == "jvm-option" (
    set CLI_JVM_OPTIONS=!CLI_JVM_OPTIONS! %%A
    set STATE=
  ) else if "!STATE!" == "arg" (
    set "ARGS=!ARGS! %%A"
  )
)

:continue1

rem The computed arguments and options could very well include reserved characters
rem which would need to be escaped. We neglect handling them, except for ARGS
rem which could include a --reference-path-matcher option that includes ">".

if "%ARGS%" == "" goto continue2

set "ARGS=%ARGS:>=^>%"

:continue2

%JAVA_HOME%/bin/java ^
  %JVM_OPTIONS% ^
  %SYSTEM_PROPERTIES_JVM_OPTIONS% ^
  %DRAGOM_SYSTEM_PROPERTIES_JVM_OPTIONS% ^
  %INIT_PROPERTIES_JVM_OPTIONS% ^
  %CLI_JVM_OPTIONS% ^
  -classpath "%DRAGOM_HOME_DIR%\classpath;%DRAGOM_HOME_DIR%\lib\*" ^
  org.azyva.dragom.tool.DragomToolInvoker %ARGS%

Fix for empty command line.

Fix for empty command line.


setlocal

IF "%1"=="" (
	set BUILD_CONFIG="Debug"
) ELSE (
	set BUILD_CONFIG=%1
)

REM Presence of a second argument indicates that the caller has already run vsvars32.bat
IF "%2"=="" (
	if not "%VS120COMNTOOLS%" == "" (
		echo Setting up Visual Studio Pro 2013 Tools...
		@call "%VS120COMNTOOLS%vsvars32.bat"
		goto build
	)

	if not "%VS100COMNTOOLS%" == "" (
		echo Setting up Visual Studio Pro 2010 Tools...
		@call "%VS100COMNTOOLS%vsvars32.bat"
		goto build
	)

	if not "%VS110COMNTOOLS%" == "" (
		echo Setting up Visual Studio Express 2010 Tools...
		@call "%VS110COMNTOOLS%vsvars32.bat"
		goto build
	)
)

:build
git pull --rebase
msbuild "Palaso.sln" /verbosity:quiet /maxcpucount /p:Configuration=%BUILD_CONFIG%

setlocal

IF "%1"=="" (
	set BUILD_CONFIG="Debug"
) ELSE (
	set BUILD_CONFIG=%1
)

REM Presence of a second argument indicates that the caller has already run vsvars32.bat
IF "%2"=="" (
	if not "%VS120COMNTOOLS%" == "" (
		echo Setting up Visual Studio Pro 2013 Tools...
		@call "%VS120COMNTOOLS%vsvars32.bat"
		goto build
	)

	if not "%VS100COMNTOOLS%" == "" (
		echo Setting up Visual Studio Pro 2010 Tools...
		@call "%VS100COMNTOOLS%vsvars32.bat"
		goto build
	)

	if not "%VS110COMNTOOLS%" == "" (
		echo Setting up Visual Studio Express 2010 Tools...
		@call "%VS110COMNTOOLS%vsvars32.bat"
		goto build
	)
)

:build
git pull --rebase
msbuild "build/Palaso.proj" /target:build /verbosity:quiet /maxcpucount /p:Configuration=%BUILD_CONFIG%

Update GetAndBuild script to match TC Build Step


"C:\Program Files (x86)\Java\jre1.8.0_45\bin\java.exe" -jar compiler.jar ^
--js=translate.js ^
--js=jquery/jquery-1.11.2.js ^
--js=jquery/jquery-ui.1.11.2.min.js ^
--js=jquery/jquery.qtip.js ^
--js=jquery/jquery.blockUI.js ^
--js=jquery/jquery.color.js ^
--js=jquery/jquery.tablesorter.js ^
--js=jquery/jquery.flot.js ^
--js=jquery/jquery.ui.position.js ^
--js=jquery/jquery.contextMenu.js ^
--js=jquery/jquery.hotkeys.js ^
--js=jquery/jquery.jsPlumb-1.6.4.js ^
--js=jquery/jquery.placeholder.js ^
--js=jquery/jquery.simplePagination.js ^
--js=handlebars-v2.0.0.js ^
--js=handlebars.form-helpers.js ^
--js=dropdown.js ^
--js=tab.js ^
--js=typeahead.bundle.js ^
--source_map_format=V3 ^
--create_source_map thirdparty.compiled.js.map ^
--js_output_file=thirdparty.compiled.js

echo //# sourceMappingURL=thirdparty.compiled.js.map >> thirdparty.compiled.js
@pause

"C:\Program Files (x86)\Java\jre1.8.0_45\bin\java.exe" -jar compiler.jar ^
--js=translate.js ^
--js=jquery/jquery-1.11.2.js ^
--js=jquery/jquery-ui.1.11.4.min.js ^
--js=jquery/jquery.qtip.js ^
--js=jquery/jquery.blockUI.js ^
--js=jquery/jquery.color.js ^
--js=jquery/jquery.tablesorter.js ^
--js=jquery/jquery.flot.js ^
--js=jquery/jquery.ui.position.js ^
--js=jquery/jquery.contextMenu.js ^
--js=jquery/jquery.hotkeys.js ^
--js=jquery/jquery.jsPlumb-1.6.4.js ^
--js=jquery/jquery.placeholder.js ^
--js=jquery/jquery.simplePagination.js ^
--js=handlebars-v2.0.0.js ^
--js=handlebars.form-helpers.js ^
--js=dropdown.js ^
--js=tab.js ^
--js=typeahead.bundle.js ^
--source_map_format=V3 ^
--create_source_map thirdparty.compiled.js.map ^
--js_output_file=thirdparty.compiled.js

echo //# sourceMappingURL=thirdparty.compiled.js.map >> thirdparty.compiled.js
@pause

Bump versiona nd update third party build to use latest jquery ui we have


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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@5 || goto :error

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

goto :EOF

:error
exit /b 1

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

@echo "Starting Windows build"

cd /d %~dp0
cd ..

call npm install -g npm@latest || goto :error
call npm install || goto :error
call npm run test || goto :error

goto :EOF

:error
exit /b 1

use latest npm on Windows (#50)

chore: use latest npm on Windows (#50)


:: Copyright (c) 2011, Jon Maken
:: License: 3-clause BSD (see project LICENSE file)
:: Revision: 01/29/2011 10:20:16 AM

@echo off
setlocal
:: echo initial:
:: echo   %%0 = %0
:: echo   %%* = %*
:: fix ruby.exe invocation when explicitly disabling RubyGems
if "x%1" == "x--disable-gems" (
  set NOGEM=%1
  for /F "tokens=1*" %%i in ("%*") do set RB_ARGS=%%j
) else (
  set NOGEM=
  set RB_ARGS=%*
)

:: echo pre call ruby:
:: echo   NOGEM = %NOGEM%
:: echo   RB_ARGS = %RB_ARGS%
ruby.exe %NOGEM% -x %~f0 %RB_ARGS%

endlocal
exit /b
#!ruby
__DIR__ = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(__DIR__, 'lib'))

require 'inquisitor'

Inquisitor.run

:: Copyright (c) 2011, Jon Maken
:: License: 3-clause BSD (see project LICENSE file)
:: Revision: 01/29/2011 10:20:16 AM

@echo off
setlocal
:: echo initial:
:: echo   %%0 = %0
:: echo   %%* = %*
:: fix ruby.exe invocation when explicitly disabling RubyGems
if "x%1" == "x--disable-gems" (
  set NOGEM=%1
  for /F "tokens=1*" %%i in ("%*") do set RB_ARGS=%%j
) else (
  set NOGEM=
  set RB_ARGS=%*
)

:: echo pre call ruby:
:: echo   NOGEM = %NOGEM%
:: echo   RB_ARGS = %RB_ARGS%
ruby.exe %NOGEM% -x %~f0 %RB_ARGS%

endlocal
exit /b
#!ruby
__DIR__ = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(__DIR__, 'lib'))
$LOAD_PATH.unshift(File.join(__DIR__))

require 'inquisitor'

Inquisitor.run

Add project root dir to $LOAD_PATH.

Add project root dir to $LOAD_PATH.


if "%1"=="" goto noargs
	svn copy http://plugins.svn.wordpress.org/comment-timeout/trunk http://plugins.svn.wordpress.org/comment-timeout/tags/%1
	goto done:
noargs:
	echo Usage: tag VERSION
	echo.
	echo Tags the latest release in Subversion as a numbered version.
done:

Add batch file to tag versions.

Add batch file to tag versions.


@rem Makes a build directory of the viewer, so that you can run the NSIS install script
@rem You should have VS2008 redistributable (vcredist_x86.exe) in your viewer trunk root
@rem as well as OpenAL installer (oalinst.exe)
@echo off
rmdir build /S /Q
md build
copy readme.txt build
copy license.txt build
copy vcredist_x86.exe build
copy oalinst.exe build
copy dxwebsetup.exe build
xcopy bin\*.* build /S /C /Y
del build\fullmemoryleaklog.txt
del build\scenestats.txt
del build\ogrestats.txt
del build\openal32.dll
del build\wrap_oal.dll
del build\*d4.dll
del build\*_d.dll
del build\Poco*d.dll
@rem del build\dbus-1d.dll
del build\libcurld.dll
del build\OpenJPEGd.dll
del build\xmlrpcepid.dll
del build\liboggd.dll
del build\libvorbisd.dll
del build\libvorbisfiled.dll
del build\viewerd.exe
del build\modules\core\*d.dll
del build\pymodules\*.pyc
del build\pymodules\apitest\*.pyc
del build\pymodules\circuits\*.pyc
del build\pymodules\circuits\core\*.pyc
del build\pymodules\circuits\net\*.pyc
del build\pymodules\circuits\tools\*.pyc
del build\pymodules\circuits\web\*.pyc
del build\pymodules\core\*.pyc
del build\pymodules\objectedit\*.pyc
del build\pymodules\lib\*.pyc
del build\pymodules\lib\webdav\*.pyc
del build\pymodules\lib\webdav\acp\*.pyc
del build\pymodules\usr\*.pyc
del build\pymodules\webdavinventory\*.pyc
del build\pymodules\webserver\*.pyc
del build\pymodules\mediaurlhandler\*.pyc
del build\pymodules\DLLs\*_d.pyd
del build\plugins\*_d.dll

@rem Makes a build directory of the viewer, so that you can run the NSIS install script
@rem You should have VS2008 redistributable (vcredist_x86.exe) in your viewer trunk root
@rem as well as OpenAL installer (oalinst.exe)
@echo off
rmdir build /S /Q
md build
copy readme.txt build
copy license.txt build
copy vcredist_x86.exe build
copy oalinst.exe build
copy dxwebsetup.exe build
xcopy bin\*.* build /S /C /Y
del build\performancelogger.txt
del build\fullmemoryleaklog.txt
del build\scenestats.txt
del build\ogrestats.txt
del build\openal32.dll
del build\wrap_oal.dll
del build\*d4.dll
del build\*_d.dll
del build\Poco*d.dll
@rem del build\dbus-1d.dll
del build\libcurld.dll
del build\OpenJPEGd.dll
del build\xmlrpcepid.dll
del build\liboggd.dll
del build\libvorbisd.dll
del build\libvorbisfiled.dll
del build\viewerd.exe
del build\modules\core\*d.dll
del build\pymodules\*.pyc
del build\pymodules\apitest\*.pyc
del build\pymodules\circuits\*.pyc
del build\pymodules\circuits\core\*.pyc
del build\pymodules\circuits\net\*.pyc
del build\pymodules\circuits\tools\*.pyc
del build\pymodules\circuits\web\*.pyc
del build\pymodules\core\*.pyc
del build\pymodules\objectedit\*.pyc
del build\pymodules\lib\*.pyc
del build\pymodules\lib\webdav\*.pyc
del build\pymodules\lib\webdav\acp\*.pyc
del build\pymodules\usr\*.pyc
del build\pymodules\webdavinventory\*.pyc
del build\pymodules\webserver\*.pyc
del build\pymodules\mediaurlhandler\*.pyc
del build\pymodules\DLLs\*_d.pyd
del build\plugins\*_d.dll

Remove performancelogger.txt from build.


@ECHO OFF
REM $Id$

REM Bat script to setup build paths for Hopsan and dependencies
REM Author: Peter Nordin peter.nordin@liu.se
REM Argument %1 should be arch: x86 or x64

REM Default values
REM Use x64 for 64-bit, use x86 for 32-bit
set hopsan_arch=x64

REM Overwrite with command line argument values if present
if not "%~1"=="" (
	set hopsan_arch=%~1
)
if not "%~2"=="" (
REM Do something maybe
)

echo Setting paths for architecture: %hopsan_arch%
if not "%hopsan_arch%"=="x86" (
  if not "%hopsan_arch%"=="x64" (
	echo Error: hopsan_arch must be x86 or x64
	pause
	goto :eof
  )
)

REM Setup compiler and Qt paths
REM These paths require the official Qt version from Qt.io (for 32-bit) and the custom build Qt library for Hopsan 64-bit
set mingw_path32=C:\Qt\Tools\mingw492_32\bin
set mingw_path64=C:\hopsan-dev\x86_64-4.9.4-release-posix-seh-rt_v5-rev0\mingw64\bin
set qmake_path32=C:\Qt\5.6.3\mingw49_32\bin
set qmake_path64=C:\hopsan-dev\qt-5.6.3-x64-mingw494-posix-seh-rt_v5-rev0\bin

REM Tool paths
set msys_path=C:\msys64\usr\bin

REM Set default installation tools paths depending on current Windows architecture
if defined ProgramFiles(x86) (
	REM do stuff for 64bit here
	echo 64bit Windows detected, expecting 64-bit tools, but checking for 32-bit anyway
	if exist "%ProgramFiles(x86)%\CMake\bin" (
		set "cmake_path=%ProgramFiles(x86)%\CMake\bin"
	) else (
		set "cmake_path=%ProgramW6432%\CMake\bin"
	)
	if exist "%ProgramFiles(x86)%\doxygen\bin" (
		set "doxygen_path=%ProgramFiles(x86)%\doxygen\bin"
	) else (
		set "doxygen_path=%ProgramW6432%\doxygen\bin"
	)
	REM Assume official "Git for Windows"
	if exist "%ProgramFiles(x86)%\Git\bin" (
		set "git_path=%ProgramFiles(x86)%\Git\bin"
		set "gitmsys_path=%ProgramFiles(x86)%\Git\usr\bin"
	) else (
		set "git_path=%ProgramW6432%\Git\bin"
		set "gitmsys_path=%ProgramW6432%\Git\usr\bin"
	)
) else (
    REM do stuff for 32bit here
	echo 32bit Windows detected, expecting 32-bit tools
	set "cmake_path=%ProgramFiles%\CMake\bin"
	set "doxygen_path=%ProgramFiles%\doxygen\bin"
	REM Assume official "Git for Windows"
	set "git_path=%ProgramFiles%\Git\bin"
	set "gitmsys_path=%ProgramFiles%\Git\usr\bin"
)

REM Choose compiler and Qt path depending on selected build type
if "%hopsan_arch%"=="x64" (
	set "mingw_path=%mingw_path64%"
	set "qmake_path=%qmake_path64%"
) else (
	set "mingw_path=%mingw_path32%"
	set "qmake_path=%qmake_path32%"
)

REM Echo expected paths
echo cmake_path:   %cmake_path%
echo doxygen_path: %doxygen_path%
echo msys_path:    %msys_path%
echo mingw_path:   %mingw_path%
echo qmake_path:   %qmake_path%
echo git_path:     %git_path%
echo gitmsys_path: %gitmsys_path%

REM Avoid duplicate msys in path, add msys if it is available, else add msys shipped with Git for Windows"
if exist "%msys_path%" (
	set "msys_to_path=%msys_path%"
) else (
	set "msys_to_path=%gitmsys_path%"
)

echo.

set PATH=%mingw_path%;%qmake_path%;%git_path%;%cmake_path%;%doxygen_path%;%msys_to_path%;%PATH%

:eof

@ECHO OFF
REM $Id$

REM Bat script to setup build paths for Hopsan and dependencies
REM Author: Peter Nordin peter.nordin@liu.se
REM Argument %1 should be arch: x86 or x64

REM Default values
REM Use x64 for 64-bit, use x86 for 32-bit
set hopsan_arch=x64

REM Overwrite with command line argument values if present
if not "%~1"=="" (
	set hopsan_arch=%~1
)
if not "%~2"=="" (
REM Do something maybe
)

echo Setting paths for architecture: %hopsan_arch%
if not "%hopsan_arch%"=="x86" (
  if not "%hopsan_arch%"=="x64" (
	echo Error: hopsan_arch must be x86 or x64
	pause
	goto :eof
  )
)

REM Setup compiler and Qt paths
REM These paths require the official Qt version from Qt.io (for 32-bit) and the custom build Qt library for Hopsan 64-bit
set mingw_path32=C:\Qt\Tools\mingw492_32\bin
set qmake_path32=C:\Qt\5.6.3\mingw49_32\bin
set mingw_path64=C:\hopsan-dev\x86_64-4.9.4-release-posix-seh-rt_v5-rev0\mingw64\bin
set qmake_path64=C:\hopsan-dev\qt-5.6.3-x64-mingw494-posix-seh-rt_v5-rev0\bin

REM Tool paths
set msys_path=C:\msys64\usr\bin

REM Set default installation tools paths depending on current Windows architecture
if defined ProgramFiles(x86) (
	REM do stuff for 64bit here
	echo 64bit Windows detected, expecting 64-bit tools, but checking for 32-bit anyway
	if exist "%ProgramFiles(x86)%\CMake\bin" (
		set "cmake_path=%ProgramFiles(x86)%\CMake\bin"
	) else (
		set "cmake_path=%ProgramW6432%\CMake\bin"
	)
	if exist "%ProgramFiles(x86)%\doxygen\bin" (
		set "doxygen_path=%ProgramFiles(x86)%\doxygen\bin"
	) else (
		set "doxygen_path=%ProgramW6432%\doxygen\bin"
	)
	REM Assume official "Git for Windows"
	if exist "%ProgramFiles(x86)%\Git\bin" (
		set "git_path=%ProgramFiles(x86)%\Git\bin"
		set "gitmsys_path=%ProgramFiles(x86)%\Git\usr\bin"
	) else (
		set "git_path=%ProgramW6432%\Git\bin"
		set "gitmsys_path=%ProgramW6432%\Git\usr\bin"
	)
) else (
    REM do stuff for 32bit here
	echo 32bit Windows detected, expecting 32-bit tools
	set "cmake_path=%ProgramFiles%\CMake\bin"
	set "doxygen_path=%ProgramFiles%\doxygen\bin"
	REM Assume official "Git for Windows"
	set "git_path=%ProgramFiles%\Git\bin"
	set "gitmsys_path=%ProgramFiles%\Git\usr\bin"
)

REM Choose compiler and Qt path depending on selected build type
if "%hopsan_arch%"=="x64" (
	set "mingw_path=%mingw_path64%"
	set "qmake_path=%qmake_path64%"
) else (
	set "mingw_path=%mingw_path32%"
	set "qmake_path=%qmake_path32%"
)

REM Echo expected paths
echo cmake_path:   %cmake_path%
echo doxygen_path: %doxygen_path%
echo msys_path:    %msys_path%
echo mingw_path:   %mingw_path%
echo qmake_path:   %qmake_path%
echo git_path:     %git_path%
echo gitmsys_path: %gitmsys_path%

REM Avoid duplicate msys in path, add msys if it is available, else add msys shipped with Git for Windows"
if exist "%msys_path%" (
	set "msys_to_path=%msys_path%"
) else (
	set "msys_to_path=%gitmsys_path%"
)

echo.

set PATH=%mingw_path%;%qmake_path%;%git_path%;%cmake_path%;%doxygen_path%;%msys_to_path%;%PATH%

:eof

Reorder paths

Reorder paths


@echo off
echo [INFO] Generating project in ./generated-projects

if not exist  generated-projects mkdir generated-projects
cd generated-projects
call mvn archetype:generate -DarchetypeGroupId=org.springside.examples -DarchetypeArtifactId=quickstart-archetype -DarchetypeVersion=4.1.1-SNAPSHOT

pause

@echo off
echo [INFO] Generating project in ./generated-projects

if not exist  generated-projects mkdir generated-projects
cd generated-projects
call mvn archetype:generate -DarchetypeGroupId=org.springside.examples -DarchetypeArtifactId=quickstart-archetype -DarchetypeVersion=4.2.3-SNAPSHOT

pause

fix generate project failed

fix generate project failed


@rem Builds gRPC NuGet packages

@rem Current package versions
set VERSION=0.12.0
set CORE_VERSION=0.12.0
set PROTOBUF_VERSION=3.0.0-alpha4

@rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well.
set VERSION_WITH_BETA=%VERSION%-beta

@rem Adjust the location of nuget.exe
set NUGET=C:\nuget\nuget.exe

setlocal
cd ..\..\vsprojects\nuget_package
@call buildall.bat || goto :error
endlocal

@call buildall.bat BUILD_SIGNED || goto :error

@call ..\..\vsprojects\build_plugins.bat || goto :error

%NUGET% pack ..\..\vsprojects\nuget_package\grpc.native.csharp.nuspec -Version %CORE_VERSION% || goto :error
%NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error
%NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% -Properties GrpcNativeCsharpVersion=%CORE_VERSION% || goto :error
%NUGET% pack Grpc.HealthCheck\Grpc.HealthCheck.nuspec -Symbols -Version %VERSION_WITH_BETA% -Properties ProtobufVersion=%PROTOBUF_VERSION% || goto :error
%NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error
%NUGET% pack Grpc.nuspec -Version %VERSION% || goto :error

goto :EOF

:error
echo Failed!
exit /b %errorlevel%

@rem Builds gRPC NuGet packages

@rem Current package versions
set VERSION=0.12.0
set CORE_VERSION=0.12.0
set PROTOBUF_VERSION=3.0.0-beta2

@rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well.
set VERSION_WITH_BETA=%VERSION%-beta

@rem Adjust the location of nuget.exe
set NUGET=C:\nuget\nuget.exe

setlocal
cd ..\..\vsprojects\nuget_package
@call buildall.bat || goto :error
endlocal

@call buildall.bat BUILD_SIGNED || goto :error

@call ..\..\vsprojects\build_plugins.bat || goto :error

%NUGET% pack ..\..\vsprojects\nuget_package\grpc.native.csharp.nuspec -Version %CORE_VERSION% || goto :error
%NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error
%NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% -Properties GrpcNativeCsharpVersion=%CORE_VERSION% || goto :error
%NUGET% pack Grpc.HealthCheck\Grpc.HealthCheck.nuspec -Symbols -Version %VERSION_WITH_BETA% -Properties ProtobufVersion=%PROTOBUF_VERSION% || goto :error
%NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error
%NUGET% pack Grpc.nuspec -Version %VERSION% || goto :error

goto :EOF

:error
echo Failed!
exit /b %errorlevel%

increase protobuf dependency version

increase protobuf dependency version


@echo off

call settings.cmd

echo.
echo 0.Set proxy
set/P HTTP_PROXY=Enter HTTP_PROXY if needed :
set/P HTTPS_PROXY=Enter HTTPS_PROXY if needed :

echo.
echo 1.GNU/WGET Init

set wget=wget-%ARCHITECTURE%.exe

echo.
echo 2.Check Python 2.7 Installation
set KEY_NAME=HKLM\Software\Python\PythonCore\2.7\InstallPath
REG QUERY %KEY_NAME% > nul || 	(
									echo 2.1 Download Python 2.7
									if %ARCHITECTURE% == x64 (
										set python_msi=python-2.7.5.amd64.msi
									) else (
										set python_msi=python-2.7.5.msi
									)

									"%wget%" -o python_donwload http://www.python.org/ftp/python/2.7.5/%python_msi%

									echo 2.2 Setup Python 2.7
									%python_msi%

									del %python_msi%
									del python_donwload
								)

for /F "tokens=4" %%A IN ('REG QUERY %KEY_NAME%') do (
    set PythonPath=%%A
)

echo.
echo 3.Check PyQt4 Installation
for %%i in (pyuic4.bat) do set qt=%%~$PATH:i
if not defined qt (

	echo 3.1 Download PyQt4
	"%wget%" -o qt_download http://heanet.dl.sourceforge.net/project/pyqt/PyQt4/PyQt-4.10.3/PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-%ARCHITECTURE%.exe

	echo 3.2 Setup PyQt4
	PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-%ARCHITECTURE%.exe

	del PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-%ARCHITECTURE%.exe
	del qt_download
)

echo.
echo 4.Check EasyInstall
if exist "%PythonPath%Scripts\easy_install.exe" (
	goto :InstallWeboobDependances
) else (

	echo 4.1 Setup setuptools
	%PythonPath%python.exe ez_setup.py || goto :InstallFailed

	del setuptools-1.1.6.tar.gz

	goto :InstallWeboobDependances
)

:InstallWeboobDependances
echo.
echo 5.Install Weboob Dependances
echo.
echo -- cssselect
%PythonPath%Scripts\easy_install.exe cssselect || goto :InstallFailed
echo.
echo -- lxml
%PythonPath%Scripts\easy_install.exe lxml || goto :InstallFailed
echo.
echo -- dateutils
%PythonPath%Scripts\easy_install.exe dateutils || goto :InstallFailed
echo.
echo -- pyyaml
%PythonPath%Scripts\easy_install.exe pyyaml || goto :InstallFailed
echo.
echo -- html2text
%PythonPath%Scripts\easy_install.exe html2text || goto :InstallFailed
echo.
echo -- mechanize
%PythonPath%Scripts\easy_install.exe mechanize || goto :InstallFailed
echo.
echo -- gdata
%PythonPath%Scripts\easy_install.exe gdata || goto :InstallFailed
echo.
echo -- pillow
%PythonPath%Scripts\easy_install.exe pillow || goto :InstallFailed

echo.
echo 6.Install WeBoob
%PythonPath%Scripts\easy_install.exe %WEBOOB% 	|| goto :InstallFailed

set StartupFolder=%AppData%\Microsoft\Windows\Start Menu\Programs
if exist "%StartupFolder%" Goto :FoundStartup
set StartupFolder=%UserProfile%\Start Menu\Programs
if exist "%StartupFolder%" Goto :FoundStartup
echo Cannot find Startup folder.
echo do not create launchers
goto :InstallSucceed

:FoundStartup
if exist "%StartupFolder%\Weboob" (
	goto :CreateLauncher
) else (
	md "%StartupFolder%\Weboob"
	goto :CreateLauncher
)

:CreateLauncher
for %%i in (%LIST_APPLIQUATIONS_QT%) do (
	echo Process %%i

	(
	  echo @echo off
	  echo start %PythonPath%pythonw.exe %PythonPath%Scripts\%%i
	) > %%i.bat

	%PythonPath%python.exe convertPNG2ICO.py "%PythonPath%\Lib\site-packages\%WEBOOB%\share\icons\hicolor\64x64\apps\%%i.png" > nul

	if exist "%StartupFolder%\Weboob\%%i.exe" (
		del "%StartupFolder%\Weboob\%%i.exe"
	)

	"Bat_To_Exe_Converter.exe" -bat "%%i.bat" -save "%StartupFolder%\Weboob\%%i.exe" -icon "%PythonPath%\Lib\site-packages\%WEBOOB%\share\icons\hicolor\64x64\apps\%%i.ico" %%i"
	del "%%i.bat"
	del "%PythonPath%\Lib\site-packages\%WEBOOB%\share\icons\hicolor\64x64\apps\%%i.ico"
)

goto :InstallSucceed

:InstallSucceed
echo.
echo INSTALLATION PROCESS SUCCEED
goto :Quit

:InstallFailed
echo.
echo INSTALLATION PROCESS FAILED
goto :Quit

:Quit
pause

@echo off
setlocal enableextensions enabledelayedexpansion

call settings.cmd

echo.
echo 0.Set proxy
set/P HTTP_PROXY=Enter HTTP_PROXY if needed :
set/P HTTPS_PROXY=Enter HTTPS_PROXY if needed :

echo.
echo 1.GNU/WGET Init

set WGET=wget-%ARCHITECTURE%.exe

echo.
echo 2.Check Python 2.7 Installation
set KEY_NAME=HKLM\Software\Python\PythonCore\2.7\InstallPath
REG QUERY %KEY_NAME% > nul || 	(
									set PYTHON_MSI=python-2.7.5.msi
									if %ARCHITECTURE% == x64 (
										set PYTHON_MSI=python-2.7.5.amd64.msi
									)

									echo 2.1 Download !PYTHON_MSI!
									"%WGET%" -o python_donwload "http://www.python.org/ftp/python/2.7.5/!PYTHON_MSI!"

									echo 2.2 Setup !PYTHON_MSI!
									!PYTHON_MSI!

									del !PYTHON_MSI!
									del python_donwload
								)

for /F "tokens=4" %%A IN ('REG QUERY %KEY_NAME%') do (
    set PythonPath=%%A
)

echo.
echo 3.Check PyQt4 Installation
set KEY_NAME=HKLM\Software\PyQt4\Py2.7\InstallPath
REG QUERY %KEY_NAME% > nul || 	(

	echo 3.1 Download PyQt4
	"%WGET%" -o qt_download http://heanet.dl.sourceforge.net/project/pyqt/PyQt4/PyQt-4.10.3/PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-%ARCHITECTURE%.exe

	echo 3.2 Setup PyQt4
	PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-%ARCHITECTURE%.exe

	del PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-%ARCHITECTURE%.exe
	del qt_download
)

echo.
echo 4.Check EasyInstall
if exist "%PythonPath%Scripts\easy_install.exe" (
	goto :InstallWeboobDependances
) else (

	echo 4.1 Setup setuptools
	%PythonPath%python.exe ez_setup.py || goto :InstallFailed

	del setuptools-1.1.6.tar.gz

	goto :InstallWeboobDependances
)

:InstallWeboobDependances
echo.
echo 5.Install Weboob Dependances
echo.
echo -- cssselect
%PythonPath%Scripts\easy_install.exe cssselect || goto :InstallFailed
echo.
echo -- lxml
%PythonPath%Scripts\easy_install.exe lxml==3.2.5 || goto :InstallFailed
echo.
echo -- dateutils
%PythonPath%Scripts\easy_install.exe dateutils || goto :InstallFailed
echo.
echo -- pyyaml
%PythonPath%Scripts\easy_install.exe pyyaml || goto :InstallFailed
echo.
echo -- html2text
%PythonPath%Scripts\easy_install.exe html2text || goto :InstallFailed
echo.
echo -- mechanize
%PythonPath%Scripts\easy_install.exe mechanize || goto :InstallFailed
echo.
echo -- gdata
%PythonPath%Scripts\easy_install.exe gdata || goto :InstallFailed
echo.
echo -- feedparser
%PythonPath%Scripts\easy_install.exe feedparser || goto :InstallFailed
echo.
echo -- pillow
%PythonPath%Scripts\easy_install.exe pillow==2.3.0 || goto :InstallFailed

echo.
echo 6.Install WeBoob
%PythonPath%Scripts\easy_install.exe %WEBOOB% 	|| goto :InstallFailed

set StartupFolder=%AppData%\Microsoft\Windows\Start Menu\Programs
if exist "%StartupFolder%" Goto :FoundStartup
set StartupFolder=%UserProfile%\Start Menu\Programs
if exist "%StartupFolder%" Goto :FoundStartup
echo Cannot find Startup folder.
echo do not create launchers
goto :InstallSucceed

:FoundStartup
if exist "%StartupFolder%\Weboob" (
	goto :CreateLauncher
) else (
	md "%StartupFolder%\Weboob"
	goto :CreateLauncher
)

:CreateLauncher
for %%i in (%LIST_APPLIQUATIONS_QT%) do (
	echo Process %%i

	(
	  echo @echo off
	  echo start %PythonPath%pythonw.exe %PythonPath%Scripts\%%i
	) > %%i.bat

	%PythonPath%python.exe convertPNG2ICO.py "%PythonPath%\Lib\site-packages\%WEBOOB%\share\icons\hicolor\64x64\apps\%%i.png" > nul

	if exist "%StartupFolder%\Weboob\%%i.exe" (
		del "%StartupFolder%\Weboob\%%i.exe"
	)

	"Bat_To_Exe_Converter.exe" -bat "%%i.bat" -save "%StartupFolder%\Weboob\%%i.exe" -icon "%PythonPath%\Lib\site-packages\%WEBOOB%\share\icons\hicolor\64x64\apps\%%i.ico" %%i"
	del "%%i.bat"
	del "%PythonPath%\Lib\site-packages\%WEBOOB%\share\icons\hicolor\64x64\apps\%%i.ico"
)

goto :InstallSucceed

:InstallSucceed
echo.
echo INSTALLATION PROCESS SUCCEED
goto :Quit

:InstallFailed
echo.
echo INSTALLATION PROCESS FAILED
goto :Quit

:Quit
pause

improve windows installer script

improve windows installer script


@echo off
if not defined HOST_PYTHON set HOST_PYTHON=python
%HOST_PYTHON% build_ssl.py %1 %2

@echo off
cd
if not defined HOST_PYTHON set HOST_PYTHON=python
%HOST_PYTHON% build_ssl.py %1 %2

Add debug output to analyse buildbot failure.


@echo off

set nsis_compiler=

if defined NSIS_HOME (
    if exist "%NSIS_HOME%\makensis.exe" (
        set "nsis_compiler=%NSIS_HOME%"
    )
)

if %PROCESSOR_ARCHITECTURE%==x86 (
    set RegQry=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NSIS
) else (
    set RegQry=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NSIS
)

if not defined nsis_compiler (
    for /F "tokens=2*" %%a in ('reg query "%RegQry%" /v InstallLocation ^|findstr InstallLocation') do set nsis_compiler=%%b
)

if not defined nsis_compiler (
    for %%X in (makensis.exe) do (set nsis_compiler=%%~dp$PATH:X)
)

set args=
:loop
    set args=%args% %1
    shift
if not "%~1"=="" goto loop

if defined nsis_compiler (
    "%nsis_compiler%\makensis.exe" %args%
) else (
    echo "Error: makensis.exe isn't in your PATH environment variable."
)

@echo off

set nsis_path=

if defined NSIS_HOME (
    if exist "%NSIS_HOME%\makensis.exe" (
        set "nsis_path=%NSIS_HOME%"
        goto build
    )
)

if %PROCESSOR_ARCHITECTURE%==x86 (
    set RegQry=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NSIS
) else (
    set RegQry=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NSIS
)

if not defined nsis_path (
    for /F "tokens=2*" %%a in ('reg query "%RegQry%" /v InstallLocation ^|findstr InstallLocation') do set nsis_path=%%b
)

if not defined nsis_path (
    for %%X in (makensis.exe) do (set nsis_path=%%~dp$PATH:X)
)

set args=
:loop
    set args=%args% %1
    shift
if not "%~1"=="" goto loop

:build
if defined nsis_path (
    "%nsis_path%\makensis.exe" %args%
) else (
    echo "Error: makensis.exe isn't in your PATH environment variable."
)

rename variable

rename variable


Update nugetpush script

Update nugetpush script


set BLPAPI_ROOT="."
copy "%BLPAPI_ROOT%"\lib\ "%PREFIX%"\lib\
if errorlevel 1 exit 1
"%PYTHON%" setup.py install
if errorlevel 1 exit 1

set BLPAPI_ROOT="."
copy "%BLPAPI_ROOT%"\lib\ "%PREFIX%"\Library\bin
if errorlevel 1 exit 1
"%PYTHON%" setup.py install
if errorlevel 1 exit 1

Fix windows DLL location

Fix windows DLL location


# Copyright 2009 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.

ifeq ($(GOOS),windows)
TARG:=$(TARG).exe
endif

all: $(TARG)

include $(QUOTED_GOROOT)/src/Make.common

PREREQ+=$(patsubst %,%.make,$(DEPS))

$(TARG): _go_.$O $(OFILES)
	$(LD) -o $@ _go_.$O $(OFILES)

_go_.$O: $(GOFILES) $(PREREQ)
	$(GC) -o $@ $(GOFILES)

install: $(QUOTED_GOBIN)/$(TARG)

$(QUOTED_GOBIN)/$(TARG): $(TARG)
	cp -f $(TARG) $(QUOTED_GOBIN)

CLEANFILES+=$(TARG)

nuke: clean
	rm -f $(QUOTED_GOBIN)/$(TARG)

# Copyright 2009 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.

ifeq ($(GOOS),windows)
TARG:=$(TARG).exe
endif

all: $(TARG)

include $(QUOTED_GOROOT)/src/Make.common

PREREQ+=$(patsubst %,%.make,$(DEPS))

$(TARG): _go_.$O
	$(LD) -o $@ _go_.$O

_go_.$O: $(GOFILES) $(PREREQ)
	$(GC) -o $@ $(GOFILES)

install: $(QUOTED_GOBIN)/$(TARG)

$(QUOTED_GOBIN)/$(TARG): $(TARG)
	cp -f $(TARG) $(QUOTED_GOBIN)

CLEANFILES+=$(TARG)

nuke: clean
	rm -f $(QUOTED_GOBIN)/$(TARG)

remove $(OFILES)

Make.cmd: remove $(OFILES)

The linker doesn't support multiple object files (maybe it did in the past?)

R=rsc
CC=golang-dev
http://codereview.appspot.com/2444041

Committer: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>


@echo on

cd git\SwiftShader

git submodule update --init

"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild" SwiftShader.sln

@echo on

SET PATH=%PATH%;C:\python27

cd git\SwiftShader

git submodule update --init

"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild" SwiftShader.sln

Add Python path to Kokoro batch script

Add Python path to Kokoro batch script

Bug b/123360006

Change-Id: Ie29b1fea3607ad0da2fb48cf3a5248e976c2cf5f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27389
Tested-by: Nicolas Capens <51edc787c30f24c4904e8ffbb5523c3a9f7a451d@google.com>
Reviewed-by: Chris Forbes <c3279c50043e18e9442c1ae071cafa0e7a4ca967@google.com>
Reviewed-by: Nicolas Capens <51edc787c30f24c4904e8ffbb5523c3a9f7a451d@google.com>


@echo off
set SELF=%~dp0

set FLAVOR=%1

if "%FLAVOR%" equ "" set FLAVOR=Release

mkdir "%SELF%\build\nuget\content\websharp" > nul 2>&1
mkdir "%SELF%\build\nuget\tools" > nul 2>&1

if not exist "%SELF%\build\download.exe" (
	csc /out:"%SELF%\build\download.exe" "%SELF%\download.cs"
)

if not exist "%SELF%\build\nuget.exe" (
	"%SELF%\build\download.exe" http://nuget.org/nuget.exe "%SELF%\build\nuget.exe"
	"%SELF%\build\nuget.exe" update -self
)

rem csc /out:"%SELF%\..\src\websharpjs\WebSharp.js\bin\Release\net451\WebSharpJs.dll" /target:library "%SELF%\..\src\websharpjs\WebSharp.js\dotnet\*.cs" "%SELF%\..\src\websharpjs\WebSharp.js\dotnet\WebSharpJs.Browser\*.cs"
rem if %ERRORLEVEL% neq 0 exit /b -1

cd "%SELF%\..\src\websharpjs\WebSharp.js"
dotnet restore WebSharp.js.sln /p:Configuration=%FLAVOR% /p:Platform="Any CPU"
if %ERRORLEVEL% neq 0 exit /b -1
dotnet build WebSharp.js.sln /p:Configuration=%FLAVOR% /p:Platform="Any CPU"
if %ERRORLEVEL% neq 0 exit /b -1
dotnet pack WebSharp.js.sln /p:Configuration=%FLAVOR% /p:Platform="Any CPU" /p:IncludeSymbols=true

if %ERRORLEVEL% neq 0 (
	echo Failure building Nuget package
	cd "%SELF%"
	exit /b -1
)

cd "%SELF%"
copy /y "%SELF%\..\src\websharpjs\WebSharp.js\bin\%FLAVOR%\*.nupkg" "%SELF%\build\nuget"
rem Make it available to the electron-dotnet module
copy /y "%SELF%\..\src\websharpjs\WebSharp.js\bin\%FLAVOR%\net451\*.dll" "%SELF%\..\lib\bin"
echo SUCCESS. Nuget package at %SELF%\build\nuget

exit /b 0

@echo off
set SELF=%~dp0

set FLAVOR=%1

if "%FLAVOR%" equ "" set FLAVOR=Release

if not exist "%SELF%\build\download.exe" (
	csc /out:"%SELF%\build\download.exe" "%SELF%\download.cs"
)

if not exist "%SELF%\build\nuget.exe" (
	"%SELF%\build\download.exe" http://nuget.org/nuget.exe "%SELF%\build\nuget.exe"
	"%SELF%\build\nuget.exe" update -self
)

cd "%SELF%\..\src\websharpjs\WebSharp.js"
dotnet restore WebSharp.js.sln /p:Configuration=%FLAVOR% /p:Platform="Any CPU"
if %ERRORLEVEL% neq 0 exit /b -1
dotnet build WebSharp.js.sln /p:Configuration=%FLAVOR% /p:Platform="Any CPU"
if %ERRORLEVEL% neq 0 exit /b -1
dotnet pack WebSharp.js.sln /p:Configuration=%FLAVOR% /p:Platform="Any CPU" /p:IncludeSymbols=true

if %ERRORLEVEL% neq 0 (
	echo Failure building Nuget package
	cd "%SELF%"
	exit /b -1
)

cd "%SELF%"
copy /y "%SELF%\..\src\websharpjs\WebSharp.js\bin\%FLAVOR%\*.nupkg" "%SELF%\build\nuget"
rem Make it available to the electron-dotnet module
copy /y "%SELF%\..\src\websharpjs\WebSharp.js\bin\%FLAVOR%\net451\*.dll" "%SELF%\..\lib\bin"
echo SUCCESS. Nuget package at %SELF%\build\nuget

exit /b 0

Clean up build directories.

Clean up build directories.


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

CHOICE /C 123456789 /M "Enter your choice:"
echo ""
if ERRORLEVEL 9 goto Nine
if ERRORLEVEL 8 goto Eight
if ERRORLEVEL 7 goto Seven
if ERRORLEVEL 6 goto Six
if ERRORLEVEL 5 goto Five
if ERRORLEVEL 4 goto Four
if ERRORLEVEL 3 goto Three
if ERRORLEVEL 2 goto Two
if ERRORLEVEL 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:\
goto MENU

:Two
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
goto MENU

:Three
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
goto MENU

:Four
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
goto MENU

:Five
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
goto MENU

:Six
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
goto MENU

:Seven
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
goto MENU

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

:Nine
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
goto MENU

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

CHOICE /C 123456789 /M "Enter your choice:"
if ERRORLEVEL 9 goto Nine
if ERRORLEVEL 8 goto Eight
if ERRORLEVEL 7 goto Seven
if ERRORLEVEL 6 goto Six
if ERRORLEVEL 5 goto Five
if ERRORLEVEL 4 goto Four
if ERRORLEVEL 3 goto Three
if ERRORLEVEL 2 goto Two
if ERRORLEVEL 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:\
goto MENU

:Two
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
goto MENU

:Three
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
goto MENU

:Four
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
goto MENU

:Five
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
goto MENU

:Six
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
goto MENU

:Seven
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
goto MENU

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

:Nine
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
goto MENU

PAUSE

Update Main.bat

Update Main.bat


@echo off
echo Downloading...
"../../tools/wget" --no-check-certificate http://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz
echo Unzipping...
"../../tools/7za" e cifar-10-binary.tar.gz && del cifar-10-binary.tar.gz
"../../tools/7za" x cifar-10-binary.tar && del cifar-10-binary.tar
echo Done!
pause

Create get_cifar10_dataset.bat

Create get_cifar10_dataset.bat


@ECHO OFF

REM the location of this batch file
SET SOURCE=%~dp0

REM extract project folder name
FOR /D %%I IN ("%SOURCE%\.") DO SET NAME=%%~nxI

REM target names
SET DEPLOY=%NAME%-deploy
SET TARGET="%SOURCE%..\%DEPLOY%"
SET SOURCE="%SOURCE%"

ECHO This script can create a deployment in %TARGET%
ECHO.

IF NOT EXIST %TARGET% GOTO deploy

ECHO "%DEPLOY%" folder already exists, please rename or remove it and try again.
ECHO.

PAUSE
EXIT

:DEPLOY

ECHO ==========
ECHO build step
ECHO ==========
ECHO.

REM FIXME: we push/pop to satisfy minify.bat requirement that package.js be in CWD

PUSHD "%CD%"
CD "%SOURCE%/minify"

REM build enyo
CALL ..\enyo\minify\minify.bat

REM build app
CALL ..\enyo\tools\minify.bat package.js -output ..\build\app

POPD

ECHO =========
ECHO copy step
ECHO =========
ECHO.

REM make deploy folder
MKDIR %TARGET%

REM copy root folder files
COPY %SOURCE%index.html %TARGET% >NUL
COPY %SOURCE%icon.png %TARGET% >NUL

REM copy assets and build
XCOPY %SOURCE%assets\*.* %TARGET%\assets\ /Q /E >NUL
XCOPY %SOURCE%build\*.* %TARGET%\build\ /Q /E >NUL

REM copy library items
MKDIR %TARGET%\lib

FOR /D %%G in (%SOURCE%lib\*) DO IF EXIST "%%G\deploy.bat" ECHO deploying "%%~nxG"
FOR /D %%G in (%SOURCE%lib\*) DO IF EXIST "%%G\deploy.bat" CALL "%%G\deploy.bat" %TARGET%\lib\"%%~nxG"

FOR /D %%G in (%SOURCE%lib\*) DO IF NOT EXIST "%%G\deploy.bat" ECHO copying "%%~nxG"
FOR /D %%G in (%SOURCE%lib\*) DO IF NOT EXIST "%%G\deploy.bat" XCOPY "%%G" %TARGET%\lib\"%%~nxG"\ /Q /E >NUL

ECHO.

PAUSE

add deploy.bat

add deploy.bat


@ECHO OFF
SETLOCAL

:: This batch file creates NuGet packages for shipped MSBuild 14.0 assemblies.  It copies the assemblies locally and then builds "reference"
:: assemblies which are empty assemblies used by the compiler during a build.  The reference assembly is built for net45 and netstandard1.3 with
:: certain code #ifdef'd out.  This allows users to compile a single assembly that should work cross-platform

:: To update the packages, change the VERSIONMINOR, VERSIONBUILD, and BUILDDROP variables.  Generally packages should be pushed to the dotnet
:: NuGet feed until tested and then placed on NuGet.org.

:: The major version here should align with the major version of MSBuild being packaged
SET VERSIONMAJOR=14
:: The minor version here should align with the Visual Studio Update of MSBuild being packaged
SET VERSIONMINOR=3
:: The build number here should be incremented when servicing the NuGet package.  The tag should be prereleaseNN when trying out something new
SET VERSIONBUILD=0-prerelease02
:: This is the path to where this file is located
SET ROOT=%~dp0
:: The path to where packages will be outputed to
SET PKGDIR=%ROOT%packages
:: The path to the build drop containing the assemblies to be packaged
SET BUILDDROP=\\cpvsbuild\drops\VS\d14rel\raw\25420.01\binaries.x86ret\bin\i386\xmake
:: The build configuration for the reference assemblies
SET CONFIGURATION=Release
:: The icon url to use in the packages
SET ICONURL=https://go.microsoft.com/fwlink/?linkid=825694
:: The license url to use in the packages
SET LICENSEURL=http://go.microsoft.com/fwlink/?LinkId=329770
:: The project url to use in the packages
SET PROJECTURL=http://go.microsoft.com/fwlink/?LinkId=624683

:: Ensure dotnet.exe is on the PATH
where dotnet.exe>NUL 2>&1
IF ERRORLEVEL 1 (
    ECHO Could not find dotnet.exe on the PATH, please open a command window with dotnet.exe on the PATH or install the dotnet CLI first. 1>&2
    EXIT /B 1
)

:: Ensure nuget.exe is on the PATH
where nuget.exe>NUL 2>&1
IF ERRORLEVEL 1 (
    ECHO Could not find nuget.exe on the PATH, please open a command window with nuget.exe on the PATH. 1>&2
    EXIT /B 1
)

:: Create a package for each assembly.  The ordering here sort of matters based on the dependencies of the assemblies
CALL :CreatePackage "Microsoft.Build.Framework"
CALL :CreatePackage "Microsoft.Build"
CALL :CreatePackage "Microsoft.Build.Engine"
CALL :CreatePackage "Microsoft.Build.Utilities.Core"
CALL :CreatePackage "Microsoft.Build.Tasks.Core"
CALL :CreatePackage "Microsoft.Build.Conversion.Core"

GOTO :EOF

:CreatePackage
:: BasePath is the root path of the assembly to build
SET BASEPATH=%ROOT%\%~1
:: The path to the .nuspec
SET NUSPEC=%BASEPATH%\%~1.nuspec
:: The path to the project.json
SET PROJECTJSON=%BASEPATH%\project.json
:: The path to where to copy the shipped assembly locally
SET LIBPATH=%BASEPATH%\lib\net45

IF EXIST "%PROJECTJSON%" (
    :: Restore NuGet packages based on the project.json
    dotnet restore "%PROJECTJSON%"
    IF ERRORLEVEL 1 ECHO Error restoring packages & EXIT /B 1

    :: Build the referece assemblies.  This will build against all frameworks in the project.json
    dotnet build "%PROJECTJSON%" --configuration "%CONFIGURATION%"
    IF ERRORLEVEL 1 EXIT /B 1
)
:: Ensure the packages directory exists otherwise NuGet will complain...
IF NOT EXIST "%PKGDIR%" MKDIR "%PKGDIR%"

:: Copy the lib assembly locally for NuGet to consume
xcopy /ydsi %BUILDDROP%\%~1.dll "%LIBPATH%\"
IF ERRORLEVEL 1 EXIT /B 1

:: Create the NuGet package
NuGet PACK "%NUSPEC%" -BasePath "%BASEPATH%" -Properties "id=%~1;version=%VERSIONMAJOR%.%VERSIONMINOR%.%VERSIONBUILD%;configuration=%CONFIGURATION%;iconUrl=%ICONURL%;licenseUrl=%LICENSEURL%;projectUrl=%PROJECTURL%" -OutputDirectory "%PKGDIR%" -Verbosity Detailed

GOTO :EOF

@ECHO OFF
SETLOCAL

:: This batch file creates NuGet packages for shipped MSBuild 14.0 assemblies.  It copies the assemblies locally and then builds "reference"
:: assemblies which are empty assemblies used by the compiler during a build.  The reference assembly is built for net45 and netstandard1.3 with
:: certain code #ifdef'd out.  This allows users to compile a single assembly that should work cross-platform

:: To update the packages, change the VERSIONMINOR, VERSIONBUILD, and BUILDDROP variables.  Generally packages should be pushed to the dotnet
:: NuGet feed until tested and then placed on NuGet.org.

:: The major version here should align with the major version of MSBuild being packaged
SET VERSIONMAJOR=14
:: The minor version here should align with the Visual Studio Update of MSBuild being packaged
SET VERSIONMINOR=3
:: The build number here should be incremented when servicing the NuGet package.  The tag should be prereleaseNN when trying out something new
SET VERSIONBUILD=0
:: This is the path to where this file is located
SET ROOT=%~dp0
:: The path to where packages will be outputed to
SET PKGDIR=%ROOT%packages
:: The path to the build drop containing the assemblies to be packaged
SET BUILDDROP=\\cpvsbuild\drops\VS\d14rel\raw\25420.01\binaries.x86ret\bin\i386\xmake
:: The build configuration for the reference assemblies
SET CONFIGURATION=Release
:: The icon url to use in the packages
SET ICONURL=https://go.microsoft.com/fwlink/?linkid=825694
:: The license url to use in the packages
SET LICENSEURL=http://go.microsoft.com/fwlink/?LinkId=329770
:: The project url to use in the packages
SET PROJECTURL=http://go.microsoft.com/fwlink/?LinkId=624683

:: Ensure dotnet.exe is on the PATH
where dotnet.exe>NUL 2>&1
IF ERRORLEVEL 1 (
    ECHO Could not find dotnet.exe on the PATH, please open a command window with dotnet.exe on the PATH or install the dotnet CLI first. 1>&2
    EXIT /B 1
)

:: Ensure nuget.exe is on the PATH
where nuget.exe>NUL 2>&1
IF ERRORLEVEL 1 (
    ECHO Could not find nuget.exe on the PATH, please open a command window with nuget.exe on the PATH. 1>&2
    EXIT /B 1
)

:: Create a package for each assembly.  The ordering here sort of matters based on the dependencies of the assemblies
CALL :CreatePackage "Microsoft.Build.Framework"
CALL :CreatePackage "Microsoft.Build"
CALL :CreatePackage "Microsoft.Build.Engine"
CALL :CreatePackage "Microsoft.Build.Utilities.Core"
CALL :CreatePackage "Microsoft.Build.Tasks.Core"
CALL :CreatePackage "Microsoft.Build.Conversion.Core"

GOTO :EOF

:CreatePackage
:: BasePath is the root path of the assembly to build
SET BASEPATH=%ROOT%\%~1
:: The path to the .nuspec
SET NUSPEC=%BASEPATH%\%~1.nuspec
:: The path to the project.json
SET PROJECTJSON=%BASEPATH%\project.json
:: The path to where to copy the shipped assembly locally
SET LIBPATH=%BASEPATH%\lib\net45

IF EXIST "%PROJECTJSON%" (
    :: Restore NuGet packages based on the project.json
    dotnet restore "%PROJECTJSON%"
    IF ERRORLEVEL 1 ECHO Error restoring packages & EXIT /B 1

    :: Build the referece assemblies.  This will build against all frameworks in the project.json
    dotnet build "%PROJECTJSON%" --configuration "%CONFIGURATION%"
    IF ERRORLEVEL 1 EXIT /B 1
)
:: Ensure the packages directory exists otherwise NuGet will complain...
IF NOT EXIST "%PKGDIR%" MKDIR "%PKGDIR%"

:: Copy the lib assembly locally for NuGet to consume
xcopy /ydsi %BUILDDROP%\%~1.dll "%LIBPATH%\"
IF ERRORLEVEL 1 EXIT /B 1

:: Create the NuGet package
NuGet PACK "%NUSPEC%" -BasePath "%BASEPATH%" -Properties "id=%~1;version=%VERSIONMAJOR%.%VERSIONMINOR%.%VERSIONBUILD%;configuration=%CONFIGURATION%;iconUrl=%ICONURL%;licenseUrl=%LICENSEURL%;projectUrl=%PROJECTURL%" -OutputDirectory "%PKGDIR%" -Verbosity Detailed

GOTO :EOF

Remove prerelease tag from MSBuild 14 packages (#987)


start cmd /C "set DEBUG=DoddCMS & npm start"

start cmd /C "set DEBUG=DoddCMS & pm2 start process.json &pm2 logs"

修改运行命令依赖于pm2

修改运行命令依赖于pm2


for /r %cd%/SPEC_PSX %%x in (*.BIN) do move "%%x" "%cd%/BUILD/TOOLS/CODEWAD_Pack/Release/GAME"
for /r %cd%/SPEC_PSX %%x in (*.REL) do move "%%x" "%cd%/BUILD/TOOLS/CODEWAD_Pack/Release/GAME"
for /r %cd%/GAME %%x in (*.BIN) do move "%%x" "%cd%/BUILD/TOOLS/CODEWAD_Pack/Release/GAME"
for /r %cd%/GAME %%x in (*.REL) do move "%%x" "%cd%/BUILD/TOOLS/CODEWAD_Pack/Release/GAME"
for /r %cd%/SPEC_PSX %%x in (*.MOD) do move "%%x" "%cd%/BUILD/TOOLS/GAMEWAD_Pack/Release/DATA"

Create PSX_MOVE_OVERLAYS.bat

Create PSX_MOVE_OVERLAYS.bat


Add file rpwibuild.bat

Add file rpwibuild.bat


mingw32-make
call PSX_EXPORT_OVERLAYS.bat
call PSX_MOVE_OVERLAYS.bat
call PSX_CREATE_GAMEWAD.bat
cd DISC
CPE2X MAIN.CPE
MAKEISO.bat
cd ../

Update PSX_BUILD.bat

Update PSX_BUILD.bat


RMDIR "%~dp0..\Drops" /S /Q
MKDIR "%~dp0..\Drops"
MKDIR "%~dp0..\Drops\Temp"
MKDIR "%~dp0..\Drops\Temp\agent"
MKDIR "%~dp0..\Drops\Temp\agent\bin"

XCOPY /E /Y "%~dp0..\Solutions\*.*" "%~dp0..\Drops\Temp"
XCOPY /E /Y  "%~dp0..\..\src\OctopusPuppet.Cmd\bin\Release\*.*" "%~dp0..\Drops\Temp\agent\bin"
DEL "%~dp0..\Drops\Temp\agent\bin\*.xml"
DEL "%~dp0..\Drops\Temp\agent\bin\*.pdb"

@PowerShell -File %~dp0Create-Zip.ps1 %~dp0..\Drops\Temp\agent\ %~dp0..\Drops\Temp\agent\octopuspuppet-metarunner.zip
PAUSE
DEL "%~dp0..\Drops\Temp\agent\*.xml"
RMDIR "%~dp0..\Drops\Temp\agent\bin" /S /Q
PAUSE
@PowerShell -File "%~dp0Create-Zip.ps1" -target %~dp0..\Drops\Temp\ %~dp0..\Drops\octopuspuppet-metarunner.zip

RMDIR "%~dp0..\Drops\Temp\" /S /Q

PAUSE

Remove pause as we want to build it from CI agent