2019-03-29 01:14:25 +03:00
|
|
|
@echo off
|
|
|
|
setlocal
|
|
|
|
|
2020-07-22 00:16:01 +03:00
|
|
|
set DEFAULT_DROP_EXE_LOCATION=%~dp0Out\SelfHost\Drop.App\lib\net45
|
2019-10-01 17:29:08 +03:00
|
|
|
|
|
|
|
if EXIST %DEFAULT_DROP_EXE_LOCATION%\drop.exe (
|
|
|
|
set DROP_EXE_LOCATION=%DEFAULT_DROP_EXE_LOCATION%
|
|
|
|
)
|
|
|
|
|
2019-03-29 01:14:25 +03:00
|
|
|
if NOT DEFINED DROP_EXE_LOCATION (
|
2019-04-10 02:02:06 +03:00
|
|
|
REM Potentiall init.cmd has set the credential provider path to a mapped b-drive. Temporarilly undo this.
|
|
|
|
set OLD_NUGET_CREDENTIALPROVIDERS_PATH=%NUGET_CREDENTIALPROVIDERS_PATH%
|
2020-07-22 00:16:01 +03:00
|
|
|
set NUGET_CREDENTIALPROVIDERS_PATH=
|
|
|
|
|
|
|
|
REM Delete any leftovers, e.g. the exe is missing but other files are still present
|
|
|
|
rmdir /Q /S %~dp0Out\SelfHost\Drop.App
|
|
|
|
|
|
|
|
REM Create the drop app folder, download the latest version and unzip it
|
|
|
|
mkdir %~dp0Out\SelfHost\Drop.App
|
|
|
|
curl "https://artifacts.dev.azure.com/cloudbuild/_apis/drop/client/exe" --output %~dp0Out\SelfHost\Drop.App.zip
|
|
|
|
tar -xf %~dp0Out\SelfHost\Drop.App.zip -C %~dp0Out\SelfHost\Drop.App
|
|
|
|
del %~dp0Out\SelfHost\Drop.App.zip
|
2019-04-10 02:02:06 +03:00
|
|
|
|
2019-10-01 17:29:08 +03:00
|
|
|
set DROP_EXE_LOCATION=%DEFAULT_DROP_EXE_LOCATION%
|
2019-04-10 02:02:06 +03:00
|
|
|
|
|
|
|
REM Restore credential provider path.
|
|
|
|
set NUGET_CREDENTIALPROVIDERS_PATH=%OLD_NUGET_CREDENTIALPROVIDERS_PATH%
|
2019-03-29 01:14:25 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
%DROP_EXE_LOCATION%\drop.exe %*
|
|
|
|
|
|
|
|
endlocal && exit /b 0
|