diff --git a/Examples/makensis.nsi b/Examples/makensis.nsi index 017b96f8..4c7e6b76 100644 --- a/Examples/makensis.nsi +++ b/Examples/makensis.nsi @@ -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 diff --git a/SCons/utils.py b/SCons/utils.py index 04e3837c..5cb5462a 100644 --- a/SCons/utils.py +++ b/SCons/utils.py @@ -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) diff --git a/SConstruct b/SConstruct index 7d495403..a2330af8 100644 --- a/SConstruct +++ b/SConstruct @@ -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