Cake.SevenZip Namespace

Class Types

Class Summary
AddCommand Adds files to archive. (Command: a).
AddCommandBuilder Builder for AddCommand.
ArgumentArchiveBuilder Extensions for all Builders that support IHaveArgumentArchive.
ArgumentDirectoriesBuilder Extensions for all Builders that support IHaveArgumentDirectories.
ArgumentFilesBuilder Extensions for all Builders that support IHaveArgumentFiles.
BaseAddLikeSyntaxCommand BaseClass for add,update,delete.
BaseBoolSwitch BaseClass for simple boolean switches.
BaseOutputBuilder<TBuilder, TCommand, TOutput> Base for builders that support OutputCommand<T>.
BaseSwitchCollection<T> Base for for switches that can be given multiple times. An example is ISupportSwitchExcludeFilenames (-x!*.pdf -x!*.xml) which uses SwitchExcludeFilenameCollection (which implements this BaseCollection) to set multiple SwitchExcludeFilename.
CommandBuilder Builder for all ICommands. Do NOT call In...Mode() multiple times.
DeleteCommand Deletes files from the archive. (Command: d).
DeleteCommandBuilder Builder for DeleteCommand.
ExtractCommand Extract files from archive - with or without full path (Commands: e and x).

With UseFullPath set to false, this represents the e-command: Extracts files from an archive to the current directory or to the output directory. The output directory can be specified by -o (Set Output Directory) switch. This command copies all extracted files to one directory.

With UseFullPath set to true, this represents the x-command: Extracts files from an archive with their full paths in the current directory, or in an output directory if specified.

ExtractCommandBuilder Builder for ExtractCommand.
InformationCommand Show information about supported formats (Command: i).
InformationCommandBuilder Builder for InformationCommand.
OutputCommand<T> base for all commands that have output. (E.g. InformationCommand).
OverwriteMode

Specifies the overwrite mode during extraction, to overwrite files already present on disk.

RecurseType

Specifies the method of treating wildcards and filenames on the command line.

SevenZipAliases

Functions to call 7-Zip.

In order to use this addin, 7z.exe or 7za.exe has to be available. One option is using 7-Zip.CommandLine from nuget. The other option is to have 7z installed on your system (I.e. There is a registry-key HKLM/Software/7-Zip/Path that points to a directory containing 7z.exe or 7za.exe).

Supported formats and capabilities depend on your 7z-version.

To install add the following lines to your cake-file:

#tool "nuget:?package=7-Zip.CommandLine"
#addin "nuget:?package=Cake.7zip"

SevenZipRunner The Tool-Runner for 7zip.
SevenZipSettings Settings for running 7zip.
SwitchArchiveType

-t (set Type of archive) switch.

Specifies the type of archive.

SwitchArchiveTypeBuilder Extensions for all Builders that support ISupportSwitchArchiveType.
SwitchCompressFilesOpenForWriting

-ssw (Compress files open for writing) switch.

Compresses files open for writing by another applications. If this switch is not set, 7-zip doesn't include such files to archive.

SwitchCompressFilesOpenForWritingBuilder Extensions for all Builders that support ISupportSwitchCompressFilesOpenForWriting.
SwitchCompressionMethod

-m (Set compression Method) switch.

Specifies the compression method.

SwitchCompressionMethodBuilder Extensions for all Builders that support ISupportSwitchCompressionMethod.
SwitchDeleteAfterCompression

-sdel (Delete files after compression) switch.

If -sdel switch is specified, 7-Zip deletes files after including to archive. So it works like moving files to archive. 7-Zip deletes files at the end of operation and only if archive was successfully created.

SwitchDeleteAfterCompressionBuilder Extensions for all Builders that support ISupportSwitchDeleteAfterCompression.
SwitchDisableParsingOfArchiveName

-an (Disable parsing of archive_name) switch.

Disables parsing of the archive_name field on the command line. This switch must be used with the -ai (Include archives) switch. If you use a file list for your archives, you specify it with the -ai switch, so you need to disable parsing of archive_name field from command line.

SwitchDisableParsingOfArchiveNameBuilder Extensions for all Builders that support ISupportSwitchDisableParsingOfArchiveName.
SwitchExcludeArchiveFilename

-ax (Exclude archive filenames) switch.

Specifies archives to be excluded from the operation. Multiple exclude archive switches are supported.

SwitchExcludeArchiveFilenameCollection A Collection of SwitchExcludeArchiveFilename.
SwitchExcludeArchiveFilenamesBuilder Extensions for all Builders that support ISupportSwitchExcludeArchiveFilenames.
SwitchExcludeFilename

-x (Exclude filenames) switch.

Specifies which filenames or wildcarded names must be excluded from the operation. Multiple exclude switches are supported.

SwitchExcludeFilenameCollection A Collection of SwitchExcludeFilename.
SwitchExcludeFilenamesBuilder Extensions for all Builders that support ISupportSwitchExcludeFilenames.
SwitchFullyQualifiedFilePaths -spf (Use fully qualified file paths) switch. (Also, -spf2 for full paths without drive letters.)

Enables the mode that allows to use fully qualified file paths in archives. If -spf switch is not specified, 7-Zip reduces file paths to relative paths when it adds files to archive, and 7-Zip converts paths to relative paths when you extract archive. If -spf switch is specified, 7-Zip doesn't try to process or convert paths.

SwitchFullyQualifiedFilePathsBuilder Extensions for all Builders that support ISupportSwitchFullyQualifiedFilePaths.
SwitchIncludeArchiveFilename

-ai (Include archive filenames) switch.

Specifies additional include archive filenames and wildcards. Multiple include switches are supported.

SwitchIncludeArchiveFilenameCollection A Collection of SwitchIncludeArchiveFilename.
SwitchIncludeArchiveFilenamesBuilder Extensions for all Builders that support ISupportSwitchIncludeArchiveFilenames.
SwitchIncludeFilename

-i (Include filenames) switch.

Specifies additional include filenames and wildcards. Multiple include switches are supported.

SwitchIncludeFilenameCollection A Collection of SwitchIncludeFilename.
SwitchIncludeFilenamesBuilder Extensions for all Builders that support ISupportSwitchIncludeFilenames.
SwitchNtfsAlternateStreams

-sns (Store NTFS alternate Streams) switch.

If -sns mode is enabled, 7-Zip processes NTFS Alternate Data Streams for files and folders. Current version of 7-Zip can store NTFS alternate streams only to WIM archives. Note: 7-Zip can't include alternate streams to archives on 32-bit Windows XP and older systems.

SwitchNtfsAlternateStreamsBuilder Extensions for all Builders that support ISupportSwitchNtfsAlternateStreams.
SwitchNtSecurityInformation

-sni (Store NT security information) switch.

Use this switch to store and restore NT (NTFS) security information for files and directories. Note that only NTFS file system supports that feature. Current version of 7-Zip can store NT security information only to WIM archives.

SwitchNtSecurityInformationBuilder Extensions for all Builders that support ISupportSwitchNtSecurityInformation.
SwitchOutputDirectory

-o (set Output directory) switch.

Specifies a destination directory where files are to be extracted. This switch can be used only with extraction commands.

SwitchOutputDirectoryBuilder Extensions for all Builders that support ISupportSwitchOutputDirectory.
SwitchOverwriteMode

-ao (Overwrite mode) switch.

Specifies the overwrite mode during extraction, to overwrite files already present on disk.

SwitchOverwriteModeBuilder Extensions for all Builders that support ISupportSwitchOverwriteMode.
SwitchPassword

-p (set Password) switch.

Specifies password.

SwitchPasswordBuilder Extensions for all Builders that support ISupportSwitchPassword.
SwitchRecurseSubdirectories

-r (Recurse subdirectories) switch.

Specifies the method of treating wildcards and filenames on the command line.

SwitchRecurseSubdirectoriesBuilder Extensions for all Builders that support ISupportSwitchRecurseSubdirectories.
SwitchSelfExtractingArchive

-sfx (Create SFX archive) switch.

Specifies the SFX module that will be combined with the archive. This module must be placed in the same directory as the 7z.exe. If {SFX_Module} is not assigned, 7-Zip will use standard console SFX module 7zCon.sfx.

SwitchSelfExtractingArchiveBuilder Extensions for all Builders that support ISupportSwitchSelfExtractingArchive.
SwitchSetTimestampFromMostRecentFile

-stl (Set archive timestamp from the most recently modified file) switch.

If -stl switch is specified, 7-Zip sets timestamp for archive file as timestamp from the most recently modified file in that archive.

SwitchSetTimestampFromMostRecentFileBuilder Extensions for all Builders that support ISupportSwitchTimestampFromMostRecentFile.
SwitchUpdateOptions

-u (Update options) switch.

Specifies how to update files in an archive and (or) how to create new archives.

SwitchUpdateOptionsBuilder Extensions for all Builders that support ISupportSwitchUpdateOptions.
SwitchVolume

-v (Create Volumes) switch.

Specifies volume sizes.

SwitchVolumeBuilder Extensions for all Builders that support ISupportSwitchVolume.
SwitchVolumeCollection A Collection of SwitchVolume.
SwitchWorkingDirectory

-w (set Working directory) switch.

Sets the working directory for the temporary base archive. By default, 7-Zip builds a new base archive file in the same directory as the old base archive file. By specifying this switch, you can set the working directory where the temporary base archive file will be built. After the temporary base archive file is built, it is copied over the original archive; then, the temporary file is deleted.

SwitchWorkingDirectoryBuilder Extensions for all Builders that support ISupportSwitchWorkingDirectory.
UpdateAction Specifies the action for a given SwitchUpdateOptions-State.

UpdateCommand Update older files in the archive and add files that are not already in the archive. (Command: u) Note: the updating of solid .7z archives can be slow, since it can require some recompression.
UpdateCommandBuilder Builder for UpdateCommand.
VolumeUnit Units for SwitchCompressionMethod.

Interface Types

Interface Summary
ICommand Interface for all commands. (E.g. AddCommand).
IHaveArgument Base for all argument.
IHaveArgumentArchive Interface for all commands supporting the Archive-Argument.
IHaveArgumentDirectories Interface for all commands supporting multiple directories as arguments.
IHaveArgumentFiles Interface for all commands supporting multiple files as arguments.
IInformationOutput The parsed Output of the InformationCommand.
ISupportArgumentBuilder<T> Base for builders that support arguments.
ISupportOutputBuilder<T> Internal interface to make the extensions more type-able.
ISupportSwitch Interfaces for all switches. Commands "support" swithches by implementing an ISupportSwitch (e.g. ISupportSwitchPassword is implemented in all commands that support setting a passeword (-p).
ISupportSwitchArchiveType

Command supports switch -t (set Type of archive).

The Switch is SwitchArchiveType.

The Builder is SwitchArchiveTypeBuilder.

ISupportSwitchBuilder<T> Base for builders that support switches.
ISupportSwitchCompressFilesOpenForWriting

Command supports switch -ssw (Compress files open for writing).

The Switch is SwitchCompressFilesOpenForWriting.

The Builder is SwitchCompressFilesOpenForWritingBuilder.

ISupportSwitchCompressionMethod

Command supports switch -m (Set compression Method).

The Switch is SwitchCompressionMethod.

The Builder is SwitchCompressionMethodBuilder.

ISupportSwitchDeleteAfterCompression

Command supports switch -sdel (Delete files after compression).

The Switch is SwitchDeleteAfterCompression.

The Builder is SwitchDeleteAfterCompressionBuilder.

ISupportSwitchDisableParsingOfArchiveName

Command supports switch -an (Disable parsing of archive_name).

The Switch is SwitchDisableParsingOfArchiveName.

The Builder is SwitchDisableParsingOfArchiveNameBuilder.

ISupportSwitchExcludeArchiveFilenames

Command supports switch -ax (Exclude archive filenames).

The Switch is SwitchExcludeArchiveFilenameCollection.

The Builder is SwitchExcludeArchiveFilenamesBuilder.

ISupportSwitchExcludeFilenames

Command supports switch -x (Exclude filenames).

The Switch is SwitchExcludeFilenameCollection.

The Builder is SwitchExcludeFilenamesBuilder.

ISupportSwitchFullyQualifiedFilePaths

Command supports switch -spf/-spf2 (Use fully qualified file paths).

The Switch is SwitchFullyQualifiedFilePaths.

The Builder is SwitchFullyQualifiedFilePathsBuilder.

ISupportSwitchIncludeArchiveFilenames

Command supports switch -ai (Include archive filenames).

The Switch is SwitchIncludeArchiveFilenameCollection.

The Builder is SwitchIncludeArchiveFilenamesBuilder.

ISupportSwitchIncludeFilenames

Command supports switch -i (Include filenames).

The Switch is SwitchIncludeFilenameCollection.

The Builder is SwitchIncludeFilenamesBuilder.

ISupportSwitchNtfsAlternateStreams

Command supports switch -sns (NTFS alternate Streams).

The Switch is SwitchNtfsAlternateStreams.

The Builder is SwitchNtfsAlternateStreamsBuilder.

ISupportSwitchNtSecurityInformation

Command supports switch -sni (NT security information).

The Switch is SwitchNtSecurityInformation.

The Builder is SwitchNtSecurityInformationBuilder.

ISupportSwitchOutputDirectory

Command supports switch -o (set Output directory).

The Switch is SwitchOutputDirectory.

The Builder is SwitchOutputDirectoryBuilder.

ISupportSwitchOverwriteMode

Command supports switch -ao (Overwrite mode).

The Switch is SwitchOverwriteMode.

The Builder is SwitchOverwriteModeBuilder.

ISupportSwitchPassword

Command supports switch -p (set Password) .

The Switch is SwitchPassword.

The Builder is SwitchPasswordBuilder.

ISupportSwitchRecurseSubdirectories

Command supports switch -r (Recurse subdirectories).

The Switch is SwitchRecurseSubdirectories.

The Builder is SwitchRecurseSubdirectoriesBuilder.

ISupportSwitchSelfExtractingArchive

Command supports switch -sfx (Create SFX archive).

The Switch is SwitchSelfExtractingArchive.

The Builder is SwitchSelfExtractingArchiveBuilder.

ISupportSwitchTimestampFromMostRecentFile

Command supports switch -stl (Set archive timestamp from the most recently modified file).

The Switch is SwitchSetTimestampFromMostRecentFile.

The Builder is SwitchSetTimestampFromMostRecentFileBuilder.

ISupportSwitchUpdateOptions

Command supports switch -u (Update options).

The Switch is SwitchUpdateOptions.

The Builder is SwitchUpdateOptionsBuilder.

ISupportSwitchVolume

Command supports switch -v (Create Volumes).

The Switch is SwitchVolumeCollection.

The Builder is SwitchVolumeBuilder.

ISupportSwitchWorkingDirectory .

Command supports switch -w (Working directory).

The Switch is SwitchWorkingDirectory.

The Builder is SwitchWorkingDirectoryBuilder.

ISwitch Base for all Switches.