@ECHO OFF
SETLOCAL EnableDelayedExpansion

SET UPSTREAMURL=https://github.com/ShiftMediaProject
SET DEPENDENCIES=( ^
libgcrypt ^
)

REM Get passed in list of dependencies to skip
SET PASSDEPENDENCIES=%~1

REM Check if git is installed and available
IF "%MSVC_VER%"=="" (
    git status >NUL 2>&1
    IF %ERRORLEVEL% NEQ 0 (
        ECHO A working copy of git was not found. To use this script you must first install git for windows.
        GOTO exitOnError
    )
)

REM Store current directory and ensure working directory is the location of current .bat
SET CURRDIR=%CD%
cd %~dp0

REM Initialise error check value
SET ERROR=0

cd ..\..
FOR %%I IN %DEPENDENCIES% DO (
    ECHO !PASSDEPENDENCIES! | FINDSTR /C:"%%I" >NUL 2>&1 || (
        REM Check if MSVC_VER environment variable is set
        IF "%MSVC_VER%"=="" (
            CALL :cloneOrUpdateRepo "%%I" || GOTO exitOnError
        ) ELSE (
            CALL :downloadLibs "%%I" || GOTO exitOnError
        )
    )
)
cd %CURRDIR% >NUL
GOTO exit

REM Function to clone or update a repo
REM  cloneOrUpdateRepo: RepoName
REM    RepoName = Name of the repository
:cloneOrUpdateRepo
SET REPONAME=%~1
REM Check if the repo folder already exists
IF EXIST "%REPONAME%" (
    ECHO %REPONAME%: Existing folder found. Checking for updates...
    cd %REPONAME%
    REM Check if any updates are available
    FOR /f %%J IN ('git rev-parse HEAD') do set CURRHEAD=%%J
    FOR /f %%J IN ('git ls-remote origin HEAD') do set ORIGHEAD=%%J
    IF "!CURRHEAD!"=="!ORIGHEAD!" (
        ECHO %REPONAME%: Repository up to date.
    ) ELSE (
        REM Stash any uncommited changes then update from origin
        ECHO %REPONAME%: Updates available. Updating repository...
        git checkout master --quiet
        git stash --quiet
        git pull origin master --quiet -ff
        git stash pop --quiet
    )
    cd ..\
) ELSE (
    ECHO %REPONAME%: Existing folder not found. Cloning repository...
    REM Clone from the origin repo
    SET REPOURL=%UPSTREAMURL%/%REPONAME%.git
    git clone !REPOURL! --quiet
    IF %ERRORLEVEL% NEQ 0 (
        ECHO %REPONAME%: Git clone failed.
        GOTO exitOnError
    )
    REM Initialise autocrlf options to fix cross platform interoperation
    REM  Once updated the repo needs to be reset to correct the local line endings
    cd %REPONAME%
    git config --local core.autocrlf false
    git rm --cached -r . --quiet
    git reset --hard --quiet
    cd ..\
)
REM Add current repo to list of already passed dependencies
SET PASSDEPENDENCIES=%PASSDEPENDENCIES% %REPONAME%
REM Check if the repo itself has required dependencies
IF EXIST "%REPONAME%\SMP\project_get_dependencies.bat" (
    ECHO %REPONAME%: Found additional dependencies...
    ECHO.
    cd %REPONAME%\SMP
    project_get_dependencies.bat "!PASSDEPENDENCIES!" || EXIT /B 1
    cd ..\..
)
ECHO.
EXIT /B %ERRORLEVEL%

REM Function to download existing prebuilt libraries
REM  downloadLibs: RepoName
REM    RepoName = Name of the repository
:downloadLibs
SET REPONAME=%~1
REM Get latest release
ECHO %REPONAME%: Getting latest release...
SET UPSTREAMAPIURL=%UPSTREAMURL:github.com=api.github.com/repos%
REM Check if secure OAuth is available
IF "%GITHUBTOKEN%" == "" (
    powershell -nologo -noprofile -command "try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest > latest.json } catch {exit 1}"
) ELSE (
    powershell -nologo -noprofile -command "try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest -Headers @{'Authorization' = 'token %GITHUBTOKEN%'} > latest.json } catch {exit 1}"
)
IF NOT %ERRORLEVEL% == 0 ( ECHO Failed getting latest %REPONAME% release & EXIT /B 1 )
REM Get tag for latest release
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR /B "tag_name"`) DO SET TAG=%%F
FOR /F "tokens=2 delims=: " %%F in ("%TAG%") DO SET TAG=%%F
IF "%TAG%"=="" ( ECHO Failed getting latest %REPONAME% release tag information & EXIT /B 1 )
REM Get download name of latest release
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR "name="`) DO SET LIBNAME=%%F
SET LIBNAME=%LIBNAME:*name=%
FOR /F "tokens=1 delims=_" %%F in ("%LIBNAME:~1%") DO SET LIBNAME=%%F
IF "%LIBNAME%"=="" ( ECHO Failed getting latest %REPONAME% release name information & EXIT /B 1 )
DEL /F /Q latest.json
REM Get the download location for the required tag
SET TAG2=%TAG:+=.%
SET DLURL=%UPSTREAMURL%/%REPONAME%/releases/download/%TAG%/%LIBNAME%_%TAG2%_msvc%MSVC_VER%.zip
REM Download a pre-built archive and extract
ECHO %REPONAME%: Downloading %LIBNAME%_%TAG%_msvc%MSVC_VER%.zip...
SET PREBUILTDIR=prebuilt
MKDIR %PREBUILTDIR% >NUL 2>&1
powershell -nologo -noprofile -command "try { (New-Object Net.WebClient).DownloadFile('%DLURL%', '%PREBUILTDIR%\temp.zip') } catch {exit 1}"
IF NOT %ERRORLEVEL% == 0 ( ECHO Failed downloading %DLURL% & EXIT /B 1 )
powershell -nologo -noprofile -command "Add-Type -AssemblyName System.IO.Compression.FileSystem; $zip=[System.IO.Compression.ZipFile]::OpenRead('%PREBUILTDIR%\temp.zip'); foreach ($item in $zip.Entries) { try {$file=(Join-Path -Path .\%PREBUILTDIR% -ChildPath $item.FullName); $null=[System.IO.Directory]::CreateDirectory((Split-Path -Path $file)); [System.IO.Compression.ZipFileExtensions]::ExtractToFile($item,$file,$true)} catch {exit 1} }"
IF NOT %ERRORLEVEL% == 0 ( ECHO Failed extracting downloaded archive & EXIT /B 1 )
DEL /F /Q %PREBUILTDIR%\\temp.zip
ECHO.
EXIT /B %ERRORLEVEL%

:exitOnError
cd %CURRDIR%
SET ERROR=1

:exit
REM Directly exit if an AppVeyor build
IF NOT "%APPVEYOR%"=="" (
    GOTO return
)
REM Return the passed dependency list
(
    ENDLOCAL
    SET PASSDEPENDENCIES=%PASSDEPENDENCIES%
)

REM Check if this was launched from an existing terminal or directly from .bat
REM  If launched by executing the .bat then pause on completion
ECHO %CMDCMDLINE% | FINDSTR /L %COMSPEC% >NUL 2>&1
IF %ERRORLEVEL% == 0 IF "%~1"=="" PAUSE

:return
EXIT /B %ERROR%

@ECHO OFF
SETLOCAL EnableDelayedExpansion

SET UPSTREAMURL=https://github.com/ShiftMediaProject
SET DEPENDENCIES=( ^
libgcrypt ^
)

REM Get passed in list of dependencies to skip
SET PASSDEPENDENCIES=%~1

REM Check if git is installed and available
IF "%MSVC_VER%"=="" (
    git status >NUL 2>&1
    IF ERRORLEVEL 1 (
        ECHO A working copy of git was not found. To use this script you must first install git for windows.
        GOTO exitOnError
    )
)

REM Store current directory and ensure working directory is the location of current .bat
SET CURRDIR="%CD%"
cd "%~dp0"

REM Initialise error check value
SET ERROR=0

cd ..\..
FOR %%I IN %DEPENDENCIES% DO (
    ECHO !PASSDEPENDENCIES! | FINDSTR /C:"%%I" >NUL 2>&1 || (
        REM Check if MSVC_VER environment variable is set
        IF "%MSVC_VER%"=="" (
            CALL :cloneOrUpdateRepo "%%I" || GOTO exitOnError
        ) ELSE (
            CALL :downloadLibs "%%I" || GOTO exitOnError
        )
    )
)
cd "%CURRDIR%" >NUL
GOTO exit

REM Function to clone or update a repo
REM  cloneOrUpdateRepo: RepoName
REM    RepoName = Name of the repository
:cloneOrUpdateRepo
SET REPONAME=%~1
REM Check if the repo folder already exists
IF EXIST "%REPONAME%" (
    ECHO %REPONAME%: Existing folder found. Checking for updates...
    cd %REPONAME%
    REM Check if any updates are available
    FOR /f %%J IN ('git rev-parse HEAD') do set CURRHEAD=%%J
    FOR /f %%J IN ('git ls-remote origin HEAD') do set ORIGHEAD=%%J
    IF "!CURRHEAD!"=="!ORIGHEAD!" (
        ECHO %REPONAME%: Repository up to date.
    ) ELSE (
        REM Stash any uncommited changes then update from origin
        ECHO %REPONAME%: Updates available. Updating repository...
        git checkout master --quiet
        git stash --quiet
        git pull origin master --quiet -ff
        git stash pop --quiet
    )
    cd ..\
) ELSE (
    ECHO %REPONAME%: Existing folder not found. Cloning repository...
    REM Clone from the origin repo
    SET REPOURL=%UPSTREAMURL%/%REPONAME%.git
    git clone !REPOURL! --quiet
    IF ERRORLEVEL 1 (
        ECHO %REPONAME%: Git clone failed.
        GOTO exitOnError
    )
    REM Initialise autocrlf options to fix cross platform interoperation
    REM  Once updated the repo needs to be reset to correct the local line endings
    cd %REPONAME%
    git config --local core.autocrlf false
    git rm --cached -r . --quiet
    git reset --hard --quiet
    cd ..\
)
REM Add current repo to list of already passed dependencies
SET PASSDEPENDENCIES=%PASSDEPENDENCIES% %REPONAME%
REM Check if the repo itself has required dependencies
IF EXIST "%REPONAME%\SMP\project_get_dependencies.bat" (
    ECHO %REPONAME%: Found additional dependencies...
    ECHO.
    cd %REPONAME%\SMP
    project_get_dependencies.bat "!PASSDEPENDENCIES!" || EXIT /B 1
    cd ..\..
)
ECHO.
EXIT /B %ERRORLEVEL%

REM Function to download existing prebuilt libraries
REM  downloadLibs: RepoName
REM    RepoName = Name of the repository
:downloadLibs
SET REPONAME=%~1
REM Get latest release
ECHO %REPONAME%: Getting latest release...
SET UPSTREAMAPIURL=%UPSTREAMURL:github.com=api.github.com/repos%
REM Check if secure OAuth is available
IF "%GITHUBTOKEN%" == "" (
    powershell -nologo -noprofile -command "try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest > latest.json } catch {exit 1}"
) ELSE (
    powershell -nologo -noprofile -command "try { Invoke-RestMethod -Uri %UPSTREAMAPIURL%/%REPONAME%/releases/latest -Headers @{'Authorization' = 'token %GITHUBTOKEN%'} > latest.json } catch {exit 1}"
)
IF ERRORLEVEL 1 ( ECHO Failed getting latest %REPONAME% release & EXIT /B 1 )
REM Get tag for latest release
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR /B "tag_name"`) DO SET TAG=%%F
FOR /F "tokens=2 delims=: " %%F in ("%TAG%") DO SET TAG=%%F
IF "%TAG%"=="" ( ECHO Failed getting latest %REPONAME% release tag information & EXIT /B 1 )
REM Get download name of latest release
FOR /F "tokens=* USEBACKQ" %%F IN (`TYPE latest.json ^| FINDSTR "name="`) DO SET LIBNAME=%%F
SET LIBNAME=%LIBNAME:*name=%
FOR /F "tokens=1 delims=_" %%F in ("%LIBNAME:~1%") DO SET LIBNAME=%%F
IF "%LIBNAME%"=="" ( ECHO Failed getting latest %REPONAME% release name information & EXIT /B 1 )
DEL /F /Q latest.json
REM Get the download location for the required tag
SET TAG2=%TAG:+=.%
SET DLURL=%UPSTREAMURL%/%REPONAME%/releases/download/%TAG%/%LIBNAME%_%TAG2%_msvc%MSVC_VER%.zip
REM Download a pre-built archive and extract
ECHO %REPONAME%: Downloading %LIBNAME%_%TAG%_msvc%MSVC_VER%.zip...
SET PREBUILTDIR=prebuilt
MKDIR %PREBUILTDIR% >NUL 2>&1
powershell -nologo -noprofile -command "try { (New-Object Net.WebClient).DownloadFile('%DLURL%', '%PREBUILTDIR%\temp.zip') } catch {exit 1}"
IF ERRORLEVEL 1 ( ECHO Failed downloading %DLURL% & EXIT /B 1 )
powershell -nologo -noprofile -command "Add-Type -AssemblyName System.IO.Compression.FileSystem; $zip=[System.IO.Compression.ZipFile]::OpenRead('%PREBUILTDIR%\temp.zip'); foreach ($item in $zip.Entries) { try {$file=(Join-Path -Path .\%PREBUILTDIR% -ChildPath $item.FullName); $null=[System.IO.Directory]::CreateDirectory((Split-Path -Path $file)); [System.IO.Compression.ZipFileExtensions]::ExtractToFile($item,$file,$true)} catch {exit 1} }"
IF ERRORLEVEL 1 ( ECHO Failed extracting downloaded archive & EXIT /B 1 )
DEL /F /Q %PREBUILTDIR%\\temp.zip
ECHO.
EXIT /B %ERRORLEVEL%

:exitOnError
cd "%CURRDIR%"
SET ERROR=1

:exit
REM Directly exit if an AppVeyor build
IF NOT "%APPVEYOR%"=="" (
    GOTO return
)
REM Return the passed dependency list
(
    ENDLOCAL
    SET PASSDEPENDENCIES=%PASSDEPENDENCIES%
)

REM Check if this was launched from an existing terminal or directly from .bat
REM  If launched by executing the .bat then pause on completion
ECHO %CMDCMDLINE% | FINDSTR /L %COMSPEC% >NUL 2>&1
IF %ERRORLEVEL% == 0 IF "%~1"=="" PAUSE

:return
EXIT /B %ERROR%

project: Correct handling of directories with spaces and error codes in dependency bat file.


set PYTHON=C:\Python27\python
set EASY_INSTALL=c:\python27\scripts\easy_install.exe
set NEXUSDIR="C:\Program Files (x86)\NeXus Data Format\"
set PATH=C:\Python27;C:\Python27\Scripts;C:\mingw\bin;%PATH%
set PYLINT=c:\python27cscripts\pylint

cd %WORKSPACE%\sasview
%PYTHON% check_packages.py

cd %WORKSPACE%\sasview
python setup.py build -cmingw32

cd %WORKSPACE%\sasview
python setup.py docs

cd %WORKSPACE%\sasview
python setup.py bdist_egg --skip-build

cd %WORKSPACE%\sasview\test
%PYTHON% utest_sasview.py

cd %WORKSPACE%\sasview
mkdir sasview-install
set PYTHONPATH=%WORKSPACE%\sasview\sasview-install;%PYTHONPATH%

cd %WORKSPACE%\sasview
cd dist
%EASY_INSTALL% -d ..\sasview-install sasview-3.1.2-py2.7-win32.egg

cd %WORKSPACE%\sasview\sasview
python setup_exe.py py2exe
python installer_generator.py
"C:\Program Files (x86)\Inno Setup 5\ISCC.exe" installer.iss

cd Output
xcopy setupSasView.exe %WORKSPACE%\sasview\dist

cd %WORKSPACE%\sasview
%PYLINT% --rcfile "build_tools/pylint.rc" -f parseable sasview-install/sasview*.egg/sas sasview > test/sasview.txt

cd  %WORKSPACE%

set PYTHON=C:\Python27\python
set EASY_INSTALL=c:\python27\scripts\easy_install.exe
set NEXUSDIR="C:\Program Files (x86)\NeXus Data Format\"
set PATH=C:\Python27;C:\Python27\Scripts;C:\mingw\bin;%PATH%
set PYLINT=c:\python27\scripts\pylint

cd %WORKSPACE%\sasview
%PYTHON% check_packages.py

cd %WORKSPACE%\sasview
python setup.py build -cmingw32

cd %WORKSPACE%\sasview
python setup.py docs

cd %WORKSPACE%\sasview
python setup.py bdist_egg --skip-build

cd %WORKSPACE%\sasview\test
%PYTHON% utest_sasview.py

cd %WORKSPACE%\sasview
mkdir sasview-install
set PYTHONPATH=%WORKSPACE%\sasview\sasview-install;%PYTHONPATH%

cd %WORKSPACE%\sasview
cd dist
%EASY_INSTALL% -d ..\sasview-install sasview-3.1.2-py2.7-win32.egg

cd %WORKSPACE%\sasview\sasview
python setup_exe.py py2exe
python installer_generator.py
"C:\Program Files (x86)\Inno Setup 5\ISCC.exe" installer.iss

cd Output
xcopy setupSasView.exe %WORKSPACE%\sasview\dist

cd %WORKSPACE%\sasview
%PYLINT% --rcfile "build_tools/pylint.rc" -f parseable sasview-install/sasview*.egg/sas sasview > test/sasview.txt

cd  %WORKSPACE%

Update new windows build script

Update new windows build script


REM build the windows stuffs
c:\windows\Microsoft.NET\Framework\v4.0.30319\MSBuild wp8\wp8\KirinWP8\KirinWP8.csproj /t:Clean,Build
c:\windows\Microsoft.NET\Framework\v4.0.30319\MSBuild w8\w8\KirinW8\KirinW8.csproj /t:Clean,Build

REM build the windows stuffs
mvn clean install -pl common/kirin-gwt -am
c:\windows\Microsoft.NET\Framework\v4.0.30319\MSBuild wp8\wp8\KirinWP8\KirinWP8.csproj /t:Clean,Build
c:\windows\Microsoft.NET\Framework\v4.0.30319\MSBuild w8\w8\KirinW8\KirinW8.csproj /t:Clean,Build

make windows build the kirin gwt

make windows build the kirin gwt


%PYTHON% -m pip install cmake pytest
.\installzlib.bat
mkdir -p atari_py\ale_interface\build && cd atari_py\ale_interface\build

cmake -G "%CMAKE_GENERATOR%" ^
      -DCMAKE_GENERATOR_PLATFORM=x64 ^

cmake --build .

rm -rf atari_py*
%PYTHON% -m pip install . --no-deps -vv

remove some unncessary stuff

remove some unncessary stuff


@echo on

mkdir build
cd build

:: eigen3 is expected in this subdir; otherwise a bundled one is extracted
mkdir third-party || goto :error
mklink /D %LIBRARY_INC%\eigen3 third-party\eigen3 || goto :error

cmake %SRC_DIR% ^
    %CMAKE_ARGS% ^
    -G "NMake Makefiles JOM" ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DCMAKE_INSTALL_LIBDIR=%LIBRARY_LIB% || goto :error

jom -j %NUMBER_OF_PROCESSORS% || goto :error
jom -j %NUMBER_OF_PROCESSORS% install || goto :error

goto :EOF

:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

@echo on

mkdir build
cd build

:: eigen3 is expected in this subdir; otherwise a bundled one is extracted
mkdir third-party || goto :error
mklink /D third-party\eigen3 %LIBRARY_INC%\eigen3 || goto :error

cmake %SRC_DIR% ^
    %CMAKE_ARGS% ^
    -G "NMake Makefiles JOM" ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DCMAKE_INSTALL_LIBDIR=%LIBRARY_LIB% || goto :error

jom -j %NUMBER_OF_PROCESSORS% || goto :error
jom -j %NUMBER_OF_PROCESSORS% install || goto :error

goto :EOF

:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%

fix mklink order

fix mklink order


rem per user startup.cmd
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 1 /f
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People /v PeopleBand /t REG_DWORD /d 0 /f
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_TrackProgs /t REG_DWORD /d 1 /f
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v Enabled /t REG_DWORD /d 0 /f
reg.exe add "HKCU\Software\Microsoft\Input\TIPC" /v Enabled /t REG_DWORD /d 0 /f
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v GlobalUserDisabled /t REG_DWORD /d 1 /f
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{A8804298-2D5F-42E3-9531-9C8C39EB29CE}" /v Value /d Deny /f
reg.exe delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /F

rem per user startup.cmd
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 1 /f
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" /v PeopleBand /t REG_DWORD /d 0 /f
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_TrackProgs /t REG_DWORD /d 1 /f
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v Enabled /t REG_DWORD /d 0 /f
reg.exe add "HKCU\Software\Microsoft\Input\TIPC" /v Enabled /t REG_DWORD /d 0 /f
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v GlobalUserDisabled /t REG_DWORD /d 1 /f
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{A8804298-2D5F-42E3-9531-9C8C39EB29CE}" /v Value /d Deny /f
reg.exe delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /F

Update Startup.cmd

Update Startup.cmd


pushd ..
if [%1] == [] (
rem === BUILDING GolangSDK ===
node generate.js golangSDK=..\sdks\GolangSDK -apiSpecPath
) else (
rem === BUILDING GolangSDK with params %* ===
node generate.js golangSDK=..\sdks\GolangSDK %*
)
popd

pause

remove pause from golang_build.bat now that it is being run through vscode build script


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

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

REM Admin checking...

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

:MENU

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

CHOICE /C 123456789 /M "Enter your choice:"
if ERRORLEVEL 9 goto Nine
if ERRORLEVEL 8 goto Eight
if ERRORLEVEL 7 goto Seven
if ERRORLEVEL 6 goto Six
if ERRORLEVEL 5 goto Five
if ERRORLEVEL 4 goto Four
if ERRORLEVEL 3 goto Three
if ERRORLEVEL 2 goto Two
if ERRORLEVEL 1 goto One

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

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

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

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

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

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

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

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

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

PAUSE

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

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

REM Admin checking...

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

:MENU

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

CHOICE /C 123456789 /M "Enter your choice:"
if ERRORLEVEL 10 goto Ten
if ERRORLEVEL 9 goto Nine
if ERRORLEVEL 8 goto Eight
if ERRORLEVEL 7 goto Seven
if ERRORLEVEL 6 goto Six
if ERRORLEVEL 5 goto Five
if ERRORLEVEL 4 goto Four
if ERRORLEVEL 3 goto Three
if ERRORLEVEL 2 goto Two
if ERRORLEVEL 1 goto One

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

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

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

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

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

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

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

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

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

:Ten
powershell Get-CimInstance Win32_StartupCommand | Select-Object Name, command, Location, User | Format-List
pause
goto MENU

PAUSE

Update Main.bat

Update Main.bat

Added powershell startup process list


if NOT DEFINED ClientRevision set ClientRevision=master
if NOT DEFINED KBFSRevision set KBFSRevision=master
if NOT DEFINED UpdaterRevision set UpdaterRevision=master
if NOT DEFINED ReleaseRevision set ReleaseRevision=master

set OUTPUT=echo
if DEFINED SlackBot set OUTPUT=go run %GOPATH%/src/github.com/keybase/slackbot/send/main.go -i=1

:: sanity check that the passphrase is set right
go run %GOPATH%\src\github.com\keybase\client\go\tools\ssss\main.go %0
IF %ERRORLEVEL% NEQ 0 (
  echo Saltpack key not set right, can't build
  EXIT /B 1
)

if NOT DEFINED DevEnvDir call "%ProgramFiles(x86)%\\Microsoft Visual Studio 14.0\\vc\\bin\\vcvars32.bat"

:: don't bother with ci or checking out source, etc. for smoke2 build
IF [%UpdateChannel%] == [Smoke2] goto:done_ci

:: NOTE: We depend on the bot or caller to checkout client first
:: call:checkout_keybase client, %ClientRevision% || goto:build_error || EXIT /B 1
call:checkout_keybase kbfs, %KBFSRevision% || goto:build_error || EXIT /B 1
call:checkout_keybase go-updater, %UpdaterRevision% || goto:build_error || EXIT /B 1
call:checkout_keybase release, %ReleaseRevision% || goto:build_error || EXIT /B 1

::wait for CI
if [%UpdateChannel%] == [SmokeCI] call:check_ci  || EXIT /B 1

:done_ci

for /F delims^=^"^ tokens^=2 %%x in ('findstr /C:"Version = " %GOPATH%\src\github.com\keybase\client\go\libkb\version.go') do set LIBKB_VER=%%x

:: release
pushd %GOPATH%\src\github.com\keybase\release
del release.exe
go build
IF %ERRORLEVEL% NEQ 0 (
  goto:build_error || EXIT /B 1
)
for /f %%i in ('release winbuildnumber --version=%LIBKB_VER%') do set BUILD_NUMBER=%%i
echo %BUILD_NUMBER%
popd

if NOT DEFINED BUILD_NUMBER (
  echo bad build number
  goto:build_error || EXIT /B 1
)
:: ensure it's numeric
SET "badbuildnumber="&for /f "delims=0123456789" %%i in ("%BUILD_NUMBER%") do set badbuildnumber=%%i
if defined badbuildnumber (
  echo bad build number
  goto:build_error || EXIT /B 1
)

call %GOPATH%\src\github.com\keybase\client\packaging\windows\build_prerelease.cmd || goto:build_error || EXIT /B 1

::RunQuiet Utility
pushd %GOPATH%\src\github.com\keybase\client\go\tools\runquiet
del rq.hash
del old.hash
powershell -command "wget https://s3.amazonaws.com/prerelease.keybase.io/windows-support/runquiet/runquiet.hash -OutFile old.hash"
git log -1 -- runquiet.go > rq.hash
fc rq.hash old.hash
if %ERRORLEVEL% EQU 0 (
    echo "downloading keybaserq"
    powershell -command "wget https://s3.amazonaws.com/prerelease.keybase.io/windows-support/runquiet/keybaserq.exe -OutFile keybaserq.exe"
) else (
    echo "--- runquiet hashes differ, building keybaserq. Server hash: ---"
    type old.hash
    echo "--- Current hash: ---"
    type rq.hash
    call ..\..\..\packaging\windows\buildrq.bat || goto:build_error || EXIT /B 1
)
popd

call %GOPATH%\src\github.com\keybase\client\packaging\windows\buildui.bat || goto:build_error || EXIT /B 1

::Build Installer
call %GOPATH%\src\github.com\keybase\client\packaging\windows\doinstaller_wix.cmd || goto:build_error || EXIT /B 1

::Publish to S3
echo "Uploading %BUILD_TAG%"
s3browser-con upload prerelease.keybase.io  %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG%\Keybase_%BUILD_TAG%.386.exe prerelease.keybase.io/windows  || goto:build_error || EXIT /B 1

if %UpdateChannel% NEQ "None" (
    :: Test channel json
    s3browser-con upload prerelease.keybase.io  %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG%\update-windows-prod-test-v2.json prerelease.keybase.io || goto:build_error || EXIT /B 1
) else (
    echo "No update channel"
)

::Invoke SmokeB build
if [%UpdateChannel%] NEQ [Smoke] (
    if [%UpdateChannel%] NEQ [SmokeCI] (
        echo "Not a smoke build"
        goto :no_smokea
    )
)

:: Smoke A json
s3browser-con upload prerelease.keybase.io  %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG%\*.json prerelease.keybase.io/windows-support || goto:build_error || EXIT /B 1

set PrevUpdateChannel=%UpdateChannel%
set UpdateChannel=Smoke2
set smokeASemVer=%KEYBASE_VERSION%
::SlackBot?

::build again
call %GOPATH%\src\github.com\keybase\client\packaging\windows\dorelease.cmd || EXIT /B 1

:: and we're done here

EXIT /B 0

:no_smokea

::Publish smoke updater jsons to S3
if [%UpdateChannel%] NEQ [Smoke2] (
    echo "Non Smoke2 build"
    %OUTPUT% "Successfully built Windows with client: %KEYBASE_VERSION%, kbfs: %KBFS_BUILD%"
    goto :no_smokeb
)
::Smoke B json
s3browser-con upload prerelease.keybase.io  %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG%\*.json prerelease.keybase.io/windows-support  || goto:build_error || EXIT /B 1
set smokeBSemVer=%KEYBASE_VERSION%
%GOPATH%\src\github.com\keybase\release\release announce-build --build-a="%SmokeASemVer%" --build-b="%smokeBSemVer%" --platform="windows" || goto:build_error || EXIT /B 1
%OUTPUT% "Successfully built Windows: --build-a=%SmokeASemVer% --build-b=%smokeBSemVer%
:no_smokeb

echo %ERRORLEVEL%

goto:eof

:checkout_keybase

if EXIST %GOPATH%\src\github.com\keybase\%~1 goto:repoexists
pushd %GOPATH%\src\github.com\keybase
git clone https://github.com/keybase/%~1.git
popd
:repoexists

pushd %GOPATH%\src\github.com\keybase\%~1
git checkout master || EXIT /B 1
git pull || EXIT /B 1
git checkout %~2 || EXIT /B 1
git pull || EXIT /B 1
popd
EXIT /B 0

goto:eof

:build_error
%OUTPUT% "Error building Windows"
EXIT /B 1

:check_ci
for /f %%i in ('git -C %GOPATH%\src\github.com\keybase\client rev-parse --short^=8 HEAD') do set clientCommit=%%i
for /f %%i in ('git -C %GOPATH%\src\github.com\keybase\kbfs rev-parse --short^=8 HEAD') do set kbfsCommit=%%i
echo [%clientCommit%] [%kbfsCommit%]
:: need GITHUB_TOKEN
pushd %GOPATH%\src\github.com\keybase\release
go build || goto:build_error || EXIT /B 1
release wait-ci --repo="client" --commit="%clientCommit%" --context="continuous-integration/jenkins/branch" --context="ci/circleci"  || goto:ci_error
release wait-ci --repo="kbfs" --commit="%kbfsCommit%" --context="continuous-integration/jenkins/branch" --context="ci/circleci"  || goto:ci_error
popd
EXIT /B 0

:ci_error
%OUTPUT% "CI Failure building Windows"
EXIT /B 1

if NOT DEFINED ClientRevision set ClientRevision=master
if NOT DEFINED KBFSRevision set KBFSRevision=master
if NOT DEFINED UpdaterRevision set UpdaterRevision=master
if NOT DEFINED ReleaseRevision set ReleaseRevision=master

set OUTPUT=echo
if DEFINED SlackBot set OUTPUT=go run %GOPATH%/src/github.com/keybase/slackbot/send/main.go -i=1

:: sanity check that the passphrase is set right
go run %GOPATH%\src\github.com\keybase\client\go\tools\ssss\main.go %0
IF %ERRORLEVEL% NEQ 0 (
  echo Saltpack key not set right, can't build
  EXIT /B 1
)

if NOT DEFINED DevEnvDir call "%ProgramFiles(x86)%\\Microsoft Visual Studio 14.0\\vc\\bin\\vcvars32.bat"

:: don't bother with ci or checking out source, etc. for smoke2 build
IF [%UpdateChannel%] == [Smoke2] goto:done_ci

:: NOTE: We depend on the bot or caller to checkout client first
:: call:checkout_keybase client, %ClientRevision% || goto:build_error || EXIT /B 1
call:checkout_keybase kbfs, %KBFSRevision% || goto:build_error || EXIT /B 1
call:checkout_keybase go-updater, %UpdaterRevision% || goto:build_error || EXIT /B 1
call:checkout_keybase release, %ReleaseRevision% || goto:build_error || EXIT /B 1

::wait for CI
if [%UpdateChannel%] == [SmokeCI] call:check_ci  || EXIT /B 1

:done_ci

for /F delims^=^"^ tokens^=2 %%x in ('findstr /C:"Version = " %GOPATH%\src\github.com\keybase\client\go\libkb\version.go') do set LIBKB_VER=%%x

:: release
pushd %GOPATH%\src\github.com\keybase\release
del release.exe
go build
IF %ERRORLEVEL% NEQ 0 (
  goto:build_error || EXIT /B 1
)
for /f %%i in ('release winbuildnumber --version=%LIBKB_VER%') do set BUILD_NUMBER=%%i
echo %BUILD_NUMBER%
popd

if NOT DEFINED BUILD_NUMBER (
  echo bad build number
  goto:build_error || EXIT /B 1
)
:: ensure it's numeric
SET "badbuildnumber="&for /f "delims=0123456789" %%i in ("%BUILD_NUMBER%") do set badbuildnumber=%%i
if defined badbuildnumber (
  echo bad build number
  goto:build_error || EXIT /B 1
)

call %GOPATH%\src\github.com\keybase\client\packaging\windows\build_prerelease.cmd || goto:build_error || EXIT /B 1

::RunQuiet Utility
pushd %GOPATH%\src\github.com\keybase\client\go\tools\runquiet
del rq.hash
del old.hash
powershell -command "wget https://s3.amazonaws.com/prerelease.keybase.io/windows-support/runquiet/runquiet.hash -OutFile old.hash"
git log -1 -- runquiet.go > rq.hash
fc rq.hash old.hash
if %ERRORLEVEL% EQU 0 (
    echo "downloading keybaserq"
    powershell -command "wget https://s3.amazonaws.com/prerelease.keybase.io/windows-support/runquiet/keybaserq.exe -OutFile keybaserq.exe"
) else (
    echo "--- runquiet hashes differ, building keybaserq. Server hash: ---"
    type old.hash
    echo "--- Current hash: ---"
    type rq.hash
    call ..\..\..\packaging\windows\buildrq.bat || goto:build_error || EXIT /B 1
)
popd

call %GOPATH%\src\github.com\keybase\client\packaging\windows\buildui.bat || goto:build_error || EXIT /B 1

::Build Installer
call %GOPATH%\src\github.com\keybase\client\packaging\windows\doinstaller_wix.cmd || goto:build_error || EXIT /B 1

::Publish to S3
echo "Uploading %BUILD_TAG%"
s3browser-con upload prerelease.keybase.io  %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG%\Keybase_%BUILD_TAG%.386.exe prerelease.keybase.io/windows  || goto:build_error || EXIT /B 1

if %UpdateChannel% NEQ "None" (
    :: Test channel json
    s3browser-con upload prerelease.keybase.io  %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG%\update-windows-prod-test-v2.json prerelease.keybase.io || goto:build_error || EXIT /B 1
) else (
    echo "No update channel"
)

::Invoke SmokeB build
if [%UpdateChannel%] NEQ [Smoke] (
    if [%UpdateChannel%] NEQ [SmokeCI] (
        echo "Not a smoke build"
        goto :no_smokea
    )
)

:: Smoke A json
s3browser-con upload prerelease.keybase.io  %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG%\*.json prerelease.keybase.io/windows-support || goto:build_error || EXIT /B 1

set PrevUpdateChannel=%UpdateChannel%
set UpdateChannel=Smoke2
set smokeASemVer=%KEYBASE_VERSION%
::SlackBot?

::build again
call %GOPATH%\src\github.com\keybase\client\packaging\windows\dorelease.cmd || EXIT /B 1

:: and we're done here

EXIT /B 0

:no_smokea

setlocal ENABLEDELAYEDEXPANSION

set BUILD_TAG_ENCODED=!BUILD_TAG:+=%%2B!

::Publish smoke updater jsons to S3
if [%UpdateChannel%] NEQ [Smoke2] (
    echo "Non Smoke2 build"
    %OUTPUT% "Successfully built Windows with client: %KEYBASE_VERSION%, kbfs: %KBFS_BUILD%"
    %OUTPUT% "https://prerelease.keybase.io/windows/Keybase_%BUILD_TAG_ENCODED%.386.exe"
    goto :no_smokeb
)
::Smoke B json
s3browser-con upload prerelease.keybase.io  %GOPATH%\src\github.com\keybase\client\packaging\windows\%BUILD_TAG%\*.json prerelease.keybase.io/windows-support  || goto:build_error || EXIT /B 1
set smokeBSemVer=%KEYBASE_VERSION%
%GOPATH%\src\github.com\keybase\release\release announce-build --build-a="%SmokeASemVer%" --build-b="%smokeBSemVer%" --platform="windows" || goto:build_error || EXIT /B 1
set BUILD_TAG_ENCODED=!SmokeASemVer:+=%%2B!
%OUTPUT% "Successfully built Windows: --build-a=%SmokeASemVer% --build-b=%smokeBSemVer%
%OUTPUT% "https://prerelease.keybase.io/windows/Keybase_%BUILD_TAG_ENCODED%.386.exe"
:no_smokeb

echo %ERRORLEVEL%

goto:eof

:checkout_keybase

if EXIST %GOPATH%\src\github.com\keybase\%~1 goto:repoexists
pushd %GOPATH%\src\github.com\keybase
git clone https://github.com/keybase/%~1.git
popd
:repoexists

pushd %GOPATH%\src\github.com\keybase\%~1
git checkout master || EXIT /B 1
git pull || EXIT /B 1
git checkout %~2 || EXIT /B 1
git pull || EXIT /B 1
popd
EXIT /B 0

goto:eof

:build_error
%OUTPUT% "Error building Windows"
EXIT /B 1

:check_ci
for /f %%i in ('git -C %GOPATH%\src\github.com\keybase\client rev-parse --short^=8 HEAD') do set clientCommit=%%i
for /f %%i in ('git -C %GOPATH%\src\github.com\keybase\kbfs rev-parse --short^=8 HEAD') do set kbfsCommit=%%i
echo [%clientCommit%] [%kbfsCommit%]
:: need GITHUB_TOKEN
pushd %GOPATH%\src\github.com\keybase\release
go build || goto:build_error || EXIT /B 1
release wait-ci --repo="client" --commit="%clientCommit%" --context="continuous-integration/jenkins/branch" --context="ci/circleci"  || goto:ci_error
release wait-ci --repo="kbfs" --commit="%kbfsCommit%" --context="continuous-integration/jenkins/branch" --context="ci/circleci"  || goto:ci_error
popd
EXIT /B 0

:ci_error
%OUTPUT% "CI Failure building Windows"
EXIT /B 1

add links in bot output (#11288)

add links in bot output (#11288)


@REM
@REM Licensed to the Apache Software Foundation (ASF) under one or more
@REM contributor license agreements. See the NOTICE file distributed with
@REM this work for additional information regarding copyright ownership.
@REM The ASF licenses this file to You under the Apache License, Version 2.0
@REM (the "License"); you may not use this file except in compliance with
@REM the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing, software
@REM distributed under the License is distributed on an "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@REM See the License for the specific language governing permissions and
@REM limitations under the License.

@echo off
if "%OS%" == "Windows_NT" setlocal

pushd "%~dp0"
call cassandra.in.bat

if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%~dp0..
if NOT DEFINED JAVA_HOME goto :err

set CASSANDRA_PARAMS=%CASSANDRA_PARAMS% -Dcassandra.logdir="%CASSANDRA_HOME%\logs"
set CASSANDRA_PARAMS=%CASSANDRA_PARAMS% -Dcassandra.storagedir="%CASSANDRA_HOME%\data"

echo Starting NodeTool
"%JAVA_HOME%\bin\java" -cp %CASSANDRA_CLASSPATH% %CASSANDRA_PARAMS% -Dlogback.configurationFile=logback-tools.xml org.apache.cassandra.tools.NodeTool %*
goto finally

:err
echo The JAVA_HOME environment variable must be set to run this program!
pause

:finally
ENDLOCAL & set RC=%ERRORLEVEL%
exit /B %RC%

Return %ERRORLEVEL% in nodetool.bat

Return %ERRORLEVEL% in nodetool.bat

Patch by jmckenzie; reviewed by pthompson for CASSANDRA-10078


set path=C:\Program Files\swipl\bin;%path%;C:\Program Files\Java\jdk1.7.0_45\bin;
cd Gui
javac -cp "C:\Program Files\swipl\lib\jpl.jar;." Board.java Game.java Menu.java Main.java
java -cp "C:\Program Files\swipl\lib\jpl.jar;." Main

Add easy launcher bat

Add easy launcher bat


@echo off

:: idempotently create the VM, bring it up
boot2docker init
boot2docker up

:: for proxies:
:: see http://stackoverflow.com/a/29303930/2388971

:: init the shell
for /f "tokens=2" %%i in ('boot2docker shellinit') do set %%i

@echo off

:: idempotently create the VM, bring it up
boot2docker init
boot2docker up

:: for proxies:
:: see http://stackoverflow.com/a/29303930/2388971

:: init the shell
set DOCKER_HOST=tcp://192.168.59.103:2376
set DOCKER_CERT_PATH=%BOOT2DOCKER_DIR%\certs\boot2docker-vm
set DOCKER_TLS_VERIFY=1

set the docker env vars manually as `docker shellinit` does not work with the earlier approach anymore


echo OFF

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

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

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

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

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

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

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

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

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

echo "User installation succeded."

echo OFF

echo ON

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

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

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

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

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

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

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

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

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

echo "User installation succeded."

echo OFF

Update user_install.bat

Update user_install.bat


@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 0.1.11
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

echo Handling Basic Web Site deployment.

REM Use the Executecmd macro to execute and validate the command worked
echo installing npm packages
call :Executecmd npm install
IF !ERRORLEVEL! NEQ 0 goto error
echo installing bower packages
call :Executecmd bower install
IF !ERRORLEVEL! NEQ 0 goto error
echo Spell Checking
call :Executecmd npm run spellCheck
IF !ERRORLEVEL! NEQ 0 goto error
echo latex .tex file Generation
call :Executecmd npm run buildTex
IF !ERRORLEVEL! NEQ 0 goto error
echo Latex Install and PDF file generation
call :Executecmd build\buildPDF.cmd
IF !ERRORLEVEL! NEQ 0 goto error
REM This creates the **index.html** which is deployed by Azure Websites.
echo Building HTML Resume
call :Executecmd npm run buildHtml
IF !ERRORLEVEL! NEQ 0 goto error
echo Building CSS files
call :Executecmd npm run buildStyles
IF !ERRORLEVEL! NEQ 0 goto error

:: 1. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
  IF !ERRORLEVEL! NEQ 0 goto error
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error

goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off

:: ----------------------
:: KUDU Deployment Script
:: Version: 0.1.11
:: ----------------------

:: Prerequisites
:: -------------

:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
  echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
  goto error
)

:: Setup
:: -----

setlocal enabledelayedexpansion

SET ARTIFACTS=%~dp0%..\artifacts

IF NOT DEFINED DEPLOYMENT_SOURCE (
  SET DEPLOYMENT_SOURCE=%~dp0%.
)

IF NOT DEFINED DEPLOYMENT_TARGET (
  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)

IF NOT DEFINED NEXT_MANIFEST_PATH (
  SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest

  IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
    SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
  )
)

IF NOT DEFINED KUDU_SYNC_CMD (
  :: Install kudu sync
  echo Installing Kudu Sync
  call npm install kudusync -g --silent
  IF !ERRORLEVEL! NEQ 0 goto error

  :: Locally just running "kuduSync" would also work
  SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

echo Handling Basic Web Site deployment.

REM Use the Executecmd macro to execute and validate the command worked
echo installing npm packages
call :Executecmd npm install
IF !ERRORLEVEL! NEQ 0 goto error
echo installing bower packages
call :Executecmd bower install
IF !ERRORLEVEL! NEQ 0 goto error
echo Spell Checking
call :Executecmd npm run spellCheck
IF !ERRORLEVEL! NEQ 0 goto error
echo latex .tex file Generation
call :Executecmd npm run buildTex
IF !ERRORLEVEL! NEQ 0 goto error
echo Latex Install and PDF file generation
call :Executecmd build\buildPDF.cmd
IF !ERRORLEVEL! NEQ 0 goto error
REM This creates the **index.html** which is deployed by Azure Websites.
echo Building HTML Resume
call :Executecmd npm run buildHtml
IF !ERRORLEVEL! NEQ 0 goto error
echo Building CSS files
call :Executecmd npm run buildStyles
IF !ERRORLEVEL! NEQ 0 goto error

:: 1. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
  call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd;node_modules"
  IF !ERRORLEVEL! NEQ 0 goto error
)

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error

goto end

:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%

:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul

:exitSetErrorLevel
exit /b 1

:exitFromFunction
()

:end
endlocal
echo Finished successfully.

exclude node modules from deployment

exclude node modules from deployment


@echo off
setlocal

rem
rem     build-app.cmd
rem
echo Info: build-app.cmd
if "%BUILDER_TOP_DIR%" == "" (
    echo BUILDER_TOP_DIR is not defined - hint builder not run?
    exit /b 1
)
if "%1" == "--debug" (
    shift
    set VERBOSE=--verbose
    echo on
)

set APPMODE=--gui
if "%1" == "--cli" set APPMODE=--cli

set PKG_DIST_DIR=%BUILDER_TOP_DIR%\Kit\Windows\app.tmp
set SRC_DIR=%BUILDER_TOP_DIR%\Source

set DIST_DIR=%PKG_DIST_DIR%

if exist build rmdir /s /q build
    if errorlevel 1 goto :error
if exist %DIST_DIR% rmdir /s /q %DIST_DIR%
    if errorlevel 1 goto :error
if exist setup.tmp rmdir /s /q setup.tmp
    if errorlevel 1 goto :error

mkdir %DIST_DIR%
    if errorlevel 1 goto :error

pushd %SRC_DIR%\Common
%PYTHON% make_wb_diff_images.py
    if errorlevel 1 goto :error
popd >NUL

pushd %SRC_DIR%\Scm
nmake -f windows.mak clean
nmake -f windows.mak
    if errorlevel 1 goto :error
popd >NUL

set PYTHONPATH=%SRC_DIR%\Scm;%SRC_DIR%\Git;%SRC_DIR%\Svn;%SRC_DIR%\Hg;%SRC_DIR%\Common
pushd %SRC_DIR%\Scm
%PYTHON% -m win_app_packager build wb_scm_main.py %APPMODE% %DIST_DIR% --icon %SRC_DIR%\wb.ico --name "SCM Workbench" --modules-allowed-to-be-missing-file %BUILDER_TOP_DIR%\Kit\Windows\modules-allowed-to-be-missing.txt %VERBOSE%
    if errorlevel 1 goto :error
popd >NUL
pushd %SRC_DIR%\Git
%PYTHON% -m win_app_packager build wb_git_callback_client_win32.py --cli %DIST_DIR% --icon %SRC_DIR%\wb.ico --name "SCM-Workbench-Git-Callback" --merge %VERBOSE%
    if errorlevel 1 goto :error
popd >NUL

rem copy in the docs

mkdir %DEST_DIR%\Documentation
copy %SRC_DIR%\Docs\scm-workbench.html %DEST_DIR%\Documentation
copy %SRC_DIR%\Docs\scm-workbench_files\*.png %DEST_DIR%\Documentation

rem rem rem rem

pushd %DIST_DIR%\PyWinAppRes\Lib\site-packages\PyQt5
    if errorlevel 1 goto :error

echo Info: clean up Qt 1. move all pyd and dll into a tmp folder
mkdir tmp
    if errorlevel 1 goto :error
move Qt*.pyd tmp >NUL
    if errorlevel 1 goto :error
move tmp\Qt.pyd . >NUL
    if errorlevel 1 goto :error

mkdir Qt\bin\tmp
    if errorlevel 1 goto :error
move Qt\bin\Qt5*.dll Qt\bin\tmp >NUL
    if errorlevel 1 goto :error

echo Info: clean up Qt 2. bring back only the ones we use
for %%x in (Core DBus Gui PrintSupport Svg Widgets) do call :qt_keep %%x

echo Info: clean up Qt 3. delete the Qt files we do not need
rmdir /s /q tmp
    if errorlevel 1 goto :error
rmdir /s /q Qt\bin\tmp
    if errorlevel 1 goto :error

echo Info: clean up Qt 4. delete qml file
rmdir /s /q Qt\qml
    if errorlevel 1 goto :error

echo Info: clean up Qt 5. delete translations file
rmdir /s /q Qt\translations
    if errorlevel 1 goto :error

echo Info: clean up Qt 6. delete webengine files
del Qt\bin\QtWebEngineProcess.exe >NUL
    if errorlevel 1 goto :error
del Qt\resources\qtwebengine*.pak >NUL
    if errorlevel 1 goto :error

echo Info: clean up Qt 6. delete qsci resources
rmdir /s /q Qt\qsci
    if errorlevel 1 goto :error

echo Info: clean up python lib 1. delete test code
rmdir /s /q %DIST_DIR%\PyWinAppRes\Lib\ctypes\test
    if errorlevel 1 goto :error
rmdir /s /q %DIST_DIR%\PyWinAppRes\Lib\site-packages\git\test
    if errorlevel 1 goto :error
rmdir /s /q %DIST_DIR%\PyWinAppRes\Lib\site-packages\gitdb\test
    if errorlevel 1 goto :error
rmdir /s /q %DIST_DIR%\PyWinAppRes\Lib\site-packages\smmap\test
    if errorlevel 1 goto :error
rmdir /s /q %DIST_DIR%\PyWinAppRes\Lib\unittest\test
    if errorlevel 1 goto :error

echo Info: clean up python lib 2. delete distutils exe
del /s %DIST_DIR%\PyWinAppRes\Lib\distutils\command\wininst-*.exe
    if errorlevel 1 goto :error

echo Info: clean up python lib 3. delete pysvn uninstall exe
del /s %DIST_DIR%\PyWinAppRes\Lib\site-packages\pysvn\unins000.exe
    if errorlevel 1 goto :error

popd

echo Info: build-app completed successfully
exit /b 0
endlocal

:qt_keep
    echo Info: Keeping Qt%1
    move tmp\Qt%1.pyd . >NUL
        if errorlevel 1 goto :error
    move Qt\bin\tmp\Qt5%1.dll Qt\bin >NUL
        if errorlevel 1 goto :error
    goto :eof

:error
    echo Error: build-app failed
    exit /b 1

@echo off
setlocal

rem
rem     build-app.cmd
rem
echo Info: build-app.cmd
if "%BUILDER_TOP_DIR%" == "" (
    echo BUILDER_TOP_DIR is not defined - hint builder not run?
    exit /b 1
)
if "%1" == "--debug" (
    shift
    set VERBOSE=--verbose
    echo on
)

set APPMODE=--gui
if "%1" == "--cli" set APPMODE=--cli

set PKG_DIST_DIR=%BUILDER_TOP_DIR%\Kit\Windows\app.tmp
set SRC_DIR=%BUILDER_TOP_DIR%\Source
set DOC_DIR=%BUILDER_TOP_DIR%\Docs

set DIST_DIR=%PKG_DIST_DIR%

if exist build rmdir /s /q build
    if errorlevel 1 goto :error
if exist %DIST_DIR% rmdir /s /q %DIST_DIR%
    if errorlevel 1 goto :error
if exist setup.tmp rmdir /s /q setup.tmp
    if errorlevel 1 goto :error

mkdir %DIST_DIR%
    if errorlevel 1 goto :error

pushd %SRC_DIR%\Common
%PYTHON% make_wb_diff_images.py
    if errorlevel 1 goto :error
popd >NUL

pushd %SRC_DIR%\Scm
nmake -f windows.mak clean
nmake -f windows.mak
    if errorlevel 1 goto :error
popd >NUL

set PYTHONPATH=%SRC_DIR%\Scm;%SRC_DIR%\Git;%SRC_DIR%\Svn;%SRC_DIR%\Hg;%SRC_DIR%\Common
pushd %SRC_DIR%\Scm
%PYTHON% -m win_app_packager build wb_scm_main.py %APPMODE% %DIST_DIR% --icon %SRC_DIR%\wb.ico --name "SCM Workbench" --modules-allowed-to-be-missing-file %BUILDER_TOP_DIR%\Kit\Windows\modules-allowed-to-be-missing.txt %VERBOSE%
    if errorlevel 1 goto :error
popd >NUL
pushd %SRC_DIR%\Git
%PYTHON% -m win_app_packager build wb_git_callback_client_win32.py --cli %DIST_DIR% --icon %SRC_DIR%\wb.ico --name "SCM-Workbench-Git-Callback" --merge %VERBOSE%
    if errorlevel 1 goto :error
popd >NUL

rem copy in the docs

mkdir %DIST_DIR%\Documentation
    if errorlevel 1 goto :error

copy %DOC_DIR%\scm-workbench.html %DIST_DIR%\Documentation
    if errorlevel 1 goto :error
copy %DOC_DIR%\scm-workbench_files\*.png %DIST_DIR%\Documentation
    if errorlevel 1 goto :error

rem rem rem rem

pushd %DIST_DIR%\PyWinAppRes\Lib\site-packages\PyQt5
    if errorlevel 1 goto :error

echo Info: clean up Qt 1. move all pyd and dll into a tmp folder
mkdir tmp
    if errorlevel 1 goto :error
move Qt*.pyd tmp >NUL
    if errorlevel 1 goto :error
move tmp\Qt.pyd . >NUL
    if errorlevel 1 goto :error

mkdir Qt\bin\tmp
    if errorlevel 1 goto :error
move Qt\bin\Qt5*.dll Qt\bin\tmp >NUL
    if errorlevel 1 goto :error

echo Info: clean up Qt 2. bring back only the ones we use
for %%x in (Core DBus Gui PrintSupport Svg Widgets) do call :qt_keep %%x

echo Info: clean up Qt 3. delete the Qt files we do not need
rmdir /s /q tmp
    if errorlevel 1 goto :error
rmdir /s /q Qt\bin\tmp
    if errorlevel 1 goto :error

echo Info: clean up Qt 4. delete qml file
rmdir /s /q Qt\qml
    if errorlevel 1 goto :error

echo Info: clean up Qt 5. delete translations file
rmdir /s /q Qt\translations
    if errorlevel 1 goto :error

echo Info: clean up Qt 6. delete webengine files
del Qt\bin\QtWebEngineProcess.exe >NUL
    if errorlevel 1 goto :error
del Qt\resources\qtwebengine*.pak >NUL
    if errorlevel 1 goto :error

echo Info: clean up Qt 6. delete qsci resources
rmdir /s /q Qt\qsci
    if errorlevel 1 goto :error

echo Info: clean up python lib 1. delete test code
rmdir /s /q %DIST_DIR%\PyWinAppRes\Lib\ctypes\test
    if errorlevel 1 goto :error
rmdir /s /q %DIST_DIR%\PyWinAppRes\Lib\site-packages\git\test
    if errorlevel 1 goto :error
rmdir /s /q %DIST_DIR%\PyWinAppRes\Lib\site-packages\gitdb\test
    if errorlevel 1 goto :error
rmdir /s /q %DIST_DIR%\PyWinAppRes\Lib\site-packages\smmap\test
    if errorlevel 1 goto :error
rmdir /s /q %DIST_DIR%\PyWinAppRes\Lib\unittest\test
    if errorlevel 1 goto :error

echo Info: clean up python lib 2. delete distutils exe
del /s %DIST_DIR%\PyWinAppRes\Lib\distutils\command\wininst-*.exe
    if errorlevel 1 goto :error

echo Info: clean up python lib 3. delete pysvn uninstall exe
del /s %DIST_DIR%\PyWinAppRes\Lib\site-packages\pysvn\unins000.exe
    if errorlevel 1 goto :error

popd

echo Info: build-app completed successfully
exit /b 0
endlocal

:qt_keep
    echo Info: Keeping Qt%1
    move tmp\Qt%1.pyd . >NUL
        if errorlevel 1 goto :error
    move Qt\bin\tmp\Qt5%1.dll Qt\bin >NUL
        if errorlevel 1 goto :error
    goto :eof

:error
    echo Error: build-app failed
    exit /b 1

fix build-windows to add docs to the kit


REM variables need to be filled out , Modify only this section
REM *****************************************************
SET VS2008DIR="C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE"
SET buildBaseDir=c:\graphviz-ms\
SET buildDir=%buildBaseDir%graphviz2\
SET targetDir=%buildBaseDir%release\
SET outputDir=c:\graphviz-ms\bin\
SET setupProjectDir=C:\graphviz-ms\graphviz-msi\setup\
SET setupProjectName=setup
SET setupProjectFile=%setupProjectDir%%setupProjectName%.sln
set sourceLibDir=c:\graphviz-ms\add-on\
set sourceUrl=http://www.graphviz.org/pub/graphviz/development/SOURCES/graphviz-working.tar.gz
set wgetPath=C:\wget\bin
set SevenzPath="C:\Program Files\7-Zip"
PATH=%PATH%;%VS2008DIR%;%wgetPath%;%SevenzPath%

REM *****************************************************
REM 84716ny
REM clean up code , if you rpvode source manually comment out this section
REM *****************************************************
rmdir /S /Q %buildBaseDir%graphviz2
rmdir /S /Q %targetDir%
del %buildBaseDir%*.msi
del %buildBaseDir%*.tar
del %buildBaseDir%*.gz
del %buildBaseDir%*.gz
del %outputDir%*.exe
del %outputDir%*.dll
REM *****************************************************
REM Comment out this section to disable source download
REM *****************************************************
wget -O %buildBaseDir%source.tar.gz %sourceUrl%
7z x -y %buildBaseDir%source.tar.gz
7z x -y %buildBaseDir%source.tar
move /Y %buildBaseDir%graphviz-2.29.* graphviz2
REM **************End of source download*****************

xcopy /Y %buildDir%windows\FEATURE %buildDir%\FEATURE\ /S
xcopy /Y %sourceLibDir%GTS %buildDir%lib\GTS\ /S
xcopy /Y %sourceLibDir%release %buildBaseDir%release\ /S
xcopy /Y %sourceLibDir%gd %buildBaseDir%\graphviz2\lib\gd\
del %buildDir%libltdl\config.h /q
copy /Y %sourceLibDir%*.lib %targetDir%bin\

REM Copy few files from source tree for windows build
REM *****************************************************
copy /Y %buildDir%windows\config.h %buildDir%
copy /Y %buildDir%windows\ast_common.h %buildDir%
copy /Y %sourceLibDir%getopt.h %buildDir%
REM copy /Y %sourceLibDir%config.h %buildDir%

REM *****************************************************

REM Build release
REM *****************************************************
devenv %buildDir%graphviz.sln -Clean release
devenv %buildDir%graphviz.sln -Build release -Out %buildDir%releaseLog1
devenv %buildDir%graphviz.sln -Build release -Out %buildDir%releaseLog2
REM *****************************************************
REM Copy release outputs
REM *****************************************************
copy /Y %sourceLibDir%*.*  %targetDir%bin
copy /Y %outputDir%*.exe  %targetDir%bin
copy /Y %outputDir%dot.exe %targetDir%bin\circo.exe
copy /Y %outputDir%dot.exe %targetDir%bin\neato.exe
copy /Y %outputDir%dot.exe %targetDir%bin\fdp.exe
copy /Y %outputDir%dot.exe %targetDir%bin\twopi.exe
copy /Y %outputDir%dot.exe %targetDir%bin\sfdp.exe
copy /Y %outputDir%gv2gml.exe %targetDir%bin\gml2gv.exe
copy /Y %outputDir%*.dll  %targetDir%bin
copy /Y %outputDir%*.lib  %targetDir%lib\release\lib
copy /Y %outputDir%*.dll  %targetDir%lib\release\dll
REM *****************************************************

REM Run dot -c to generate config6 file. condig6 is shipped in the package
REM *****************************************************
%targetDir%\bin\dot -c
REM *****************************************************

REM Build debug
REM *****************************************************
devenv %buildDir%graphviz.sln -Clean debug
devenv %buildDir%graphviz.sln -Build debug -Out %buildDir%debugLog1
devenv %buildDir%graphviz.sln -Build debug -Out %buildDir%debugLog2
copy /Y %outputDir%*.lib  %targetDir%lib\debug\lib
copy /Y %outputDir%*.dll  %targetDir%lib\debug\dll
REM *****************************************************
REM del %setupProjectDir%Release\%setupProjectName%.msi
del %setupProjectDir%Release\*.msi
devenv %setupProjectFile% -Clean release -Out %buildDir%packagingLog
devenv %setupProjectFile% -Build release -Out %buildDir%packagingLog
COPY /Y %setupProjectDir%Release\%setupProjectName%.msi %buildBaseDir%graphviz-2.29.%date:~10,4%.%date:~4,2%.%date:~7,2%.msi
pscp -q *.msi graphviz-web://data/pub/graphviz/development/windows

REM variables need to be filled out , Modify only this section
REM *****************************************************
SET VS2008DIR="C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE"
SET buildBaseDir=c:\graphviz-ms\
SET buildDir=%buildBaseDir%graphviz2\
SET targetDir=%buildBaseDir%release\
SET outputDir=c:\graphviz-ms\bin\
SET setupProjectDir=C:\graphviz-ms\graphviz-msi\setup\
SET setupProjectName=setup
SET setupProjectFile=%setupProjectDir%%setupProjectName%.sln
set sourceLibDir=c:\graphviz-ms\add-on\
set sourceUrl=http://www.graphviz.org/pub/graphviz/development/SOURCES/graphviz-working.tar.gz
set wgetPath=C:\wget\bin
set SevenzPath="C:\Program Files\7-Zip"
set pscpPath="C:\Program Files\PuTTY"
PATH=%PATH%;%VS2008DIR%;%wgetPath%;%SevenzPath%;%pscpPath%;

REM *****************************************************
REM 84716ny
REM clean up code , if you rpvode source manually comment out this section
REM *****************************************************
rmdir /S /Q %buildBaseDir%graphviz2
rmdir /S /Q %targetDir%
del %buildBaseDir%*.msi
del %buildBaseDir%*.tar
del %buildBaseDir%*.gz
del %buildBaseDir%*.gz
del %outputDir%*.exe
del %outputDir%*.dll
REM *****************************************************
REM Comment out this section to disable source download
REM *****************************************************
wget -O %buildBaseDir%source.tar.gz %sourceUrl%
7z x -y %buildBaseDir%source.tar.gz
7z x -y %buildBaseDir%source.tar
move /Y %buildBaseDir%graphviz-2.29.* graphviz2
REM **************End of source download*****************

xcopy /Y %buildDir%windows\FEATURE %buildDir%\FEATURE\ /S
xcopy /Y %sourceLibDir%GTS %buildDir%lib\GTS\ /S
xcopy /Y %sourceLibDir%release %buildBaseDir%release\ /S
xcopy /Y %sourceLibDir%gd %buildBaseDir%\graphviz2\lib\gd\
del %buildDir%libltdl\config.h /q
copy /Y %sourceLibDir%*.lib %targetDir%bin\

REM Copy few files from source tree for windows build
REM *****************************************************
copy /Y %buildDir%windows\config.h %buildDir%
copy /Y %buildDir%windows\ast_common.h %buildDir%
copy /Y %sourceLibDir%getopt.h %buildDir%
REM copy /Y %sourceLibDir%config.h %buildDir%

REM *****************************************************

REM Build release
REM *****************************************************
devenv %buildDir%graphviz.sln -Clean release
devenv %buildDir%graphviz.sln -Build release -Out %buildDir%releaseLog1
devenv %buildDir%graphviz.sln -Build release -Out %buildDir%releaseLog2
REM *****************************************************
REM Copy release outputs
REM *****************************************************
copy /Y %sourceLibDir%*.*  %targetDir%bin
copy /Y %outputDir%*.exe  %targetDir%bin
copy /Y %outputDir%dot.exe %targetDir%bin\circo.exe
copy /Y %outputDir%dot.exe %targetDir%bin\neato.exe
copy /Y %outputDir%dot.exe %targetDir%bin\fdp.exe
copy /Y %outputDir%dot.exe %targetDir%bin\twopi.exe
copy /Y %outputDir%dot.exe %targetDir%bin\sfdp.exe
copy /Y %outputDir%gv2gml.exe %targetDir%bin\gml2gv.exe
copy /Y %outputDir%*.dll  %targetDir%bin
copy /Y %outputDir%*.lib  %targetDir%lib\release\lib
copy /Y %outputDir%*.dll  %targetDir%lib\release\dll
REM *****************************************************

REM Run dot -c to generate config6 file. condig6 is shipped in the package
REM *****************************************************
%targetDir%\bin\dot -c
REM *****************************************************

REM Build debug
REM *****************************************************
devenv %buildDir%graphviz.sln -Clean debug
devenv %buildDir%graphviz.sln -Build debug -Out %buildDir%debugLog1
devenv %buildDir%graphviz.sln -Build debug -Out %buildDir%debugLog2
copy /Y %outputDir%*.lib  %targetDir%lib\debug\lib
copy /Y %outputDir%*.dll  %targetDir%lib\debug\dll
REM *****************************************************
REM del %setupProjectDir%Release\%setupProjectName%.msi
del %setupProjectDir%Release\*.msi
devenv %setupProjectFile% -Clean release -Out %buildDir%packagingLog
devenv %setupProjectFile% -Build release -Out %buildDir%packagingLog
COPY /Y %setupProjectDir%Release\%setupProjectName%.msi %buildBaseDir%graphviz-2.29.%date:~10,4%.%date:~4,2%.%date:~7,2%.msi
pscp -q *.msi graphviz-web://data/pub/graphviz/development/windows

Update Windows batch build file

Update Windows batch build file


@echo on

:: Download Meson and Ninja, create install directory
mkdir _build
mkdir graphene-shared-%MSVC_PLATFORM%
cd _build
curl -LsSO https://github.com/mesonbuild/meson/releases/download/0.44.1/meson-0.44.1.tar.gz
7z x meson-0.44.1.tar.gz
move dist\meson-0.44.1.tar .
7z x meson-0.44.1.tar
rmdir dist
del meson-0.44.1.tar meson-0.44.1.tar.gz
curl -LsSO https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip
7z x ninja-win.zip
del ninja-win.zip
cd ..

:: Build and install
cd _build
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %MSVC_PLATFORM%
@echo on
C:\Python36\python.exe meson-0.44.1\meson.py .. . --backend=ninja --prefix=%APPVEYOR_BUILD_FOLDER%\graphene-shared-%MSVC_PLATFORM% || goto :error
ninja || goto :error
ninja test || goto :error
ninja install || goto :error
cd ..

:: Copy license into install directory and create .zip file
copy LICENSE graphene-shared-%MSVC_PLATFORM% || goto :error
dir graphene-shared-%MSVC_PLATFORM% /s /b || goto :error
7z a -tzip graphene-shared-%MSVC_PLATFORM%.zip graphene-shared-%MSVC_PLATFORM% || goto :error

goto :EOF

:error
exit /b 1

@echo on

:: Download Meson and Ninja, create install directory
mkdir _build
mkdir graphene-shared-%MSVC_PLATFORM%
cd _build
curl -LsSO https://github.com/mesonbuild/meson/releases/download/0.47.1/meson-0.47.1.tar.gz
7z x meson-0.47.1.tar.gz
move dist\meson-0.47.1.tar .
7z x meson-0.47.1.tar
rmdir dist
del meson-0.47.1.tar meson-0.47.1.tar.gz
curl -LsSO https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip
7z x ninja-win.zip
del ninja-win.zip
cd ..

:: Build and install
cd _build
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %MSVC_PLATFORM%
@echo on
C:\Python36\python.exe meson-0.47.1\meson.py .. . --backend=ninja --prefix=%APPVEYOR_BUILD_FOLDER%\graphene-shared-%MSVC_PLATFORM% || goto :error
ninja || goto :error
ninja test || goto :error
ninja install || goto :error
cd ..

:: Copy license into install directory and create .zip file
copy LICENSE graphene-shared-%MSVC_PLATFORM% || goto :error
dir graphene-shared-%MSVC_PLATFORM% /s /b || goto :error
7z a -tzip graphene-shared-%MSVC_PLATFORM%.zip graphene-shared-%MSVC_PLATFORM% || goto :error

goto :EOF

:error
exit /b 1

Use the latest Meson version with MSVC

ci: Use the latest Meson version with MSVC

We depend on Meson 0.47.0, now, so we need to update the AppVeyor script
that downloads Meson.


@echo off

:: check if we have the .iso file (if we don't have it, the VM won't start!)
if not exist %HOME%\.boot2docker\boot2docker.iso (
  echo boot2docker.iso not found in %HOME%\.boot2docker\, downloading it...
  boot2docker download
)

:: check if "boot2docker-vm" exists already
for /f "usebackq tokens=*" %%l in (`VBoxManage list --long vms`) do (
  if "%%l" == "Name:            boot2docker-vm" (
    echo Found existing boot2docker-vm in VirtualBox!
    goto check
  )
)

:init
echo No existing boot2docker-vm found in VirtualBox, initializing...
boot2docker init --memory=512

:check
:: check if boot2docker is running
for /f "usebackq tokens=*" %%s in (`boot2docker status`) do (
  if %%s == running (
    echo The boot2docker VM is already running, doing nothing
    goto end
  )
)

SETLOCAL

:: make sure we are stopped
echo Making sure the boot2docker VM is stopped...
boot2docker halt

:: check for existence of BK_ROOT env var
if "%BK_ROOT%" == "" (
  echo BK_ROOT env var not set, please make sure to run `set-env.bat` before! Exiting...
  exit /b 1
)

:: replace backward with forward slashes
set BK_ROOT_FWD_SLASH=%BK_ROOT:\=/%
:: convert drive letter to cygwin style (try c, d, e, w)
set BK_ROOT_DRIVE=%BK_ROOT_FWD_SLASH:C:/=/c/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:D:/=/d/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:E:/=/e/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:W:/=/w/%
:: okay, here we go
set BK_ROOT_CYGPATH=%BK_ROOT_DRIVE%

:: add the drive while the VM is still down
echo Adding shared folder "billskitchen" for hostpath %BK_ROOT%
VBoxManage sharedfolder add "boot2docker-vm" --name "billskitchen" --hostpath %BK_ROOT%

:: echo the config for debugging
boot2docker config

:: bring it up
echo Bringing up the boot2docker VM...
boot2docker up

:: mount drive inside vbox
echo Mounting the shared folder inside the VM to %BK_ROOT_CYGPATH%
boot2docker ssh -- sudo mkdir -p %BK_ROOT_CYGPATH%
boot2docker ssh -- sudo mount -t vboxsf billskitchen %BK_ROOT_CYGPATH%

:: set / unset proxy in boot2docker VM
:: for more on proxies, see http://stackoverflow.com/a/29303930/2388971
if "%BK_USE_PROXY%" == "1" (
  echo setting proxy in the boot2docker VM...
  boot2docker ssh "echo 'export HTTP_PROXY=%HTTP_PROXY%; export HTTPS_PROXY=%HTTPS_PROXY%; export NO_PROXY=%NO_PROXY%;' | sudo tee /var/lib/boot2docker/profile"
) else (
  echo making sure no proxy is set in the boot2docker VM...
  boot2docker ssh "sudo rm -rf /var/lib/boot2docker/profile"
)
boot2docker ssh "sudo /etc/init.d/docker restart > /dev/null"
boot2docker ssh "sudo /etc/init.d/docker status"

ENDLOCAL

:: update the DOCKER_HOST as the ip address might change
for /f "usebackq tokens=*" %%s in (`boot2docker ip`) do set b2d_ip=%%s
echo updating DOCKER_HOST env var to "tcp://%b2d_ip%:2376"...
set DOCKER_HOST=tcp://%b2d_ip%:2376

:end

@echo off

:: check if we have the .iso file (if we don't have it, the VM won't start!)
if not exist %HOME%\.boot2docker\boot2docker.iso (
  echo boot2docker.iso not found in %HOME%\.boot2docker\, downloading version 1.7.1...
  curl -L -o %HOME%\.boot2docker\boot2docker.iso https://github.com/boot2docker/boot2docker/releases/download/v1.7.1/boot2docker.iso
)

:: check if "boot2docker-vm" exists already
for /f "usebackq tokens=*" %%l in (`VBoxManage list --long vms`) do (
  if "%%l" == "Name:            boot2docker-vm" (
    echo Found existing boot2docker-vm in VirtualBox!
    goto check
  )
)

:init
echo No existing boot2docker-vm found in VirtualBox, initializing...
boot2docker init --memory=512

:check
:: check if boot2docker is running
for /f "usebackq tokens=*" %%s in (`boot2docker status`) do (
  if %%s == running (
    echo The boot2docker VM is already running, doing nothing
    goto end
  )
)

SETLOCAL

:: make sure we are stopped
echo Making sure the boot2docker VM is stopped...
boot2docker halt

:: check for existence of BK_ROOT env var
if "%BK_ROOT%" == "" (
  echo BK_ROOT env var not set, please make sure to run `set-env.bat` before! Exiting...
  exit /b 1
)

:: replace backward with forward slashes
set BK_ROOT_FWD_SLASH=%BK_ROOT:\=/%
:: convert drive letter to cygwin style (try c, d, e, w)
set BK_ROOT_DRIVE=%BK_ROOT_FWD_SLASH:C:/=/c/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:D:/=/d/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:E:/=/e/%
set BK_ROOT_DRIVE=%BK_ROOT_DRIVE:W:/=/w/%
:: okay, here we go
set BK_ROOT_CYGPATH=%BK_ROOT_DRIVE%

:: add the drive while the VM is still down
echo Adding shared folder "billskitchen" for hostpath %BK_ROOT%
VBoxManage sharedfolder add "boot2docker-vm" --name "billskitchen" --hostpath %BK_ROOT%

:: echo the config for debugging
boot2docker config

:: bring it up
echo Bringing up the boot2docker VM...
boot2docker up

:: mount drive inside vbox
echo Mounting the shared folder inside the VM to %BK_ROOT_CYGPATH%
boot2docker ssh -- sudo mkdir -p %BK_ROOT_CYGPATH%
boot2docker ssh -- sudo mount -t vboxsf billskitchen %BK_ROOT_CYGPATH%

:: set / unset proxy in boot2docker VM
:: for more on proxies, see http://stackoverflow.com/a/29303930/2388971
if "%BK_USE_PROXY%" == "1" (
  echo setting proxy in the boot2docker VM...
  boot2docker ssh "echo 'export HTTP_PROXY=%HTTP_PROXY%; export HTTPS_PROXY=%HTTPS_PROXY%; export NO_PROXY=%NO_PROXY%;' | sudo tee /var/lib/boot2docker/profile"
) else (
  echo making sure no proxy is set in the boot2docker VM...
  boot2docker ssh "sudo rm -rf /var/lib/boot2docker/profile"
)
boot2docker ssh "sudo /etc/init.d/docker restart > /dev/null"
boot2docker ssh "sudo /etc/init.d/docker status"

ENDLOCAL

:: update the DOCKER_HOST as the ip address might change
for /f "usebackq tokens=*" %%s in (`boot2docker ip`) do set b2d_ip=%%s
echo updating DOCKER_HOST env var to "tcp://%b2d_ip%:2376"...
set DOCKER_HOST=tcp://%b2d_ip%:2376

:end

use `curl` instead of `boot2docker download` so we can control the version to download (not just 'latest')


rem
rem CK wrapper for preprocessing the ImageNet dataset using Pillow.
rem
rem See CK LICENSE.txt for licensing details.
rem rem See CK COPYRIGHT.txt for copyright details.
rem rem
rem rem Developer(s):
rem rem - Anton Lokhmotov, anton@dividiti.com, 2020
rem

echo Preprocessing ImageNet using Pillow ...

"%CK_ENV_COMPILER_PYTHON_FILE%" "%PACKAGE_DIR%/preprocess_image_dataset.py" "%CK_ENV_DATASET_IMAGENET_VAL%" "%INSTALL_DIR%"

if %errorlevel% neq 0 (
  echo.
  echo Error: Failed preprocessing ImageNet using Pillow ...
  goto err
)

exit /b 0

:err
exit /b 1

Add Windows wrapper for preprocessing ImageNet using Pillow.


REM
REM Copyright (C) 2011-13, DyND Developers
REM BSD 2-Clause License, see LICENSE.txt
REM
REM This is the master windows build + test script for building
REM the dynd python bindings on jenkins.
REM
REM Jenkins Requirements:
REM   - Anaconda should be installed and in the path
REM   - Use a jenkins build matrix for multiple
REM     platforms/python versions
REM   - Use the XShell plugin to launch this script
REM   - Call the script from the root workspace
REM     directory as ./jenkins/jenkins-build
REM

REM Jenkins has '/' in its workspace. Fix it to '\' to simplify the DOS commands.
set WORKSPACE=%WORKSPACE:/=\%

if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto :amd64
 set MSVC_VERSION=10.0
 set MSVC_VCVARS_PLATFORM=x86
 set MSVC_BUILD_PLATFORM=x86
 set CMAKE_BUILD_TARGET="Visual Studio 10"
goto :notamd64
:amd64
 set MSVC_VERSION=10.0
 set MSVC_VCVARS_PLATFORM=amd64
 set MSVC_BUILD_PLATFORM=x64
 set CMAKE_BUILD_TARGET="Visual Studio 10 Win64"
:notamd64

REM Configure the appropriate visual studio command line environment
if "%PROGRAMFILES(X86)%" == "" set VCDIR=%PROGRAMFILES%\Microsoft Visual Studio %MSVC_VERSION%\VC
if NOT "%PROGRAMFILES(X86)%" == "" set VCDIR=%PROGRAMFILES(X86)%\Microsoft Visual Studio %MSVC_VERSION%\VC
call "%VCDIR%\vcvarsall.bat" %MSVC_VCVARS_PLATFORM%
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on

REM Remove the build subdirectory from last time
rd /q /s build

REM Get libdynd into the libraries subdirectory
REM TODO: Build libdynd in a separate jenkins project,
REM       and use its build artifact here.
call .\jenkins\checkout_libdynd.bat
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Use conda to create a conda environment of the required
REM python version and containing the dependencies.
SET PYENV_PREFIX=%WORKSPACE%\build\pyenv
call .\jenkins\create_conda_pyenv.bat 2.7 %PYENV_PREFIX%
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on
export PATH=%PYENV_PREFIX%;%PYENV_PREFIX%\Scripts;%PATH%

REM Create a fresh visual studio solution with cmake, and do the build/install
cd build
cmake -DCMAKE_INSTALL_PREFIX=install -G %CMAKE_BUILD_TARGET% ..
IF %ERRORLEVEL% NEQ 0 exit /b 1
devenv dynd-python.sln /Build "RelWithDebInfo|%MSVC_BUILD_PLATFORM%"
IF %ERRORLEVEL% NEQ 0 exit /b 1
devenv dynd-python.sln /Build "RelWithDebInfo|%MSVC_BUILD_PLATFORM%" /Project INSTALL
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Run the tests and generate xml results
python -c "import dynd;dynd.test(xunitfile='../test_results.xml', exit=1)"
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Get the version number and process it into a suitable form
FOR /F "delims=" %%i IN ('python -c "import dynd;print(dynd.__version_string__)"') DO set PYDYND_VERSION=%%i
set PYDYND_VERSION=%PYDYND_VERSION:-=_%
set PYDYND_VERSION=%PYDYND_VERSION:~1%

RM Put the conda package by itself in the directory pkgs
cd ..
rd /q /s pkgs
mkdir pkgs
cd pkgs

# Create a conda package from the build
call conda package -p %PYENV_PREFIX% --pkg-name=dynd --pkg-version=%PYDYND_VERSION%
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on

cd ..

exit /b 0

REM
REM Copyright (C) 2011-13, DyND Developers
REM BSD 2-Clause License, see LICENSE.txt
REM
REM This is the master windows build + test script for building
REM the dynd python bindings on jenkins.
REM
REM Jenkins Requirements:
REM   - Anaconda should be installed and in the path
REM   - Use a jenkins build matrix for multiple
REM     platforms/python versions
REM   - Use the XShell plugin to launch this script
REM   - Call the script from the root workspace
REM     directory as ./jenkins/jenkins-build
REM

REM Jenkins has '/' in its workspace. Fix it to '\' to simplify the DOS commands.
set WORKSPACE=%WORKSPACE:/=\%

if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto :amd64
 set MSVC_VERSION=10.0
 set MSVC_VCVARS_PLATFORM=x86
 set MSVC_BUILD_PLATFORM=Win32
 set CMAKE_BUILD_TARGET="Visual Studio 10"
goto :notamd64
:amd64
 set MSVC_VERSION=10.0
 set MSVC_VCVARS_PLATFORM=amd64
 set MSVC_BUILD_PLATFORM=x64
 set CMAKE_BUILD_TARGET="Visual Studio 10 Win64"
:notamd64

REM Configure the appropriate visual studio command line environment
if "%PROGRAMFILES(X86)%" == "" set VCDIR=%PROGRAMFILES%\Microsoft Visual Studio %MSVC_VERSION%\VC
if NOT "%PROGRAMFILES(X86)%" == "" set VCDIR=%PROGRAMFILES(X86)%\Microsoft Visual Studio %MSVC_VERSION%\VC
call "%VCDIR%\vcvarsall.bat" %MSVC_VCVARS_PLATFORM%
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on

REM Remove the build subdirectory from last time
rd /q /s build

REM Get libdynd into the libraries subdirectory
REM TODO: Build libdynd in a separate jenkins project,
REM       and use its build artifact here.
call .\jenkins\checkout_libdynd.bat
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Use conda to create a conda environment of the required
REM python version and containing the dependencies.
SET PYENV_PREFIX=%WORKSPACE%\build\pyenv
call .\jenkins\create_conda_pyenv.bat 2.7 %PYENV_PREFIX%
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on
export PATH=%PYENV_PREFIX%;%PYENV_PREFIX%\Scripts;%PATH%

REM Create a fresh visual studio solution with cmake, and do the build/install
cd build
cmake -DCMAKE_INSTALL_PREFIX=install -G %CMAKE_BUILD_TARGET% ..
IF %ERRORLEVEL% NEQ 0 exit /b 1
devenv dynd-python.sln /Build "RelWithDebInfo|%MSVC_BUILD_PLATFORM%"
IF %ERRORLEVEL% NEQ 0 exit /b 1
devenv dynd-python.sln /Build "RelWithDebInfo|%MSVC_BUILD_PLATFORM%" /Project INSTALL
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Run the tests and generate xml results
python -c "import dynd;dynd.test(xunitfile='../test_results.xml', exit=1)"
IF %ERRORLEVEL% NEQ 0 exit /b 1

REM Get the version number and process it into a suitable form
FOR /F "delims=" %%i IN ('python -c "import dynd;print(dynd.__version_string__)"') DO set PYDYND_VERSION=%%i
set PYDYND_VERSION=%PYDYND_VERSION:-=_%
set PYDYND_VERSION=%PYDYND_VERSION:~1%

RM Put the conda package by itself in the directory pkgs
cd ..
rd /q /s pkgs
mkdir pkgs
cd pkgs

# Create a conda package from the build
call conda package -p %PYENV_PREFIX% --pkg-name=dynd --pkg-version=%PYDYND_VERSION%
IF %ERRORLEVEL% NEQ 0 exit /b 1
echo on

cd ..

exit /b 0

Fix the build target on 32-bit windows jenkins script


:: Copyright 2015 Rouslan Solomakhin
::
:: 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.

copy /Y drmemory-env.bat c:\src\
copy /Y env.bat          c:\src\

pushd c:\src
call env.bat
popd

pushd c:\src\dotfiles\
mkdir %APPDATA\Console\
copy  /Y third_party\console2\console.xml %APPDATA%\Console\
copy  /Y     cvsignore    %USERPROFILE%\.cvsignore
copy  /Y     emacs        %USERPROFILE%\.emacs
copy  /Y     vimrc        %USERPROFILE%\.vimrc
copy  /Y     zshrc        %USERPROFILE%\.zshrc
xcopy /Y/S/I emacs.d      %USERPROFILE%\.emacs.d
xcopy /Y/S/I third_party  %USERPROFILE%\.third_party
xcopy /Y/S/I vim          %USERPROFILE%\vimfiles
popd

git.exe config --global --replace-all alias.br branch
git.exe config --global --replace-all alias.brv "branch -vv"
git.exe config --global --replace-all alias.can "commit -a --amend --no-edit"
git.exe config --global --replace-all alias.co checkout
git.exe config --global --replace-all alias.ls ls-files
git.exe config --global --replace-all alias.st status
git.exe config --global --replace-all alias.sub "submodule update --init --recursive"
git.exe config --global --replace-all color.ui true
git.exe config --global --replace-all core.autocrlf false
git.exe config --global --replace-all core.excludesfile %USERPROFILE%\.cvsignore
git.exe config --global --replace-all core.filemode false
git.exe config --global --replace-all http.cookiefile %USERPROFILE%\.gitcookies
git.exe config --global --replace-all push.default simple
git.exe config --global --replace-all user.name "Rouslan Solomakhin"

pushd %USERPROFILE%\.emacs.d\
emacs.exe -Q --script %HOME%\.third_party\cask\cask-cli.el -- install
popd

:: Copyright 2015 Rouslan Solomakhin
::
:: 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.

copy /Y drmemory-env.bat c:\src\
copy /Y env.bat          c:\src\

pushd c:\src
call env.bat
popd

pushd c:\src\dotfiles\
mkdir %APPDATA\Console\
copy  /Y third_party\console2\console.xml %APPDATA%\Console\
copy  /Y     cvsignore    %USERPROFILE%\.cvsignore
copy  /Y     emacs        %USERPROFILE%\.emacs
copy  /Y     vimrc        %USERPROFILE%\.vimrc
copy  /Y     zshrc        %USERPROFILE%\.zshrc
xcopy /Y/S/I emacs.d      %USERPROFILE%\.emacs.d
xcopy /Y/S/I third_party  %USERPROFILE%\.third_party
xcopy /Y/S/I vim          %USERPROFILE%\vimfiles
popd

git.exe config --global --replace-all alias.br branch
git.exe config --global --replace-all alias.brv "branch -vv"
git.exe config --global --replace-all alias.can "commit -a --amend --no-edit"
git.exe config --global --replace-all alias.co checkout
git.exe config --global --replace-all alias.ls ls-files
git.exe config --global --replace-all alias.st status
git.exe config --global --replace-all alias.sub "submodule update --init --recursive"
git.exe config --global --replace-all color.ui true
git.exe config --global --replace-all core.autocrlf false
git.exe config --global --replace-all core.excludesfile %USERPROFILE%\.cvsignore
git.exe config --global --replace-all core.filemode false
git.exe config --global --replace-all http.cookiefile %USERPROFILE%\.gitcookies
git.exe config --global --replace-all push.default simple
git.exe config --global --replace-all user.name "Rouslan Solomakhin"
git.exe config --global --get user.email > NUL 2>&1
if errorlevel 1 (
  git.exe config --global --replace-all user.email "rouslan.solomakhin@gmail.com"
)

pushd %USERPROFILE%\.emacs.d\
emacs.exe -Q --script %HOME%\.third_party\cask\cask-cli.el -- install
popd

Set user.email if not already set on windows.


@echo on
choco install -y --allowEmptyChecksum firefox googlechrome wget notepadplusplus sublimetext3 mono monodevelop gtksharp visualstudiocode microsoft-build-tools visualstudio2015community p4merge dotnet4.5 ruby nodejs.install stylecop conemu dejavufonts
call refreshenv

wget -c https://cygwin.com/setup-x86_64.exe
setup-x86_64.exe -R "C:\cygwin64" -s http://mirror.switch.ch/ftp/mirror/cygwin/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang,cmake,lua,perl,the_silver_searcher

set script_path=%~dp0
set repo_path=%script_path%\..\
set bash=c:\cygwin64\bin\bash.exe --login -c

for /f "delims=" %%A in ('%bash% "cd `cygpath $HOMEPATH`/dev/dotfiles && git rev-parse --abbrev-ref HEAD"') do set "branch=%%A"
%bash% 'echo "branch is $branch"'
%bash% "cp -vr `cygpath $HOMEPATH`/.ssh $HOME/"
%bash% "export OUTER_CLONE=`cygpath $repo_path` && $script_path/build_insider.sh"

@echo on
choco install -y --allowEmptyChecksum firefox googlechrome wget notepadplusplus sublimetext3 mono monodevelop gtksharp visualstudiocode p4merge dotnet4.5 ruby nodejs.install stylecop conemu dejavufonts ag
call refreshenv

wget -c https://cygwin.com/setup-x86_64.exe
setup-x86_64.exe -R "C:\cygwin64" -s http://mirror.switch.ch/ftp/mirror/cygwin/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang,cmake,lua,perl,the_silver_searcher

set script_path=%~dp0
set repo_path=%script_path%\..\
set bash=c:\cygwin64\bin\bash.exe --login -c

for /f "delims=" %%A in ('%bash% "cd `cygpath $HOMEPATH`/dev/dotfiles && git rev-parse --abbrev-ref HEAD"') do set "branch=%%A"
%bash% 'echo "branch is $branch"'
%bash% "cp -vr `cygpath $HOMEPATH`/.ssh $HOME/"
%bash% "export OUTER_CLONE=`cygpath $repo_path` && $script_path/build_insider.sh"

Add more lightweigth tools instead of full VS suite


@echo off

rem Copyright 2008 (c) Cisco Systems, Inc.

rem This .bat file installs the etch-java-runtime jar file to the local maven
rem repository. It assumes either M2_HOME or MAVEN_HOME is set in the
rem environment to match the maven installation, or "mvn" command is in the
rem search path.

setlocal

rem Define the etch home directory and artifact particulars

set ETCH_HOME=%~dp0..
set GROUP=etch.etch
set ARTIFACT=etch-java-runtime
set VERSION=@EtchVersion@

if "%M2_HOME%" == "" goto try_maven_home
set MVN=%M2_HOME%\bin\mvn.bat
if not exist "%MVN%" goto try_maven_home
goto run_mvn

:try_maven_home
if "%MAVEN_HOME%" == "" goto try_path
set MVN=%MAVEN_HOME%\bin\mvn.bat
if not exist "%MVN%" goto try_path
goto run_mvn

:try_path
set MVN=mvn.bat

:run_mvn
"%MVN%" install:install-file "-Dfile=%ETCH_HOME%\lib\etch-java-runtime-%VERSION%.jar" -DgroupId=%GROUP% -DartifactId=%ARTIFACT% -Dversion=%VERSION% -Dpackaging=jar

@echo off

rem Copyright 2008 (c) Cisco Systems, Inc.

rem This .bat file installs the etch-java-runtime jar file to the local maven
rem repository. It assumes either M2_HOME or MAVEN_HOME is set in the
rem environment to match the maven installation, or "mvn" command is in the
rem search path.

setlocal

rem Define the etch home directory and artifact particulars

set ETCH_HOME=%~dp0..
set GROUP=etch.etch
set ARTIFACTS=etch-ant-plugin, etch-compiler, etch-csharp-compiler, etch-java-compiler, etch-java-runtime, etch-xml-compiler
set VERSION=@EtchVersion@

if "%M2_HOME%" == "" goto try_maven_home
set MVN=%M2_HOME%\bin\mvn.bat
if not exist "%MVN%" goto try_maven_home
goto run_mvn

:try_maven_home
if "%MAVEN_HOME%" == "" goto try_path
set MVN=%MAVEN_HOME%\bin\mvn.bat
if not exist "%MVN%" goto try_path
goto run_mvn

:try_path
set MVN=mvn.bat

:run_mvn
FOR %%A IN (%ARTIFACTS%) DO CALL "%MVN%" install:install-file "-Dfile=%ETCH_HOME%\lib\%%A-%VERSION%.jar" -DgroupId=%GROUP% -DartifactId=%%A -Dversion=%VERSION% -Dpackaging=jar
FOR %%A IN (%ARTIFACTS%) DO CALL "%MVN%" install:install-file "-Dfile=%ETCH_HOME%\lib\%%A-%VERSION%-src.zip" -DgroupId=%GROUP% -DartifactId=%%A -Dversion=%VERSION% -Dpackaging=jar -Dclassifier=sources

fix for ETCH-29: Installing all Maven artifacts along with their sources.

git-svn-id: fadc92a2e5f700a5cbf547f810915d7a82a23cf8@737770 13f79535-47bb-0310-9956-ffa450edef68


cd finder
call cordova build --release android
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ..\my-release-key.keystore platforms\android\ant-build\Finder-release-unsigned.apk alias_name
rm platforms\android\ant-build\Finder.apk
zipalign -v 4 platforms\android\ant-build\Finder-release-unsigned.apk platforms\android\ant-build\Finder.apk

Add cordova deploy

Add cordova deploy