Use appropriate zlib DLL depending on version.

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6255 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
golubdr 2012-08-22 23:32:05 +00:00
parent 4247359df9
commit 957653f389
3 changed files with 11 additions and 1 deletions

View file

@ -123,7 +123,11 @@ ${MementoSection} "NSIS Core Files (required)" SecCore
File /nonfatal ..\NSIS.exe.manifest
SetOutPath $INSTDIR\Bin
File ..\Bin\makensis.exe
!ifdef USE_NEW_ZLIB
File ..\Bin\zlib.dll
!else
File ..\Bin\zlib1.dll
!endif
IfFileExists $INSTDIR\nsisconf.nsi "" +2
Rename $INSTDIR\nsisconf.nsi $INSTDIR\nsisconf.nsh

View file

@ -22,8 +22,10 @@ def AddZLib(env, platform, alias='install-utils'):
env.Append(CPPPATH = env['ZLIB_W32_INC'])
env.Append(LIBPATH = env['ZLIB_W32_LIB'])
zlib = ['zdll', 'z']
if 'ZLIB_W32_DLL' in env:
if 'ZLIB_W32_DLL' in env and env['ZLIB_W32_DLL']:
env.DistributeW32Bin(env['ZLIB_W32_DLL'], alias=alias)
if 'ZLIB_W32_NEW_DLL' in env and env['ZLIB_W32_NEW_DLL']:
env.DistributeW32Bin(env['ZLIB_W32_NEW_DLL'], alias=alias)
else:
print 'Please specify folder of zlib for Win32 via ZLIB_W32'
Exit(1)

View file

@ -430,6 +430,8 @@ if 'ZLIB_W32' in defenv:
break
defenv['ZLIB_W32_DLL'] = defenv.FindFile('zlib1.dll',
[defenv['ZLIB_W32'], defenv['ZLIB_W32_LIB']])
defenv['ZLIB_W32_NEW_DLL'] = defenv.FindFile('zlib.dll',
[defenv['ZLIB_W32'], defenv['ZLIB_W32_LIB']])
tools = defenv['TOOLS']
@ -484,6 +486,8 @@ inst_env['NSISCONFDIR'] = os.path.abspath(str(defenv['INSTDISTDIR']))
def build_installer(target, source, env):
cmdline = FindMakeNSIS(env, str(env['INSTDISTDIR'])) + ' %sDOUTFILE=%s %s' % (optchar, target[0].abspath, env['INSTVER'])
if 'ZLIB_W32_NEW_DLL' in env and env['ZLIB_W32_NEW_DLL']:
cmdline += ' %sDUSE_NEW_ZLIB' % optchar
cmd = env.Command(None, source, cmdline + ' $SOURCE')
AlwaysBuild(cmd)
# Comment out the following if you want to see the installation directory