FunctionEnd Function .onInstFailed Banner::destroy ${UAC.Unload} UAC::Exec '' '"$INSTDIR\${PRODUCT_NAME}.exe" --launch-bt --FINISHED_UPDATE' '' '' FunctionEnd ''' % (product_version, outfile, baseFolder) file=open('windows\\build\\updater.nsi','w') file.write(nsis) file.close() print('Building Installer') p = subprocess.Popen('"C:\\Program Files\\NSIS\\makensis.exe" updater.nsi', stdout=subprocess.PIPE, shell=True, cwd='windows\\build') print p.communicate()[0] exitStat = p.wait() print("Creating current_version.txt") fileHash = Crypto.hash_file_data("windows\\build\\%s" % (outfile)) f = open("windows\\build\\current_version.txt", "wb") f.write(Globals.VERSION + "\n\n") f.write(fileHash + "\n\n") f.write(versionDescription) f.close() print("uploading") #p = subprocess.Popen(['C:\\Program Files\\winscp\\winscp418.exe', "/console", "/command", "open %s" % (WINSCP_ADDRESS), "put %s\\%s %s" % (os.getcwdu(), LOCAL_FILE_NAME, REMOTE_FILE_NAME), "exit"], cwd="C:\\Program Files\\winscp") #x = p.wait() print("all done")
Banner::destroy ${UAC.Unload} UAC::Exec '' '"$INSTDIR\${PRODUCT_NAME}.exe" --launch-bt --FINISHED_UPDATE' '' '' FunctionEnd ''' % (product_version, outfile, baseFolder) file = open('windows\\build\\updater.nsi', 'w') file.write(nsis) file.close() print('Building Installer') p = subprocess.Popen('"C:\\Program Files\\NSIS\\makensis.exe" updater.nsi', stdout=subprocess.PIPE, shell=True, cwd='windows\\build') print p.communicate()[0] exitStat = p.wait() print("Creating current_version.txt") fileHash = Crypto.hash_file_data("windows\\build\\%s" % (outfile)) f = open("windows\\build\\current_version.txt", "wb") f.write(Globals.VERSION + "\n\n") f.write(fileHash + "\n\n") f.write(versionDescription) f.close() print("uploading") #p = subprocess.Popen(['C:\\Program Files\\winscp\\winscp418.exe', "/console", "/command", "open %s" % (WINSCP_ADDRESS), "put %s\\%s %s" % (os.getcwdu(), LOCAL_FILE_NAME, REMOTE_FILE_NAME), "exit"], cwd="C:\\Program Files\\winscp") #x = p.wait() print("all done")
def sign(self, msg): """Sign the msg with key, return the result as string""" return self.key.sign(Crypto.make_hash(msg), 'sha256')
def verify(self, msg, sig): """Return boolean of whether sig is a valid signature of msg with this key.""" Basic.validate_type(msg, types.StringType) Basic.validate_type(sig, types.StringType) return self.key.verify(Crypto.make_hash(msg), sig, 'sha256')
SectionEnd ''' % (product_version, outfile, mui_icon, mui_unicon, baseFolder, SURVEY_ADDRESS) file=open(os.path.join(BUILD_DIR, "installer.nsi"),'w') file.write(nsis) file.close() print('Building Installer') #os.chdir('windows\\build') p = subprocess.Popen('makensis.exe installer.nsi', stdout=subprocess.PIPE, shell=True, cwd=BUILD_DIR) print p.communicate()[0] exitStat = p.wait() assert exitStat == 0 print("Creating current_version.txt") fileHash = Crypto.hash_file_data(os.path.join(BUILD_DIR, outfile)) f = open(os.path.join(BUILD_DIR, "releases", "current_version.txt"), "wb") f.write(Globals.VERSION + "\n\n") f.write(fileHash + "\n\n") f.write(versionDescription) f.close() if DO_ARCHIVE: #archive the build: print("Archiving release") archiveLocation = os.path.join(BUILD_DIR, "releases", product_version) if os.path.exists(archiveLocation): shutil.rmtree(archiveLocation, True) shutil.move(os.path.join(BUILD_DIR, "release"), archiveLocation) archiveBuild = os.path.join(BUILD_DIR, "releases", outfile) if os.path.exists(archiveBuild):