:: Purpose:       Removes all versions of Microsoft Silverlight from a system. Saves a log to c:\logs by default
:: Requirements:  Run this script with an admin account
:: Author:        vocatus on reddit.com/r/sysadmin ( vocatus.gate@gmail.com ) // PGP key ID: 0x82A211A2
:: History:       1.0.0 + Initial write
SETLOCAL

:::::::::::::::
:: VARIABLES :: ---- Set these to your desired values. The defaults should work fine though ------ ::
:::::::::::::::
:: Rules for variables:
::  * NO quotes!                       (bad:  "%SYSTEMDRIVE%\directory\path"       )
::  * NO trailing slashes on the path! (bad:   %SYSTEMDRIVE%\directory\            )
::  * Spaces are okay                  (okay:  %SYSTEMDRIVE%\my folder\with spaces )
::  * Network paths are okay           (okay:  \\server\share name      )
::                                     (       \\172.16.1.5\share name  )

:: Log location and name. Do not use trailing slashes (\)
set LOGPATH=%SystemDrive%\Logs
set LOGFILE=%COMPUTERNAME%_microsoft_silverlight_nuker.log

:: Force-close processes that might be using Silverlight? Recommend leaving this set to 'yes' unless you
:: specifically want to abort the script if the target machine might possibly be using Silverlight.
:: If you change this to 'no', the script will exit with an error code if it thinks Silverlight could be in use.
set FORCE_CLOSE_PROCESSES=yes
:: Exit code to use when FORCE_CLOSE_PROCESSES is "no" and a potential Silverlight-dependent process is detected
set FORCE_CLOSE_PROCESSES_EXIT_CODE=1618

:: =============================================================================================== ::
:: ======  Think of everything below this line like a feral badger: Look, but Do Not Touch  ====== ::
:: =============================================================================================== ::

:::::::::::::::::::::
:: PREP AND CHECKS ::
:::::::::::::::::::::
@echo off && cls
set SCRIPT_VERSION=1.0.0
set SCRIPT_UPDATED=2019-10-17
:: Get the date into ISO 8601 standard 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"

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

:: Check if we're on XP. This affects some commands later, because XP uses slightly
:: different binaries for reg.exe and various other Windows utilities
set OS_VERSION=OTHER
ver | find /i "XP" >NUL
IF %ERRORLEVEL%==0 set OS_VERSION=XP

title Silverlight Nuker v%SCRIPT_VERSION% (%SCRIPT_UPDATED%)

:::::::::::::::::::::::::::
:: FORCE-CLOSE PROCESSES :: -- Do we want to kill Silverlight before running? If so, this is where it happens
:::::::::::::::::::::::::::
if %FORCE_CLOSE_PROCESSES%==yes (
	REM Kill all browsers and running Silverlight instances
	call :log "%CUR_DATE% %TIME%   Looking for and closing all running browsers and Silverlight instances..."
	if %OS_VERSION%==XP (
		REM XP version of the task killer
		REM this loop contains the processes we should kill
		for %%i in (battle,chrome,firefox,silverlight,iexplore,iexplorer,opera,palemoon,plugin-container,skype,steam,yahoo) do (
			echo     Searching for %%i.exe...
			%WINDIR%\system32\tskill.exe /a /v %%i* >> "%LOGPATH%\%LOGFILE%" 2>NUL
		)
	) else (
		REM 7/8/2008/2008R2/2012/etc version of the task killer
		REM this loop contains the processes we should kill
		FOR %%i in (battle.net,chrome,firefox,Silverlight,iexplore,iexplorer,opera,palemoon,plugin-container,skype,steam,yahoo) do (
			echo     Searching for %%i.exe...
			%WINDIR%\system32\taskkill.exe /f /fi "IMAGENAME eq %%i*" /T >> "%LOGPATH%\%LOGFILE%" 2>NUL
		)
	)
)

:: If we DON'T want to force-close Silverlight, then check for possible running Silverlight processes and abort the script if we find any
if %FORCE_CLOSE_PROCESSES%==no (
	call :log "%CUR_DATE% %TIME%   Variable FORCE_CLOSE_PROCESSES is set to '%FORCE_CLOSE_PROCESSES%'. Checking for running processes before execution..."

	REM Don't ask...
	REM Okay so basically we loop through this list of processes, and for each one we dump the result of the search in the '%%a' variable.
	REM Then we check that variable, and if it's not null (e.g. FIND.exe found something) we abort the script, returning the exit code
	REM specified at the beginning of the script. Normally you'd use ERRORLEVEL for this, but because it is very flaky (it doesn't
	REM always get set, even when it should) we instead resort to using this method of dumping the results in a variable and checking it.
	for %%i IN (battle.net,chrome,firefox,silverlight,iexplore,iexplorer,opera,palemoon,plugin-container,skype,steam,yahoo) do (
		call :log "%CUR_DATE% %TIME%   Searching for %%i.exe...
		for /f "delims=" %%a in ('tasklist ^| find /i "%%i"') do (
			if not [%%a]==[] (
				call :log "%CUR_DATE% %TIME% ! ERROR: Process '%%i' is currently running, aborting."
				exit /b %FORCE_CLOSE_PROCESSES_EXIT_CODE%
			)
		)
	)
	REM If we made it this far, we didn't find anything, so we can go ahead
	call :log "%CUR_DATE% %TIME%   All clear, no Silverlight-related processes found. Going ahead with removal..."
)

:::::::::::::
:: EXECUTE ::
:::::::::::::
:: Log that we started
call :log "%CUR_DATE% %TIME%   Beginning removal of Silverlight, all versions..."

:::::::::::::::::::::::::
:: UNINSTALLER SECTION :: -- Here we just brute-force every "normal" method for removing
:::::::::::::::::::::::::    Silverlight, then resort to more painstaking methods later

:: Attempt WMIC by name, this should usually catch most installations
call :log "%CUR_DATE% %TIME%    Attempting removal via WMIC name wildcard..."
wmic product where "name like 'Silverlight%%'" uninstall /nointeractive >> "%LOGPATH%\%LOGFILE%"
call :log "%CUR_DATE% %TIME%    Done."

:: Attempt WMIC by specific GUID listing
call :log "%CUR_DATE% %TIME%    Attempting removal via specific GUID listing..."
	:: Silverlight ActiveX ProductCodes
	:: Silverlight
	MsiExec.exe /uninstall {A1591282-1198-4647-A2B1-27E5FF5F6F3B} /quiet /norestart
	:: Silverlight v5.1.41212.0
	MsiExec.exe /uninstall {89F4137D-6C26-4A84-BDB8-2E5A4BB71E00} /quiet /norestart
call :log "%CUR_DATE% %TIME%    Done."

::::::::::::::::::::::::::::::::
:: FILE AND DIRECTORY CLEANUP ::
::::::::::::::::::::::::::::::::
call :log "%CUR_DATE% %TIME%   Launching manual purge of leftover files..."

:: JOB: Directories
call :log "%CUR_DATE% %TIME%    Removing directories..."
	if exist "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Microsoft Silverlight" rmdir "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Microsoft Silverlight" /s /q >> "%LOGPATH%\%LOGFILE%" 2>NUL
	if exist "%ProgramFiles%\Microsoft Silverlight" rmdir "%ProgramFiles%\Microsoft Silverlight" /s /q >> "%LOGPATH%\%LOGFILE%" 2>NUL
	if exist "%ProgramFiles(x86)%\Microsoft Silverlight" rmdir "%ProgramFiles(x86)%\Microsoft Silverlight" /s /q >> "%LOGPATH%\%LOGFILE%" 2>NUL
call :log "%CUR_DATE% %TIME%    Done."

:: JOB: Prefetch and cache files
call :log "%CUR_DATE% %TIME%    Purging prefetch and cache files..."
	if exist "%WINDIR%\Prefetch\SILVERLIGHT*.pf" del "%WINDIR%\Prefetch\SILVERLIGHT*.pf" >> "%LOGPATH%\%LOGFILE%" 2>NUL
call :log "%CUR_DATE% %TIME%    Done."

:: JOB: Registry entries
call :log "%CUR_DATE% %TIME%    Purging registry entries..."
	reg delete HKLM\Software\Microsoft\Silverlight /f >> "%LOGPATH%\%LOGFILE%" 2>NUL
	reg delete HKEY_CLASSES_ROOT\Installer\Products\D7314F9862C648A4DB8BE2A5B47BE100 /f >> "%LOGPATH%\%LOGFILE%" 2>NUL
	reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\D7314F9862C648A4DB8BE2A5B47BE100 /f >> "%LOGPATH%\%LOGFILE%" 2>NUL
	reg delete HKEY_CLASSES_ROOT\TypeLib\{283C8576-0726-4DBC-9609-3F855162009A} /f >> "%LOGPATH%\%LOGFILE%" 2>NUL
	reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\install.exe /f >> "%LOGPATH%\%LOGFILE%" 2>NUL
	reg delete HKEY_CLASSES_ROOT\AgControl.AgControl /f >> "%LOGPATH%\%LOGFILE%" 2>NUL
	reg delete HKEY_CLASSES_ROOT\AgControl.AgControl.5.1 /f >> "%LOGPATH%\%LOGFILE%" 2>NUL
	reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00} /f >> "%LOGPATH%\%LOGFILE%" 2>NUL
call :log "%CUR_DATE% %TIME%    Done."

call :log "%CUR_DATE% %TIME%   Removal complete. Recommend rebooting immediately."

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

:::::::::::::::
:: FUNCTIONS ::
:::::::::::::::
:log
echo:%~1 >> "%LOGPATH%\%LOGFILE%"
echo:%~1
goto :eof

Create microsoft_silverlight_nuker.bat

Create microsoft_silverlight_nuker.bat


::batch file for win platform
@echo off
set BASE_DIR=%~dp0
set USB_VID=8087
set USB_PID=0a99
set /a TIMEOUT=60

::Phone flash tools configuration part
set DO_RECOVERY=0
set EDISON_XML_FILE="%BASE_DIR%pft-config-edison.xml"
set PFT_XML_FILE="%BASE_DIR%pft-config-edison.xml"

:: Handle Ifwi file for DFU update
set IFWI_DFU_FILE=%BASE_DIR%edison_ifwi-dbg

set VAR_DIR=%BASE_DIR%u-boot-envs\
set VARIANT_NAME_DEFAULT=edison-defaultrndis
set VARIANT_NAME_BLANK=edison-blankrndis
set VARIANT_NAME=%VARIANT_NAME_BLANK%

set LOG_FILENAME=flash.log
set /a verbose_output=0
:: ********************************************************************
:: parse arg
set show_help=0
set argcount=0
set appname=%0
:parse_arg_start
if -%1-==-- goto parse_arg_end
if -%1- == ---recovery- (
	set /a DO_RECOVERY=1
)
if -%1- == ---keep-data- (
	set VARIANT_NAME=%VARIANT_NAME_DEFAULT%
)
if -%1- == -/?- set /a show_help=1
if -%1- == --h- set /a show_help=1
if -%1- == ---help- set /a show_help=1
if -%1- == --v- set /a verbose_output=1
set /a argcount+= 1
shift
goto :parse_arg_start
:parse_arg_end

:: handle help on cmd arg
if %show_help% == 1 (
	call:print-usage %appname%
	exit /b
)

if %verbose_output% == 1 goto skip_init_log
echo ** Flashing Edison Board %date% %time% ** >> %LOG_FILENAME%
:skip_init_log

:: ********************************************************************
:: Ifwi flashing part
if %DO_RECOVERY% == 0 goto :skip_flash_ifwi
echo Starting Recovery mode
echo Please plug and reboot the board
if not exist %PFT_XML_FILE% (
	echo %PFT_XML_FILE% does not exist
	exit /b 3
)
echo Flashing IFWI
call:flash-ifwi
if %errorlevel% neq 0 ( exit /b %errorlevel%)
echo Recovery Success...
echo You can now try a regular flash
goto :skip_flash_kernel
:skip_flash_ifwi

:: ********************************************************************
:: Kernel & rootfs flashing part
echo Using U-boot target: %VARIANT_NAME%
set VARIANT_FILE="%VAR_DIR%%VARIANT_NAME%.bin"
	if not exist %VARIANT_FILE% (
		echo U-boot target %VARIANT_NAME%: %VARIANT_FILE% not found aborting
		exit /b 5
)

echo Now waiting for dfu device %USB_VID%:%USB_PID%
echo Please plug and reboot the board
call:dfu-wait
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing IFWI
call:flash-dfu-ifwi ifwi00 "%IFWI_DFU_FILE%-00-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib00 "%IFWI_DFU_FILE%-00-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi01 "%IFWI_DFU_FILE%-01-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib01 "%IFWI_DFU_FILE%-01-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi02 "%IFWI_DFU_FILE%-02-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib02 "%IFWI_DFU_FILE%-02-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi03 "%IFWI_DFU_FILE%-03-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib03 "%IFWI_DFU_FILE%-03-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi04 "%IFWI_DFU_FILE%-04-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib04 "%IFWI_DFU_FILE%-04-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi05 "%IFWI_DFU_FILE%-05-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib05 "%IFWI_DFU_FILE%-05-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi06 "%IFWI_DFU_FILE%-06-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib06 "%IFWI_DFU_FILE%-06-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing U-Boot
call:flash-command --alt u-boot0 -D "%BASE_DIR%u-boot-edison.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing U-Boot Environment
call:flash-command --alt u-boot-env0 -D %VARIANT_FILE%
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing U-Boot Environment Backup
call:flash-command --alt u-boot-env1 -D %VARIANT_FILE% -R
if %errorlevel% neq 0 ( exit /b %errorlevel%)
echo Rebooting to apply partiton changes
call:dfu-wait
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing boot partition ^(kernel^)
call:flash-command --alt boot -D "%BASE_DIR%resin-edison-edison.hddimg"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo "Flashing data_disk, ^(it can take up to 5 minutes... Please be patient^)"
call:flash-command --alt data_disk -D "%BASE_DIR%data_disk.img"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing rootfs, ^(it can take up to 5 minutes... Please be patient^)
call:flash-command --alt rootfs -D "%BASE_DIR%resin-edison-edison.ext4" -R
if %errorlevel% neq 0 ( exit /b %errorlevel% )

echo Rebooting
echo U-boot ^& Kernel System Flash Success...
if %VARIANT_NAME% == %VARIANT_NAME_BLANK% (
	echo Your board needs to reboot to complete the flashing procedure, please do not unplug it for 2 minutes.
)
:skip_flash_kernel

:: ********************************************************************
:: The End
exit /b 0

:print-usage
	echo Usage: %1 [-h] [--help] [--recovery] [--keep-data]
	echo Update all software and restore board to its initial state.
	echo  -h,--help     display this help and exit.
	echo  -v            verbose output
	echo  --recovery    recover the board to DFU mode using a dedicated tool,
	echo                available only on linux and window hosts.
	echo  --keep-data   preserve user data when flashing.
	exit /b 5

:flash-dfu-ifwi
	dfu-util -d %USB_VID%:%USB_PID% -l | findstr "%1" > NUL 2>&1
	if %errorlevel% == 0 (
		call:flash-command --alt %1 -D %2
		exit /b %errorlevel%
	)
	exit /b 0

:flash-command
	set filterout="on"
	if %verbose_output% == 1 ( set filterout="off")

	dfu-util -d %USB_VID%:%USB_PID% %* 2>&1 | cscript.exe /E:JScript //B filter-dfu-out.js %LOG_FILENAME% %filterout%

	set /a err_num=%errorlevel%
	if %err_num% neq 0 echo Flash failed on %*
	exit /b %err_num%

:flash-debug
	echo DEBUG: dfu-util -l
	dfu-util -l
	exit /b

:flash-ifwi
	for %%X in (xfstk-dldr-solo.exe) do (set xfstk_tool_found=%%~$PATH:X)
	for %%X in (cflasher.exe) do (set pft_tool_found=%%~$PATH:X)
	if defined pft_tool_found (
		call:flash-ifwi-pft
		exit /b %errorlevel%
	)
	if defined xfstk_tool_found (
		call:flash-ifwi-xfstk
		exit /b %errorlevel%
	)
	echo !!! You should install xfstk tools, please visit http://xfstk.sourceforge.net/
	exit /b 3

:flash-ifwi-xfstk
	xfstk-dldr-solo.exe --gpflags 0x80000007 --osimage "%BASE_DIR%u-boot-edison.img"  --fwdnx "%BASE_DIR%edison_dnx_fwr.bin" --fwimage "%BASE_DIR%edison_ifwi-dbg-00.bin" --osdnx "%BASE_DIR%edison_dnx_osr.bin"
	set /a err_num=%errorlevel%
	if %err_num% neq 0 echo Ifwi Flash failed
	exit /b %err_num%

:flash-ifwi-pft
	cflasher -f %PFT_XML_FILE%
	set /a err_num=%errorlevel%
	if %err_num% neq 0 echo Ifwi Flash failed
	exit /b %err_num%

:dfu-wait
	setlocal
	set /a currtime=%TIMEOUT%
:start_wait
	dfu-util -l -d %USB_VID%:%USB_PID% | findstr "Found" | findstr "%USB_VID%" > NUL 2>&1
	if %errorlevel% == 0 (
		echo Dfu device found
		exit /b 0
	) else (
		set /a currtime-= 1
		timeout /t 1 /nobreak > nul
		if %currtime% gtr 0 goto:start_wait
	)
	echo Dfu device not found Timeout
	echo Did you plug and reboot your board?
	echo If yes, please try a recovery by calling this script with the --recovery option
	exit /b 3

::batch file for win platform
@echo off
set BASE_DIR=%~dp0
set USB_VID=8087
set USB_PID=0a99
set /a TIMEOUT=60

::Phone flash tools configuration part
set DO_RECOVERY=0
set EDISON_XML_FILE="%BASE_DIR%pft-config-edison.xml"
set PFT_XML_FILE="%BASE_DIR%pft-config-edison.xml"

:: Handle Ifwi file for DFU update
set IFWI_DFU_FILE=%BASE_DIR%edison_ifwi-dbg

set VAR_DIR=%BASE_DIR%u-boot-envs\
set VARIANT_NAME_DEFAULT=edison-defaultrndis
set VARIANT_NAME_BLANK=edison-blankrndis
set VARIANT_NAME=%VARIANT_NAME_BLANK%

set LOG_FILENAME=flash.log
set /a verbose_output=0
:: ********************************************************************
:: parse arg
set show_help=0
set argcount=0
set appname=%0
:parse_arg_start
if -%1-==-- goto parse_arg_end
if -%1- == ---recovery- (
	set /a DO_RECOVERY=1
)
if -%1- == ---keep-data- (
	set VARIANT_NAME=%VARIANT_NAME_DEFAULT%
)
if -%1- == -/?- set /a show_help=1
if -%1- == --h- set /a show_help=1
if -%1- == ---help- set /a show_help=1
if -%1- == --v- set /a verbose_output=1
set /a argcount+= 1
shift
goto :parse_arg_start
:parse_arg_end

:: handle help on cmd arg
if %show_help% == 1 (
	call:print-usage %appname%
	exit /b
)

if %verbose_output% == 1 goto skip_init_log
echo ** Flashing Edison Board %date% %time% ** >> %LOG_FILENAME%
:skip_init_log

:: ********************************************************************
:: Ifwi flashing part
if %DO_RECOVERY% == 0 goto :skip_flash_ifwi
echo Starting Recovery mode
echo Please plug and reboot the board
if not exist %PFT_XML_FILE% (
	echo %PFT_XML_FILE% does not exist
	exit /b 3
)
echo Flashing IFWI
call:flash-ifwi
if %errorlevel% neq 0 ( exit /b %errorlevel%)
echo Recovery Success...
echo You can now try a regular flash
goto :skip_flash_kernel
:skip_flash_ifwi

:: ********************************************************************
:: Kernel & rootfs flashing part
echo Using U-boot target: %VARIANT_NAME%
set VARIANT_FILE="%VAR_DIR%%VARIANT_NAME%.bin"
	if not exist %VARIANT_FILE% (
		echo U-boot target %VARIANT_NAME%: %VARIANT_FILE% not found aborting
		exit /b 5
)

echo Now waiting for dfu device %USB_VID%:%USB_PID%
echo Please plug and reboot the board
call:dfu-wait
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing IFWI
call:flash-dfu-ifwi ifwi00 "%IFWI_DFU_FILE%-00-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib00 "%IFWI_DFU_FILE%-00-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi01 "%IFWI_DFU_FILE%-01-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib01 "%IFWI_DFU_FILE%-01-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi02 "%IFWI_DFU_FILE%-02-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib02 "%IFWI_DFU_FILE%-02-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi03 "%IFWI_DFU_FILE%-03-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib03 "%IFWI_DFU_FILE%-03-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi04 "%IFWI_DFU_FILE%-04-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib04 "%IFWI_DFU_FILE%-04-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi05 "%IFWI_DFU_FILE%-05-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib05 "%IFWI_DFU_FILE%-05-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

call:flash-dfu-ifwi ifwi06 "%IFWI_DFU_FILE%-06-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)
call:flash-dfu-ifwi ifwib06 "%IFWI_DFU_FILE%-06-dfu.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing U-Boot
call:flash-command --alt u-boot0 -D "%BASE_DIR%u-boot-edison.bin"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing U-Boot Environment
call:flash-command --alt u-boot-env0 -D %VARIANT_FILE%
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing U-Boot Environment Backup
call:flash-command --alt u-boot-env1 -D %VARIANT_FILE% -R
if %errorlevel% neq 0 ( exit /b %errorlevel%)
echo Rebooting to apply partiton changes
call:dfu-wait
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing boot partition ^(kernel^)
call:flash-command --alt resin-boot -D "%BASE_DIR%resin-image-edison.hddimg"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo "Flashing config partition"
call:flash-command --alt resin-conf -D "%BASE_DIR%config.img"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo "Flashing data_disk, ^(it can take up to 5 minutes... Please be patient^)"
call:flash-command --alt resin-data -D "%BASE_DIR%data_disk.img"
if %errorlevel% neq 0 ( exit /b %errorlevel%)

echo Flashing rootfs, ^(it can take up to 5 minutes... Please be patient^)
call:flash-command --alt resin-root -D "%BASE_DIR%resin-image-edison.ext3" -R
if %errorlevel% neq 0 ( exit /b %errorlevel% )

echo Rebooting
echo U-boot ^& Kernel System Flash Success...
if %VARIANT_NAME% == %VARIANT_NAME_BLANK% (
	echo Your board needs to reboot to complete the flashing procedure, please do not unplug it for 2 minutes.
)
:skip_flash_kernel

:: ********************************************************************
:: The End
exit /b 0

:print-usage
	echo Usage: %1 [-h] [--help] [--recovery] [--keep-data]
	echo Update all software and restore board to its initial state.
	echo  -h,--help     display this help and exit.
	echo  -v            verbose output
	echo  --recovery    recover the board to DFU mode using a dedicated tool,
	echo                available only on linux and window hosts.
	echo  --keep-data   preserve user data when flashing.
	exit /b 5

:flash-dfu-ifwi
	dfu-util -d %USB_VID%:%USB_PID% -l | findstr "%1" > NUL 2>&1
	if %errorlevel% == 0 (
		call:flash-command --alt %1 -D %2
		exit /b %errorlevel%
	)
	exit /b 0

:flash-command
	set filterout="on"
	if %verbose_output% == 1 ( set filterout="off")

	dfu-util -d %USB_VID%:%USB_PID% %* 2>&1 | cscript.exe /E:JScript //B filter-dfu-out.js %LOG_FILENAME% %filterout%

	set /a err_num=%errorlevel%
	if %err_num% neq 0 echo Flash failed on %*
	exit /b %err_num%

:flash-debug
	echo DEBUG: dfu-util -l
	dfu-util -l
	exit /b

:flash-ifwi
	for %%X in (xfstk-dldr-solo.exe) do (set xfstk_tool_found=%%~$PATH:X)
	for %%X in (cflasher.exe) do (set pft_tool_found=%%~$PATH:X)
	if defined pft_tool_found (
		call:flash-ifwi-pft
		exit /b %errorlevel%
	)
	if defined xfstk_tool_found (
		call:flash-ifwi-xfstk
		exit /b %errorlevel%
	)
	echo !!! You should install xfstk tools, please visit http://xfstk.sourceforge.net/
	exit /b 3

:flash-ifwi-xfstk
	xfstk-dldr-solo.exe --gpflags 0x80000007 --osimage "%BASE_DIR%u-boot-edison.img"  --fwdnx "%BASE_DIR%edison_dnx_fwr.bin" --fwimage "%BASE_DIR%edison_ifwi-dbg-00.bin" --osdnx "%BASE_DIR%edison_dnx_osr.bin"
	set /a err_num=%errorlevel%
	if %err_num% neq 0 echo Ifwi Flash failed
	exit /b %err_num%

:flash-ifwi-pft
	cflasher -f %PFT_XML_FILE%
	set /a err_num=%errorlevel%
	if %err_num% neq 0 echo Ifwi Flash failed
	exit /b %err_num%

:dfu-wait
	setlocal
	set /a currtime=%TIMEOUT%
:start_wait
	dfu-util -l -d %USB_VID%:%USB_PID% | findstr "Found" | findstr "%USB_VID%" > NUL 2>&1
	if %errorlevel% == 0 (
		echo Dfu device found
		exit /b 0
	) else (
		set /a currtime-= 1
		timeout /t 1 /nobreak > nul
		if %currtime% gtr 0 goto:start_wait
	)
	echo Dfu device not found Timeout
	echo Did you plug and reboot your board?
	echo If yes, please try a recovery by calling this script with the --recovery option
	exit /b 3

Fix flashall script for Windows

edison-dfu: Fix flashall script for Windows

Signed-off-by: Theodor Gherzan <be3f40ffe21d83aefcbc279c996fd6bca5445244@resin.io>


@echo off
.nuget\NuGet.exe install .nuget\packages.config -OutputDirectory packages
packages\psake.4.4.2\tools\psake.cmd .\build.ps1 %*

@echo off
cd "%~dp0"
.nuget\NuGet.exe install .nuget\packages.config -OutputDirectory packages
packages\psake.4.4.2\tools\psake.cmd .\build.ps1 %*

Build fix

Build fix


@echo off

rem $Id$

::remove any quotes from JAVA_HOME and EXIST_HOME env var, will be re-added below
for /f "delims=" %%G IN (%JAVA_HOME%) DO SET JAVA_HOME=%%G
for /f "delims=" %%G IN (%EXIST_HOME%) DO SET EXIST_HOME=%%G

rem will be set by the installer
set EXIST_HOME=$INSTALL_PATH
rem will be set by the installer
set JAVA_HOME=$JAVA_HOME

:gotJavaHome
set JAVA_CMD="%JAVA_HOME%\bin\java"

set JAVA_OPTS="-Xms64m -Xmx768m"

rem make sure there's the jetty tmp directory
mkdir "%EXIST_HOME%\tools\jetty\tmp"

rem echo "JAVA_HOME: %JAVA_HOME%"
rem echo "EXIST_HOME: %EXIST_HOME%"
echo %JAVA_OPTS%

%JAVA_CMD% "%JAVA_OPTS%" -Dexist.home="%EXIST_HOME%" -Duse.autodeploy.feature=false -jar "%EXIST_HOME%\start.jar" org.exist.installer.Setup %1 %2 %3 %4 %5 %6 %7 %8 %9

:eof

@echo off

::will be set by the installer
set JAVA_HOME="$JAVA_HOME"
set EXIST_HOME="$INSTALL_PATH"

::remove any quotes from JAVA_HOME and EXIST_HOME env var, will be re-added below
for /f "delims=" %%G IN (%JAVA_HOME%) DO SET JAVA_HOME=%%G
for /f "delims=" %%G IN (%EXIST_HOME%) DO SET EXIST_HOME=%%G

:gotJavaHome
set JAVA_CMD="%JAVA_HOME%\bin\java"

set JAVA_OPTS="-Xms64m -Xmx768m"

::make sure there's the jetty tmp directory
mkdir "%EXIST_HOME%\tools\jetty\tmp"

echo "JAVA_HOME: [%JAVA_HOME%]"
echo "EXIST_HOME: [%EXIST_HOME%]"
echo "EXIST_OPTS: [%JAVA_OPTS%]"
echo:
echo:

%JAVA_CMD% "%JAVA_OPTS%" -Dexist.home="%EXIST_HOME%" -Duse.autodeploy.feature=false -jar "%EXIST_HOME%\start.jar" org.exist.installer.Setup %1 %2 %3 %4 %5 %6 %7 %8 %9

:eof

[bugfix] Make sure to correctly quote/unquote Windows paths in the installer


echo Creating map files
copy /y helpid.hm+resource.hm+hlp\HexEdit.hm+I:\Micros~1\vc98\mfc\include\afxhelp.hm+D:\bcg590\BCGControlBar\help\BCGControlBar.hm HexeditMap.tmp
sed "s/^HID/#define HID/"  <HexeditMap.tmp >HexeditMap2.tmp
del HexeditMap.tmp
sed "s/^AFX_HID/#define AFX_HID/"  <HexeditMap2.tmp >HTMLHelp\HexeditMap.hm
del HexeditMap2.tmp

echo Creating map files

REM Get MFC help IDs
rem copy /y I:\Micros~1\vc98\mfc\include\afxhelp.hm  afxhelp.tmp
copy /y "C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include\afxhelp.hm"  afxhelp.tmp

REM Get BCG help IDs
rem copy /y D:\bcg590\BCGControlBar\help\BCGControlBar.hm  bcghelp.tmp
copy /y "I:\Devel\BCG6_2\BCGControlBar\Help\BCGControlBar.hm"  .\bcghelp.tmp

REM Copy all help IDs into one file
copy /y helpid.hm+resource.hm+hlp\HexEdit.hm+afxhelp.tmp+bcghelp.tmp  HexeditMap.tmp

rem del afxhelp.tmp
rem del bcghelp.tmp

REM Make sure they all start with #define which is what RoboHelp expects
sed "s/^HID/#define HID/"  <HexeditMap.tmp >HexeditMap2.tmp
rem del HexeditMap.tmp
sed "s/^AFX_HID/#define AFX_HID/"  <HexeditMap2.tmp >HTMLHelp\HexeditMap.h
rem del HexeditMap2.tmp

Fix creation of help map file for Robohelp
- different location for MFC and BCG .hm file
- changes needed to handle spaces in file name
- output to HexEditMap.h (not .hm)

git-svn-id: c806da28ca781a1e2f2d0b1fde2a9d9a144b325a@158 295070fd-a27b-da4f-a32e-77c6a882a0e3


@echo off
setlocal

set PROJECT_DIR=%~1
set DOTNET_CMD=%~2
set TOOLRUNTIME_DIR=%~3
IF [%BUILDTOOLS_TARGET_RUNTIME%]==[] set BUILDTOOLS_TARGET_RUNTIME=win7-x64
set BUILDTOOLS_PACKAGE_DIR=%~dp0
set MICROBUILD_VERSION=0.2.0
set PORTABLETARGETS_VERSION=0.1.1-dev
set ROSLYNCOMPILERS_VERSION=1.2.0-beta1-20160202-02
set MSBUILD_CONTENT_JSON={"dependencies": { "MicroBuild.Core": "%MICROBUILD_VERSION%", Microsoft.Portable.Targets": "%PORTABLETARGETS_VERSION%", "Microsoft.Net.Compilers": "%ROSLYNCOMPILERS_VERSION%"},"frameworks": {"dnxcore50": {},"net46": {}}}

if not exist "%PROJECT_DIR%" (
  echo ERROR: Cannot find project root path at [%PROJECT_DIR%]. Please pass in the source directory as the 1st parameter.
  exit /b 1
)

if not exist "%DOTNET_CMD%" (
  echo ERROR: Cannot find dotnet cli at [%DOTNET_CMD%]. Please pass in the path to dotnet.exe as the 2nd parameter.
  exit /b 1
)

ROBOCOPY "%BUILDTOOLS_PACKAGE_DIR%\." "%TOOLRUNTIME_DIR%" /E

cd "%BUILDTOOLS_PACKAGE_DIR%\tool-runtime\"
call "%DOTNET_CMD%" restore --source https://www.myget.org/F/dotnet-core/ --source https://www.myget.org/F/dotnet-buildtools/ --source https://www.nuget.org/api/v2/
call "%DOTNET_CMD%" publish -f dnxcore50 -r %BUILDTOOLS_TARGET_RUNTIME% -o "%TOOLRUNTIME_DIR%"

:: Copy Portable Targets Over to ToolRuntime
if not exist "%BUILDTOOLS_PACKAGE_DIR%\portableTargets" mkdir "%BUILDTOOLS_PACKAGE_DIR%\portableTargets"
echo %MSBUILD_CONTENT_JSON% > "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\project.json"
cd "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\"
call "%DOTNET_CMD%" restore --source https://www.myget.org/F/dotnet-buildtools/ --source http://www.nuget.org/api/v2/ --packages "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\packages"
Robocopy "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\packages\Microsoft.Portable.Targets\%PORTABLETARGETS_VERSION%\contentFiles\any\any\." "%TOOLRUNTIME_DIR%\." /E
Robocopy "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\packages\MicroBuild.Core\%MICROBUILD_VERSION%\build\." "%TOOLRUNTIME_DIR%\." /E

:: Copy Roslyn Compilers Over to ToolRuntime
Robocopy "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\packages\Microsoft.Net.Compilers\%ROSLYNCOMPILERS_VERSION%\." "%TOOLRUNTIME_DIR%\net45\roslyn\." /E

exit /b %ERRORLEVEL%

@echo off
setlocal

set PROJECT_DIR=%~1
set DOTNET_CMD=%~2
set TOOLRUNTIME_DIR=%~3
IF [%BUILDTOOLS_TARGET_RUNTIME%]==[] set BUILDTOOLS_TARGET_RUNTIME=win7-x64
set BUILDTOOLS_PACKAGE_DIR=%~dp0
set MICROBUILD_VERSION=0.2.0
set PORTABLETARGETS_VERSION=0.1.1-dev
set ROSLYNCOMPILERS_VERSION=1.2.0-beta1-20160202-02
set MSBUILD_CONTENT_JSON={"dependencies": { "MicroBuild.Core": "%MICROBUILD_VERSION%", "Microsoft.Portable.Targets": "%PORTABLETARGETS_VERSION%", "Microsoft.Net.Compilers": "%ROSLYNCOMPILERS_VERSION%"},"frameworks": {"dnxcore50": {},"net46": {}}}

if not exist "%PROJECT_DIR%" (
  echo ERROR: Cannot find project root path at [%PROJECT_DIR%]. Please pass in the source directory as the 1st parameter.
  exit /b 1
)

if not exist "%DOTNET_CMD%" (
  echo ERROR: Cannot find dotnet cli at [%DOTNET_CMD%]. Please pass in the path to dotnet.exe as the 2nd parameter.
  exit /b 1
)

ROBOCOPY "%BUILDTOOLS_PACKAGE_DIR%\." "%TOOLRUNTIME_DIR%" /E

cd "%BUILDTOOLS_PACKAGE_DIR%\tool-runtime\"
call "%DOTNET_CMD%" restore --source https://www.myget.org/F/dotnet-core/ --source https://www.myget.org/F/dotnet-buildtools/ --source https://www.nuget.org/api/v2/
call "%DOTNET_CMD%" publish -f dnxcore50 -r %BUILDTOOLS_TARGET_RUNTIME% -o "%TOOLRUNTIME_DIR%"

:: Copy Portable Targets Over to ToolRuntime
if not exist "%BUILDTOOLS_PACKAGE_DIR%\portableTargets" mkdir "%BUILDTOOLS_PACKAGE_DIR%\portableTargets"
echo %MSBUILD_CONTENT_JSON% > "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\project.json"
cd "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\"
call "%DOTNET_CMD%" restore --source https://www.myget.org/F/dotnet-buildtools/ --source http://www.nuget.org/api/v2/ --packages "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\packages"
Robocopy "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\packages\Microsoft.Portable.Targets\%PORTABLETARGETS_VERSION%\contentFiles\any\any\." "%TOOLRUNTIME_DIR%\." /E
Robocopy "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\packages\MicroBuild.Core\%MICROBUILD_VERSION%\build\." "%TOOLRUNTIME_DIR%\." /E

:: Copy Roslyn Compilers Over to ToolRuntime
Robocopy "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\packages\Microsoft.Net.Compilers\%ROSLYNCOMPILERS_VERSION%\." "%TOOLRUNTIME_DIR%\net45\roslyn\." /E

exit /b %ERRORLEVEL%

Fix typo in init-tools.cmd

Fix typo in init-tools.cmd

https://github.com/dotnet/buildtools/commit/d852b602fc85b463defafbd6cf2e4ed62cc2c092
removed a leading quote from the emitted project.json content.


@echo off

echo Building dependencies...

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

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

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

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

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

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

cd evpp
cd vsprojects
"%VS140COMNTOOLS%..\IDE\Devenv" libevpp.sln /build "Debug|x64" /project libevpp.vcxproj
"%VS140COMNTOOLS%..\IDE\Devenv" libevpp.sln /build "Release|x64" /project libevpp.vcxproj
cd ..\..\
REM ####################################################################################################
REM back to root dir
cd ../

@echo off

echo Building dependencies...

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

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

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

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

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

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

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

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

add copy files for evpp

add copy files for evpp

Former-commit-id: 502d1bbc2e81037d00a31feba70db2bc95113848
Former-commit-id: 3e83c3e0707edf8aaab8c5cd871719d3cf06edc6 [formerly 58288b9dd7f3615977080b7ed909d0427ef18331] [formerly 824f0a9048c5ce79f89fec6d0605a89d301b7dd7 [formerly 0d177c4de18cedad9746c5f6acc61626ee3bfdef]]
Former-commit-id: a91d4b3e7594befe2d1bdef3f0c9de77350cf725 [formerly 7c0d7373a6d659cc329ad0357ef5ab467e662dcd]
Former-commit-id: ea61ee01681e06282d93a8aac1f0e00aea939ab7
Former-commit-id: 0429f27e529f4a38cf303a0aa7dae624fed491e1


rem We need Java 6 for this plugin. If you have Java 6, installed, set an environment variable, JDK6, to its location.
if exist classes rmdir classes /s /q
mkdir classes
xcopy /E /y src classes\
java -cp src;classes;../../../3rdpartypublic/classext/*;../../mmstudio/MMJ_.jar;../../MMCoreJ_wrap/MMCoreJ.jar;../../acqEngine/MMAcqEngine.jar -Djava.library.path=../../bin_x64 -Dclojure.compile.path=classes -server clojure.lang.Compile slide-explorer.plugin
jar cf SlideExplorer2.jar -C classes\ .
copy /Y SlideExplorer2.jar ..\..\Install_AllPlatforms\micro-manager\mmplugins\

rem We need Java 6 for this plugin. If you have Java 6, installed, set an environment variable, JDK6, to its location.
if exist classes rmdir classes /s /q
mkdir classes
xcopy /E /y src classes\
java -cp src;classes;../../../3rdpartypublic/classext/clojure.jar;../../../3rdpartypublic/classext/core.cache.jar;../../../3rdpartypublic/classext/core.memoize.jar;../../../3rdpartypublic/classext/ij.jar;../../../3rdpartypublic/classext/bsh-2.0b4.jar;../../mmstudio/MMJ_.jar;../../MMCoreJ_wrap/MMCoreJ.jar;../../acqEngine/MMAcqEngine.jar -Djava.library.path=../../bin_x64 -Dclojure.compile.path=classes -server clojure.lang.Compile slide-explorer.plugin
rmdir /S /Q classes\clojure
jar cf SlideExplorer2.jar -C classes\ .
copy /Y SlideExplorer2.jar ..\..\Install_AllPlatforms\micro-manager\mmplugins\

remove unnecessary files

remove unnecessary files

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@10374 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd


@ECHO OFF
SETLOCAL
SET EL=0

ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SET PROJECT_DIR=%CD%
ECHO PROJECT_DIR^: %PROJECT_DIR%
ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
ECHO cmake^: && cmake --version

ECHO activating VS command prompt ...
SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

ECHO platform^: %platform%
:: HARDCODE "x64" as it is uppercase on AppVeyor and download from S3 is case sensitive
SET DEPSPKG=osrm-deps-win-x64-14.0.7z

:: local development
ECHO LOCAL_DEV^: %LOCAL_DEV%
IF NOT DEFINED LOCAL_DEV SET LOCAL_DEV=0
IF DEFINED LOCAL_DEV IF %LOCAL_DEV% EQU 1 IF EXIST %DEPSPKG% ECHO skipping deps download && GOTO SKIPDL

IF EXIST %DEPSPKG% DEL %DEPSPKG%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO downloading %DEPSPKG%
powershell Invoke-WebRequest https://mapbox.s3.amazonaws.com/windows-builds/windows-build-deps/$env:DEPSPKG -OutFile $env:PROJECT_DIR\$env:DEPSPKG
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:SKIPDL

IF EXIST osrm-deps ECHO deleting osrm-deps... && RD /S /Q osrm-deps
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST build ECHO deletings build dir... && RD /S /Q build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

7z -y x %DEPSPKG% | %windir%\system32\FIND "ing archive"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

MKDIR build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
cd build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET OSRMDEPSDIR=%PROJECT_DIR%\osrm-deps
set PREFIX=%OSRMDEPSDIR%/libs
set BOOST_ROOT=%OSRMDEPSDIR%/boost
set TBB_INSTALL_DIR=%OSRMDEPSDIR%/tbb
set TBB_ARCH_PLATFORM=intel64/vc14

ECHO calling cmake ....
cmake .. ^
-G "Visual Studio 14 2015 Win64" ^
-DBOOST_ROOT=%BOOST_ROOT% ^
-DBoost_ADDITIONAL_VERSIONS=1.58 ^
-DBoost_USE_MULTITHREADED=ON ^
-DBoost_USE_STATIC_LIBS=ON ^
-DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
-DCMAKE_INSTALL_PREFIX=%PREFIX%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO building ...
msbuild OSRM.sln ^
/p:Configuration=%Configuration% ^
/p:Platform=x64 ^
/t:rebuild ^
/p:BuildInParallel=true ^
/m:%NUMBER_OF_PROCESSORS% ^
/toolsversion:14.0 ^
/p:PlatformToolset=v140 ^
/clp:Verbosity=normal ^
/nologo ^
/flp1:logfile=build_errors.txt;errorsonly ^
/flp2:logfile=build_warnings.txt;warningsonly
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CD %PROJECT_DIR%\build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET PATH=%PROJECT_DIR%\osrm-deps\libs\bin;%PATH%

ECHO running datastructure-tests.exe ...
%Configuration%\datastructure-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running algorithm-tests.exe ...
%Configuration%\algorithm-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

IF NOT "%APPVEYOR_REPO_BRANCH%"=="develop" GOTO DONE
ECHO ========= CREATING PACKAGES ==========

CD %PROJECT_DIR%\build\%Configuration%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET P=%PROJECT_DIR%
SET ZIP= %P%\osrm_%Configuration%.zip
IF EXIST %ZIP% ECHO deleting %ZIP% && DEL /F /Q %ZIP%
IF %ERRORLEVEL% NEQ 0 ECHO deleting %ZIP% FAILED && GOTO ERROR

7z a %ZIP% *.lib *.exe *.pdb %P%/osrm-deps/libs/bin/*.dll -tzip -mx9 | %windir%\system32\FIND "ing archive"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CD ..\..\profiles
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO disk=c:\temp\stxxl,10000,wincall > .stxxl.txt
7z a %ZIP% * -tzip -mx9 | %windir%\system32\FIND "ing archive"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

GOTO DONE

:ERROR
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO ERRORLEVEL^: %ERRORLEVEL%
SET EL=%ERRORLEVEL%

:DONE
ECHO ~~~~~~~~~~~~~~~~~~~~~~ DONE %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

EXIT /b %EL%

@ECHO OFF
SETLOCAL
SET EL=0

ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SET PROJECT_DIR=%CD%
ECHO PROJECT_DIR^: %PROJECT_DIR%
ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
ECHO cmake^: && cmake --version

ECHO activating VS command prompt ...
SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

ECHO platform^: %platform%
:: HARDCODE "x64" as it is uppercase on AppVeyor and download from S3 is case sensitive
SET DEPSPKG=osrm-deps-win-x64-14.0.7z

:: local development
ECHO LOCAL_DEV^: %LOCAL_DEV%
IF NOT DEFINED LOCAL_DEV SET LOCAL_DEV=0
IF DEFINED LOCAL_DEV IF %LOCAL_DEV% EQU 1 IF EXIST %DEPSPKG% ECHO skipping deps download && GOTO SKIPDL

IF EXIST %DEPSPKG% DEL %DEPSPKG%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO downloading %DEPSPKG%
powershell Invoke-WebRequest https://mapbox.s3.amazonaws.com/windows-builds/windows-build-deps/$env:DEPSPKG -OutFile $env:PROJECT_DIR\$env:DEPSPKG
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:SKIPDL

IF EXIST osrm-deps ECHO deleting osrm-deps... && RD /S /Q osrm-deps
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST build ECHO deletings build dir... && RD /S /Q build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

7z -y x %DEPSPKG% | %windir%\system32\FIND "ing archive"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

MKDIR build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
cd build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET OSRMDEPSDIR=%PROJECT_DIR%\osrm-deps
set PREFIX=%OSRMDEPSDIR%/libs
set BOOST_ROOT=%OSRMDEPSDIR%/boost
set TBB_INSTALL_DIR=%OSRMDEPSDIR%/tbb
set TBB_ARCH_PLATFORM=intel64/vc14

ECHO calling cmake ....
cmake .. ^
-G "Visual Studio 14 2015 Win64" ^
-DBOOST_ROOT=%BOOST_ROOT% ^
-DBoost_ADDITIONAL_VERSIONS=1.58 ^
-DBoost_USE_MULTITHREADED=ON ^
-DBoost_USE_STATIC_LIBS=ON ^
-DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
-DCMAKE_INSTALL_PREFIX=%PREFIX%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO building ...
msbuild OSRM.sln ^
/p:Configuration=%Configuration% ^
/p:Platform=x64 ^
/t:rebuild ^
/p:BuildInParallel=true ^
/m:%NUMBER_OF_PROCESSORS% ^
/toolsversion:14.0 ^
/p:PlatformToolset=v140 ^
/clp:Verbosity=normal ^
/nologo ^
/flp1:logfile=build_errors.txt;errorsonly ^
/flp2:logfile=build_warnings.txt;warningsonly
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CD %PROJECT_DIR%\build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET PATH=%PROJECT_DIR%\osrm-deps\libs\bin;%PATH%

ECHO running engine-tests.exe ...
%Configuration%\engine-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running extractor-tests.exe ...
%Configuration%\extractor-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO running util-tests.exe ...
%Configuration%\util-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

IF NOT "%APPVEYOR_REPO_BRANCH%"=="develop" GOTO DONE
ECHO ========= CREATING PACKAGES ==========

CD %PROJECT_DIR%\build\%Configuration%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET P=%PROJECT_DIR%
SET ZIP= %P%\osrm_%Configuration%.zip
IF EXIST %ZIP% ECHO deleting %ZIP% && DEL /F /Q %ZIP%
IF %ERRORLEVEL% NEQ 0 ECHO deleting %ZIP% FAILED && GOTO ERROR

7z a %ZIP% *.lib *.exe *.pdb %P%/osrm-deps/libs/bin/*.dll -tzip -mx9 | %windir%\system32\FIND "ing archive"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CD ..\..\profiles
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO disk=c:\temp\stxxl,10000,wincall > .stxxl.txt
7z a %ZIP% * -tzip -mx9 | %windir%\system32\FIND "ing archive"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

GOTO DONE

:ERROR
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO ERRORLEVEL^: %ERRORLEVEL%
SET EL=%ERRORLEVEL%

:DONE
ECHO ~~~~~~~~~~~~~~~~~~~~~~ DONE %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

EXIT /b %EL%

Fix AppVayor tests

Fix AppVayor tests


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

:: This batch file will try to sync the root directory.

setlocal

:: Windows freaks out if a file is overwritten while it's being executed.  Copy
:: this script off to a temporary location and reinvoke from there before
:: running any svn or git commands.
IF %~nx0==update_depot_tools.bat (
  COPY /Y %~dp0update_depot_tools.bat %TEMP%\update_depot_tools_tmp.bat >nul
  if errorlevel 1 goto :EOF
  %TEMP%\update_depot_tools_tmp.bat %~dp0 %*
)

set DEPOT_TOOLS_DIR=%1
SHIFT

set GIT_URL=https://chromium.googlesource.com/chromium/tools/depot_tools.git

:: Will download svn and python.
:: If you don't want to install the depot_tools version of these tools, remove
:: the 'force' option on the next command. The tools will be installed only if
:: not already in the PATH environment variable.
call "%DEPOT_TOOLS_DIR%bootstrap\win\win_tools.bat" force
if errorlevel 1 goto :EOF
:: Now clear errorlevel so it can be set by other programs later.
set errorlevel=

IF "%DEPOT_TOOLS_WIN_TOOLCHAIN%" == "0" GOTO :NOTOOLCHAIN
call python %~dp0win_toolchain\get_toolchain_if_necessary.py
if errorlevel 1 goto :EOF
set errorlevel=
:NOTOOLCHAIN

:: Shall skip automatic update?
IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :EOF

:: We need either .\.svn\. or .\.git\. to be able to sync.
IF EXIST "%DEPOT_TOOLS_DIR%.svn\." GOTO :SVN_UPDATE
IF EXIST "%DEPOT_TOOLS_DIR%.git\." GOTO :GIT_UPDATE
echo Error updating depot_tools, no revision tool found.
goto :EOF

:SVN_UPDATE
call svn up -q "%DEPOT_TOOLS_DIR%."
goto :EOF

:GIT_UPDATE
cd /d "%DEPOT_TOOLS_DIR%."
call git config remote.origin.fetch > NUL
if errorlevel 1 goto :GIT_SVN_UPDATE
for /F %%x in ('git config --get remote.origin.url') DO (
  IF not "%%x" == "%GIT_URL%" (
    echo Your depot_tools checkout is configured to fetch from an obsolete URL
    choice /N /T 60 /D N /M "Would you like to update it? [y/N]: "
    IF not errorlevel 2 (
      call git config remote.origin.url "%GIT_URL%"
    )
  )
)
call git fetch -q origin > NUL
call git rebase -q origin/master > NUL
if errorlevel 1 echo Failed to update depot_tools.

goto :EOF

:GIT_SVN_UPDATE
cd /d "%DEPOT_TOOLS_DIR%."
call git svn rebase -q -q
goto :EOF

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

:: This batch file will try to sync the root directory.

setlocal

:: Windows freaks out if a file is overwritten while it's being executed.  Copy
:: this script off to a temporary location and reinvoke from there before
:: running any svn or git commands.
IF %~nx0==update_depot_tools.bat (
  COPY /Y %~dp0update_depot_tools.bat %TEMP%\update_depot_tools_tmp.bat >nul
  if errorlevel 1 goto :EOF
  %TEMP%\update_depot_tools_tmp.bat %~dp0 %*
)

set DEPOT_TOOLS_DIR=%1
SHIFT

set GIT_URL=https://chromium.googlesource.com/chromium/tools/depot_tools.git

:: Will download svn and python.
:: If you don't want to install the depot_tools version of these tools, remove
:: the 'force' option on the next command. The tools will be installed only if
:: not already in the PATH environment variable.
call "%DEPOT_TOOLS_DIR%bootstrap\win\win_tools.bat" force
if errorlevel 1 goto :EOF
:: Now clear errorlevel so it can be set by other programs later.
set errorlevel=

:: Opt-in for now.
IF "%DEPOT_TOOLS_WIN_TOOLCHAIN%" == "" GOTO :NOTOOLCHAIN
call python %~dp0win_toolchain\get_toolchain_if_necessary.py
if errorlevel 1 goto :EOF
set errorlevel=
:NOTOOLCHAIN

:: Shall skip automatic update?
IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :EOF

:: We need either .\.svn\. or .\.git\. to be able to sync.
IF EXIST "%DEPOT_TOOLS_DIR%.svn\." GOTO :SVN_UPDATE
IF EXIST "%DEPOT_TOOLS_DIR%.git\." GOTO :GIT_UPDATE
echo Error updating depot_tools, no revision tool found.
goto :EOF

:SVN_UPDATE
call svn up -q "%DEPOT_TOOLS_DIR%."
goto :EOF

:GIT_UPDATE
cd /d "%DEPOT_TOOLS_DIR%."
call git config remote.origin.fetch > NUL
if errorlevel 1 goto :GIT_SVN_UPDATE
for /F %%x in ('git config --get remote.origin.url') DO (
  IF not "%%x" == "%GIT_URL%" (
    echo Your depot_tools checkout is configured to fetch from an obsolete URL
    choice /N /T 60 /D N /M "Would you like to update it? [y/N]: "
    IF not errorlevel 2 (
      call git config remote.origin.url "%GIT_URL%"
    )
  )
)
call git fetch -q origin > NUL
call git rebase -q origin/master > NUL
if errorlevel 1 echo Failed to update depot_tools.

goto :EOF

:GIT_SVN_UPDATE
cd /d "%DEPOT_TOOLS_DIR%."
call git svn rebase -q -q
goto :EOF

Revert 252633 "Switch to opt-out for toolchain"

> Switch to opt-out for toolchain
>
> R=maruel@chromium.org
> BUG=323300
>
> Review URL: https://codereview.chromium.org/174663005

TBR=scottmg@chromium.org

Review URL: https://codereview.chromium.org/175743002

git-svn-id: fd409f4bdeea2bb50a5d34bb4d4bfc2046a5a3dd@252634 0039d316-1c4b-4281-b951-d872f2087c98


# This is an example file to generate boot.scr - a boot script for U-Boot
# Generate boot.scr:
# ./tools/mkimage -c none -A arm -T script -d autoboot.cmd boot.scr
#
# It requires a list of environment variables to be defined before load:
# platform dependent: boardname, fdtfile, console
# system dependent: mmcbootdev, mmcbootpart, mmcrootdev, mmcrootpart, rootfstype
#
setenv fdtfile	   KERNEL_DEVICETREE
setenv fdtaddr     FDTADDR
setenv initrdname  "uInitrd"
setenv initrdaddr  INITRADDR
setenv loaddtb     "load mmc ${mmcbootdev}:${mmcbootpart} ${fdtaddr} ${fdtfile}"
setenv loadinitrd  "load mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} ${initrdname}"
setenv loadkernel  "load mmc ${mmcbootdev}:${mmcbootpart} '${kerneladdr}' '${kernelname}'"
setenv kernel_args "setenv bootargs ${console} root=/dev/mmcblk${mmcrootdev}p${mmcrootpart} rootfstype=${rootfstype} rootwait ${opts}"

#### Routine: check_dtb - check that target.dtb exists on boot partition
setenv check_dtb "
if test -e mmc '${mmcbootdev}':'${mmcbootpart}' '${fdtfile}'; then
	run loaddtb;
	setenv fdt_addr ${fdtaddr};
else
	echo Warning! Booting without DTB: '${fdtfile}'!;
	setenv fdt_addr;
fi;"

#### Routine: check_ramdisk - check that uInitrd exists on boot partition
setenv check_ramdisk "
if test -e mmc '${mmcbootdev}':'${mmcbootpart}' '${initrdname}'; then
	echo "Found ramdisk image.";
	run loadinitrd;
	setenv initrd_addr ${initrdaddr};
else
	echo Warning! Booting without RAMDISK: '${initrdname}'!;
	setenv initrd_addr -;
fi;"

#### Routine: boot_fit - check that env $boardname is set and boot proper config of ITB image
setenv setboot_fit "
if test -e '${boardname}'; then
	setenv fdt_addr ;
	setenv initrd_addr ;
	setenv kerneladdr  0x42000000;
	setenv kernelname  Image.itb;
	setenv itbcfg      "\"#${boardname}\"";
	setenv imgbootcmd  bootm;
else
	echo Warning! Variable: \$boardname is undefined!;
fi"

#### Routine: setboot_uimg - prepare env to boot uImage
setenv setboot_uimg "
	setenv kerneladdr 0x40007FC0;
	setenv kernelname uImage;
	setenv itbcfg     ;
	setenv imgbootcmd bootm;
	run check_dtb;
	run check_ramdisk;"

#### Routine: setboot_zimg - prepare env to boot zImage
setenv setboot_zimg "
	setenv kerneladdr 0x40007FC0;
	setenv kernelname zImage;
	setenv itbcfg     ;
	setenv imgbootcmd bootz;
	run check_dtb;
	run check_ramdisk;"

#### Routine: boot_img - boot the kernel after env setup
setenv boot_img "
	run loadkernel;
	run kernel_args;
	'${imgbootcmd}' '${kerneladdr}${itbcfg}' '${initrd_addr}' '${fdt_addr}';"

#### Routine: autoboot - choose proper boot path
setenv autoboot "
if test -e mmc 0:${mmcbootpart} Image.itb; then
	echo Found kernel image: Image.itb;
	run setboot_fit;
	run boot_img;
elif test -e mmc 0:${mmcbootpart} zImage; then
	echo Found kernel image: zImage;
	run setboot_zimg;
	run boot_img;
elif test -e mmc 0:${mmcbootpart} uImage; then
	echo Found kernel image: uImage;
	run setboot_uimg;
	run boot_img;
fi;"

#### Execute the defined autoboot macro
run autoboot

# This is an example file to generate boot.scr - a boot script for U-Boot
# Generate boot.scr:
# ./tools/mkimage -c none -A arm -T script -d autoboot.cmd boot.scr
#
# It requires a list of environment variables to be defined before load:
# platform dependent: boardname, fdtfile, console
# system dependent: mmcbootdev, mmcbootpart, mmcrootdev, mmcrootpart, rootfstype
#
setenv fdtfile	   KERNEL_DEVICETREE
setenv fdtaddr     FDTADDR
setenv initrdname  "uInitrd"
setenv initrdaddr  INITRADDR
setenv loaddtb     "load mmc ${mmcbootdev}:${mmcbootpart} ${fdtaddr} ${fdtfile}"
setenv loadinitrd  "load mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} ${initrdname}"
setenv loadkernel  "load mmc ${mmcbootdev}:${mmcbootpart} '${kerneladdr}' '${kernelname}'"
setenv kernel_args "setenv bootargs ${console} root=/dev/mmcblk1p${mmcrootpart} rootfstype=${rootfstype} rootwait ${opts}"

#### Routine: check_dtb - check that target.dtb exists on boot partition
setenv check_dtb "
if test -e mmc '${mmcbootdev}':'${mmcbootpart}' '${fdtfile}'; then
	run loaddtb;
	setenv fdt_addr ${fdtaddr};
else
	echo Warning! Booting without DTB: '${fdtfile}'!;
	setenv fdt_addr;
fi;"

#### Routine: check_ramdisk - check that uInitrd exists on boot partition
setenv check_ramdisk "
if test -e mmc '${mmcbootdev}':'${mmcbootpart}' '${initrdname}'; then
	echo "Found ramdisk image.";
	run loadinitrd;
	setenv initrd_addr ${initrdaddr};
else
	echo Warning! Booting without RAMDISK: '${initrdname}'!;
	setenv initrd_addr -;
fi;"

#### Routine: boot_fit - check that env $boardname is set and boot proper config of ITB image
setenv setboot_fit "
if test -e '${boardname}'; then
	setenv fdt_addr ;
	setenv initrd_addr ;
	setenv kerneladdr  0x42000000;
	setenv kernelname  Image.itb;
	setenv itbcfg      "\"#${boardname}\"";
	setenv imgbootcmd  bootm;
else
	echo Warning! Variable: \$boardname is undefined!;
fi"

#### Routine: setboot_uimg - prepare env to boot uImage
setenv setboot_uimg "
	setenv kerneladdr 0x40007FC0;
	setenv kernelname uImage;
	setenv itbcfg     ;
	setenv imgbootcmd bootm;
	run check_dtb;
	run check_ramdisk;"

#### Routine: setboot_zimg - prepare env to boot zImage
setenv setboot_zimg "
	setenv kerneladdr 0x40007FC0;
	setenv kernelname zImage;
	setenv itbcfg     ;
	setenv imgbootcmd bootz;
	run check_dtb;
	run check_ramdisk;"

#### Routine: boot_img - boot the kernel after env setup
setenv boot_img "
	run loadkernel;
	run kernel_args;
	'${imgbootcmd}' '${kerneladdr}${itbcfg}' '${initrd_addr}' '${fdt_addr}';"

#### Routine: autoboot - choose proper boot path
setenv autoboot "
if test -e mmc 0:${mmcbootpart} Image.itb; then
	echo Found kernel image: Image.itb;
	run setboot_fit;
	run boot_img;
elif test -e mmc 0:${mmcbootpart} zImage; then
	echo Found kernel image: zImage;
	run setboot_zimg;
	run boot_img;
elif test -e mmc 0:${mmcbootpart} uImage; then
	echo Found kernel image: uImage;
	run setboot_uimg;
	run boot_img;
fi;"

#### Execute the defined autoboot macro
run autoboot

update mmc blk device number

u-boot-config: update mmc blk device number

newer kernel changed mmc blk device numbering.

Signed-off-by: Armin Kuster <525edcd226fb27e7f47fbb319a38fe989c677548@gmail.com>


:: Copyright (c) Facebook, Inc. and its affiliates.
::
:: This source code is licensed under the MIT license found in the
:: LICENSE file in the root directory of this source tree.

@echo off
title Metro Bundler
call .packager.bat
node "%~dp0..\cli.js" start
pause
exit

:: Copyright (c) Facebook, Inc. and its affiliates.
::
:: This source code is licensed under the MIT license found in the
:: LICENSE file in the root directory of this source tree.

@echo off
title Metro Bundler
call .packager.bat
node "%~dp0..\cli.js" --reactNativePath ../ start
pause
exit

Fix bat file (#23967)

Fix bat file (#23967)

Summary:
Add reactNativePath to cli.js

Add reactNativePath to cli.js

[GENERAL] [FIXED] - Internal - Update packagers to the latest CLI
Pull Request resolved: https://github.com/facebook/react-native/pull/23967

Differential Revision: D14502855

Pulled By: hramos

fbshipit-source-id: b9804e4fb364c004215227d938fe7101641f5b3c


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

if exist generated (
  rmdir /s /q generated
)
mkdir generated\include generated\common

cd generated/include
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_safe_struct.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_safe_struct.cpp
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_struct_size_helper.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_struct_size_helper.c
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_enum_string_helper.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_object_types.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_dispatch_table_helper.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml thread_check.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml parameter_validation.cpp
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml unique_objects_wrappers.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_layer_dispatch_table.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml vk_extension_helper.h
py -3 ../../../scripts/lvl_genvk.py -registry ../../../scripts/vk.xml object_tracker.cpp
cd ../..

update .bat line termination

build-android: update .bat line termination

Change-Id: I9d4152df8cc7c10e74f6484dbc802c2c854c9fef


@ECHO off
if /I %1 == default goto :default
if /I %1 == init goto :init
if /I %1 == lint goto :lint
if /I %1 == test goto :test
if /I %1 == clean goto :clean
if /I %1 == build goto :build
if /I %1 == install goto :install

goto :eof ::can be ommited to run the `default` function similarly to makefiles

:default
goto :test

:init
pip install -r requirements.txt
goto :eof

:lint
python -m flake8 ./pybbn
goto :eof

:test
nosetests tests
goto :eof

:clean
del /S *.pyc
rmdir /S /Q coverage
rmdir /S /Q dist
rmdir /S /Q build
rmdir /S /Q pybbn.egg-info
rmdir /S /Q pybbn/pybbn.egg-info
rmdir /S /Q jupyter/.ipynb_checkpoints
rmdir /S /Q docs/build
rmdir /S /Q joblib_memmap
rmdir /S /Q .pytest_cache
del .coverage
del .noseids
goto :eof

:build
python setup.py bdist_egg
goto :eof

:install
python setup.py install
goto :eof

@ECHO off
if /I %1 == default goto :default
if /I %1 == init goto :init
if /I %1 == lint goto :lint
if /I %1 == test goto :test
if /I %1 == clean goto :clean
if /I %1 == build goto :build
if /I %1 == install goto :install

goto :eof ::can be ommited to run the `default` function similarly to makefiles

:default
goto :test

:init
pip install -r requirements.txt
goto :eof

:lint
python -m flake8 ./pybbn
goto :eof

:test
nosetests tests
goto :eof

:clean
del /S *.pyc
rmdir /S /Q coverage
rmdir /S /Q dist
rmdir /S /Q build
rmdir /S /Q pybbn.egg-info
rmdir /S /Q pybbn/pybbn.egg-info
rmdir /S /Q jupyter/.ipynb_checkpoints
rmdir /S /Q docs/build
rmdir /S /Q joblib_memmap
rmdir /S /Q .pytest_cache
del .coverage
del .noseids
goto :eof

:build
python setup.py bdist_egg sdist bdist_wheel
goto :eof

:install
python setup.py install
goto :eof

create all

create all


@echo off

echo.
echo == Stripdown
echo.

echo.
echo === Stripping packages in ..\repackage
echo.

pushd repackage

echo.
echo Python27
rd /s /q "..\repackage\Python27\Doc"
rd /s /q "..\repackage\Python27\tcl"
rd /s /q "..\repackage\Python27\Scripts"
rd /s /q "..\repackage\Python27\Tools"
rm       "..\repackage\Python27\NEWS.txt"
rm       "..\repackage\Python27\w9xpopen.exe"

popd

@echo off

echo.
echo == Stripdown
echo.

echo.
echo === Stripping packages in ..\repackage
echo.

pushd repackage

echo.
echo Python27
rd /s /q "..\repackage\Python27\Doc"
rd /s /q "..\repackage\Python27\tcl"
rd /s /q "..\repackage\Python27\Scripts"
rd /s /q "..\repackage\Python27\Tools"
rm       "..\repackage\Python27\NEWS.txt"
rm       "..\repackage\Python27\w9xpopen.exe"

echo.
echo Unknown-Horizons
rm       "..\repackage\unknown-horizons\Mypy.ini"
rm       "..\repackage\unknown-horizons\.editorconfig"

popd

fix #8

fix #8


@echo off

for /f "delims=" %%i in ("%~dp0..\envs") do (
    set ANACONDA_ENVS=%%~fi
)

if "%1" == "" goto skipmissingarg
    echo Usage: deactivate
    echo.
    echo Deactivates previously activated Conda
    echo environment.
    exit /b 1
:skipmissingarg

REM Deactivate a previous activation if it is live
if "%CONDA_DEFAULT_ENV%" == "" goto skipdeactivate
    REM This search/replace removes the previous env from the path
    echo Deactivating environment "%CONDA_DEFAULT_ENV%"...

    REM Run any deactivate scripts
    if not exist "%CONDA_DEFAULT_ENV%\etc\conda\deactivate.d" goto nodeactivate
        pushd "%CONDA_DEFAULT_ENV%\etc\conda\deactivate.d"
        for %%g in (*.bat) do call "%%g"
        popd
    :nodeactivate

    set CONDACTIVATE_PATH=%CONDA_DEFAULT_ENV%;%CONDA_DEFAULT_ENV%\Scripts;%CONDA_DEFAULT_ENV%\Library\bin;
    call set PATH=%%PATH:%CONDACTIVATE_PATH%=%%
    set CONDA_DEFAULT_ENV=
    set CONDA_ENV_PATH=
    set CONDACTIVATE_PATH=
:skipdeactivate

set PROMPT=%CONDA_OLD_PROMPT%
set CONDA_OLD_PROMPT=

@echo off

for /f "delims=" %%i in ("%~dp0..\envs") do (
    set ANACONDA_ENVS=%%~fi
)

if "%1" == "" goto skipmissingarg
    echo Usage: deactivate
    echo.
    echo Deactivates previously activated Conda
    echo environment.
    exit /b 1
:skipmissingarg

REM Deactivate a previous activation if it is live
if "%CONDA_DEFAULT_ENV%" == "" goto skipdeactivate
    REM This search/replace removes the previous env from the path
    echo Deactivating environment "%CONDA_DEFAULT_ENV%"...

    REM Run any deactivate scripts
    if not exist "%CONDA_DEFAULT_ENV%\etc\conda\deactivate.d" goto nodeactivate
        pushd "%CONDA_DEFAULT_ENV%\etc\conda\deactivate.d"
        for %%g in (*.bat) do call "%%g"
        popd
    :nodeactivate

    set CONDACTIVATE_PATH="%CONDA_DEFAULT_ENV%";"%CONDA_DEFAULT_ENV%\Scripts";"%CONDA_DEFAULT_ENV%\Library\bin";
    call set PATH=%%PATH:%CONDACTIVATE_PATH%=%%
    set CONDA_DEFAULT_ENV=
    set CONDA_ENV_PATH=
    set CONDACTIVATE_PATH=
:skipdeactivate

set PROMPT=%CONDA_OLD_PROMPT%
set CONDA_OLD_PROMPT=

add quotes to paths being removed

deactivate.bat: add quotes to paths being removed


SET ECLIPSEC_MARS=C:\Users\Scott\eclipse\cpp-mars\eclipse\eclipsec.exe
SET ECLIPSEC_JUNO=C:\Eclipse\eclipsec.exe
REM Build all binaries

REM CD to Root Directory
pushd ..

REM
REM Begin a command-line "clean build" of the navx protocol java library
REM
pushd .\java\navx
call ant clean build
popd

REM
REM Copy navx protocol java library file to project folders that need it.
REM

mkdir .\processing\libraries\navx\library\
copy .\java\navx\jar\*.jar .\processing\libraries\navx\library\ /Y

REM
REM Copy the navX protocol library .h files to the
REM projects that need them.
REM

cp ./stm32/navx-mxp/IMU*.h  ./arduino/navXTestJig/
cp ./stm32/navx-mxp/AHRS*.h ./arduino/navXTestJig/

REM
REM Begin a command-line "clean build" of the Debug version of the navx-mxp firmware
REM

REM Use the GIT checkin count as the firmware revision number

pushd .\stm32\navx-mxp
echo|set /p=#define NAVX_MXP_REVISION  > revision.h
git rev-list --count --first-parent HEAD >> revision.h
popd

REM Build navX-MXP and navX-Micro Firmware

rm -r -f ./build_workspace_navx-mxp
mkdir build_workspace_navx-mxp

%ECLIPSEC_JUNO% -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data ./build_workspace_navx-mxp -import ./stm32 -cleanBuild navx-mxp/navX-MXP_Debug

rm -r -f ./build_workspace_navx-micro
mkdir build_workspace_navx-micro

%ECLIPSEC_JUNO% -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data ./build_workspace_navx-micro -import ./stm32 -cleanBuild navx-mxp/navX-Micro_Debug

rmdir /S /Q stm32\bin
mkdir stm32\bin

@echo off
for /f %%i in ('grep NAVX_MXP_FIRMWARE_VERSION_MAJOR stm32/navx-mxp/version.h ^| sed 's/#define NAVX_MXP_FIRMWARE_VERSION_MAJOR/ /' ^| sed 's/^[ \t]*//'') do set VER_MAJOR=%%i
for /f %%i in ('grep NAVX_MXP_FIRMWARE_VERSION_MINOR stm32/navx-mxp/version.h ^| sed 's/#define NAVX_MXP_FIRMWARE_VERSION_MINOR/ /' ^| sed 's/^[ \t]*//'') do set VER_MINOR=%%i
for /f %%i in ('git rev-list --count --first-parent HEAD') do set VER_REVISION=%%i
set REVISION_STRING=%VER_MAJOR%.%VER_MINOR%.%VER_REVISION%
REM Place version string into setup script
@echo on
pushd build
echo %REVISION_STRING% > version.txt
popd
copy .\stm32\navX-MXP_Debug\navx-mxp.hex .\stm32\bin\navx-mxp_%REVISION_STRING%.hex
copy .\stm32\navX-Micro_Debug\navx-micro.hex .\stm32\bin\navx-micro_%REVISION_STRING%.hex

REM Build CSharp Components

pushd .\build
call buildcsharp.bat

REM Build Processing components

call buildprocessing.bat
popd

REM
REM Begin a command-line "clean build" of the navx frc C++ library
REM

pushd .\roborio\c++\navx_frc_cpp
call gradlew clean
REM the build build doesn't work correctly, due to some conflict w/the publishing steps
REM therefore, for now, build the release static library
call gradlew navx_frcLinuxathenaReleaseSharedLibrary
call gradlew navx_frcLinuxraspbianReleaseStaticLibrary
REM For now, publish to a local maven repo, for access by setup builder and the maven_deploy script.
REM The local maven repo is at %HOMEDRIVE%%HOMEPATH%\.m2\repository
call gradlew publishCppPublicationToMavenLocal
REM rm -r -f ./build_workspace_luna
REM mkdir build_workspace_luna

REM %ECLIPSEC_MARS% -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data ./build_workspace_luna -import ./navx_frc_cpp -cleanBuild navx_frc_cpp/Debug
popd

REM
REM Begin a command-line "clean build" of the navx frc Java library
REM

pushd .\roborio\java\navx_frc
REM call ant clean build
call gradlew clean
call gradlew build
REM For now, publish to a local maven repo, for access by setup builder and the maven_deploy script.
REM The local maven repo is at %HOMEDRIVE%%HOMEPATH%\.m2\repository
call gradlew publishMavenJavaPublicationToMavenLocal
popd

REM Build FTC Library
pushd .\android\navx_ftc
rmdir /S /Q build
call gradlew.bat assembleDebug
call gradlew.bat assembleRelease
popd

REM Update FRC vendordeps file with latest version number.
copy .\build\vendordeps\navx_frc.json.template .\build\vendordeps\navx_frc.json
Powershell -command "(get-content .\build\vendordeps\navx_frc.json) -replace ('0.0.000','%REVISION_STRING%') | out-file .\build\vendordeps\navx_frc.json  -encoding ASCII"

REM Build setup program

copy .\setup\navx-mxp-setup.iss .\setup\navx-mxp-setup-orig.iss
Powershell -command "(get-content .\setup\navx-mxp-setup.iss) -replace ('0.0.000','%REVISION_STRING%') | out-file .\setup\navx-mxp-setup.iss -encoding ASCII"
pushd build
call buildsetup_navx-mxp.bat
popd
copy .\setup\navx-mxp-setup-orig.iss .\setup\navx-mxp-setup.iss
del .\setup\navx-mxp-setup-orig.iss

copy .\setup\navx-micro-setup.iss .\setup\navx-micro-setup-orig.iss
Powershell -command "(get-content .\setup\navx-micro-setup.iss) -replace ('0.0.000','%REVISION_STRING%') | out-file .\setup\navx-micro-setup.iss -encoding ASCII"
pushd build
call buildsetup_navx-micro.bat
popd
copy .\setup\navx-micro-setup-orig.iss .\setup\navx-micro-setup.iss
del .\setup\navx-micro-setup-orig.iss

popd

SET ECLIPSEC_MARS=C:\Users\Scott\eclipse\cpp-mars\eclipse\eclipsec.exe
SET ECLIPSEC_JUNO=C:\Eclipse\eclipsec.exe
REM Build all binaries

REM CD to Root Directory
pushd ..

REM
REM Begin a command-line "clean build" of the navx protocol java library
REM
pushd .\java\navx
call ant clean build
popd

REM
REM Copy navx protocol java library file to project folders that need it.
REM

mkdir .\processing\libraries\navx\library\
copy .\java\navx\jar\*.jar .\processing\libraries\navx\library\ /Y

REM
REM Copy the navX protocol library .h files to the
REM projects that need them.
REM

cp ./stm32/navx-mxp/IMU*.h  ./arduino/navXTestJig/
cp ./stm32/navx-mxp/AHRS*.h ./arduino/navXTestJig/

REM
REM Begin a command-line "clean build" of the Debug version of the navx-mxp firmware
REM

REM Use the GIT checkin count as the firmware revision number

pushd .\stm32\navx-mxp
echo|set /p=#define NAVX_MXP_REVISION  > revision.h
git rev-list --count --first-parent HEAD >> revision.h
popd

REM Build navX-MXP and navX-Micro Firmware

rm -r -f ./build_workspace_navx-mxp
mkdir build_workspace_navx-mxp

%ECLIPSEC_JUNO% -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data ./build_workspace_navx-mxp -import ./stm32 -cleanBuild navx-mxp/navX-MXP_Debug

rm -r -f ./build_workspace_navx-micro
mkdir build_workspace_navx-micro

%ECLIPSEC_JUNO% -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data ./build_workspace_navx-micro -import ./stm32 -cleanBuild navx-mxp/navX-Micro_Debug

rmdir /S /Q stm32\bin
mkdir stm32\bin

@echo off
for /f %%i in ('grep NAVX_MXP_FIRMWARE_VERSION_MAJOR stm32/navx-mxp/version.h ^| sed 's/#define NAVX_MXP_FIRMWARE_VERSION_MAJOR/ /' ^| sed 's/^[ \t]*//'') do set VER_MAJOR=%%i
for /f %%i in ('grep NAVX_MXP_FIRMWARE_VERSION_MINOR stm32/navx-mxp/version.h ^| sed 's/#define NAVX_MXP_FIRMWARE_VERSION_MINOR/ /' ^| sed 's/^[ \t]*//'') do set VER_MINOR=%%i
for /f %%i in ('git rev-list --count --first-parent HEAD') do set VER_REVISION=%%i
set REVISION_STRING=%VER_MAJOR%.%VER_MINOR%.%VER_REVISION%
REM Place version string into setup script
@echo on
pushd build
echo %REVISION_STRING% > version.txt
popd
copy .\stm32\navX-MXP_Debug\navx-mxp.hex .\stm32\bin\navx-mxp_%REVISION_STRING%.hex
copy .\stm32\navX-Micro_Debug\navx-micro.hex .\stm32\bin\navx-micro_%REVISION_STRING%.hex

REM Build CSharp Components

pushd .\build
call buildcsharp.bat

REM Build Processing components

call buildprocessing.bat
popd

REM
REM Begin a command-line "clean build" of the navx frc C++ library
REM

pushd .\roborio\c++\navx_frc_cpp
call gradlew clean
REM Build the Athena (RoboRIO), Raspbian and Windows x86 library versions
call gradlew navx_frcLinuxathenaReleaseSharedLibrary
call gradlew navx_frcLinuxraspbianReleaseStaticLibrary
call gradlew navx_frcWindowsx86-64ReleaseSharedLibrary
REM For now, publish to a local maven repo, for access by setup builder and the maven_deploy script.
REM The local maven repo is at %HOMEDRIVE%%HOMEPATH%\.m2\repository
call gradlew publishCppPublicationToMavenLocal
REM rm -r -f ./build_workspace_luna
REM mkdir build_workspace_luna

REM %ECLIPSEC_MARS% -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data ./build_workspace_luna -import ./navx_frc_cpp -cleanBuild navx_frc_cpp/Debug
popd

REM
REM Begin a command-line "clean build" of the navx frc Java library
REM

pushd .\roborio\java\navx_frc
REM call ant clean build
call gradlew clean
call gradlew build
REM For now, publish to a local maven repo, for access by setup builder and the maven_deploy script.
REM The local maven repo is at %HOMEDRIVE%%HOMEPATH%\.m2\repository
call gradlew publishMavenJavaPublicationToMavenLocal
popd

REM Build FTC Library
pushd .\android\navx_ftc
rmdir /S /Q build
call gradlew.bat assembleDebug
call gradlew.bat assembleRelease
popd

REM Update FRC vendordeps file with latest version number.
copy .\build\vendordeps\navx_frc.json.template .\build\vendordeps\navx_frc.json
Powershell -command "(get-content .\build\vendordeps\navx_frc.json) -replace ('0.0.000','%REVISION_STRING%') | out-file .\build\vendordeps\navx_frc.json  -encoding ASCII"

REM Build setup program

copy .\setup\navx-mxp-setup.iss .\setup\navx-mxp-setup-orig.iss
Powershell -command "(get-content .\setup\navx-mxp-setup.iss) -replace ('0.0.000','%REVISION_STRING%') | out-file .\setup\navx-mxp-setup.iss -encoding ASCII"
pushd build
call buildsetup_navx-mxp.bat
popd
copy .\setup\navx-mxp-setup-orig.iss .\setup\navx-mxp-setup.iss
del .\setup\navx-mxp-setup-orig.iss

copy .\setup\navx-micro-setup.iss .\setup\navx-micro-setup-orig.iss
Powershell -command "(get-content .\setup\navx-micro-setup.iss) -replace ('0.0.000','%REVISION_STRING%') | out-file .\setup\navx-micro-setup.iss -encoding ASCII"
pushd build
call buildsetup_navx-micro.bat
popd
copy .\setup\navx-micro-setup-orig.iss .\setup\navx-micro-setup.iss
del .\setup\navx-micro-setup-orig.iss

popd

Add windows x86 build step to build recipe.


if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::TLS12; (New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
    msiexec /qb /i C:\Windows\Temp\7z920-x64.msi
)

if exist "C:\Users\vagrant\windows.iso" (
    move /Y C:\Users\vagrant\windows.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\windows.iso" (
    powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::TLS12; (New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/12.5.5/5234757/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
    cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
    FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
    rd /S /Q "C:\Program Files (x86)\VMWare"
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\windows.iso -oC:\Windows\Temp\VMware"
cmd /c "C:\Windows\Temp\VMware\setup64.exe /s /v/qb /v/norestart"

rd /S /Q "C:\Windows\Temp\VMware"

if not exist "C:\Windows\Temp\7z920-x64.msi" (
    powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::TLS12; (New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" <NUL
    msiexec /qb /i C:\Windows\Temp\7z920-x64.msi
)

if exist "C:\Users\vagrant\windows.iso" (
    move /Y C:\Users\vagrant\windows.iso C:\Windows\Temp
)

if not exist "C:\Windows\Temp\windows.iso" (
    powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::TLS12; (New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/12.5.5/5234757/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
    cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
    FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
    rd /S /Q "C:\Program Files (x86)\VMWare"
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\windows.iso -oC:\Windows\Temp\VMware"
cmd /c "C:\Windows\Temp\VMware\setup64.exe /s /v/qb"

rd /S /Q "C:\Windows\Temp\VMware"

Remove the `/norestart` option as it results in a no-op


### application.bat - 2013 - ROBIN  ###

echo "version 1.2"
echo "Copyright company - 2013"
echo "Build : 10:00"

add partner name

add partner name


setlocal

cl rbuildmode.c
rbuildmode.exe
if errorlevel 1 (set BUILDMODE=win32) else (set BUILDMODE=x64)

set DEVENV=devenv
for %%X in (vcexpress.exe) do (set VCEXP=%%~$PATH:X)
if defined VCEXP set DEVENV=%VCEXP%

cd racket
"%DEVENV%" racket.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..\gracket
"%DEVENV%" gracket.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

cd gc2
..\..\..\racketcgc %SELF_RACKET_FLAGS% -cu make.rkt
if errorlevel 1 exit /B 1
cd ..

cd mzstart
"%DEVENV%" mzstart.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..\mrstart
"%DEVENV%" mrstart.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

cd mzcom
"%DEVENV%" mzcom.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

cd mzcom
..\..\..\racket %SELF_RACKET_FLAGS% -cu xform.rkt
if errorlevel 1 exit /B 1
cd ..

cd mzcom
"%DEVENV%" mzcom.sln /Build "3m|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

..\..\racket -l racket/kernel/init -e "(if (directory-exists? \"../../etc\") (void) (make-directory \"../../etc\"))"
if errorlevel 1 exit /B 1

copy COPYING-libscheme.txt ..\..\etc\
copy COPYING_LESSER.txt ..\..\etc\
copy COPYING.txt ..\..\etc\

..\..\racket -N "raco setup" %SELF_RACKET_FLAGS% -l- setup %PLT_SETUP_OPTIONS%
if errorlevel 1 exit /B 1

setlocal

cl rbuildmode.c
rbuildmode.exe
if errorlevel 1 (set BUILDMODE=win32) else (set BUILDMODE=x64)

set DEVENV=devenv
for %%X in (vcexpress.exe) do (set VCEXP=%%~$PATH:X)
if defined VCEXP set DEVENV=%VCEXP%

cd racket
"%DEVENV%" racket.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..\gracket
"%DEVENV%" gracket.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

cd gc2
..\..\..\racketcgc %SELF_RACKET_FLAGS% -cu make.rkt
if errorlevel 1 exit /B 1
cd ..

cd mzstart
"%DEVENV%" mzstart.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..\mrstart
"%DEVENV%" mrstart.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

cd mzcom
"%DEVENV%" mzcom.sln /Build "Release|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

cd mzcom
..\..\..\racket %SELF_RACKET_FLAGS% -cu xform.rkt
if errorlevel 1 exit /B 1
cd ..

cd mzcom
"%DEVENV%" mzcom.sln /Build "3m|%BUILDMODE%"
if errorlevel 1 exit /B 1
cd ..

..\..\racket -l racket/kernel/init -e "(if (directory-exists? \"../../etc\") (void) (make-directory \"../../etc\"))"
if errorlevel 1 exit /B 1
..\..\racket -l racket/kernel/init -e "(if (directory-exists? \"../../doc\") (void) (make-directory \"../../doc\"))"
if errorlevel 1 exit /B 1

copy COPYING-libscheme.txt ..\..\etc\
copy COPYING_LESSER.txt ..\..\etc\
copy COPYING.txt ..\..\etc\

..\..\racket -N "raco setup" %SELF_RACKET_FLAGS% -l- setup %PLT_SETUP_OPTIONS%
if errorlevel 1 exit /B 1

make "doc" dir for core install

win32: make "doc" dir for core install