mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Digitally sign the windows .msi installer
This commit is contained in:
parent
d02f080e09
commit
7aafb31929
@ -6,11 +6,13 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import os, shutil, subprocess
|
import os, shutil, subprocess, re
|
||||||
|
|
||||||
from setup import Command, __appname__, __version__
|
from setup import Command, __appname__, __version__
|
||||||
from setup.installer import VMInstaller
|
from setup.installer import VMInstaller
|
||||||
|
|
||||||
|
SIGNTOOL = r'C:\cygwin\home\kovid\sign.bat'
|
||||||
|
|
||||||
class Win(Command):
|
class Win(Command):
|
||||||
|
|
||||||
description = 'Build windows binary installers'
|
description = 'Build windows binary installers'
|
||||||
@ -34,10 +36,19 @@ class Win32(VMInstaller):
|
|||||||
INSTALLER_EXT = 'msi'
|
INSTALLER_EXT = 'msi'
|
||||||
SHUTDOWN_CMD = ['shutdown.exe', '-s', '-f', '-t', '0']
|
SHUTDOWN_CMD = ['shutdown.exe', '-s', '-f', '-t', '0']
|
||||||
|
|
||||||
|
def sign_msi(self):
|
||||||
|
raw = open(self.VM).read()
|
||||||
|
vmx = re.search(r'''launch_vmware\(['"](.+?)['"]''', raw).group(1)
|
||||||
|
subprocess.check_call(['vmrun', '-T', 'ws', '-gu', 'kovid', '-gp',
|
||||||
|
"et tu brutus", 'runProgramInGuest', vmx, 'cmd.exe', '/C',
|
||||||
|
r'C:\cygwin\home\kovid\sign.bat'])
|
||||||
|
|
||||||
def download_installer(self):
|
def download_installer(self):
|
||||||
installer = self.installer()
|
installer = self.installer()
|
||||||
if os.path.exists('build/winfrozen'):
|
if os.path.exists('build/winfrozen'):
|
||||||
shutil.rmtree('build/winfrozen')
|
shutil.rmtree('build/winfrozen')
|
||||||
|
self.sign_msi()
|
||||||
|
|
||||||
subprocess.check_call(('scp',
|
subprocess.check_call(('scp',
|
||||||
'xp_build:build/%s/%s'%(__appname__, installer), 'dist'))
|
'xp_build:build/%s/%s'%(__appname__, installer), 'dist'))
|
||||||
if not os.path.exists(installer):
|
if not os.path.exists(installer):
|
||||||
|
@ -23,7 +23,6 @@ SW = r'C:\cygwin\home\kovid\sw'
|
|||||||
IMAGEMAGICK = os.path.join(SW, 'build', 'ImageMagick-6.7.6',
|
IMAGEMAGICK = os.path.join(SW, 'build', 'ImageMagick-6.7.6',
|
||||||
'VisualMagick', 'bin')
|
'VisualMagick', 'bin')
|
||||||
CRT = r'C:\Microsoft.VC90.CRT'
|
CRT = r'C:\Microsoft.VC90.CRT'
|
||||||
SIGNTOOL = r'C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\signtool.exe'
|
|
||||||
|
|
||||||
VERSION = re.sub('[a-z]\d+', '', __version__)
|
VERSION = re.sub('[a-z]\d+', '', __version__)
|
||||||
WINVER = VERSION+'.0'
|
WINVER = VERSION+'.0'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user