Module: Omnizip::Formats::Msi
- Defined in:
- lib/omnizip/formats/msi.rb,
lib/omnizip/formats/msi/entry.rb,
lib/omnizip/formats/msi/reader.rb,
lib/omnizip/formats/msi/constants.rb,
lib/omnizip/formats/msi/string_pool.rb,
lib/omnizip/formats/msi/table_parser.rb,
lib/omnizip/formats/msi/cab_extractor.rb,
lib/omnizip/formats/msi/directory_resolver.rb
Overview
MSI (Microsoft Installer) format support
Provides read access to MSI packages, extracting files from embedded or external cabinet archives.
MSI files are OLE compound documents containing:
- Database tables (File, Component, Directory, Media, etc.)
- String pool for interned strings
- Embedded cabinets (in _Streams or direct OLE streams)
Defined Under Namespace
Modules: Constants Classes: CabExtractor, DirectoryResolver, Entry, Reader, StringPool, TableParser
Class Method Summary collapse
-
.extract(path, output_dir) ⇒ Array<String>
Extract all files from MSI package.
-
.info(path) ⇒ Hash
Get information about MSI package.
-
.list(path) ⇒ Array<String>
List files in MSI package.
-
.open(path) {|Reader| ... } ⇒ Reader
Open MSI file and return reader.
-
.register! ⇒ Object
Register MSI format with format registry.
Class Method Details
.extract(path, output_dir) ⇒ Array<String>
Extract all files from MSI package
56 57 58 59 60 61 |
# File 'lib/omnizip/formats/msi.rb', line 56 def extract(path, output_dir) open(path) do |reader| reader.extract(output_dir) reader.files.map { |f| File.join(output_dir, f.path) } end end |
.info(path) ⇒ Hash
Get information about MSI package
67 68 69 |
# File 'lib/omnizip/formats/msi.rb', line 67 def info(path) open(path, &:info) end |
.list(path) ⇒ Array<String>
List files in MSI package
47 48 49 |
# File 'lib/omnizip/formats/msi.rb', line 47 def list(path) open(path) { |r| r.files.map(&:path) } end |
.open(path) {|Reader| ... } ⇒ Reader
Open MSI file and return reader
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/omnizip/formats/msi.rb', line 29 def open(path) reader = Reader.new(path) reader.open if block_given? begin yield reader ensure reader.close end else reader end end |
.register! ⇒ Object
Register MSI format with format registry
This overrides OLE's .msi registration.
74 75 76 77 |
# File 'lib/omnizip/formats/msi.rb', line 74 def register! FormatRegistry.register(".msi", self) FormatRegistry.register(".msp", self) end |