CABSetup - suite to assist with multi-volume setups in NSIS.
Version 1.3.1.0
Written by Duncan McKellar (Mr Inches), January-December 2006, June 2008
The suite operates under the assumption (which I believe is correct), that the
bulk of an NSIS installer that would require multiple source media is a large
number or amount of source files e.g. large data files, rather than a large
amount of NSIS code. Since NSIS installers are very compact, and the plugin
only consumes about 16K (8K compressed) itself, this should prove workable for
most installers.
These large files can be packaged into cabinet sets that span multiple source
media and the accessory code to perform any other actions can be contained
in a relatively small NSIS package placed on the first disk.
If a larger installer is required, it can be packaged into a dataset set with
a small installer to extract it from the source media, pass control to it,
delete the temporary (large) installer as the last step of the small installer
and let InstStub delete the small installer when it completes.
History
=======
1.0.0.0 28 February 2006
Initial Release.
1.1.0.0 07 June 2006
Removed MSVC runtime dependencies.
Fixed bug/design issue that emptied NSIS stack when plugin functions
called. Parameter lists must now end in the '|' character.
Report function now prints text to the Detail text field and log.
Both ExitStub/InstStub and CABSetup.dll use libctiny.lib to replace
the CRT. The library does not need to be distributed with installers
created with CABSetup.
1.2.0.0 26 June 2006 (not released)
Added a progress bar to be displayed during the extraction process.
Currently this only works for the entire dataset i.e. with the /ALL
switch, since it uses the summary report file.
Added /REPORTFILE switch to both functions to support the generation
and use of this summary report.
1.2.3.0 03 October 2006
Added new function, DataSetSize, to retrieve the size of a dataset
from the associated report file.
Changed BuildSetupFile parameters to unify filenames for the report,
directive, and information files. Datasets are now identified by a
dataset name and a path to hold the dataset cabinets; the above files
are named after the dataset name and held in the dataset path.
These are specified through the /DATASET and /DATASETPATH parameters.
Added the option for Compress switch to have a value of "None" to
disable compression.
Updated all scripts to use the new forms of the functions and to include
the mulitple datasets and progress bars.
1.3.0.0 12 December 2006
Added ability to cancel the extraction of a dataset.
Added function to show the extraction rate during the extraction of
a dataset.
Added function to resume the extraction of a dataset that has been
cancelled/stopped.
Extract will now attempt to create the target path if it does not
exist.
1.3.1.0 2 June 2008
Fixed bug that caused installers using Extract to crash on Vista.
Components
===========
The CABSetup suite consists of a number of components that operate together to
support multi-volume NSIS installers.
CABSetup.dll - NSIS plugin for creating multi-volume cabinet sets and
extracting the contents of multi-volume cabinet sets.
Place in your "NSIS\Plugins" directory.
InstStub.exe - CABSetup Installer Stub for multi-volume setups.
Runs the second stage setup (real NSIS package), deletes it
when it completes, and then deletes itself.
stubsetup.nsi - NSIS script to launch InstStub.exe and the real NSIS
package.
_setup.nsi - Example NSIS script of a real NSIS package that uses the
CABSetup plugin and is run by stubsetup.nsi
makesetup.nsi - Example NSIS script for creating a setup cabinet file set.
Usage
-------
The CABSetup plug-in exposes three functions:
BuildSetupFiles - for creating multi-volume/spanning datasets.
Extract - for installing the contents of a dataset.
DataSetSize - for determining the uncompressed size of a dataset.
BuildSetupFiles
---------------
BuildSetupFiles - constructs a Diamond Directive File (.DDF) for use with the
MAKECAB.EXE utility provided with Windows.
Windows XP and 2003 have MAKECAB installed by default, users of other Windows
versions may have to get it from either the SUPPORT.CAB file on the Windows CD
or from the Cabinet SDK from Microsoft.
If you have to install MAKECAB, ensure that it is available via your PATH
before using this function.
CABSetup should work with any version of MAKECAB.EXE.
Usage from NSIS is
BuildSetupFiles /NOUNLOAD /CREATE "/DISKSIZE=xxxx" "/DISK1SIZE=xxxx" \
"/DISKNAME=xxxx" "/CABNAME=xxxx" \
"/DISKDIR=xxxx" "/COMPRESS =xxxx" \
"/DATASET=xxxx" \
"/DATASETPATH=path" |
BuildSetupFiles /NOUNLOAD "/ADD=C:\PROJECT\SOURCE\*.EXE" /S |
BuildSetupFiles /NOUNLOAD /CLOSE |
BuildSetupFiles /NOUNLOAD /MAKEFILES "/TARGET=path" |
BuildSetupFiles /DESTROY |
NOTE: It is very important that the plugin is not unloaded between calls to
each function until the /DESTROY function is called.
This is because the plug-in retains information in a function-global
(local static) variable and this variable is re-initialised if the
library is unloaded and reloaded.
The /NOUNLOAD switch must not be present in the final call otherwise
the NSIS will not be able to delete the plugin and remove the $PLUGINS
directory.
The order that the parameters for an option appear in is not important, but
the format of each option and the order of the options is.
The options are as follows (in the expected order of execution):
/CREATE - starts the creation of a dataset.
Creates the directive file and sets the parameters for the
construction of the dataset.
Many of the following parameters mirror directives that MAKECAB
uses. For further information, consult the MAKECAB documentation.
Parameters are as follows:
/DISKSIZE - sets the size of each cabinet within the set in bytes.
Can be any number that is a multiple of 512, or one of the
following values:
CDROM = 650MB
1.44M = size of a 3 1/2" high density double-sided floppy
1.2M = size of a 5 1/4 HD floppy
720K = size of a 3 1/2" low density double-sided floppy
360K = size of a 3 1/2" low density single-sided floppy
Default value is "CDROM".
/DISK1SIZE - sets the size of the first cabinet within the set in bytes.
Allowed values are the same as for /DISKSIZE.
Setting this parameter will allow you to make room on the
first disk for the NSIS installer package.
This option is not set by default.
/DISKNAME - sets the template for disk names created by the cabinet set.
If an asterisk is present in this field it is replaced
with the current disk number.
Default value is "SETUP#*".
/CABNAME - set the template for the filenames for cabinets created by
the cabinet set.
If
- 1
- 2
- 3
- 4
- 5
- 6
前往页