@rem Makes a build directory of the viewer, so that you can run the NSIS install script
@rem You should have VS2008 redistributable (vcredist_x86.exe) in your viewer trunk root
@rem as well as OpenAL installer (oalinst.exe)
@echo off
rmdir build /S /Q
md build
copy readme.txt build
copy license.txt build
copy vcredist_x86.exe build
copy oalinst.exe build
copy dxwebsetup.exe build
xcopy bin\*.* build /S /C /Y

del build\performancelogger.txt
del build\fullmemoryleaklog.txt
del build\scenestats.txt
del build\ogrestats.txt
del build\openal32.dll
del build\wrap_oal.dll
del build\*d4.dll
del build\*_d.dll
del build\Poco*d.dll
@rem del build\dbus-1d.dll
del build\libcurld.dll
del build\audiod.dll
del build\OpenJPEGd.dll
del build\xmlrpcepid.dll
del build\QtSolutions_PropertyBrowser-2.5d.dll
del build\QtPropertyBrowserd.dll
del build\liboggd.dll
del build\libvorbisd.dll
del build\libvorbisfiled.dll
del build\viewerd.exe
del build\serverd.exe
del build\modules\core\*d.dll
del build\pymodules\*.pyc
del build\pymodules\apitest\*.pyc
del build\pymodules\circuits\*.pyc
del build\pymodules\circuits\core\*.pyc
del build\pymodules\circuits\net\*.pyc
del build\pymodules\circuits\tools\*.pyc
del build\pymodules\circuits\web\*.pyc
del build\pymodules\core\*.pyc
del build\pymodules\objectedit\*.pyc
del build\pymodules\lib\*.pyc
del build\pymodules\lib\webdav\*.pyc
del build\pymodules\lib\webdav\acp\*.pyc
del build\pymodules\lib\poster\*.pyc
del build\pymodules\usr\*.pyc
del build\pymodules\webdavinventory\*.pyc
del build\pymodules\webserver\*.pyc
del build\pymodules\mediaurlhandler\*.pyc
del build\pymodules\localscene\*.pyc
del build\pymodules\objecttools\*.pyc
del build\pymodules\estatemanagement\*.pyc
del build\pymodules\loadurlhandler\*.pyc
del build\pymodules\DLLs\*_d.pyd
del build\plugins\*_d.dll

@rem Makes a build directory of the viewer, so that you can run the NSIS install script
@rem You should have VS2008 redistributable (vcredist_x86.exe) in your viewer trunk root
@rem as well as OpenAL installer (oalinst.exe)
@echo off
rmdir build /S /Q
md build
copy readme.txt build
copy license.txt build
copy vcredist_x86.exe build
copy oalinst.exe build
copy dxwebsetup.exe build
xcopy bin\*.* build /S /C /Y

del build\plugins\*d.dll
del build\performancelogger.txt
del build\fullmemoryleaklog.txt
del build\scenestats.txt
del build\ogrestats.txt
del build\telepathy*.dll
del build\caelum*.dll
del build\openal32.dll
del build\wrap_oal.dll
del build\*d4.dll
del build\*_d.dll
del build\Poco*d.dll
@rem del build\dbus-1d.dll
del build\libcurld.dll
del build\audiod.dll
del build\OpenJPEGd.dll
del build\xmlrpcepid.dll
del build\QtSolutions_PropertyBrowser-2.5d.dll
del build\QtPropertyBrowserd.dll
del build\liboggd.dll
del build\libvorbisd.dll
del build\libvorbisfiled.dll
del build\viewerd.exe
del build\serverd.exe
del build\modules\core\*d.dll
@rem for now, delete whole pymodules folder
rmdir build\pymodules /S /Q
@rem del build\pymodules\*.pyc
@rem del build\pymodules\apitest\*.pyc
@rem del build\pymodules\circuits\*.pyc
@rem del build\pymodules\circuits\core\*.pyc
@rem del build\pymodules\circuits\net\*.pyc
@rem del build\pymodules\circuits\tools\*.pyc
@rem del build\pymodules\circuits\web\*.pyc
@rem del build\pymodules\core\*.pyc
@rem del build\pymodules\objectedit\*.pyc
@rem del build\pymodules\lib\*.pyc
@rem del build\pymodules\lib\webdav\*.pyc
@rem del build\pymodules\lib\webdav\acp\*.pyc
@rem del build\pymodules\lib\poster\*.pyc
@rem del build\pymodules\usr\*.pyc
@rem del build\pymodules\webdavinventory\*.pyc
@rem del build\pymodules\webserver\*.pyc
@rem del build\pymodules\mediaurlhandler\*.pyc
@rem del build\pymodules\localscene\*.pyc
@rem del build\pymodules\objecttools\*.pyc
@rem del build\pymodules\estatemanagement\*.pyc
@rem del build\pymodules\loadurlhandler\*.pyc
@rem del build\pymodules\DLLs\*_d.pyd

Update makebuild.bat.

Update makebuild.bat.


rem Set up script for Windows.

copy /-Y .vimrc %HOME%\_vimrc
copy /-Y .gvimrc %HOME%\_gvimrc

Set up script for Windows.

Set up script for Windows.


Fix setup.bat do not execute second command


@echo off
setlocal EnableExtensions

set BATDIR=%~dp0
if not exist "%USERPROFILE%" (
    echo [Error] Environment variable %%USERPROFILE%% is not set.
    goto :EOF
)

REM Check access priviledge
if exist "%TEMP%\makelinks.tmp" del "%TEMP%\makelinks.tmp"
(mklink "%TEMP%\makelinks.tmp" "%~0" 2>&1) > NUL
if not %ERRORLEVEL% == 0 (
    echo Failed to create symbolic link
    goto :EOF
)
del ".\makelinks.tmp" 2> NUL

call :MAIN "%USERPROFILE%\vimfiles\"
goto :EOF

REM ---------------------------------------------------------------------------
:MAIN
    set DOTVIM=%~f1
    call :MKDIR  "%DOTVIM%"
    call :MKLINK "%DOTVIM%vimrc" "%BATDIR%.vim\vimrc"
    call :MKDIR  "%DOTVIM%ftplugin"
    for %%I in (%BATDIR%.vim\ftplugin\*.vim) do (
        call :MKLINK "%DOTVIM%ftplugin\%%~nxI" "%%~fI"
    )
    exit /b 0

:MKLINK
    set DEST=%~f1
    set SRC=%~f2
    if exist "%DEST%" del /q "%DEST%"
    mklink "%DEST%" "%SRC%" > NUL
    echo mklink "%DEST%" "%SRC%"
    exit /b 0

:MKDIR
    if not exist "%~f1" (
        mkdir "%~f1"
	echo mkdir "%~f1"
    ) else (
        echo mkdir "%~f1" ^(skip^)
    )
    exit /b 0

Use spaces for indent

profile: Use spaces for indent


@ECHO OFF
SETLOCAL
SET EL=0

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

::use 64 bit python if platform is 64 bit
IF /I "%PLATFORM%" == "x64" set PATH=C:\Python27-x64;%PATH%
SET PATH=C:\Program Files\7-Zip;%PATH%
::add local node to path (since we install it below)
SET PATH=%CD%;%PATH%;

SET MAPNIK_SDK_URL=https://mapnik.s3.amazonaws.com/dist/dev/mapnik-win-sdk-v%MAPNIK_GIT%-%platform%-%msvs_toolset%.0.7z
ECHO fetching mapnik sdk^: %MAPNIK_SDK_URL%
IF EXIST mapnik-sdk.7z (ECHO already downloaded) ELSE (powershell Invoke-WebRequest "${env:MAPNIK_SDK_URL}" -OutFile mapnik-sdk.7z)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO extracting mapnik sdk
IF EXIST mapnik-sdk (ECHO already extracted) ELSE (7z -y x mapnik-sdk.7z | %windir%\system32\FIND "ing archive")
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

::replace installed node.exe with Mapbox node.exe
::install node version per visual studio toolset
IF EXIST node.exe ECHO found local node.exe, deleting ... && DEL /F node.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET ARCHPATH=
IF /I %platform% == x64 (SET ARCHPATH=x64/)
SET NODE_URL=https://mapbox.s3.amazonaws.com/node-cpp11/v%nodejs_version%/%ARCHPATH%node.exe
ECHO fetching node.exe^: %NODE_URL%
powershell Invoke-WebRequest "${env:NODE_URL}" -OutFile node.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO deleting node.exe programfiles x64
IF EXIST "%ProgramFiles%\nodejs" ^
    IF EXIST "%ProgramFiles%\nodejs\node.exe" ^
        ECHO found "%ProgramFiles%\nodejs\node.exe", deleting... && ^
        DEL /F "%ProgramFiles%\nodejs\node.exe"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO copying node.exe to programfiles x64
IF EXIST %ProgramFiles%\nodejs ECHO copying to "%ProgramFiles%\nodejs\node.exe" && COPY /Y node.exe "%ProgramFiles%\nodejs\"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO deleting node.exe programfiles x86
IF DEFINED ProgramFiles(x86) IF EXIST "%ProgramFiles(x86)%\nodejs" IF EXIST "%ProgramFiles(x86)%\nodejs\node.exe" ECHO "found %ProgramFiles(x86)%\nodejs\node.exe", deleting... && DEL /F "%ProgramFiles(x86)%\nodejs\node.exe"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO copying node.exe to programfiles x86
IF DEFINED ProgramFiles(x86) IF EXIST "%ProgramFiles(x86)%\nodejs" ECHO copying to "%ProgramFiles(x86)%\nodejs\node.exe" && COPY /Y node.exe "%ProgramFiles(x86)%\nodejs\"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO clear out node-gyp header cache
IF "%msvs_toolset%" == "14" IF EXIST %USERPROFILE%\.node-gyp rd /s /q %USERPROFILE%\.node-gyp

ECHO activating VS command prompt
IF /I %platform% == x64 CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" amd64
IF /I %platform% == x86 CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" x86

ECHO available node.exe:
where node
ECHO available npm^:
where npm

ECHO node -v && node -v
ECHO node that gets called && node -e "console.log(process.arch,process.execPath)"
ECHO npm -v && CALL npm -v
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO ===== where npm puts stuff START ============
ECHO npm root && CALL npm root
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm root -g && CALL npm root -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO npm bin && CALL npm bin
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm bin -g && CALL npm bin -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET NPM_BIN_DIR=
FOR /F "tokens=*" %%i in ('CALL npm bin -g') DO SET NPM_BIN_DIR=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF /I "%NPM_BIN_DIR%"=="%CD%" ECHO ERROR npm bin -g equals local directory && SET ERRORLEVEL=1 && GOTO ERROR
ECHO ===== where npm puts stuff END ============

ECHO installing node-gyp
CALL npm install -g node-gyp
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO ERRORLEVEL^: %ERRORLEVEL%
ECHO updating node-gyp
CALL npm update -g node-gyp
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO ERRORLEVEL^: %ERRORLEVEL%

ECHO deleting node_modules && rd /s /q node_modules
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST node_modules ECHO ERROR could not delete node_modules && SET ERRORLEVEL=1 && GOTO ERROR
if EXIST node_modules (ECHO node_modules found) ELSE (ECHO bootstrapping modules && CALL npm install mapnik-vector-tile nan sphericalmercator mocha node-pre-gyp jshint)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET MAPNIK_SDK=%CD%\mapnik-sdk
SET PATH=%MAPNIK_SDK%\bin;%MAPNIK_SDK%\lib;%PATH%
SET PROJ_LIB=%MAPNIK_SDK%\share\proj
SET GDAL_DATA=%MAPNIK_SDK%\share\gdal
SET ICU_DATA=%MAPNIK_SDK%\share\icu

ECHO building node-mapnik
CALL npm install --build-from-source --msvs_version=2015 %TOOLSET_ARGS% --loglevel=http
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

FOR /F "tokens=*" %%i in ('CALL node_modules\.bin\node-pre-gyp reveal module_path --silent') DO SET NODEMAPNIK_BINDING_DIR=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO NODEMAPNIK_BINDING_DIR^: %NODEMAPNIK_BINDING_DIR%
IF "%NODEMAPNIK_BINDING_DIR%"=="" ECHO ERROR could not determine binding dir && SET ERRORLEVEL=1 && GOTO ERROR

powershell scripts\build_against_sdk_02-copy-deps-to-bindingdir.ps1
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

powershell scripts\show_module_runtime.ps1 %CD%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

powershell scripts\build_against_sdk_03-write-mapnik.settings.ps1
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CALL npm test
::IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CALL node_modules\.bin\node-pre-gyp package testpackage %TOOLSET_ARGS%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO APPVEYOR_REPO_COMMIT_MESSAGE^: %APPVEYOR_REPO_COMMIT_MESSAGE%
SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE%
IF NOT "%CM%" == "%CM:[publish binary]=%" (ECHO publishing... && CALL node_modules\.bin\node-pre-gyp --msvs_version=2015 publish %TOOLSET_ARGS%) ELSE (ECHO not publishing)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF NOT "%CM%" == "%CM:[republish binary]=%" (ECHO republishing ... && CALL node_modules\.bin\node-pre-gyp --msvs_version=2015 unpublish publish %TOOLSET_ARGS%) ELSE (ECHO not republishing)
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 ===========

:: use 64 bit python if platform is 64 bit
IF /I "%PLATFORM%" == "x64" set PATH=C:\Python27-x64;%PATH%
:: put 7z on path (needed for unpacking mapnik sdk)
SET PATH=C:\Program Files\7-Zip;%PATH%

:: TODO - dist/dev/ is intended for dev releases of mapnik
:: We ideally want to get in the habit of only using Mapnik official releases
:: which will be uploaded to dist/
SET MAPNIK_SDK_URL=https://mapnik.s3.amazonaws.com/dist/dev/mapnik-win-sdk-v%MAPNIK_GIT%-%platform%-%msvs_toolset%.0.7z
ECHO fetching mapnik sdk^: %MAPNIK_SDK_URL%
IF EXIST mapnik-sdk.7z (ECHO already downloaded) ELSE (powershell Invoke-WebRequest "${env:MAPNIK_SDK_URL}" -OutFile mapnik-sdk.7z)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO extracting mapnik sdk
IF EXIST mapnik-sdk (ECHO already extracted) ELSE (7z -y x mapnik-sdk.7z | %windir%\system32\FIND "ing archive")
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:: replace installed node.exe with Mapbox node.exe
:: so that the binaries based on Visual Studio 2015
:: and built by https://travis-ci.org/mapbox/node-cpp11 are used
SET ARCHPATH=
IF /I %platform% == x64 (SET ARCHPATH=x64/)
SET NODE_URL=https://mapbox.s3.amazonaws.com/node-cpp11/v%nodejs_version%/%ARCHPATH%node.exe
ECHO fetching node.exe^: %NODE_URL%
powershell Invoke-WebRequest "${env:NODE_URL}" -OutFile node.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:: we replace the existing node.exe with our own
:: we do this in place so that the npm path logic
:: is preserved. The alternative might be to put
:: our custom node.exe on PATH from a custom location
:: and then pass `--prefix` to npm - but this is untested
ECHO deleting node.exe programfiles x64
IF EXIST "%ProgramFiles%\nodejs" ^
    IF EXIST "%ProgramFiles%\nodejs\node.exe" ^
        ECHO found "%ProgramFiles%\nodejs\node.exe", deleting... && ^
        DEL /F "%ProgramFiles%\nodejs\node.exe"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO copying node.exe to programfiles x64
IF EXIST %ProgramFiles%\nodejs ECHO copying to "%ProgramFiles%\nodejs\node.exe" && COPY /Y node.exe "%ProgramFiles%\nodejs\"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO deleting node.exe programfiles x86
IF DEFINED ProgramFiles(x86) IF EXIST "%ProgramFiles(x86)%\nodejs" IF EXIST "%ProgramFiles(x86)%\nodejs\node.exe" ECHO "found %ProgramFiles(x86)%\nodejs\node.exe", deleting... && DEL /F "%ProgramFiles(x86)%\nodejs\node.exe"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO copying node.exe to programfiles x86
IF DEFINED ProgramFiles(x86) IF EXIST "%ProgramFiles(x86)%\nodejs" ECHO copying to "%ProgramFiles(x86)%\nodejs\node.exe" && COPY /Y node.exe "%ProgramFiles(x86)%\nodejs\"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:: this is not needed on a fresh machine without previous installs
:: but is important on a machine that already has compiled for a given
:: node version. So, we have to clear to ensure that the Visual Studio 2015
:: binaries are used rather than the ones from joyent (which are built with Visual Studio 2013)
ECHO clear out node-gyp binary cache to ensure vs 2015 binaries are linked
IF "%msvs_toolset%" == "14" IF EXIST %USERPROFILE%\.node-gyp rd /s /q %USERPROFILE%\.node-gyp

ECHO activating VS command prompt
IF /I %platform% == x64 CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" amd64
IF /I %platform% == x86 CALL "C:\Program Files (x86)\Microsoft Visual Studio %msvs_toolset%.0\VC\vcvarsall.bat" x86

ECHO available node.exe:
where node
ECHO available npm^:
where npm

ECHO node -v && CALL node -v
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO node that gets called && CALL node -e "console.log(process.arch,process.execPath)"
ECHO npm -v && CALL npm -v
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO ===== where npm puts stuff START ============
ECHO npm root && CALL npm root
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm root -g && CALL npm root -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO npm bin && CALL npm bin
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO npm bin -g && CALL npm bin -g
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET NPM_BIN_DIR=
FOR /F "tokens=*" %%i in ('CALL npm bin -g') DO SET NPM_BIN_DIR=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF /I "%NPM_BIN_DIR%"=="%CD%" ECHO ERROR npm bin -g equals local directory && SET ERRORLEVEL=1 && GOTO ERROR
ECHO ===== where npm puts stuff END ============

ECHO installing node-gyp
CALL npm install -g node-gyp
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO ERRORLEVEL^: %ERRORLEVEL%
ECHO updating node-gyp
CALL npm update -g node-gyp
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO ERRORLEVEL^: %ERRORLEVEL%

ECHO deleting node_modules && rd /s /q node_modules
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST node_modules ECHO ERROR could not delete node_modules && SET ERRORLEVEL=1 && GOTO ERROR
if EXIST node_modules (ECHO node_modules found) ELSE (ECHO bootstrapping modules && CALL npm install mapnik-vector-tile nan sphericalmercator mocha node-pre-gyp jshint)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET MAPNIK_SDK=%CD%\mapnik-sdk
SET PATH=%MAPNIK_SDK%\bin;%MAPNIK_SDK%\lib;%PATH%
SET PROJ_LIB=%MAPNIK_SDK%\share\proj
SET GDAL_DATA=%MAPNIK_SDK%\share\gdal
SET ICU_DATA=%MAPNIK_SDK%\share\icu

ECHO building node-mapnik
CALL npm install --build-from-source --msvs_version=2015 %TOOLSET_ARGS% --loglevel=http
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

FOR /F "tokens=*" %%i in ('CALL node_modules\.bin\node-pre-gyp reveal module_path --silent') DO SET NODEMAPNIK_BINDING_DIR=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO NODEMAPNIK_BINDING_DIR^: %NODEMAPNIK_BINDING_DIR%
IF "%NODEMAPNIK_BINDING_DIR%"=="" ECHO ERROR could not determine binding dir && SET ERRORLEVEL=1 && GOTO ERROR

powershell scripts\build_against_sdk_02-copy-deps-to-bindingdir.ps1
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

powershell scripts\show_module_runtime.ps1 %CD%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

powershell scripts\build_against_sdk_03-write-mapnik.settings.ps1
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CALL npm test
::IF %ERRORLEVEL% NEQ 0 GOTO ERROR

CALL node_modules\.bin\node-pre-gyp package testpackage %TOOLSET_ARGS%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO APPVEYOR_REPO_COMMIT_MESSAGE^: %APPVEYOR_REPO_COMMIT_MESSAGE%
SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE%
IF NOT "%CM%" == "%CM:[publish binary]=%" (ECHO publishing... && CALL node_modules\.bin\node-pre-gyp --msvs_version=2015 publish %TOOLSET_ARGS%) ELSE (ECHO not publishing)
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF NOT "%CM%" == "%CM:[republish binary]=%" (ECHO republishing ... && CALL node_modules\.bin\node-pre-gyp --msvs_version=2015 unpublish publish %TOOLSET_ARGS%) ELSE (ECHO not republishing)
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%

add a lot of code comments to win script


if not exist "C:\Windows\Temp\7z1900-x64.msi" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')" <NUL
)
if not exist "C:\Windows\Temp\7z1900-x64.msi" (
    powershell -Command "Start-Sleep 5 ; (New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')" <NUL
)
msiexec /qb /i C:\Windows\Temp\7z1900-x64.msi

if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
if "%PACKER_BUILDER_TYPE%" equ "qemu" goto :qemu
goto :done

:vmware

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 "(New-Object System.Net.WebClient).DownloadFile('https://softwareupdate.vmware.com/cds/vmw-desktop/ws/15.5.1/15018445/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\setup.exe /S /v"/qn REBOOT=R\"

del /Q "C:\Windows\Temp\vmware-tools.tar"
del /Q "C:\Windows\Temp\windows.iso"
rd /S /Q "C:\Windows\Temp\VMware"
goto :done

:virtualbox

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

if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
    powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://download.virtualbox.org/virtualbox/6.1.2/VBoxGuestAdditions_6.1.2.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
cmd /c for %%i in (C:\Windows\Temp\virtualbox\cert\vbox*.cer) do C:\Windows\Temp\virtualbox\cert\VBoxCertUtil add-trusted-publisher %%i --root %%i
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
rd /S /Q "C:\Windows\Temp\virtualbox"
goto :done

:parallels
if exist "C:\Users\vagrant\prl-tools-win.iso" (
	move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
	cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
	cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
	rd /S /Q "C:\Windows\Temp\parallels"
)
goto :done

:qemu
if exist "E:\guest-agent\" (
    msiexec /qb /x E:\guest-agent\qemu-ga-x86_64.msi
)

:done
msiexec /qb /x C:\Windows\Temp\7z1900-x64.msi

if not exist "C:\Windows\Temp\7z1900-x64.msi" (
    powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')" <NUL
)
if not exist "C:\Windows\Temp\7z1900-x64.msi" (
    powershell -Command "Start-Sleep 5 ; (New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')" <NUL
)
msiexec /qb /i C:\Windows\Temp\7z1900-x64.msi

if "%PACKER_BUILDER_TYPE%" equ "vmware-iso" goto :vmware
if "%PACKER_BUILDER_TYPE%" equ "virtualbox-iso" goto :virtualbox
if "%PACKER_BUILDER_TYPE%" equ "parallels-iso" goto :parallels
if "%PACKER_BUILDER_TYPE%" equ "qemu" goto :qemu
goto :done

:vmware

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 "(New-Object System.Net.WebClient).DownloadFile('https://softwareupdate.vmware.com/cds/vmw-desktop/ws/15.5.1/15018445/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\setup.exe /S /v"/qn REBOOT=R\"

del /Q "C:\Windows\Temp\vmware-tools.tar"
del /Q "C:\Windows\Temp\windows.iso"
rd /S /Q "C:\Windows\Temp\VMware"
goto :done

:virtualbox

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

if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
    powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://download.virtualbox.org/virtualbox/6.1.4/VBoxGuestAdditions_6.1.4.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
)

cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
cmd /c for %%i in (C:\Windows\Temp\virtualbox\cert\vbox*.cer) do C:\Windows\Temp\virtualbox\cert\VBoxCertUtil add-trusted-publisher %%i --root %%i
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
rd /S /Q "C:\Windows\Temp\virtualbox"
goto :done

:parallels
if exist "C:\Users\vagrant\prl-tools-win.iso" (
	move /Y C:\Users\vagrant\prl-tools-win.iso C:\Windows\Temp
	cmd /C "C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\prl-tools-win.iso -oC:\Windows\Temp\parallels
	cmd /C C:\Windows\Temp\parallels\PTAgent.exe /install_silent
	rd /S /Q "C:\Windows\Temp\parallels"
)
goto :done

:qemu
if exist "E:\guest-agent\" (
    msiexec /qb /x E:\guest-agent\qemu-ga-x86_64.msi
)

:done
msiexec /qb /x C:\Windows\Temp\7z1900-x64.msi

Update VBox guest additions 6.1.4

Update VBox guest additions 6.1.4


@echo off
setlocal EnableDelayedExpansion
setlocal EnableExtensions

echo Moustacheminer Server Services - Discord
title Moustacheminer Server Services - Discord

set api=KEY HERE
:a
node bot.js !api!
goto a

Create start.bat

Create start.bat


Create foo.bat

Create foo.bat


@REM
@REM Copyright 2010-2017 Boxfuse GmbH
@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.
@REM

@Echo off

setlocal

@REM Set the current directory to the installation directory
set INSTALLDIR=%~dp0

if exist "%INSTALLDIR%\jre\bin\java.exe" (
 set JAVA_CMD="%INSTALLDIR%\jre\bin\java.exe"
) else (
 @REM Use JAVA_HOME if it is set
 if "%JAVA_HOME%"=="" (
  set JAVA_CMD=java
 ) else (
  set JAVA_CMD="%JAVA_HOME%\bin\java.exe"
 )
)

%JAVA_CMD% -cp "%INSTALLDIR%\lib\*;%INSTALLDIR%\drivers\*" org.flywaydb.commandline.Main %*

@REM Exit using the same code returned from Java
EXIT /B %ERRORLEVEL%

@REM
@REM Copyright 2010-2017 Boxfuse GmbH
@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.
@REM

@Echo off

setlocal

@REM Set the current directory to the installation directory
set INSTALLDIR=%~dp0

if exist "%INSTALLDIR%\jre\bin\java.exe" (
 set JAVA_CMD="%INSTALLDIR%\jre\bin\java.exe"
) else (
 @REM Use JAVA_HOME if it is set
 if "%JAVA_HOME%"=="" (
  set JAVA_CMD=java
 ) else (
  set JAVA_CMD="%JAVA_HOME%\bin\java.exe"
 )
)
SET CP=

IF DEFINED CLASSPATH ( SET CP=%CLASSPATH%;)

%JAVA_CMD% -cp "%CP%%INSTALLDIR%\lib\*;%INSTALLDIR%\drivers\*" org.flywaydb.commandline.Main %*

@REM Exit using the same code returned from Java
EXIT /B %ERRORLEVEL%

Use Windows CLASSPATH environment variable

Added a check to see if CLASSPATH environment variable is set. If yes, then add the classpath variable to the java command classpath option


@echo off
goto start
rem  Copyright 2010 Google Inc.
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.

rem  This helper script is used to access several Connector Manager functions
rem  from the command line.  This script sets up the Java classpath needed
rem  by the Connector Manager, then invokes the Connector Manager command
rem  processor.
rem
rem  Usage: Manager [-?] [-v] [command] [options] [arguments]
rem         -?, --help    Display the set of available commands
rem         -v, --version Display the Connector Manager version
rem
rem  To get help for a command, specify the command along with -? or --help
rem  For instance:
rem    Manager MigrateStore --help

:start
setlocal

rem The Connector Manager main class.
set classname=com.google.enterprise.connector.manager.ManagerMain

set pwd=%cd%
rem The Windows equivalent of dirname and basename only work in FOR and CALL.
for %%i in ( "%pwd%" ) do set pwdname=%%~nxi
for %%i in ( "%pwd%" ) do set parentdir=%%~dpi
if "%parentdir:~-1%" == "\" set parentdir=%parentdir:~0,-1%

rem  If there is a setenv file in the same directory as my script, then invoke
rem  it to set certain environment variables appropriate to this installation.
rem  For instance, JAVA_HOME or CLASSPATH.
rem  If the Connector requires JAR files not included in the Connector
rem  installation (for instance Documentum DFC JAR files), then you should
rem  specify those JAR files in the CLASSPATH environment variable.
rem  For instance:
rem    set CLASSPATH="%CLASSPATH%";"%DOCUMENTUM_SHARED%"\dfc\dfc.jar;"%DOCUMENTUM_SHARED%"\config
for %%i in ( "%0" ) do set scriptdir=%%~dpi
if exist "%scriptdir%\setenv.bat" (
  call "%scriptdir%\setenv.bat"
)

rem  Locate a Java runtime. The Connector Manager requires Java 5 or better.
if "%JAVA_HOME%" == "" (
  if "%JRE_HOME%" == "" (
    set java=java
  ) else (
    set java="%JRE_HOME%"\bin\java
  )
) else (
  set java="%JAVA_HOME%"\bin\java
)

rem  Locate the Tomcat 6 installation.  Note that this code requires a
rem  Tomcat 6 directory layout, which is simplified over previous versions.
if "%CATALINA_HOME%" == "" (
  if "%pwdname%" == "Tomcat" (
    set cathome=%pwd%
  ) else if "%pwdname%" == "Scripts" (
    set cathome=%parentdir%\Tomcat
  ) else (
    set cathome=%pwd%\Tomcat
  )
) else (
  set cathome=%CATALINA_HOME%
)
if not exist "%cathome%" (
  echo Unable to locate the Apache Tomcat web application container.
  echo Please set the CATALINA_HOME and CATALINA_BASE environment
  echo variables appropriately.
  goto end
)
if "%CATALINA_BASE%" == "" (
  set catbase=%cathome%
) else (
  set catbase=%CATALINA_BASE%
)

rem  Locate the Connector Manager's WEB-INF directory, typically found at
rem  'Tomcat\webapps\connector-manager\WEB-INF' in the Connector installation.
set webinf=%catbase%\webapps\connector-manager\WEB-INF
if not exist "%webinf%" (
  rem  Perhaps we are running from the Install dir, or Scripts.
  set webinf=Tomcat\webapps\connector-manager\WEB-INF
  if "%pwdname%" == "Scripts" (
    set webinf=%parentdir%\%webinf%
  )
  if not exist "%webinf%" (
    echo Unable to locate the Connector Manager web application directory.
    goto end
  )
)

rem  Set the classpath to include all jars in the Connector Manager
rem  lib directory.
for /R "%webinf%"\lib %%a in (*.jar) do call :appendClassPath %%a

rem  Set the classpath to include all jars in the Tomcat lib directory.
rem  This is where JDBC drivers should be installed.
for /R "%cathome%"\lib %%a in (*.jar) do call :appendClassPath %%a

rem  The Connector Manager webapp directory is the parent of WEB-INF.
for %%i in ( "%webinf%" ) do set managerdir=%%~dpi
if "%managerdir:~-1%" == "\" set managerdir=%managerdir:~0,-1%

rem  Run the program.
"%java%" -Dmanager.dir="%managerdir%" -Dcatalina.base="%catbase%" %classname% %*

:end
endlocal
goto :eof

:appendClassPath
set CLASSPATH=%*;%CLASSPATH%
goto :eof

@echo off
goto start
rem  Copyright 2010 Google Inc.
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.

rem  This helper script is used to access several Connector Manager functions
rem  from the command line.  This script sets up the Java classpath needed
rem  by the Connector Manager, then invokes the Connector Manager command
rem  processor.
rem
rem  Usage: Manager [-?] [-v] [command] [options] [arguments]
rem         -?, --help    Display the set of available commands
rem         -v, --version Display the Connector Manager version
rem
rem  To get help for a command, specify the command along with -? or --help
rem  For instance:
rem    Manager MigrateStore --help

:start
setlocal

rem The Connector Manager main class.
set classname=com.google.enterprise.connector.manager.ManagerMain

set pwd=%cd%
rem The Windows equivalent of dirname and basename only work in FOR and CALL.
for %%i in ( "%pwd%" ) do set pwdname=%%~nxi
for %%i in ( "%pwd%" ) do set parentdir=%%~dpi
if "%parentdir:~-1%" == "\" set parentdir=%parentdir:~0,-1%

rem  If there is a setenv file in the same directory as my script, then invoke
rem  it to set certain environment variables appropriate to this installation.
rem  For instance, JAVA_HOME or CLASSPATH.
rem  If the Connector requires JAR files not included in the Connector
rem  installation (for instance Documentum DFC JAR files), then you should
rem  specify those JAR files in the CLASSPATH environment variable.
rem  For instance:
rem    set CLASSPATH="%CLASSPATH%";"%DOCUMENTUM_SHARED%"\dfc\dfc.jar;"%DOCUMENTUM_SHARED%"\config
for %%i in ( "%0" ) do set scriptdir=%%~dpi
if exist "%scriptdir%\setenv.bat" (
  call "%scriptdir%\setenv.bat"
)

rem  Locate a Java runtime. The Connector Manager requires Java 5 or better.
if "%JAVA_HOME%" == "" (
  if "%JRE_HOME%" == "" (
    set java=java
  ) else (
    set java=%JRE_HOME%\bin\java
  )
) else (
  set java=%JAVA_HOME%\bin\java
)

rem  Locate the Tomcat 6 installation.  Note that this code requires a
rem  Tomcat 6 directory layout, which is simplified over previous versions.
if "%CATALINA_HOME%" == "" (
  if "%pwdname%" == "Tomcat" (
    set cathome=%pwd%
  ) else if "%pwdname%" == "Scripts" (
    set cathome=%parentdir%\Tomcat
  ) else (
    set cathome=%pwd%\Tomcat
  )
) else (
  set cathome=%CATALINA_HOME%
)
if not exist "%cathome%" (
  echo Unable to locate the Apache Tomcat web application container.
  echo Please set the CATALINA_HOME and CATALINA_BASE environment
  echo variables appropriately.
  goto end
)
if "%CATALINA_BASE%" == "" (
  set catbase=%cathome%
) else (
  set catbase=%CATALINA_BASE%
)

rem  Locate the Connector Manager's WEB-INF directory, typically found at
rem  'Tomcat\webapps\connector-manager\WEB-INF' in the Connector installation.
set webinf=%catbase%\webapps\connector-manager\WEB-INF
if not exist "%webinf%" (
  rem  Perhaps we are running from the Install dir, or Scripts.
  set webinf=Tomcat\webapps\connector-manager\WEB-INF
  if "%pwdname%" == "Scripts" (
    set webinf=%parentdir%\%webinf%
  )
  if not exist "%webinf%" (
    echo Unable to locate the Connector Manager web application directory.
    goto end
  )
)

rem  Set the classpath to include all jars in the Connector Manager
rem  lib directory.
for /R "%webinf%"\lib %%a in (*.jar) do call :appendClassPath %%a

rem  Set the classpath to include all jars in the Tomcat lib directory.
rem  This is where JDBC drivers should be installed.
for /R "%cathome%"\lib %%a in (*.jar) do call :appendClassPath %%a

rem  The Connector Manager webapp directory is the parent of WEB-INF.
for %%i in ( "%webinf%" ) do set managerdir=%%~dpi
if "%managerdir:~-1%" == "\" set managerdir=%managerdir:~0,-1%

rem  Run the program.
"%java%" -Dmanager.dir="%managerdir%" -Dcatalina.base="%catbase%" %classname% %*

:end
endlocal
goto :eof

:appendClassPath
set CLASSPATH=%*;%CLASSPATH%
goto :eof

Fix extraneous quotes using JAVA_HOME/JRE_HOME variables.


add which command (for after Windows7)

add which command (for after Windows7)


@echo off
@echo Salt Windows Build Package Script
@echo ----------------------------------------------------------------------
@echo.

:: Define Variables
@echo Defining Variables...
@echo ----------------------------------------------------------------------
Set "CurrDir=%cd%"
Set "BinDir=%cd%\buildenv\bin"
Set "InsDir=%cd%\installer"
Set "PyDir=C:\Python27"

:: Get the version from git if not passed
if [%1]==[] (
    for /f "delims=" %%a in ('git describe') do @set "Version=%%a"
) else (
    set "Version=%~1"
)

:: Find the NSIS Installer
If Exist "C:\Program Files\NSIS\" (
    Set NSIS="C:\Program Files\NSIS\"
) Else (
    Set NSIS="C:\Program Files (x86)\NSIS\"
)
Set "PATH=%NSIS%;%PATH%"
@echo.

@echo Copying C:\Python27 to bin...
@echo ----------------------------------------------------------------------
:: Check for existing bin directory and remove
If Exist "%BinDir%\" rd /S /Q "%BinDir%"

:: Copy the Python27 directory to bin
@echo xcopy /E /Q "%PyDir%" "%BinDir%\"
xcopy /E /Q "%PyDir%" "%BinDir%\"
@echo.

:: Remove the fixed path in .exe files
@echo Removing fixed path from .exe files
@echo ----------------------------------------------------------------------
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\easy_install.exe"
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\easy_install-2.7.exe"
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip.exe"
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip2.7.exe"
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip2.exe"
@echo.

@echo Cleaning up unused files and directories...
@echo ----------------------------------------------------------------------
:: Remove all Compiled Python files (.pyc)
del /S /Q "%BinDir%\*.pyc" 1>nul
:: Remove all Compiled HTML Help (.chm)
del /S /Q "%BinDir%\*.chm" 1>nul
:: Remove all empty text files (they are placeholders for git)
del /S /Q "%BinDir%\..\empty.*" 1>nul

:: Delete Unused Docs and Modules
If Exist "%BinDir%\Doc"           rd /S /Q "%BinDir%\Doc"
If Exist "%BinDir%\share"         rd /S /Q "%BinDir%\share"
If Exist "%BinDir%\tcl"           rd /S /Q "%BinDir%\tcl"
If Exist "%BinDir%\Lib\idlelib"   rd /S /Q "%BinDir%\Lib\idlelib"
If Exist "%BinDir%\Lib\lib-tk"    rd /S /Q "%BinDir%\Lib\lib-tk"
If Exist "%BinDir%\Lib\test"      rd /S /Q "%BinDir%\Lib\test"
If Exist "%BinDir%\Lib\unit-test" rd /S /Q "%BinDir%\Lib\unit-test"

:: Delete Unused .dll files
If Exist "%BinDir%\DLLs\tcl85.dll"    del /S /Q "%BinDir%\DLLs\tcl85.dll"    1>nul
If Exist "%BinDir%\DLLs\tclpip85.dll" del /S /Q "%BinDir%\DLLs\tclpip85.dll" 1>nul
If Exist "%BinDir%\DLLs\tk85.dll"     del /S /Q "%BinDir%\DLLs\tk85.dll"     1>nul

:: Delete Unused .lib files
If Exist "%BinDir%\libs\_tkinter.lib" del /S /Q "%BinDir%\libs\_tkinter.lib" 1>nul

:: Delete .txt files
If Exist "%BinDir%\NEWS.txt"   del /q "%BinDir%\NEWS.txt"   1>nul
If Exist "%BinDir%\README.txt" del /q "%BinDir%\README.txt" 1>nul
@echo.

@echo Building the installer...
@echo ----------------------------------------------------------------------
makensis.exe /DSaltVersion=%Version% "%InsDir%\Salt-Minion-Setup.nsi"
@echo.

@echo.
@echo ======================================================================
@echo Script completed...
@echo ======================================================================
@echo Installation file can be found in the following directory:
@echo %InsDir%

:done
if [%Version%] == [] pause

@echo off
@echo Salt Windows Build Package Script
@echo ----------------------------------------------------------------------
@echo.

:: Define Variables
@echo Defining Variables...
@echo ----------------------------------------------------------------------
Set "CurrDir=%cd%"
Set "BinDir=%cd%\buildenv\bin"
Set "InsDir=%cd%\installer"
Set "PyDir=C:\Python27"

:: Get the version from git if not passed
if [%1]==[] (
    for /f "delims=" %%a in ('git describe') do @set "Version=%%a"
) else (
    set "Version=%~1"
)

:: Find the NSIS Installer
If Exist "C:\Program Files\NSIS\" (
    Set NSIS="C:\Program Files\NSIS\"
) Else (
    Set NSIS="C:\Program Files (x86)\NSIS\"
)
Set "PATH=%NSIS%;%PATH%"
@echo.

@echo Copying C:\Python27 to bin...
@echo ----------------------------------------------------------------------
:: Check for existing bin directory and remove
If Exist "%BinDir%\" rd /S /Q "%BinDir%"

:: Copy the Python27 directory to bin
@echo xcopy /E /Q "%PyDir%" "%BinDir%\"
xcopy /E /Q "%PyDir%" "%BinDir%\"
@echo.

:: Remove the fixed path in .exe files
@echo Removing fixed path from .exe files
@echo ----------------------------------------------------------------------
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\easy_install.exe"
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\easy_install-2.7.exe"
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip.exe"
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip2.7.exe"
%PyDir%\python "%CurrDir%\portable.py" -f "%BinDir%\Scripts\pip2.exe"
@echo.

@echo Cleaning up unused files and directories...
@echo ----------------------------------------------------------------------
:: Remove all Compiled Python files (.pyc)
del /S /Q "%BinDir%\*.pyc" 1>nul
:: Remove all Compiled HTML Help (.chm)
del /S /Q "%BinDir%\*.chm" 1>nul
:: Remove all empty text files (they are placeholders for git)
del /S /Q "%BinDir%\..\empty.*" 1>nul

:: Delete Unused Docs and Modules
If Exist "%BinDir%\Doc"           rd /S /Q "%BinDir%\Doc"
If Exist "%BinDir%\share"         rd /S /Q "%BinDir%\share"
If Exist "%BinDir%\tcl"           rd /S /Q "%BinDir%\tcl"
If Exist "%BinDir%\Lib\idlelib"   rd /S /Q "%BinDir%\Lib\idlelib"
If Exist "%BinDir%\Lib\lib-tk"    rd /S /Q "%BinDir%\Lib\lib-tk"
If Exist "%BinDir%\Lib\test"      rd /S /Q "%BinDir%\Lib\test"
If Exist "%BinDir%\Lib\unit-test" rd /S /Q "%BinDir%\Lib\unit-test"

:: Delete Unused .dll files
If Exist "%BinDir%\DLLs\tcl85.dll"    del /S /Q "%BinDir%\DLLs\tcl85.dll"    1>nul
If Exist "%BinDir%\DLLs\tclpip85.dll" del /S /Q "%BinDir%\DLLs\tclpip85.dll" 1>nul
If Exist "%BinDir%\DLLs\tk85.dll"     del /S /Q "%BinDir%\DLLs\tk85.dll"     1>nul

:: Delete Unused .lib files
If Exist "%BinDir%\libs\_tkinter.lib" del /S /Q "%BinDir%\libs\_tkinter.lib" 1>nul

:: Delete .txt files
If Exist "%BinDir%\NEWS.txt"   del /q "%BinDir%\NEWS.txt"   1>nul
If Exist "%BinDir%\README.txt" del /q "%BinDir%\README.txt" 1>nul
@echo.

@echo Building the installer...
@echo ----------------------------------------------------------------------
makensis.exe /DSaltVersion=%Version% "%InsDir%\Salt-Minion-Setup.nsi"
makensis.exe /DSaltVersion=%Version% "%InsDir%\Salt-Setup.nsi"
@echo.

@echo.
@echo ======================================================================
@echo Script completed...
@echo ======================================================================
@echo Installation file can be found in the following directory:
@echo %InsDir%

:done
if [%Version%] == [] pause

Add master build package build

Add master build package build


@rem This requires clang to be installed and in %PATH%
@rem http://llvm.org/releases/download.html

@cd src

@rem for /f "delims=|" %%f in ('dir /b *.cpp *.h') do @echo %%f

for /f "delims=|" %%f in ('dir /b *.cpp *.h') do clang-format -style="{BasedOnStyle: Mozilla, IndentWidth: 4, ColumnLimit: 100}" -i %%f
@rem clang-format -style="{BasedOnStyle: Mozilla, IndentWidth: 4, ColumnLimit: 100}" -i *.cpp *.h

@rem This requires clang to be installed and in %PATH%
@rem http://llvm.org/releases/download.html

@cd src

@rem for /f "delims=|" %%f in ('dir /b *.cpp *.h') do @echo %%f
for /f %%f in ('dir /b *.cpp *.h') do clang-format -style="{BasedOnStyle: Mozilla, IndentWidth: 4, ColumnLimit: 100}" -i %%f

simplify for loop

simplify for loop


@echo off

setlocal EnableDelayedExpansion

set registryRoot=HKCU\Software\Classes
set key=igfxcui

reg add "%registryRoot%\Directory\Background\shellex\ContextMenuHandlers\%key%" /d "---" /f

set key=igfxDTCM

reg add "%registryRoot%\Directory\Background\shellex\ContextMenuHandlers\%key%" /d "---" /f

Add script to disable intel context menu


@echo off

setlocal

set PATH=%CD%\tools;%PATH%

set WGET_ARGS=-c --no-check-certificate
set UNZIP_ARGS=-q

set BASEURL=https://s3.amazonaws.com/rstudio-buildtools/
set BOOST_GCC493_FILE=boost-1.50-win-rtools33-gcc493.zip
set RTOOLS_FILE=Rtools33.exe
set GIN_FILE=gin-1.5.zip
set GWT_FILE=gwt-2.7.0.zip
set JUNIT_FILE=junit-4.9b3.jar
set GNUDIFF_FILE=gnudiff.zip
set GNUGREP_FILE=gnugrep-2.5.4.zip
set MSYS_SSH_FILE=msys-ssh-1000-18.zip
set SUMATRA_PDF_FILE=SumatraPDF-3.1.1.zip
set WINUTILS_FILE=winutils-1.0.zip

set PANDOC_VERSION=1.17.0.2
set PANDOC_NAME=pandoc-%PANDOC_VERSION%
set PANDOC_FILE=%PANDOC_NAME%.zip

set LIBCLANG_VERSION=3.4
set LIBCLANG_NAME=libclang-%LIBCLANG_VERSION%
set LIBCLANG_FILE=%LIBCLANG_NAME%.zip
set LIBCLANG_HEADERS=builtin-headers
set LIBCLANG_HEADERS_FILE=libclang-%LIBCLANG_HEADERS%.zip

set RTOOLS_DIR=%RTOOLS_FILE:.exe=%
if not exist %RTOOLS_DIR% (
  wget %WGET_ARGS% "%BASEURL%%RTOOLS_FILE%"
  echo Installing '%RTOOLS_FILE%' -- please wait...
  start /wait Rtools33.exe /verysilent /dir=%CD%\%RTOOLS_DIR%
  if %ERRORLEVEL% EQU 0 (
    echo '%RTOOLS_FILE%' successfully installed!
    del %RTOOLS_FILE%
  ) else (
    echo Failed to install '%RTOOLS_FILE%'!
  )
)

if not exist boost-1.50-win-rtools33-gcc493 (
  wget %WGET_ARGS% "%BASEURL%%BOOST_GCC493_FILE%"
  echo Unzipping %BOOST_GCC493_FILE%
  unzip %UNZIP_ARGS% "%BOOST_GCC493_FILE%" -d boost-1.50-win-rtools33-gcc493
  del "%BOOST_GCC493_FILE%"
)

if not exist gnudiff (
  wget %WGET_ARGS% "%BASEURL%%GNUDIFF_FILE%"
  mkdir gnudiff
  echo Unzipping %GNUDIFF_FILE%
  unzip %UNZIP_ARGS% "%GNUDIFF_FILE%" -d gnudiff
  del "%GNUDIFF_FILE%"
)

if not exist gnugrep (
  wget %WGET_ARGS% "%BASEURL%%GNUGREP_FILE%"
  mkdir gnugrep
  echo Unzipping %GNUGREP_FILE%
  unzip %UNZIP_ARGS% "%GNUGREP_FILE%" -d gnugrep
  del "%GNUGREP_FILE%"
)

if not exist msys-ssh-1000-18 (
  wget %WGET_ARGS% "%BASEURL%%MSYS_SSH_FILE%"
  mkdir msys-ssh-1000-18
  echo Unzipping %MSYS_SSH_FILE%
  unzip %UNZIP_ARGS% "%MSYS_SSH_FILE%" -d msys-ssh-1000-18
  del "%MSYS_SSH_FILE%"
)

if not exist sumatra\3.1.1 (
  wget %WGET_ARGS% "%BASEURL%%SUMATRA_PDF_FILE%"
  mkdir sumatra\3.1.1
  echo Unzipping %SUMATRA_PDF_FILE%
  unzip %UNZIP_ARGS% "%SUMATRA_PDF_FILE%" -d sumatra\3.1.1
  del "%SUMATRA_PDF_FILE%"
)

if not exist winutils\1.0 (
  wget %WGET_ARGS% "%BASEURL%%WINUTILS_FILE%"
  mkdir winutils\1.0
  echo Unzipping %WINUTILS_FILE%
  unzip %UNZIP_ARGS% "%WINUTILS_FILE%" -d winutils\1.0
  del "%WINUTILS_FILE%"
)

if not exist ..\..\src\gwt\lib (
  mkdir ..\..\src\gwt\lib
)
pushd ..\..\src\gwt\lib

if not exist gin\1.5 (
  wget %WGET_ARGS% "%BASEURL%%GIN_FILE%"
  mkdir gin\1.5
  echo Unzipping %GIN_FILE%
  unzip %UNZIP_ARGS% "%GIN_FILE%" -d gin\1.5
  del "%GIN_FILE%"
)

if not exist gwt\2.7.0 (
  wget %WGET_ARGS% "%BASEURL%%GWT_FILE%"
  echo Unzipping %GWT_FILE%
  unzip %UNZIP_ARGS% "%GWT_FILE%"
  mkdir gwt
  move gwt-2.7.0 gwt\2.7.0
  del "%GWT_FILE%"
)

if not exist %JUNIT_FILE% (
  wget %WGET_ARGS% "%BASEURL%%JUNIT_FILE%"
)

popd

pushd ..\common
set CORE_DICTIONARIES=core-dictionaries.zip
if not exist "dictionaries\en_US.dic" (
  wget %WGET_ARGS% "https://s3.amazonaws.com/rstudio-dictionaries/%CORE_DICTIONARIES%"
  if exist "%CORE_DICTIONARIES%" (
     mkdir dictionaries
     echo Unzipping %CORE_DICTIONARIES%
     unzip %UNZIP_ARGS% "%CORE_DICTIONARIES%" -d dictionaries
     del "%CORE_DICTIONARIES%"
  )
)

set MATHJAX=mathjax-23.zip
if not exist "mathjax-23" (
  wget %WGET_ARGS% "https://s3.amazonaws.com/rstudio-buildtools/%MATHJAX%"
  if exist "%MATHJAX%" (
     mkdir mathjax-23
     echo Unzipping %MATHJAX%
     unzip %UNZIP_ARGS% "%MATHJAX%"
     del "%MATHJAX%"
  )
)

if not exist pandoc\%PANDOC_VERSION% (
  wget %WGET_ARGS% "%BASEURL%%PANDOC_FILE%"
  echo Unzipping %PANDOC_FILE%
  unzip %UNZIP_ARGS% "%PANDOC_FILE%"
  mkdir pandoc\%PANDOC_VERSION%
  copy "%PANDOC_NAME%\windows\pandoc*" "pandoc\%PANDOC_VERSION%""
  del %PANDOC_FILE%
  rmdir /s /q %PANDOC_NAME%
)

if not exist libclang\%LIBCLANG_VERSION% (
  wget %WGET_ARGS% "%BASEURL%%LIBCLANG_FILE%"
  echo Unzipping %LIBCLANG_FILE%
  unzip %UNZIP_ARGS% "%LIBCLANG_FILE%"
  mkdir libclang\%LIBCLANG_VERSION%
  xcopy /s "%LIBCLANG_NAME%\windows\mingw" "libclang\%LIBCLANG_VERSION%"
  del %LIBCLANG_FILE%
  rmdir /s /q %LIBCLANG_NAME%
)

if not exist libclang\%LIBCLANG_HEADERS% (
  wget %WGET_ARGS% "%BASEURL%%LIBCLANG_HEADERS_FILE%"
  echo Unzipping %LIBCLANG_HEADERS%
  unzip %UNZIP_ARGS% "%LIBCLANG_HEADERS_FILE%" -d libclang
  del %LIBCLANG_HEADERS_FILE%
)

install-packages.cmd

popd

@echo off

setlocal

set PATH=%CD%\tools;%PATH%

set WGET_ARGS=-c --no-check-certificate
set UNZIP_ARGS=-q

set BASEURL=https://s3.amazonaws.com/rstudio-buildtools/
set BOOST_GCC493_FILE=boost-1.50-win-rtools33-gcc493.zip
set RTOOLS_FILE=Rtools33.exe
set GIN_FILE=gin-1.5.zip
set GWT_FILE=gwt-2.7.0.zip
set JUNIT_FILE=junit-4.9b3.jar
set GNUDIFF_FILE=gnudiff.zip
set GNUGREP_FILE=gnugrep-2.5.4.zip
set MSYS_SSH_FILE=msys-ssh-1000-18.zip
set SUMATRA_PDF_FILE=SumatraPDF-3.1.1.zip
set WINUTILS_FILE=winutils-1.0.zip

set PANDOC_VERSION=1.17.0.2
set PANDOC_NAME=pandoc-%PANDOC_VERSION%
set PANDOC_FILE=%PANDOC_NAME%.zip

set LIBCLANG_VERSION=3.4
set LIBCLANG_NAME=libclang-%LIBCLANG_VERSION%
set LIBCLANG_FILE=%LIBCLANG_NAME%.zip
set LIBCLANG_HEADERS=builtin-headers
set LIBCLANG_HEADERS_FILE=libclang-%LIBCLANG_HEADERS%.zip

set RTOOLS_DIR=%RTOOLS_FILE:.exe=%
if not exist %RTOOLS_DIR% (
  wget %WGET_ARGS% "%BASEURL%%RTOOLS_FILE%"
  echo Installing '%RTOOLS_FILE%' -- please wait...
  start /wait Rtools33.exe /verysilent /dir=%CD%\%RTOOLS_DIR%
  if %ERRORLEVEL% EQU 0 (
    echo '%RTOOLS_FILE%' successfully installed!
    del %RTOOLS_FILE%
  ) else (
    echo Failed to install '%RTOOLS_FILE%'!
  )
)

if not exist boost-1.50-win-rtools33-gcc493 (
  wget %WGET_ARGS% "%BASEURL%%BOOST_GCC493_FILE%"
  echo Unzipping %BOOST_GCC493_FILE%
  unzip %UNZIP_ARGS% "%BOOST_GCC493_FILE%" -d boost-1.50-win-rtools33-gcc493
  del "%BOOST_GCC493_FILE%"
)

if not exist gnudiff (
  wget %WGET_ARGS% "%BASEURL%%GNUDIFF_FILE%"
  mkdir gnudiff
  echo Unzipping %GNUDIFF_FILE%
  unzip %UNZIP_ARGS% "%GNUDIFF_FILE%" -d gnudiff
  del "%GNUDIFF_FILE%"
)

if not exist gnugrep (
  wget %WGET_ARGS% "%BASEURL%%GNUGREP_FILE%"
  mkdir gnugrep
  echo Unzipping %GNUGREP_FILE%
  unzip %UNZIP_ARGS% "%GNUGREP_FILE%" -d gnugrep
  del "%GNUGREP_FILE%"
)

if not exist msys-ssh-1000-18 (
  wget %WGET_ARGS% "%BASEURL%%MSYS_SSH_FILE%"
  mkdir msys-ssh-1000-18
  echo Unzipping %MSYS_SSH_FILE%
  unzip %UNZIP_ARGS% "%MSYS_SSH_FILE%" -d msys-ssh-1000-18
  del "%MSYS_SSH_FILE%"
)

if not exist sumatra\3.1.1 (
  wget %WGET_ARGS% "%BASEURL%%SUMATRA_PDF_FILE%"
  mkdir sumatra\3.1.1
  echo Unzipping %SUMATRA_PDF_FILE%
  unzip %UNZIP_ARGS% "%SUMATRA_PDF_FILE%" -d sumatra\3.1.1
  del "%SUMATRA_PDF_FILE%"
)

if not exist winutils\1.0 (
  wget %WGET_ARGS% "%BASEURL%%WINUTILS_FILE%"
  mkdir winutils\1.0
  echo Unzipping %WINUTILS_FILE%
  unzip %UNZIP_ARGS% "%WINUTILS_FILE%" -d winutils\1.0
  del "%WINUTILS_FILE%"
)

if not exist ..\..\src\gwt\lib (
  mkdir ..\..\src\gwt\lib
)
pushd ..\..\src\gwt\lib

if not exist gin\1.5 (
  wget %WGET_ARGS% "%BASEURL%%GIN_FILE%"
  mkdir gin\1.5
  echo Unzipping %GIN_FILE%
  unzip %UNZIP_ARGS% "%GIN_FILE%" -d gin\1.5
  del "%GIN_FILE%"
)

if not exist gwt\2.7.0 (
  wget %WGET_ARGS% "%BASEURL%%GWT_FILE%"
  echo Unzipping %GWT_FILE%
  unzip %UNZIP_ARGS% "%GWT_FILE%"
  mkdir gwt
  move gwt-2.7.0 gwt\2.7.0
  del "%GWT_FILE%"
)

if not exist %JUNIT_FILE% (
  wget %WGET_ARGS% "%BASEURL%%JUNIT_FILE%"
)

popd

pushd ..\common
set CORE_DICTIONARIES=core-dictionaries.zip
if not exist "dictionaries\en_US.dic" (
  wget %WGET_ARGS% "https://s3.amazonaws.com/rstudio-dictionaries/%CORE_DICTIONARIES%"
  if exist "%CORE_DICTIONARIES%" (
     mkdir dictionaries
     echo Unzipping %CORE_DICTIONARIES%
     unzip %UNZIP_ARGS% "%CORE_DICTIONARIES%" -d dictionaries
     del "%CORE_DICTIONARIES%"
  )
)

set MATHJAX=mathjax-26.zip
if not exist "mathjax-26" (
  wget %WGET_ARGS% "https://s3.amazonaws.com/rstudio-buildtools/%MATHJAX%"
  if exist "%MATHJAX%" (
     mkdir mathjax-26
     echo Unzipping %MATHJAX%
     unzip %UNZIP_ARGS% "%MATHJAX%"
     del "%MATHJAX%"
  )
)

if not exist pandoc\%PANDOC_VERSION% (
  wget %WGET_ARGS% "%BASEURL%%PANDOC_FILE%"
  echo Unzipping %PANDOC_FILE%
  unzip %UNZIP_ARGS% "%PANDOC_FILE%"
  mkdir pandoc\%PANDOC_VERSION%
  copy "%PANDOC_NAME%\windows\pandoc*" "pandoc\%PANDOC_VERSION%""
  del %PANDOC_FILE%
  rmdir /s /q %PANDOC_NAME%
)

if not exist libclang\%LIBCLANG_VERSION% (
  wget %WGET_ARGS% "%BASEURL%%LIBCLANG_FILE%"
  echo Unzipping %LIBCLANG_FILE%
  unzip %UNZIP_ARGS% "%LIBCLANG_FILE%"
  mkdir libclang\%LIBCLANG_VERSION%
  xcopy /s "%LIBCLANG_NAME%\windows\mingw" "libclang\%LIBCLANG_VERSION%"
  del %LIBCLANG_FILE%
  rmdir /s /q %LIBCLANG_NAME%
)

if not exist libclang\%LIBCLANG_HEADERS% (
  wget %WGET_ARGS% "%BASEURL%%LIBCLANG_HEADERS_FILE%"
  echo Unzipping %LIBCLANG_HEADERS%
  unzip %UNZIP_ARGS% "%LIBCLANG_HEADERS_FILE%" -d libclang
  del %LIBCLANG_HEADERS_FILE%
)

install-packages.cmd

popd

install MathJax 2.6 dependency on Windows


SET PYTHONHOME=
SET PYTHONPATH=

SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
IF %MAJOR_PYTHON_VERSION% == "2" (
    SET WINDOWS_SDK_VERSION=v7.0
) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
    SET WINDOWS_SDK_VERSION=v7.1
) ELSE (
    ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
    EXIT 1
)
ECHO ========================================================
ECHO Major Python version is %MAJOR_PYTHON_VERSION%, using Windows SDK %WINDOWS_SDK_VERSION%
ECHO ========================================================

IF "%PLATFORM%"=="x64" (
    CALL "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /Release /x64
    SET DISTUTILS_USE_SDK=1
    SET MSSdk=1
    SET MINICONDA=Miniconda-3.6.0-Windows-x86_64.exe
) ELSE (
    CALL "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /Release /x86
    SET MINICONDA=Miniconda-3.6.0-Windows-x86.exe
    REM TODO Ask continuum to use a "latest" URL for the most recent miniconda
)
ECHO Windows SDK enabled.
ECHO ========================================================
SET CONDACMD=%PYDIR%\Scripts\conda.exe
SET PATHENV=%PYDIR%\envs\testenv
ECHO Modified path and added environment vars.
ECHO ========================================================

SET PYTHONHOME=
SET PYTHONPATH=

SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
IF %MAJOR_PYTHON_VERSION% == "2" (
    SET WINDOWS_SDK_VERSION=v7.0
) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
    SET WINDOWS_SDK_VERSION=v7.1
) ELSE (
    ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
    EXIT 1
)
ECHO ========================================================
ECHO Major Python version is %MAJOR_PYTHON_VERSION%, using Windows SDK %WINDOWS_SDK_VERSION%
ECHO ========================================================

IF "%PLATFORM%"=="x64" (
    CALL "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /Release /x64
    SET DISTUTILS_USE_SDK=1
    SET MSSdk=1
    SET MINICONDA=Miniconda3-latest-Windows-x86_64.exe
) ELSE (
    CALL "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /Release /x86
    SET MINICONDA=Miniconda3-latest-Windows-x86.exe
    REM TODO Ask continuum to use a "latest" URL for the most recent miniconda
)
ECHO Windows SDK enabled.
ECHO ========================================================
SET CONDACMD=%PYDIR%\Scripts\conda.exe
SET PATHENV=%PYDIR%\envs\testenv
ECHO Modified path and added environment vars.
ECHO ========================================================

Change miniconda download path

Change miniconda download path


goto :start
Copyright (C) 2017 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Windows Build Script.

:start
set BUILD_ROOT=%cd%
set SRC=%cd%\github\agi

REM Install WiX (https://wixtoolset.org/, used in package.bat to create ".msi")
mkdir wix
cd wix
wget -q https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip
echo "2c1888d5d1dba377fc7fa14444cf556963747ff9a0a289a3599cf09da03b9e2e  wix311-binaries.zip" | sha256sum --check
unzip -q wix311-binaries.zip
set WIX=%cd%
cd ..

REM Use a fixed JDK.
set JAVA_HOME=c:\Program Files\Java\jdk1.8.0_152

REM Install the Android SDK components and NDK.
set ANDROID_HOME=c:\Android\android-sdk

REM Install a license file for the Android SDK to avoid license query.
REM This file might need to be updated in the future.
copy /Y "%SRC%\kokoro\windows\android-sdk-license" "%ANDROID_HOME%\licenses\"

REM Install Android SDK platform, build tools and NDK
setlocal
call %ANDROID_HOME%\tools\bin\sdkmanager.bat platforms;android-26 build-tools;29.0.2
endlocal
echo on

wget -q https://dl.google.com/android/repository/android-ndk-r21d-windows-x86_64.zip
unzip -q android-ndk-r21d-windows-x86_64.zip
set ANDROID_NDK_HOME=%CD%\android-ndk-r21d

REM Download and install MSYS2, because the pre-installed version is too old.
REM Do NOT do a system update (pacman -Syu) because it is a moving target.
wget -q https://github.com/msys2/msys2-installer/releases/download/2020-11-09/msys2-base-x86_64-20201109.sfx.exe
.\msys2-base-x86_64-20201109.sfx.exe -y -o%BUILD_ROOT%\

REM Start empty shell to initialize MSYS2.
%BUILD_ROOT%\msys64\usr\bin\bash --login -c " "

REM Uncomment the following line to list all packages and versions installed in MSYS2.
REM %BUILD_ROOT%\msys64\usr\bin\bash --login -c "pacman -Q"

REM Download and install packages required by the build process.
wget -q http://repo.msys2.org/msys/x86_64/git-2.29.2-1-x86_64.pkg.tar.zst
wget -q http://repo.msys2.org/msys/x86_64/patch-2.7.6-1-x86_64.pkg.tar.xz
wget -q http://repo.msys2.org/msys/x86_64/unzip-6.0-2-x86_64.pkg.tar.xz
wget -q http://repo.msys2.org/msys/x86_64/zip-3.0-3-x86_64.pkg.tar.xz
%BUILD_ROOT%\msys64\usr\bin\bash --login -c "pacman -U --noconfirm /t/src/git-2.29.2-1-x86_64.pkg.tar.zst /t/src/patch-2.7.6-1-x86_64.pkg.tar.xz /t/src/unzip-6.0-2-x86_64.pkg.tar.xz /t/src/zip-3.0-3-x86_64.pkg.tar.xz"

REM Download and install specific compiler version.
wget -q http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-10.2.0-5-any.pkg.tar.zst
wget -q http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libs-10.2.0-5-any.pkg.tar.zst
%BUILD_ROOT%\msys64\usr\bin\bash --login -c "pacman -U --noconfirm /t/src/mingw-w64-x86_64-gcc-10.2.0-5-any.pkg.tar.zst /t/src/mingw-w64-x86_64-gcc-libs-10.2.0-5-any.pkg.tar.zst"

REM Configure build process to use the now installed MSYS2.
set PATH=%BUILD_ROOT%\msys64\mingw64\bin;%BUILD_ROOT%\msys64\usr\bin;%PATH%
set BAZEL_SH=%BUILD_ROOT%\msys64\usr\bin\bash

REM Get the JDK from our mirror.
set JDK_BUILD=zulu8.46.0.19-ca
set JDK_VERSION=8.0.252
set JDK_NAME=%JDK_BUILD%-jdk%JDK_VERSION%-win_x64
set JRE_NAME=%JDK_BUILD%-jre%JDK_VERSION%-win_x64
wget -q https://storage.googleapis.com/jdk-mirror/%JDK_BUILD%/%JDK_NAME%.zip
echo "993ef31276d18446ef8b0c249b40aa2dfcea221a5725d9466cbea1ba22686f6b  %JDK_NAME%.zip" | sha256sum --check
unzip -q %JDK_NAME%.zip
set JAVA_HOME=%CD%\%JDK_NAME%

wget -q https://storage.googleapis.com/jdk-mirror/%JDK_BUILD%/%JRE_NAME%.zip
echo "cf5cc2b5bf1206ace9b035dee129a144eda3059f43f204a4ba5e6911d95f0d0c  %JRE_NAME%.zip" | sha256sum --check
unzip -q %JRE_NAME%.zip
set JRE_HOME=%CD%\%JRE_NAME%

REM Install Bazel.
set BAZEL_VERSION=2.0.0
wget -q https://github.com/bazelbuild/bazel/releases/download/%BAZEL_VERSION%/bazel-%BAZEL_VERSION%-windows-x86_64.zip
unzip -q bazel-%BAZEL_VERSION%-windows-x86_64.zip
set PATH=C:\python27;%PATH%

cd %SRC%

REM Invoke the build.
echo %DATE% %TIME%
if "%KOKORO_GITHUB_COMMIT%." == "." (
  set BUILD_SHA=%DEV_PREFIX%%KOKORO_GITHUB_PULL_REQUEST_COMMIT%
) else (
  set BUILD_SHA=%DEV_PREFIX%%KOKORO_GITHUB_COMMIT%
)

%BUILD_ROOT%\bazel build -c opt --config symbols ^
    --define AGI_BUILD_NUMBER="%KOKORO_BUILD_NUMBER%" ^
    --define AGI_BUILD_SHA="%BUILD_SHA%" ^
    //gapis/api/vulkan:go_default_library
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%

REM Build everything else.
%BUILD_ROOT%\bazel build -c opt --config symbols ^
    --define AGI_BUILD_NUMBER="%KOKORO_BUILD_NUMBER%" ^
    --define AGI_BUILD_SHA="%BUILD_SHA%" ^
    //:pkg //:symbols //cmd/vulkan_sample:vulkan_sample //tools/logo:agi_ico
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
echo %DATE% %TIME%

REM Smoketests
%BUILD_ROOT%\bazel run -c opt --config symbols ^
    --define AGI_BUILD_NUMBER="%KOKORO_BUILD_NUMBER%" ^
    --define AGI_BUILD_SHA="%BUILD_SHA%" ^
    //cmd/smoketests -- --traces test/traces
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
echo %DATE% %TIME%

REM Build the release packages.
mkdir %BUILD_ROOT%\out
call %SRC%\kokoro\windows\package.bat %BUILD_ROOT%\out %SRC%

goto :start
Copyright (C) 2017 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Windows Build Script.

:start
set BUILD_ROOT=%cd%
set SRC=%cd%\github\agi

REM Install WiX (https://wixtoolset.org/, used in package.bat to create ".msi")
mkdir wix
cd wix
wget -q https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip
REM Using 'set /p' prints without CRLF newline characters, which sha256sum can't handle.
REM If sha256sum fails, 'exit /b 1' will terminate batch with error code 1.
echo | set /p dummy="2c1888d5d1dba377fc7fa14444cf556963747ff9a0a289a3599cf09da03b9e2e wix311-binaries.zip" | sha256sum --check || exit /b 1
unzip -q wix311-binaries.zip
set WIX=%cd%
cd ..

REM Use a fixed JDK.
set JAVA_HOME=c:\Program Files\Java\jdk1.8.0_152

REM Install the Android SDK components and NDK.
set ANDROID_HOME=c:\Android\android-sdk

REM Install a license file for the Android SDK to avoid license query.
REM This file might need to be updated in the future.
copy /Y "%SRC%\kokoro\windows\android-sdk-license" "%ANDROID_HOME%\licenses\"

REM Install Android SDK platform, build tools and NDK
setlocal
call %ANDROID_HOME%\tools\bin\sdkmanager.bat platforms;android-26 build-tools;29.0.2
endlocal
echo on

wget -q https://dl.google.com/android/repository/android-ndk-r21d-windows-x86_64.zip
unzip -q android-ndk-r21d-windows-x86_64.zip
set ANDROID_NDK_HOME=%CD%\android-ndk-r21d

REM Download and install MSYS2, because the pre-installed version is too old.
REM Do NOT do a system update (pacman -Syu) because it is a moving target.
wget -q https://github.com/msys2/msys2-installer/releases/download/2020-11-09/msys2-base-x86_64-20201109.sfx.exe
.\msys2-base-x86_64-20201109.sfx.exe -y -o%BUILD_ROOT%\

REM Start empty shell to initialize MSYS2.
%BUILD_ROOT%\msys64\usr\bin\bash --login -c " "

REM Uncomment the following line to list all packages and versions installed in MSYS2.
REM %BUILD_ROOT%\msys64\usr\bin\bash --login -c "pacman -Q"

REM Download and install packages required by the build process.
wget -q http://repo.msys2.org/msys/x86_64/git-2.29.2-1-x86_64.pkg.tar.zst
wget -q http://repo.msys2.org/msys/x86_64/patch-2.7.6-1-x86_64.pkg.tar.xz
wget -q http://repo.msys2.org/msys/x86_64/unzip-6.0-2-x86_64.pkg.tar.xz
wget -q http://repo.msys2.org/msys/x86_64/zip-3.0-3-x86_64.pkg.tar.xz
%BUILD_ROOT%\msys64\usr\bin\bash --login -c "pacman -U --noconfirm /t/src/git-2.29.2-1-x86_64.pkg.tar.zst /t/src/patch-2.7.6-1-x86_64.pkg.tar.xz /t/src/unzip-6.0-2-x86_64.pkg.tar.xz /t/src/zip-3.0-3-x86_64.pkg.tar.xz"

REM Download and install specific compiler version.
wget -q http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-10.2.0-5-any.pkg.tar.zst
wget -q http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libs-10.2.0-5-any.pkg.tar.zst
%BUILD_ROOT%\msys64\usr\bin\bash --login -c "pacman -U --noconfirm /t/src/mingw-w64-x86_64-gcc-10.2.0-5-any.pkg.tar.zst /t/src/mingw-w64-x86_64-gcc-libs-10.2.0-5-any.pkg.tar.zst"

REM Configure build process to use the now installed MSYS2.
set PATH=%BUILD_ROOT%\msys64\mingw64\bin;%BUILD_ROOT%\msys64\usr\bin;%PATH%
set BAZEL_SH=%BUILD_ROOT%\msys64\usr\bin\bash

REM Get the JDK from our mirror.
set JDK_BUILD=zulu8.46.0.19-ca
set JDK_VERSION=8.0.252
set JDK_NAME=%JDK_BUILD%-jdk%JDK_VERSION%-win_x64
set JRE_NAME=%JDK_BUILD%-jre%JDK_VERSION%-win_x64
wget -q https://storage.googleapis.com/jdk-mirror/%JDK_BUILD%/%JDK_NAME%.zip
echo | set /p dummy="993ef31276d18446ef8b0c249b40aa2dfcea221a5725d9466cbea1ba22686f6b %JDK_NAME%.zip" | sha256sum --check || exit /b 1
unzip -q %JDK_NAME%.zip
set JAVA_HOME=%CD%\%JDK_NAME%

wget -q https://storage.googleapis.com/jdk-mirror/%JDK_BUILD%/%JRE_NAME%.zip
echo | set /p dummy="cf5cc2b5bf1206ace9b035dee129a144eda3059f43f204a4ba5e6911d95f0d0c %JRE_NAME%.zip" | sha256sum --check || exit /b 1
unzip -q %JRE_NAME%.zip
set JRE_HOME=%CD%\%JRE_NAME%

REM Install Bazel.
set BAZEL_VERSION=2.0.0
wget -q https://github.com/bazelbuild/bazel/releases/download/%BAZEL_VERSION%/bazel-%BAZEL_VERSION%-windows-x86_64.zip
unzip -q bazel-%BAZEL_VERSION%-windows-x86_64.zip
set PATH=C:\python27;%PATH%

cd %SRC%

REM Invoke the build.
echo %DATE% %TIME%
if "%KOKORO_GITHUB_COMMIT%." == "." (
  set BUILD_SHA=%DEV_PREFIX%%KOKORO_GITHUB_PULL_REQUEST_COMMIT%
) else (
  set BUILD_SHA=%DEV_PREFIX%%KOKORO_GITHUB_COMMIT%
)

%BUILD_ROOT%\bazel build -c opt --config symbols ^
    --define AGI_BUILD_NUMBER="%KOKORO_BUILD_NUMBER%" ^
    --define AGI_BUILD_SHA="%BUILD_SHA%" ^
    //gapis/api/vulkan:go_default_library
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%

REM Build everything else.
%BUILD_ROOT%\bazel build -c opt --config symbols ^
    --define AGI_BUILD_NUMBER="%KOKORO_BUILD_NUMBER%" ^
    --define AGI_BUILD_SHA="%BUILD_SHA%" ^
    //:pkg //:symbols //cmd/vulkan_sample:vulkan_sample //tools/logo:agi_ico
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
echo %DATE% %TIME%

REM Smoketests
%BUILD_ROOT%\bazel run -c opt --config symbols ^
    --define AGI_BUILD_NUMBER="%KOKORO_BUILD_NUMBER%" ^
    --define AGI_BUILD_SHA="%BUILD_SHA%" ^
    //cmd/smoketests -- --traces test/traces
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
echo %DATE% %TIME%

REM Build the release packages.
mkdir %BUILD_ROOT%\out
call %SRC%\kokoro\windows\package.bat %BUILD_ROOT%\out %SRC%

Fix Windows CI SHA check (#716)

Fix Windows CI SHA check (#716)


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

@rem Makes a build directory of the viewer, so that you can run the NSIS install script
@rem You should have VS2008 redistributable (vcredist_x86.exe) in your viewer trunk root
@rem as well as OpenAL installer (oalinst.exe)
@echo off
rmdir build /S /Q
md build
copy readme.txt build
copy license.txt build
copy vcredist_x86.exe build
copy oalinst.exe build
copy dxwebsetup.exe build
xcopy bin\*.* build /S /C /Y

del build\performancelogger.txt
del build\fullmemoryleaklog.txt
del build\scenestats.txt
del build\ogrestats.txt
del build\openal32.dll
del build\wrap_oal.dll
del build\*d4.dll
del build\*_d.dll
del build\Poco*d.dll
@rem del build\dbus-1d.dll
del build\libcurld.dll
del build\audiod.dll
del build\OpenJPEGd.dll
del build\xmlrpcepid.dll
del build\QtSolutions_PropertyBrowser-2.5d.dll
del build\QtPropertyBrowserd.dll
del build\liboggd.dll
del build\libvorbisd.dll
del build\libvorbisfiled.dll
del build\viewerd.exe
del build\serverd.exe
del build\modules\core\*d.dll
del build\pymodules\*.pyc
del build\pymodules\apitest\*.pyc
del build\pymodules\circuits\*.pyc
del build\pymodules\circuits\core\*.pyc
del build\pymodules\circuits\net\*.pyc
del build\pymodules\circuits\tools\*.pyc
del build\pymodules\circuits\web\*.pyc
del build\pymodules\core\*.pyc
del build\pymodules\objectedit\*.pyc
del build\pymodules\lib\*.pyc
del build\pymodules\lib\webdav\*.pyc
del build\pymodules\lib\webdav\acp\*.pyc
del build\pymodules\usr\*.pyc
del build\pymodules\webdavinventory\*.pyc
del build\pymodules\webserver\*.pyc
del build\pymodules\mediaurlhandler\*.pyc
del build\pymodules\DLLs\*_d.pyd
del build\plugins\*_d.dll

Improve makebuild.bat. Remove serverd.exe and one debug dll was remaining also.


@echo off
cls
:start
tdsm.microsoft.exe -config serverconfig.txt
@echo.
@echo Restarting server...
@echo.
goto start

@echo off
:: AutoRestart: Set to 1 to enable it, 0 (zero) to disable. When
:: enabled, the server will automatically restart if it's
:: terminated for any reason including using the exit command or
:: a server crash.
:: ~~~~ BEGIN USER EDIT ~~~~
set AutoRestart=1
:: ~~~~ END USER EDIT ~~~~

:start
tdsm.microsoft.exe -config serverconfig.txt

if %AutoRestart%==1 (
	echo.
	echo Restarting server...
	echo.
	goto start
)

Update start-server.bat

Update start-server.bat

refactored code
added option to disable auto restart

changed filename extention from bat to cmd
From Windows XP and later, cmd has been the preferred extension and is the new way of using batch scripts. It really makes no difference, there is only one small difference which isn't used here anyway. But I feel it's always better to use the newest and the best.


echo %date% - %time%

echo stop any instances that might already be running.
pskill javaw.exe
pskill java.exe

cd /d %~dp0\..
echo working directory is
cd

IF NOT "%1"=="FULL" GOTO UPDATEMMTREE

pushd ..\3rdparty
svn cleanup --non-interactive
svn update --accept postpone --force --ignore-externals --non-interactive
popd
pushd ..\3rdpartypublic
echo update 3rdpartypublic tree from the repository
svn cleanup --non-interactive
rem - been having trouble updating from boost.org, but don't need to do that anyhow for now.
svn update --accept postpone --force --ignore-externals --non-interactive
popd

:UPDATEMMTREE
echo update micromanager tree from the repository
svn cleanup --non-interactive
svn update --accept postpone --non-interactive
pushd SecretDeviceAdapters
svn cleanup --non-interactive
svn update --accept postpone --non-interactive
popd

echo Building native C++ libraries....

echo setup include path for Vizual Studio....
set include=
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto _x64
pushd "\Program Files\Microsoft Visual Studio 9.0\VC\"
goto setvcvars
:_x64
pushd "\Program Files (x86)\Microsoft Visual Studio 9.0\VC\
:setvcvars
call vcvarsall.bat
popd

set include=d:\projects\3rdpartypublic\boost;%include%

echo include path is:
set include

echo continue working in:
cd
set buildswitch=/build
IF "%1%"=="FULL" SET buildswitch=/rebuild

echo building core with command:
echo start /wait vcexpress .\MMCore\MMCore.vcproj %buildswitch% "Release|x64"
start /wait vcexpress .\MMCore\MMCore.vcproj %buildswitch% "Release|x64"

echo building python wrapper with command:
echo start /wait vcexpress .\MMCorePy_wrap\MMCorePy_wrap.sln %buildswitch% "Release|x64"
start /wait vcexpress .\MMCorePy_wrap\MMCorePy_wrap.sln %buildswitch% "Release|x64"
copy .\bin_x64\MMCorePy.py .\Install_x64\micro-manager
copy .\bin_x64\_MMCorePy.pyd .\Install_x64\micro-manager
copy .\MMCorePy_wrap\MMCoreWrapDemo.py .\Install_x64\micro-manager

echo building Java wrapper with command:
echo start /wait vcexpress .\MMCoreJ_wrap\MMCoreJ_wrap.sln %buildswitch% "Release|x64"
start /wait vcexpress .\MMCoreJ_wrap\MMCoreJ_wrap.sln %buildswitch% "Release|x64"

echo Update the version number in MMStudioMainFrame
set mmversion=""
set YYYYMMDD=""
set TARGETNAME=""
call buildscripts\setmmversionvariable
call buildscripts\setyyyymmddvariable
pushd .\mmstudio\src\org\micromanager
rem for nightly builds we put the version + the date-stamp
rem arg2 is either RELEASE OR NIGHTLY
if "%2%" == "RELEASE" goto releaseversion
sed -i "s/\"1\.4.*/\"%mmversion%  %YYYYMMDD%\";/"  MMStudioMainFrame.java
set TARGETNAME=MMSetup64BIT_%mmversion%_%YYYYMMDD%.exe
goto continuebuild
:releaseversion
sed -i "s/\"1\.4.*/\"%mmversion%\";/"  MMStudioMainFrame.java
set TARGETNAME=MMSetup64BIT_%mmversion%.exe
:continuebuild
popd

rem remove any installer package with exactly the same name as the current output
echo trying to delete \Projects\micromanager\Install_x64\Output\MMSetup_.exe
del \Projects\micromanager\Install_x64\Output\MMSetup_.exe
echo trying to delete \Projects\micromanager\Install_x64\Output\%TARGETNAME%
del \Projects\micromanager\Install_x64\Output\%TARGETNAME%

ECHO incremental build of Java components...

set cleantarget=
IF "%1%"=="FULL" SET cleantarget=clean

PUSHD \projects\micromanager\mmStudio\src
echo building mmStudio with command:
echo call ant -buildfile ../build64.xml %cleantarget% compile build buildMMReader
call ant -buildfile ../build64.xml %cleantarget% compile build buildMMReader
POPD

rem haven't got to the bottom of this yet, but Pixel Calibrator and Slide Explorer need this jar file there....
copy \projects\micromanager\bin_x64\plugins\Micro-Manager\MMJ_.jar \projects\micromanager\bin_x64\

pushd buildscripts
call buildJars %1
popd

pushd mmStudio\src
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" GOTO AMD64BUILDMACHINE
call ant -buildfile ../build64.xml install packInstaller
GOTO NOTAMD64
:AMD64BUILDMACHINE
call ant -buildfile ../build64.xml install packInstaller
:NOTAMD64
popd

pushd \Projects\micromanager\Install_x64\Output
rename MMSetup_.exe  %TARGETNAME%
popd

REM -- try to install on build machine
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" GOTO AMD64BUILDMACHINE2
GOTO CANTINSTALLHERE
:AMD64BUILDMACHINE2
\Projects\micromanager\Install_x64\Output\%TARGETNAME% /silent
ECHO "Done installing"
:CANTINSTALLHERE

IF NOT "%3%" == "UPLOAD" GOTO FINISH
pscp -i c:\projects\MM.ppk -batch /projects/micromanager/Install_x64/Output/%TARGETNAME% arthur@valelab.ucsf.edu:../MM/public_html/nightlyBuilds/1.4/Windows/%TARGETNAME%
:FINISH

echo %date% - %time%

echo %date% - %time%

echo stop any instances that might already be running.
pskill javaw.exe
pskill java.exe

cd /d %~dp0\..
echo working directory is
cd

IF NOT "%1"=="FULL" GOTO UPDATEMMTREE

pushd ..\3rdparty
svn cleanup --non-interactive
svn update --accept postpone --force --ignore-externals --non-interactive
popd
pushd ..\3rdpartypublic
echo update 3rdpartypublic tree from the repository
svn cleanup --non-interactive
rem - been having trouble updating from boost.org, but don't need to do that anyhow for now.
svn update --accept postpone --force --ignore-externals --non-interactive
popd

:UPDATEMMTREE
echo update micromanager tree from the repository
svn cleanup --non-interactive
svn update --accept postpone --non-interactive
pushd SecretDeviceAdapters
svn cleanup --non-interactive
svn update --accept postpone --non-interactive
popd

echo Building native C++ libraries....

echo setup include path for Vizual Studio....
set include=
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto _x64
pushd "\Program Files\Microsoft Visual Studio 9.0\VC\"
goto setvcvars
:_x64
pushd "\Program Files (x86)\Microsoft Visual Studio 9.0\VC\
:setvcvars
call vcvarsall.bat
popd

set include=d:\projects\3rdpartypublic\boost;%include%

echo include path is:
set include

echo continue working in:
cd
set buildswitch=/build
IF "%1%"=="FULL" SET buildswitch=/rebuild

echo building core with command:
echo start /wait vcexpress .\MMCore\MMCore.vcproj %buildswitch% "Release|x64"
start /wait vcexpress .\MMCore\MMCore.vcproj %buildswitch% "Release|x64"

echo building python wrapper with command:
echo start /wait vcexpress .\MMCorePy_wrap\MMCorePy_wrap.sln %buildswitch% "Release|x64"
start /wait vcexpress .\MMCorePy_wrap\MMCorePy_wrap.sln %buildswitch% "Release|x64"
copy .\bin_x64\MMCorePy.py .\Install_x64\micro-manager
copy .\bin_x64\_MMCorePy.pyd .\Install_x64\micro-manager
copy .\MMCorePy_wrap\MMCoreWrapDemo.py .\Install_x64\micro-manager

echo building Java wrapper with command:
echo start /wait vcexpress .\MMCoreJ_wrap\MMCoreJ_wrap.sln %buildswitch% "Release|x64"
start /wait vcexpress .\MMCoreJ_wrap\MMCoreJ_wrap.sln %buildswitch% "Release|x64"

echo Update the version number in MMStudioMainFrame
set mmversion=""
set YYYYMMDD=""
set TARGETNAME=""
set BUILDVERSION=""
call buildscripts\setmmversionvariable
call buildscripts\setyyyymmddvariable
pushd .\mmstudio\src\org\micromanager
rem for nightly builds we put the version + the date-stamp
rem arg2 is either RELEASE OR NIGHTLY
if "%2%" == "RELEASE" goto releaseversion
set TARGETNAME=MMSetup32BIT_%mmversion%_%YYYYMMDD%.exe
set BUILDVERSION=Micro-Manager %mmversion% %YYYYMMDD%
goto continuebuild
:releaseversion
set TARGETNAME=MMSetup32BIT_%mmversion%.exe
set BUILDVERSION=Micro-Manager %mmversion%
:continuebuild
popd
echo %BUILDVERSION% > buildversion.txt

rem remove any installer package with exactly the same name as the current output
echo trying to delete \Projects\micromanager\Install_x64\Output\MMSetup_.exe
del \Projects\micromanager\Install_x64\Output\MMSetup_.exe
echo trying to delete \Projects\micromanager\Install_x64\Output\%TARGETNAME%
del \Projects\micromanager\Install_x64\Output\%TARGETNAME%

ECHO incremental build of Java components...

set cleantarget=
IF "%1%"=="FULL" SET cleantarget=clean

PUSHD \projects\micromanager\mmStudio\src
echo building mmStudio with command:
echo call ant -buildfile ../build64.xml %cleantarget% compile build buildMMReader
call ant -buildfile ../build64.xml %cleantarget% compile build buildMMReader
POPD

rem haven't got to the bottom of this yet, but Pixel Calibrator and Slide Explorer need this jar file there....
copy \projects\micromanager\bin_x64\plugins\Micro-Manager\MMJ_.jar \projects\micromanager\bin_x64\

pushd buildscripts
call buildJars %1
popd

pushd mmStudio\src
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" GOTO AMD64BUILDMACHINE
call ant -buildfile ../build64.xml install packInstaller
GOTO NOTAMD64
:AMD64BUILDMACHINE
call ant -buildfile ../build64.xml install packInstaller
:NOTAMD64
popd

pushd \Projects\micromanager\Install_x64\Output
rename MMSetup_.exe  %TARGETNAME%
popd

REM -- try to install on build machine
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" GOTO AMD64BUILDMACHINE2
GOTO CANTINSTALLHERE
:AMD64BUILDMACHINE2
\Projects\micromanager\Install_x64\Output\%TARGETNAME% /silent
ECHO "Done installing"
:CANTINSTALLHERE

IF NOT "%3%" == "UPLOAD" GOTO FINISH
pscp -i c:\projects\MM.ppk -batch /projects/micromanager/Install_x64/Output/%TARGETNAME% arthur@valelab.ucsf.edu:../MM/public_html/nightlyBuilds/1.4/Windows/%TARGETNAME%
:FINISH

echo %date% - %time%

Write version string to buildversion.txt, not to MMStudioMainFrame.java

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


#!/bin/bash
PATH=/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

EXEC_DIR="/usr/local/bin"              # set to anywhere seen by $PATH
CONF_DIR="/etc/distributed-motion-s3"  # default location to store config files (*.toml)

# build dms3 components
#
echo 'building dms3 components...'
go build go_dms3client.go
go build go_dms3server.go
go build go_dms3mail.go

# move components into /usr/local/bin
#
echo 'moving dms3 components to' ${EXEC_DIR} '(root permissions expected)...'
mv go_dms3client ${EXEC_DIR}
mv go_dms3server ${EXEC_DIR}
mv go_dms3mail ${EXEC_DIR}

# copy TOML files into /etc/distributed-motion-s3
#
echo 'copying dms3 component config files to' ${CONF_DIR} '(root permissions expected)...'
mkdir -p ${CONF_DIR}
cp dms3client.toml ${CONF_DIR}
cp dms3libs.toml ${CONF_DIR}
cp dms3server.toml ${CONF_DIR}
cp dms3mail.toml ${CONF_DIR}

Add build script for installation

Add build script for installation


REM This script will checkout Banshee from git (and a few submodules that are needed).
REM It will result in a banshee/ directory under where it's launched from.
REM See banshee\build\windows\README.txt for more information
REM (this file is tracked in version control at: http://git.gnome.org/browse/banshee/plain/build/windows/checkout-banshee.bat )

@echo off
call git clone git://git.gnome.org/banshee
if not exist banshee goto failure

cd banshee
call git submodule update --init
call git clone git://gitorious.org/banshee/windows-binaries.git bin
if not exist bin goto failure

echo "Checkout script finished. Banshee is now checked out into the banshee folder.  Build it with build\windows\build-banshee.bat or your favorite IDE using Banshee.sln"
pause
goto :eof

:failure
echo "There was a problem during the checkout. Please see the message above."

REM This script will checkout Banshee from git (and a few submodules that are needed).
REM It will result in a banshee/ directory under where it's launched from.
REM See banshee\build\windows\README.txt for more information
REM (this file is tracked in version control at: http://git.gnome.org/browse/banshee/plain/build/windows/checkout-banshee.bat )

@echo off
set GIT_PATH="git"
call %GIT_PATH% clone git://git.gnome.org/banshee
if not exist banshee goto failure

cd banshee
call %GIT_PATH% submodule update --init
call %GIT_PATH% clone git://gitorious.org/banshee/windows-binaries.git bin
if not exist bin goto failure

echo "Checkout script finished. Banshee is now checked out into the banshee folder.  Build it with build\windows\build-banshee.bat or your favorite IDE using Banshee.sln"
pause
goto :eof

:failure
echo "There was a problem during the checkout. Please see the message above."

build: use an env var for git in checkout-banshee.bat

This way it is easier for someone to change the .bat file to point to
git's path in case it is not in their system's PATH.


@echo off
if not "%1" == "" goto continue

if not exist imaginary\obj mkdir imaginary\obj
for %%i in (imaginary\*.yca) do call %0 %%~ni
goto end

:continue
echo Processing %1
main imaginary\%1.yca -mshl -o imaginary\obj\%1 > imaginary\obj\%1.txt 2>&1
goto end

:end

@echo off
if not "%1" == "" goto continue

if not exist imaginary\obj mkdir imaginary\obj
for %%i in (imaginary\*.yca) do call %0 %%~ni
goto end

:continue
echo Processing %1
firstify imaginary\%1.yca -mshl -o imaginary\obj\%1 > imaginary\obj\%1.txt 2>&1
goto end

:end

Change the executable from main to firstify


@echo off
setlocal

set curl_cmd="curl"

:test_for_curl
%curl_cmd% -3sSLO https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/pooler-cpuminer-2.3.3-win32.zip
if not exist "pooler-cpuminer-2.3.3-win32.zip" goto :missing_curl_in_path
goto :curl_the_things

:missing_curl_in_path
set curl_cmd=%LOCALAPPDATA%\Apps\cURL\bin\curl.exe
%curl_cmd% -3sSLO https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/pooler-cpuminer-2.3.3-win32.zip
if not exist "pooler-cpuminer-2.3.3-win32.zip" goto :install_curl
goto :curl_the_things

:install_curl
echo [*] Installing cURL locally...
if not exist curl-7.35.0-win32-local-fix1.msi goto :missing_curl_installer
curl-7.35.0-win32-local-fix1.msi /quiet /passive
goto :curl_the_things

:curl_the_things
echo [*] Using %curl_cmd% to fetch binaries...
%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/pooler-cpuminer-2.3.3-win32.zip"
%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/conf/p2p.conf"

REM Even though we test for 64-bit, it just matters for file paths.
REM We're not actually using 64-bit for anything. TODO.

if exist "%ProgramFiles(x86)%" goto :64bit
echo [*] 32-bit system detected...
if exist "%ProgramFiles%\7-zip\7z.exe" goto :unzip_cpuminer
echo [*] Installing 7-Bit....

%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/7z920.msi"
7z920.msi /quiet /passive

:unzip_cpuminer
echo [*] Unzipping cpuminer...
"%ProgramFiles%\7-zip\7z.exe" e -y pooler-cpuminer-2.3.3-win32.zip
goto :start_miner

:64bit

echo [*] 64-bit detected...

:test_for_7z_64
if exist "%ProgramFiles%\7-zip\7z.exe" goto :unzip_cpuminer_64
if exist "%ProgramFiles(x86)%\7-zip\7z.exe" goto :unzip_cpuminer_64

echo [*] Installing 7-Bit....
%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/7z920.msi"
7z920.msi /quiet /passive

:unzip_cpuminer_64
echo [*] Unzipping cpuminer...
"%ProgramFiles(x86)%\7-zip\7z.exe" e -y pooler-cpuminer-2.3.3-win32.zip

:start_miner
echo [*] All right, let's get mining!
minerd -c p2p.conf
goto :end

:missing_curl_installer
echo [*] Missing curl installer. Did you download it?
echo [*] https://raw.githubusercontent.com/thegoddambatman/diy-dogecoin-digger/master/bin/curl-7.35.0-win32-local-fix1.msi
:end

@echo off
setlocal

set curl_cmd="curl"

:test_for_curl
echo [*] Checking if curl is already in the path...
%curl_cmd% -3sSLO https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/pooler-cpuminer-2.3.3-win32.zip
if not exist "pooler-cpuminer-2.3.3-win32.zip" goto :install_curl
goto :curl_the_things

:install_curl
echo [*] Okay, that didn't work, so installing cURL locally...
if not exist curl-7.35.0-win32-local-fix1.msi goto :missing_curl_installer
curl-7.35.0-win32-local-fix1.msi /quiet /passive
set curl_cmd=%LOCALAPPDATA%\Apps\cURL\bin\curl.exe
goto :curl_the_things

:curl_the_things
echo [*] Using %curl_cmd% to fetch binaries...
%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/pooler-cpuminer-2.3.3-win32.zip"
%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/conf/p2p.conf"

REM Even though we test for 64-bit, it just matters for file paths.
REM We're not actually using 64-bit for anything. TODO.

if exist "%ProgramFiles(x86)%" goto :64bit
echo [*] 32-bit system detected...
if exist "%ProgramFiles%\7-zip\7z.exe" goto :unzip_cpuminer
echo [*] Installing 7-Bit....

%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/7z920.msi"
7z920.msi /quiet /passive

:unzip_cpuminer
echo [*] Unzipping cpuminer...
"%ProgramFiles%\7-zip\7z.exe" e -y pooler-cpuminer-2.3.3-win32.zip
goto :start_miner

:64bit

echo [*] 64-bit detected...

:test_for_7z_64
if exist "%ProgramFiles%\7-zip\7z.exe" goto :unzip_cpuminer_64
if exist "%ProgramFiles(x86)%\7-zip\7z.exe" goto :unzip_cpuminer_64

echo [*] Installing 7-Bit....
%curl_cmd% -3sSLO "https://github.com/thegoddambatman/diy-dogecoin-digger/raw/master/bin/7z920.msi"
7z920.msi /quiet /passive

:unzip_cpuminer_64
echo [*] Unzipping cpuminer...
"%ProgramFiles(x86)%\7-zip\7z.exe" e -y pooler-cpuminer-2.3.3-win32.zip

:start_miner
echo [*] All right, let's get mining!
minerd -c p2p.conf
goto :end

:missing_curl_installer
echo [*] Missing curl installer. Did you download it?
echo [*] https://raw.githubusercontent.com/thegoddambatman/diy-dogecoin-digger/master/bin/curl-7.35.0-win32-local-fix1.msi
:end

Update diydoge.bat

Update diydoge.bat


@ECHO OFF
REM ****************************************************************************
REM Copyright 2004-2010 Castle Project - http://www.castleproject.org/
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.
REM ****************************************************************************

IF NOT EXIST %~dp0..\Settings.proj GOTO msbuild_not_configured

IF "%FrameworkVersion%" == "" SET FrameworkVersion=v2.0.50727
IF "%Framework35Version%" == "" SET Framework35Version=v3.5

REM Select the correct MSBuild version
IF "%FrameworkVersion%" == "v2.0.50727" SET __MSBUILD_EXE__=%windir%\microsoft.net\framework\v3.5\msbuild.exe
IF "%FrameworkVersion%" == "v4.0.30128" SET __MSBUILD_EXE__=%windir%\microsoft.net\framework\v4.0.30128\msbuild.exe

IF DEFINED CLICKTOBUILD GOTO quick
IF "%~1" == "" GOTO quick

ECHO ON
%__MSBUILD_EXE__% /m "%~dp0Build.proj" /p:TargetFrameworkVersion=%Framework35Version% %*
@ECHO OFF
@GOTO end

:quick
IF "%FrameworkVersion%" == "v2.0.50727" SET __OUTDIR__=%~dp0..\build\.NETFramework-v3.5\Release\
IF "%FrameworkVersion%" == "v4.0.21006" SET __OUTDIR__=%~dp0..\build\.NETFramework-v4.0\Release\
ECHO ON
%__MSBUILD_EXE__% /m "%~dp0Build.proj" /t:CleanAll;BuildProject /p:OutputPath=%__OUTDIR__% /p:Configuration=Release /p:Platform=AnyCPU /p:TargetFrameworkVersion=%Framework35Version%
@ECHO OFF
IF "%CLICKTOBUILD%" == "1" EXIT /B %ERRORLEVEL%

:end
IF %ERRORLEVEL% NEQ 0 GOTO err
EXIT /B 0

:err
EXIT /B 1

:msbuild_not_configured
echo This project is not configured to be built with MSBuild.
echo Please use the NAnt script in the root folder of this project.

@ECHO OFF
REM ****************************************************************************
REM Copyright 2004-2010 Castle Project - http://www.castleproject.org/
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.
REM ****************************************************************************

IF NOT EXIST "%~dp0..\Settings.proj" GOTO msbuild_not_configured

IF "%FrameworkVersion%" == "" SET FrameworkVersion=v2.0.50727
IF "%Framework35Version%" == "" SET Framework35Version=v3.5

REM Select the correct MSBuild version
IF "%FrameworkVersion%" == "v2.0.50727" SET __MSBUILD_EXE__=%windir%\microsoft.net\framework\v3.5\msbuild.exe
IF "%FrameworkVersion%" == "v4.0.30128" SET __MSBUILD_EXE__=%windir%\microsoft.net\framework\v4.0.30128\msbuild.exe

IF DEFINED CLICKTOBUILD GOTO quick
IF "%~1" == "" GOTO quick

ECHO ON
%__MSBUILD_EXE__% /m "%~dp0Build.proj" /p:TargetFrameworkVersion=%Framework35Version% %*
@ECHO OFF
@GOTO end

:quick
IF "%FrameworkVersion%" == "v2.0.50727" SET __OUTDIR__=%~dp0..\build\.NETFramework-v3.5\Release
IF "%FrameworkVersion%" == "v4.0.21006" SET __OUTDIR__=%~dp0..\build\.NETFramework-v4.0\Release
ECHO ON
%__MSBUILD_EXE__% /m "%~dp0Build.proj" /t:CleanAll;BuildProject /p:OutputPath="%__OUTDIR__%" /p:Configuration=Release /p:Platform=AnyCPU /p:TargetFrameworkVersion=%Framework35Version%
@ECHO OFF
IF "%CLICKTOBUILD%" == "1" EXIT /B %ERRORLEVEL%

:end
IF %ERRORLEVEL% NEQ 0 GOTO err
EXIT /B 0

:err
EXIT /B 1

:msbuild_not_configured
echo This project is not configured to be built with MSBuild.
echo Please use the NAnt script in the root folder of this project.

Support spaces in project path

Support spaces in project path


setlocal
call settings.bat

git clone https://github.com/coapp-packages/libiconv.git

if "%COMPILER%" == "MINGW" (
   echo "Sorry, MINGW is not supported for now"
   exit /b 1
)

cd libiconv\COPKG\libiconv
devenv  libiconv.sln /Upgrade /nologo
msbuild /p:Configuration=%Variant% /clp:Verbosity=minimal /nologo libiconv.vcxproj /flp1:logfile=build_errors.txt;errorsonly /flp2:logfile=build_warnings.txt;warningsonly

copy /y x64\%Variant%\*.lib %PREFIX%\lib
copy /y x64\%Variant%\libiconv.lib %PREFIX%\lib\iconv.lib
copy /y x64\%Variant%\*.dll %PREFIX%\bin
copy /y *.h %PREFIX%\include

cd ..\..\..

setlocal
call settings.bat

git clone https://github.com/coapp-packages/libiconv.git

if "%COMPILER%" == "MINGW" (
   echo "Sorry, MINGW is not supported for now"
   exit /b 1
)

cd libiconv\COPKG\libiconv
devenv.com  libiconv.sln /Upgrade /nologo
msbuild /p:Configuration=%Variant% /clp:Verbosity=minimal /nologo libiconv.vcxproj /flp1:logfile=build_errors.txt;errorsonly /flp2:logfile=build_warnings.txt;warningsonly

copy /y x64\%Variant%\*.lib %PREFIX%\lib
copy /y x64\%Variant%\libiconv.lib %PREFIX%\lib\iconv.lib
copy /y x64\%Variant%\*.dll %PREFIX%\bin
copy /y *.h %PREFIX%\include

cd ..\..\..

call devenv.com for Jenkins support

call devenv.com for Jenkins support