Archive: makensis-bz and makensis-zzip compare


makensis-bz and makensis-zzip compare
the first test data block to select the best one
the later seems to have the best ratio of all
could you add those feature to makensis
http://mentasm.com/~zed/nsis/makensis_bz.exe
http://mentasm.com/~zed/nsis/makensis_zzip.exe
MakeNSIS v1.44 - Copyright 1999-2001 Nullsoft, Inc.

Portions Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler.
Contributors: nnop@newmail.ru, Ryan Geiss, Andras Varga, Drew Davidson, et al.

Use the /LICENSE switch to view license information.

-=-=-=-=-=-=-=-=-=-=- Processing config -=-=-=-=-=-=-=-=-=-=-
-=-=-=-=-=-=-=-=-=-=- Processing script -=-=-=-=-=-=-=-=-=-=-
Script file: "example1.nsi"
!packhdr: filename="tmp.dat", command="C:\winnt\upx -9 -q tmp.dat"
Name: "Example1"
OutFile: "example1.exe"
InstallDir: "$PROGRAMFILES\Example1"
DirText: "This will install the very simple example1 on your computer. Choose a directory"
Section: "ThisNameIsIgnoredSoWhyBother?"
SetOutPath: "$INSTDIR"
File: "winhlp32.exe" [compress]
@@@ [100kb block] 141357 bytes
@@@ [200kb block] 138972 bytes
@@@ [300kb block] 139635 bytes
@@@ [400kb block] 139635 bytes
@@@ [500kb block] 139635 bytes
@@@ [600kb block] 139635 bytes
@@@ [700kb block] 139635 bytes
@@@ [800kb block] 139635 bytes
@@@ [900kb block] 139635 bytes
@@@ [200kb block] 138972 bytes *** BEST!
138972/269584 bytes
File: "winhelp.exe" [compress]
@@@ [100kb block] 133528 bytes
@@@ [200kb block] 131662 bytes
@@@ [300kb block] 128850 bytes
@@@ [400kb block] 128850 bytes
@@@ [500kb block] 128850 bytes
@@@ [600kb block] 128850 bytes
@@@ [700kb block] 128850 bytes
@@@ [800kb block] 128850 bytes
@@@ [900kb block] 128850 bytes
@@@ [300kb block] 128850 bytes *** BEST!
Ultimate Packer for eXecutables
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
UPX 1.20w Markus F.X.J. Oberhumer & Laszlo Molnar May 23rd 2001

File size Ratio Format Name
-------------------- ------ ----------- -----------
39424 -> 22016 55.84% win32/pe tmp.dat

Packed 1 file.
128850/261616 bytes
SectionEnd
Locating install icon after compress: found at offset 20590

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Output: "example1.exe"

@@@ [100kb block] 315 bytes *** BEST!
Install: 1 section (1 required).
Install: 4 instructions, 191 byte string table.

EXE header size: 22016 / 39424 bytes
Install code+strings: 351 / 491 bytes
Install data: 267830 / 531208 bytes
CRC (0x4E0B8DB7): 4 / 4 bytes
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Total size: 290201 / 571127 bytes (50.8%)

MakeNSIS v1.44 - Copyright 1999-2001 Nullsoft, Inc.

Portions Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler.
Contributors: nnop@newmail.ru, Ryan Geiss, Andras Varga, Drew Davidson, et al.

Use the /LICENSE switch to view license information.

-=-=-=-=-=-=-=-=-=-=- Processing config -=-=-=-=-=-=-=-=-=-=-
-=-=-=-=-=-=-=-=-=-=- Processing script -=-=-=-=-=-=-=-=-=-=-
Script file: "example1.nsi"
!packhdr: filename="tmp.dat", command="C:\winnt\upx -9 -q tmp.dat"
Name: "Example1"
OutFile: "example1.exe"
InstallDir: "$PROGRAMFILES\Example1"
DirText: "This will install the very simple example1 on your computer. Choose a directory"
Section: "ThisNameIsIgnoredSoWhyBother?"
SetOutPath: "$INSTDIR"
File: "winhlp32.exe" [compress] 132987/269584 bytes
File: "winhelp.exe" [compress] Ultimate Packer for eXecutables
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
UPX 1.20w Markus F.X.J. Oberhumer & Laszlo Molnar May 23rd 2001

File size Ratio Format Name
-------------------- ------ ----------- -----------
35840 -> 20992 58.57% win32/pe tmp.dat

Packed 1 file.
126191/261616 bytes
SectionEnd
Locating install icon after compress: found at offset 19566

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Output: "example1.exe"
Install: 1 section (1 required).
Install: 4 instructions, 191 byte string table.

EXE header size: 20992 / 35840 bytes
Install code+strings: 281 / 503 bytes
Install data: 259186 / 531208 bytes
CRC (0x5F4686A0): 4 / 4 bytes
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Total size: 280463 / 567555 bytes (49.4%)

MakeNSIS v1.70 - Copyright 1999-2001 Nullsoft, Inc.

Portions Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler.
Contributors: nnop@newmail.ru, Ryan Geiss, Andras Varga, Drew Davidson, Peter Windridge, Dave Laundon, et al.

-=-=-=-=-=-=-=-=-=-=- Processing config -=-=-=-=-=-=-=-=-=-=-
-=-=-=-=-=-=-=-=-=-=- Processing script -=-=-=-=-=-=-=-=-=-=-
Script file: "example1.nsi"
!packhdr: filename="tmp.dat", command="C:\winnt\upx -9 -q tmp.dat"
Name: "Example1"
OutFile: "example1.exe"
InstallDir: "$PROGRAMFILES\Example1"
DirText: "This will install the very simple example1 on your computer. Choose a directory" "" ""
Section: "ThisNameIsIgnoredSoWhyBother?"
SetOutPath: "$INSTDIR"
File: "winhlp32.exe" [compress] 143781/269584 bytes
File: "winhelp.exe" [compress] Ultimate Packer for eXecutables
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
UPX 1.20w Markus F.X.J. Oberhumer & Laszlo Molnar May 23rd 2001

File size Ratio Format Name
-------------------- ------ ----------- -----------
34816 -> 20992 60.29% win32/pe tmp.dat

Packed 1 file.
137236/261616 bytes
SectionEnd
Locating install icon after compress: found at offset 19566

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Output: "example1.exe"
Install: 1 section (1 required).
Install: 4 instructions (96 bytes), 532 byte string table.

EXE header size: 20992 / 34816 bytes
Install code+strings: 516 / 928 bytes
Install data: 281025 / 531208 bytes
CRC (0xB3473048): 4 / 4 bytes
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Total size: 302537 / 566956 bytes (53.4%)


The compression modes I am adding in 1.9 perform better than either of these versions, and you will be able to choose which method to use.

-Justin


To Justin
I am confused
I wrote SetCompress auto
SetDatablockOptimize on
in my .nsi
It seems that v1.9a execute compress Install data at last step
but neither Uninstall code+data+strings norInstall code+strings is compressed.
I noticed you add following lines to config.h, do you compiled v1.9a with those defination?
could you tell me what shall I do?
config.h
//...
// NSIS_CONFIG_COMPRESSION_SUPPORT enables support for making installers
// that use compression (recommended).

#define NSIS_CONFIG_COMPRESSION_SUPPORT
// compression specific options

// NSIS_COMPRESS_USE_ZLIB uses deflate compression, which is very good.
// this mode uses the least amount of overhead on the runtime side, in
// terms of memory usage, disk footprint, and speed.
//#define NSIS_COMPRESS_USE_ZLIB

// NSIS_COMPRESS_USE_BZIP2 uses bzip2 compression, which can be better
// than deflate, especially when using NSIS_COMPRESS_WHOLE. bzip2 is much
// slower to decompress, and uses a LOT more memory at runtime. The disk
// footprint using bzip2 is also approximately 6kb more than zlib.
#define NSIS_COMPRESS_USE_BZIP2
// if NSIS_COMPRESS_BZIP2_SMALLMODE is defined, bzip2's decompressor uses
// bzip2's alternative decompression method that uses a lot less memory, at
// the expense of speed. not recommended.
//#define NSIS_COMPRESS_BZIP2_SMALLMODE

// NSIS_COMPRESS_WHOLE makes all install data compressed together. Runtime
// requirements are increased, but potential for compression is as well.
// Adds approximately 1kb of disk footprint, and requires that the installer
// create a (potentially large) temporary file in the temp directory.
#define NSIS_COMPRESS_WHOLE
//...
v1.9a
Output: "sarpins1.exe"
Install: 4 sections (2 required, 1 divider).
Install: 40 instructions (960 bytes), 3051 byte string table.
Uninstall: 17 instructions (408 bytes), 520 byte string table.

EXE header size: 22528 / 39936 bytes
Install code+strings: 4351 / 4351 bytes
Install data: 1346648 / 1346648 bytes
[compress]
Uninstall code+data+strings: 1818 / 1818 bytes

Total size post compress: 1113727 / 1392753 bytes (80.0%)
v1.8
Output: "sarpins1.exe"
Install: 4 sections (2 required, 1 divider).
Install: 40 instructions (960 bytes), 3051 byte string table.
Uninstall: 17 instructions (408 bytes), 520 byte string table.

EXE header size: 20992 / 34816 bytes
Install code+strings: 2371 / 4351 bytes
Install data: 1047429 / 1346658 bytes
Uninstall code+data+strings: 846 / 1323 bytes

Total size: 1071638 / 1387148 bytes (77.3%)


When using the whole compression mode of 1.9a, the compression happens last, and groups all the data together (hence you can't split out how big the compressed size of various elements are)..

-Justin


Thanks
I still regreted that the ratio is lower than that of v1.8


Well, that's an issue with bzip2 and that data then I suppose. You can of course switch it back to zlib, or file-based as opposed to whole compression. As for zzip, we can't use it since its license (LGPL) is incompatible with ours (BSDish).

-Justin