Exclude MS Visual C++ libraries from UPX compression.

This commit is contained in:
Bastian Kleineidam 2011-04-27 18:23:10 +02:00
parent dd542c98e3
commit eced4bdb47
2 changed files with 30 additions and 3 deletions

27
windows/compress.bat Normal file
View file

@ -0,0 +1,27 @@
:: Compressing executables and libraries
:: Copyright (C) 2011 Bastian Kleineidam
:: This program is free software; you can redistribute it and/or modify
:: it under the terms of the GNU General Public License as published by
:: the Free Software Foundation; either version 2 of the License, or
:: (at your option) any later version.
::
:: This program is distributed in the hope that it will be useful,
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
:: GNU General Public License for more details.
::
:: You should have received a copy of the GNU General Public License along
:: with this program; if not, write to the Free Software Foundation, Inc.,
:: 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
set UPX_EXE="C:\Software\upx307w\upx.exe"
:: Do not compress the MS Visual C++ runtime files. Otherwise the
:: program won't run.
if "%1" == "msvcm90.dll" goto :finish
if "%1" == "msvcp90.dll" goto :finish
if "%1" == "msvcr90.dll" goto :finish
%UPX_EXE% "%1" --best
:finish

View file

@ -16,7 +16,6 @@
@echo off
set PYDIR=C:\Python27
set SZ_EXE="C:\Programme\7-Zip\7z.exe"
set UPX_EXE="C:\Software\upx307w\upx.exe"
for /f "usebackq tokens=*" %%a in (`%PYDIR%\python.exe setup.py --version`) do set VERSION="%%a"
set PORTDIR=LinkChecker-%VERSION%
rd /s /q build > nul
@ -28,7 +27,8 @@ echo Building portable distribution
rd /s /q %PORTDIR% > nul
xcopy /e /i dist %PORTDIR%
del %PORTDIR%\omt.iss
echo Compressing executables
for /r %PORTDIR% %%e in (*.pyd,*.dll,*.exe) do %UPX_EXE% "%%e" --best
echo Compressing libraries and executables
for /r %PORTDIR% %%f in (*.pyd,*.dll,*.exe) do call compress.bat "%%f"
echo Generating portable distribution file
%SZ_EXE% a -mx=9 -md=32m LinkChecker-%VERSION%-portable.zip %PORTDIR%
rd /s /q %PORTDIR%