diff --git a/Tools/msi/generate_md5.py b/Tools/msi/generate_md5.py new file mode 100644 index 00000000000..9e4c14731bd --- /dev/null +++ b/Tools/msi/generate_md5.py @@ -0,0 +1,27 @@ +import hashlib +import os +import sys + +def main(): + filenames, hashes, sizes = [], [], [] + + for file in sys.argv[1:]: + if not os.path.isfile(file): + continue + + with open(file, 'rb') as f: + data = f.read() + md5 = hashlib.md5() + md5.update(data) + filenames.append(os.path.split(file)[1]) + hashes.append(md5.hexdigest()) + sizes.append(str(len(data))) + + print('{:40s} {:<32s} {:<9s}'.format('File', 'MD5', 'Size')) + for f, h, s in zip(filenames, hashes, sizes): + print('{:40s} {:>32s} {:>9s}'.format(f, h, s)) + + + +if __name__ == "__main__": + sys.exit(int(main() or 0)) diff --git a/Tools/msi/uploadrelease.bat b/Tools/msi/uploadrelease.bat index c91d229475e..37091964cca 100644 --- a/Tools/msi/uploadrelease.bat +++ b/Tools/msi/uploadrelease.bat @@ -20,19 +20,28 @@ if "%1" EQU "--target" (set TARGET=%~2) && shift && shift && goto CheckOpts if "%1" EQU "--dry-run" (set DRYRUN=true) && shift && goto CheckOpts if not defined PLINK where plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc" +if not defined PLINK where /R "%ProgramFiles(x86)%\PuTTY" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc" if not defined PLINK where /R "%ProgramFiles(x86)%" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc" if not defined PLINK echo Cannot locate plink.exe & exit /B 1 echo Found plink.exe at %PLINK% if not defined PSCP where pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc" +if not defined PSCP where /R "%ProgramFiles(x86)%\PuTTY" pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc" if not defined PSCP where /R "%ProgramFiles(x86)%" pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc" if not defined PSCP echo Cannot locate pscp.exe & exit /B 1 echo Found pscp.exe at %PSCP% +if not defined GPG where gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc" +if not defined GPG where /R "%PCBUILD%..\externals" gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc" +if not defined GPG echo Cannot locate gpg2.exe. Signatures will not be uploaded & pause +echo Found gpg2.exe at %GPG% + call "%PCBUILD%env.bat" > nul 2> nul pushd "%D%" msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x86 msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false +msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x86 +msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x64 /p:IncludeDoc=false popd exit /B 0 diff --git a/Tools/msi/uploadrelease.proj b/Tools/msi/uploadrelease.proj index 56aff4ace5a..dea37566716 100644 --- a/Tools/msi/uploadrelease.proj +++ b/Tools/msi/uploadrelease.proj @@ -38,6 +38,17 @@ + + + + + + + %(File.CopyTo) + + + + - + + + + + + + + +