mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Faster signing of windows installers
This commit is contained in:
parent
f53daffda9
commit
710f6fc94d
@ -39,18 +39,6 @@ class Win32(WinBase):
|
||||
def msi64(self):
|
||||
return installer_name('msi', is64bit=True)
|
||||
|
||||
def sign_msi(self):
|
||||
import xattr
|
||||
print ('Signing installers ...')
|
||||
sign64 = False
|
||||
msi64 = self.msi64
|
||||
if os.path.exists(msi64) and 'user.signed' not in xattr.list(msi64):
|
||||
subprocess.check_call(['scp', msi64, self.VM_NAME +
|
||||
':build/%s/%s'%(__appname__, msi64)])
|
||||
sign64 = True
|
||||
subprocess.check_call(['ssh', self.VM_NAME, '~/sign.sh'], shell=False)
|
||||
return sign64
|
||||
|
||||
def do_dl(self, installer, errmsg):
|
||||
subprocess.check_call(('scp',
|
||||
'%s:build/%s/%s'%(self.VM_NAME, __appname__, installer), 'dist'))
|
||||
@ -62,14 +50,8 @@ class Win32(WinBase):
|
||||
installer = self.installer()
|
||||
if os.path.exists('build/winfrozen'):
|
||||
shutil.rmtree('build/winfrozen')
|
||||
sign64 = self.sign_msi()
|
||||
if sign64:
|
||||
self.do_dl(self.msi64, 'Failed to d/l signed 64 bit installer')
|
||||
import xattr
|
||||
xattr.set(self.msi64, 'user.signed', 'true')
|
||||
|
||||
self.do_dl(installer, 'Failed to freeze')
|
||||
|
||||
installer = 'dist/%s-portable-installer-%s.exe'%(__appname__, __version__)
|
||||
self.do_dl(installer, 'Failed to get portable installer')
|
||||
|
||||
|
@ -91,6 +91,7 @@ class Win32Freeze(Command, WixMixIn):
|
||||
if not is64bit:
|
||||
self.build_portable()
|
||||
self.build_portable_installer()
|
||||
self.sign_installers()
|
||||
|
||||
def remove_CRT_from_manifests(self):
|
||||
'''
|
||||
@ -488,6 +489,17 @@ class Win32Freeze(Command, WixMixIn):
|
||||
|
||||
subprocess.check_call([LZMA + r'\bin\elzma.exe', '-9', '--lzip', name])
|
||||
|
||||
def sign_installers(self):
|
||||
self.info('Signing installers...')
|
||||
files = glob.glob(self.j('dist', '*.msi')) + glob.glob(self.j('dist',
|
||||
'*.exe'))
|
||||
if not files:
|
||||
raise ValueError('No installers found')
|
||||
subprocess.check_call(['signtool.exe', 'sign', '/a', '/d',
|
||||
'calibre - E-book management', '/du',
|
||||
'http://calibre-ebook.com', '/t',
|
||||
'http://timestamp.verisign.com/scripts/timstamp.dll'] + files)
|
||||
|
||||
def add_dir_to_zip(self, zf, path, prefix=''):
|
||||
'''
|
||||
Add a directory recursively to the zip file with an optional prefix.
|
||||
|
Loading…
x
Reference in New Issue
Block a user