Documentation
¶
Index ¶
- func Available() bool
- func DecompressDCS(data []byte) ([]byte, error)
- func IsDCS(data []byte) bool
- type Compression
- type Decompressor
- type ProgressFunc
- type WIM
- func (w *WIM) AddEmptyImage(name string) (int, error)
- func (w *WIM) Close()
- func (w *WIM) ExportImage(imageNum int, dest *WIM, compression Compression) error
- func (w *WIM) ExtractImage(imageNum int, targetDir string, onProgress ProgressFunc) error
- func (w *WIM) ExtractPaths(imageNum int, targetDir string, wimPaths []string) error
- func (w *WIM) ImageCount() (int, error)
- func (w *WIM) ImageDescription(imageNum int) (string, error)
- func (w *WIM) ListChildren(imageNum int, wimDirPath string) ([]string, error)
- func (w *WIM) Overwrite() error
- func (w *WIM) ReferenceResourceFilePaths(paths []string) error
- func (w *WIM) ReferenceResourceFiles(globs []string) error
- func (w *WIM) SetBootImage(imageNum int) error
- func (w *WIM) SetImageName(imageNum int, name, description string) error
- func (w *WIM) SetImageProperty(imageNum int, propertyName, propertyValue string) error
- func (w *WIM) UpdateImageAdd(imageNum int, fsSourcePath, wimTargetPath string) error
- func (w *WIM) UpdateImageAddTree(imageNum int, fsRootDir, wimRootDir string) error
- func (w *WIM) UpdateImageDelete(imageNum int, wimPath string) error
- func (w *WIM) Write(path string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecompressDCS ¶
DecompressDCS decompresses a DCS\x01 container (CBS delta-compressed store). The format wraps LZMS-compressed blocks:
Header (12 bytes): Signature(4) + NumberOfBlocks(4, LE) + UncompressedFileSize(4, LE) Per block: BlockSize(4, LE) + DecompressedBlockSize(4, LE) + CompressedData[BlockSize-4] Next block starts at current offset + BlockSize + 4.
Types ¶
type Compression ¶
type Compression int
Compression type for WIM images.
const ( None Compression = 0 LZX Compression = 1 LZMS Compression = 2 )
type Decompressor ¶
type Decompressor struct {
// contains filtered or unexported fields
}
Decompressor wraps a wimlib decompressor handle for raw block decompression.
func NewDecompressor ¶
func NewDecompressor(ctype Compression, maxBlockSize int) (*Decompressor, error)
func (*Decompressor) Close ¶
func (d *Decompressor) Close()
func (*Decompressor) Decompress ¶
func (d *Decompressor) Decompress(compressed []byte, uncompressedSize int) ([]byte, error)
type ProgressFunc ¶
type ProgressFunc func(percentDone int)
ProgressFunc is called during long WIM operations with completion percentage.
type WIM ¶
type WIM struct {
// contains filtered or unexported fields
}
WIM represents an open WIM archive.
func CreateWIM ¶
func CreateWIM(compression Compression) (*WIM, error)
func (*WIM) AddEmptyImage ¶ added in v0.2.0
AddEmptyImage adds a new, empty image to the WIM and returns its 1-based index. Files can then be added via UpdateImageAdd/UpdateImageAddTree.
func (*WIM) ExportImage ¶
func (w *WIM) ExportImage(imageNum int, dest *WIM, compression Compression) error
func (*WIM) ExtractImage ¶
func (w *WIM) ExtractImage(imageNum int, targetDir string, onProgress ProgressFunc) error
func (*WIM) ExtractPaths ¶
ExtractPaths extracts specific paths from a WIM image into targetDir. Each wimPath is an absolute path within the WIM (e.g. `\Windows\System32\config\SYSTEM`). The extracted files land in targetDir preserving their directory structure.
func (*WIM) ImageCount ¶
func (*WIM) ListChildren ¶
ListChildren returns the names of the immediate children of wimDirPath inside the given image, e.g. every component directory under `\Windows\WinSxS`. Names are basenames, not full paths.
func (*WIM) ReferenceResourceFilePaths ¶
ReferenceResourceFilePaths adds individual file paths (not globs) as resource references. This bypasses glob expansion and opens each file directly.
func (*WIM) ReferenceResourceFiles ¶
func (*WIM) SetBootImage ¶
func (*WIM) SetImageName ¶
SetImageName sets the name and description of a WIM image via properties. Uses wimlib_set_image_property (wimlib_set_image_description was removed).
func (*WIM) SetImageProperty ¶
SetImageProperty sets a property on a WIM image (e.g. FLAGS, DISPLAYNAME).
func (*WIM) UpdateImageAdd ¶
UpdateImageAdd adds a file or directory from the filesystem into a WIM image.
func (*WIM) UpdateImageAddTree ¶
UpdateImageAddTree adds an entire directory tree from the filesystem into a WIM image. All files and subdirectories under fsRootDir are added under wimRootDir.
func (*WIM) UpdateImageDelete ¶
UpdateImageDelete removes a path from a WIM image.