blob: 796763730a61a068bbe1de2de65643be3d509a07 [file] [log] [blame]
Zachary Ware774ac372015-04-13 12:11:40 -05001@setlocal
2@echo off
3
4set D=%~dp0
5set PCBUILD=%D%..\..\PCBuild\
6
7set HOST=
8set USER=
9set TARGET=
10set DRYRUN=false
11
12:CheckOpts
13if "%1" EQU "-h" goto Help
14if "%1" EQU "-o" (set HOST=%~2) && shift && shift && goto CheckOpts
15if "%1" EQU "--host" (set HOST=%~2) && shift && shift && goto CheckOpts
16if "%1" EQU "-u" (set USER=%~2) && shift && shift && goto CheckOpts
17if "%1" EQU "--user" (set USER=%~2) && shift && shift && goto CheckOpts
18if "%1" EQU "-t" (set TARGET=%~2) && shift && shift && goto CheckOpts
19if "%1" EQU "--target" (set TARGET=%~2) && shift && shift && goto CheckOpts
20if "%1" EQU "--dry-run" (set DRYRUN=true) && shift && goto CheckOpts
21
22if not defined PLINK where plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
23if not defined PLINK where /R "%ProgramFiles(x86)%\PuTTY" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
24if not defined PLINK where /R "%ProgramFiles(x86)%" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
25if not defined PLINK echo Cannot locate plink.exe & exit /B 1
26echo Found plink.exe at %PLINK%
27
28if not defined PSCP where pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
29if not defined PSCP where /R "%ProgramFiles(x86)%\PuTTY" pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
30if not defined PSCP where /R "%ProgramFiles(x86)%" pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
31if not defined PSCP echo Cannot locate pscp.exe & exit /B 1
32echo Found pscp.exe at %PSCP%
33
34if not defined GPG where gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"
35if not defined GPG where /R "%PCBUILD%..\externals" gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"
36if not defined GPG echo Cannot locate gpg2.exe. Signatures will not be uploaded & pause
37echo Found gpg2.exe at %GPG%
38
39call "%PCBUILD%env.bat" > nul 2> nul
40pushd "%D%"
41msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x86
42msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false
43msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x86
44msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x64 /p:IncludeDoc=false
45popd
46exit /B 0
47
48:Help
49echo uploadrelease.bat --host HOST --user USERNAME [--target TARGET] [--dry-run] [-h]
50echo.
51echo --host (-o) Specify the upload host (required)
52echo --user (-u) Specify the user on the host (required)
53echo --target (-t) Specify the target directory on the host
54echo --dry-run Display commands and filenames without executing them
55echo -h Display this help information
56echo.