1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
# Script to sign exe and dll files from WB
import os
#import zipfile
import sys
import shutil
user = sys.argv[1]
passw = sys.argv[2]
if not os.path.exists("MySQLWorkbench.exe"):
print "This script must be executed from the build output directory (bin\Release)"
sys.exit(1)
exclude_files=[
"python.exe",
"python_d.exe",
"MySQLWorkbench.vshost.exe",
"WBTests.exe",
"Aga.Controls.dll",
"HTMLRenderer.dll",
"iconv.dll",
"intl.dll",
"libcairo.dll",
"libctemplate.dll",
"libglib-2.0-0.dll",
"libgmodule-2.0-0.dll",
"libgobject-2.0-0.dll",
"libgthread-2.0-0.dll",
"libpng12-0.dll",
"libxml2.dll",
"pcre.dll",
"python27_d.dll",
"python27.dll",
"Scintilla.dll",
"sqlite3.dll",
"zlib1.dll"]
files = [f for f in os.listdir(".") if (f.endswith(".exe") or f.endswith(".dll")) and f not in exclude_files]
#print "Creating input zip file"
# Create input zip file
#z = zipfile.ZipFile("../MySQLWorkbench", 'w', zipfile.ZIP_DEFLATED)
#for f in files:
# print "Zipping", f
# z.write(f, f)
#z.close()
# Sign everything
print "Sending to codesign server..."
for f in files:
#os.system("java -Xmx1024m -jar ../../../mysql-gui-win-res/bin/Client.jar -user %s -pass %s -file_to_sign ../MySQLWorkbench -signed_location ../signed -type batchsign -sign_method microsoft" % (user, passw))
os.system("java -Xmx1024m -jar ../../../mysql-gui-win-res/bin/Client.jar -user %s -pass %s -file_to_sign %s -signed_location ../signed -sign_method microsoft" % (user, passw, f))
shutil.copy("../signed/%s" % f, f)
print "Unpacking signed files"
# Unpack back everything
#z = zipfile.ZipFile("../signed/MySQLWorkbench", 'r')
#for f in z.namelist():
# print "Replacing", f
# o = open(f, 'wb+')
# o.write(z.read(f))
# o.close()
#z.close()
#os.remove("../MySQLWorkbench")
#os.remove("../signed/MySQLWorkbench")
print "Done"
|