1@setlocal 2@echo off 3 4set D=%~dp0 5set PCBUILD=%D%..\..\PCBuild\ 6 7set HOST= 8set USER= 9set TARGET= 10set DRYRUN=false 11set NOGPG= 12set PURGE_OPTION=/p:Purge=true 13set NOTEST= 14 15:CheckOpts 16if "%1" EQU "-h" goto Help 17if "%1" EQU "-o" (set HOST=%~2) && shift && shift && goto CheckOpts 18if "%1" EQU "--host" (set HOST=%~2) && shift && shift && goto CheckOpts 19if "%1" EQU "-u" (set USER=%~2) && shift && shift && goto CheckOpts 20if "%1" EQU "--user" (set USER=%~2) && shift && shift && goto CheckOpts 21if "%1" EQU "-t" (set TARGET=%~2) && shift && shift && goto CheckOpts 22if "%1" EQU "--target" (set TARGET=%~2) && shift && shift && goto CheckOpts 23if "%1" EQU "--dry-run" (set DRYRUN=true) && shift && goto CheckOpts 24if "%1" EQU "--skip-gpg" (set NOGPG=true) && shift && goto CheckOpts 25if "%1" EQU "--skip-purge" (set PURGE_OPTION=) && shift && godo CheckOpts 26if "%1" EQU "--skip-test" (set NOTEST=true) && shift && godo CheckOpts 27if "%1" EQU "-T" (set NOTEST=true) && shift && godo CheckOpts 28if "%1" NEQ "" echo Unexpected argument "%1" & exit /B 1 29 30if not defined PLINK where plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc" 31if not defined PLINK where /R "%ProgramFiles(x86)%\PuTTY" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc" 32if not defined PLINK where /R "%ProgramFiles(x86)%" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc" 33if not defined PLINK echo Cannot locate plink.exe & exit /B 1 34echo Found plink.exe at %PLINK% 35 36if not defined PSCP where pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc" 37if not defined PSCP where /R "%ProgramFiles(x86)%\PuTTY" pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc" 38if not defined PSCP where /R "%ProgramFiles(x86)%" pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc" 39if not defined PSCP echo Cannot locate pscp.exe & exit /B 1 40echo Found pscp.exe at %PSCP% 41 42if defined NOGPG ( 43 set GPG= 44 echo Skipping GPG signature generation because of --skip-gpg 45) else ( 46 if not defined GPG where gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc" 47 if not defined GPG where /R "%PCBUILD%..\externals\windows-installer" gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc" 48 if not defined GPG echo Cannot locate gpg2.exe. Signatures will not be uploaded & pause 49 echo Found gpg2.exe at %GPG% 50) 51 52call "%PCBUILD%env.bat" > nul 2> nul 53pushd "%D%" 54msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x86 %PURGE_OPTION% 55msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false %PURGE_OPTION% 56if not defined NOTEST ( 57 msbuild /v:m /nologo uploadrelease.proj /t:Test /p:Platform=x86 58 msbuild /v:m /nologo uploadrelease.proj /t:Test /p:Platform=x64 59) 60msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x86 61msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x64 /p:IncludeDoc=false 62popd 63exit /B 0 64 65:Help 66echo uploadrelease.bat --host HOST --user USERNAME [--target TARGET] [--dry-run] [-h] 67echo. 68echo --host (-o) Specify the upload host (required) 69echo --user (-u) Specify the user on the host (required) 70echo --target (-t) Specify the target directory on the host 71echo --dry-run Display commands and filenames without executing them 72echo --skip-gpg Does not generate GPG signatures before uploading 73echo --skip-purge Does not perform CDN purge after uploading 74echo --skip-test (-T) Does not perform post-upload tests 75echo -h Display this help information 76echo. 77