added CODESIGNER option to enable executable digital signing
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4221 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
09d17aff6f
commit
2a8231fbdb
1 changed files with 17 additions and 0 deletions
17
SConstruct
17
SConstruct
|
@ -82,6 +82,7 @@ opts.Add(ListOption('SKIPSTUBS', 'A list of stubs that will not be built', 'none
|
|||
opts.Add(ListOption('SKIPPLUGINS', 'A list of plug-ins that will not be built', 'none', plugins))
|
||||
opts.Add(ListOption('SKIPUTILS', 'A list of utilities that will not be built', 'none', utils))
|
||||
opts.Add(ListOption('SKIPMISC', 'A list of plug-ins that will not be built', 'none', misc))
|
||||
opts.Add(PathOption('CODESIGNER', 'A program used to sign executables', None))
|
||||
opts.Update(defenv)
|
||||
|
||||
Help(opts.GenerateHelpText(defenv))
|
||||
|
@ -102,18 +103,22 @@ def Distribute(dir, files):
|
|||
defenv.Install('$ZIPDISTDIR/%s' % dir, files)
|
||||
defenv.Install('$INSTDISTDIR/%s' % dir, files)
|
||||
defenv.Install('$TESTDISTDIR/%s' % dir, files)
|
||||
|
||||
if defenv.has_key('PREFIX') and defenv['PREFIX']:
|
||||
ins = defenv.Install('$PREFIX/%s' % dir, files)
|
||||
return ins
|
||||
|
||||
return []
|
||||
|
||||
def DistributeAs(path, file):
|
||||
defenv.InstallAs('$ZIPDISTDIR/%s' % path, file)
|
||||
defenv.InstallAs('$INSTDISTDIR/%s' % path, file)
|
||||
defenv.InstallAs('$TESTDISTDIR/%s' % path, file)
|
||||
|
||||
if defenv.has_key('PREFIX') and defenv['PREFIX']:
|
||||
ins = defenv.InstallAs('$PREFIX/%s' % path, file)
|
||||
return ins
|
||||
|
||||
return []
|
||||
|
||||
def DistributeExamples(dir, examples):
|
||||
|
@ -125,11 +130,18 @@ def DistributeDocs(dir, docs):
|
|||
def DistributeContribs(dir, contribs):
|
||||
return Distribute('Contrib/%s' % dir, contribs)
|
||||
|
||||
def Sign(targets):
|
||||
if defenv.has_key('CODESIGNER'):
|
||||
for t in targets:
|
||||
a = defenv.Action('$CODESIGNER "%s"' % t.path)
|
||||
defenv.AddPostAction(t, a)
|
||||
|
||||
defenv.Distribute = Distribute
|
||||
defenv.DistributeAs = DistributeAs
|
||||
defenv.DistributeExamples = DistributeExamples
|
||||
defenv.DistributeDocs = DistributeDocs
|
||||
defenv.DistributeContribs = DistributeContribs
|
||||
defenv.Sign = Sign
|
||||
|
||||
######################################################################
|
||||
####### Environments ###
|
||||
|
@ -200,6 +212,7 @@ installer_target = defenv.Command('nsis-${VERSION}.exe',
|
|||
'$INSTDISTDIR' + os.sep + 'makensis$PROGSUFFIX ' +
|
||||
'/DOUTFILE=$TARGET.abspath $INSTVER $SOURCE')
|
||||
defenv.Depends(installer_target, '$INSTDISTDIR')
|
||||
defenv.Sign(installer_target)
|
||||
defenv.Alias('dist-installer', installer_target)
|
||||
|
||||
AlwaysBuild(defenv.AddPostAction(installer_target, Delete('$INSTDISTDIR')))
|
||||
|
@ -314,6 +327,8 @@ def BuildPlugin(target, source, libs, examples = None, docs = None,
|
|||
defenv.Alias(target, plugin)
|
||||
defenv.Alias('plugins', plugin)
|
||||
|
||||
defenv.Sign(plugin)
|
||||
|
||||
CleanMap(env, plugin, target)
|
||||
|
||||
env.Distribute('Plugins', plugin)
|
||||
|
@ -348,6 +363,8 @@ def BuildUtil(target, source, libs, entry = None, res = None,
|
|||
defenv.Alias(target, util)
|
||||
defenv.Alias('utils', util)
|
||||
|
||||
defenv.Sign(util)
|
||||
|
||||
CleanMap(env, util, target)
|
||||
|
||||
if install is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue