Better NSIS Menu .manifest requirement detection
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6631 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
650ebca347
commit
2a341bc918
3 changed files with 24 additions and 5 deletions
|
@ -58,11 +58,9 @@ if env['PLATFORM'] != 'win32' and WhereIs('wx-config') or \
|
|||
)
|
||||
|
||||
# manifest
|
||||
|
||||
if env.has_key('MSVS_VERSION'):
|
||||
if float(env['MSVS_VERSION'].replace('Exp','')) >= 8.0:
|
||||
manifest = env.SideEffect('%s.exe.manifest' % target, nsis_menu)
|
||||
env.DistributeBin(manifest, alias='install-utils')
|
||||
if env.get('MSVCRT_NEEDSMANIFEST'):
|
||||
manifest = env.SideEffect('%s.exe.manifest' % target, nsis_menu)
|
||||
env.DistributeBin(manifest, alias='install-utils')
|
||||
|
||||
# set directories
|
||||
|
||||
|
|
|
@ -156,7 +156,9 @@ ${MementoSection} "NSIS Core Files (required)" SecCore
|
|||
File ..\COPYING
|
||||
File ..\NSIS.chm
|
||||
File ..\NSIS.exe
|
||||
!verbose push 1
|
||||
File /nonfatal ..\NSIS.exe.manifest
|
||||
!verbose pop
|
||||
|
||||
SetOutPath $INSTDIR\Bin
|
||||
File ..\Bin\makensis.exe
|
||||
|
|
|
@ -23,6 +23,7 @@ defenv['CPP_REQUIRES_STDLIB'] = 0
|
|||
defenv['SUBSYS_CON'] = '/subsystem:console'
|
||||
defenv['SUBSYS_WIN'] = '/subsystem:windows'
|
||||
defenv['MSVCRT_FLAG'] = '/MD'
|
||||
defenv['MSVCRT_NEEDSMANIFEST'] = False
|
||||
defenv['STDCALL'] = '__stdcall'
|
||||
|
||||
msvs_version = float(defenv['MSVS_VERSION'].replace('Exp',''))
|
||||
|
@ -104,6 +105,24 @@ if float(defenv['MSVS_VERSION'].replace('Exp','')) < 8.0:
|
|||
|
||||
conf.Finish()
|
||||
|
||||
# Linking to msvcr?0.dll (/MD) might require a manifest
|
||||
|
||||
confenv = defenv.Clone()
|
||||
conf = confenv.Configure()
|
||||
if msvs_version >= 7.0:
|
||||
conf.env.Append(CCFLAGS = [defenv['MSVCRT_FLAG']])
|
||||
code = """
|
||||
#include <stdlib.h>
|
||||
int main() { return atoi("0"); }
|
||||
"""
|
||||
result = True # TryLink should not fail but default to True just in case so distribution will fail as well
|
||||
if conf.TryLink(code, '.cpp'):
|
||||
import os
|
||||
result = os.path.exists('%s.manifest' % conf.lastTarget)
|
||||
defenv['MSVCRT_NEEDSMANIFEST'] = result
|
||||
conf.Finish()
|
||||
|
||||
|
||||
### unicode
|
||||
tdefenv = defenv.Clone()
|
||||
if tdefenv['UNICODE']:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue