### Get MSI Version Source: https://github.com/activescott/lessmsi/wiki/Command-Line Prints the version information of the specified MSI file. No switches are supported for this command. ```bash lessmsi v theinstall.msi ``` -------------------------------- ### Install Git and Chocolatey using winget Source: https://github.com/activescott/lessmsi/blob/master/README.md Installs Git for Windows and Chocolatey package manager using the winget command-line tool. Chocolatey is required for building the MSBuild script and creating the CI-deployed package. ```powershell # install git for windows (this also installs "bash" via "Git Bash") $ winget install git.git # install chocolatey (this is required to run the MSBuild script and create the chocolatey package that is deployed by CI) $ winget install chocolatey ``` -------------------------------- ### Extract MSI Contents Source: https://github.com/activescott/lessmsi/wiki/Command-Line Use the 'v' command to view the contents of an MSI file. This is useful for inspecting the files and properties within an installer package. ```bash lessmsi v c:\theinstall.msi ``` -------------------------------- ### Get MSI File Metadata using MsiFile.CreateMsiFilesFromMSI Source: https://context7.com/activescott/lessmsi/llms.txt Use MsiFile.CreateMsiFilesFromMSI to obtain an array of MsiFile objects, each containing metadata like name, size, version, and location for files within an MSI. Iterate through the returned array to access individual file details. ```csharp using LessMsi.Msi; using LessIO; // Get all files from an MSI var msiPath = new Path(@"C:\installer.msi"); MsiFile[] files = MsiFile.CreateMsiFilesFromMSI(msiPath); // Iterate and display file information foreach (MsiFile file in files) { Console.WriteLine($"File: {file.LongFileName}"); Console.WriteLine($" Short Name: {file.ShortFileName}"); Console.WriteLine($" Size: {file.FileSize} bytes"); Console.WriteLine($" Version: {file.Version}"); Console.WriteLine($" Component: {file.Component}"); Console.WriteLine($" Directory: {file.Directory?.GetPath()}"); Console.WriteLine(); } // Example output: // File: application.exe // Short Name: APPLIC~1.EXE // Size: 1048576 bytes // Version: 1.0.0.0 // Component: MainComponent // Directory: Program Files\MyApp ``` -------------------------------- ### LessMsi Extraction Modes Source: https://context7.com/activescott/lessmsi/llms.txt Defines available extraction modes for controlling file extraction and naming conflict resolution. Usage examples demonstrate different extraction strategies. ```csharp using LessMsi.Msi; // Available extraction modes: // Default - Standard extraction preserving directory structure ExtractionMode.Default // PreserveDirectoriesExtraction - Same as Default, preserves folder hierarchy ExtractionMode.PreserveDirectoriesExtraction // OverwriteExtraction - Preserves directories, overwrites existing files ExtractionMode.OverwriteExtraction // RenameFlatExtraction - Flat extraction, renames duplicates with _1, _2 suffix ExtractionMode.RenameFlatExtraction // OverwriteFlatExtraction - Flat extraction, overwrites duplicate filenames ExtractionMode.OverwriteFlatExtraction // Usage example var msiPath = new LessIO.Path(@"C:\\installer.msi"); // Preserve directory structure (default behavior) Wixtracts.ExtractFiles(msiPath, @"C:\\output", new string[0], null, ExtractionMode.PreserveDirectoriesExtraction); // Flat extraction with renamed duplicates // Files like: app.exe, app_1.exe, app_2.exe Wixtracts.ExtractFiles(msiPath, @"C:\\flat", new string[0], null, ExtractionMode.RenameFlatExtraction); // Flat extraction overwriting duplicates (last file wins) Wixtracts.ExtractFiles(msiPath, @"C:\\flat", new string[0], null, ExtractionMode.OverwriteFlatExtraction); ``` -------------------------------- ### Show Help (h command) Source: https://context7.com/activescott/lessmsi/llms.txt Displays the command-line help information, listing all available commands and options for lessmsi. ```bash lessmsi h # Output: # Usage: # lessmsi [options] [] [file_names] # # Commands: # x Extracts all or specified files from the specified msi_name. ``` -------------------------------- ### Show Version (v command) Source: https://context7.com/activescott/lessmsi/llms.txt Displays the ProductVersion property from the MSI file, typically the software version number. Can be used in scripts. ```bash # Get the version from an MSI lessmsi v C:\downloads\installer.msi # Output: # 1.2.3.4 # Use in scripts FOR /F %%i IN ('lessmsi v installer.msi') DO SET VERSION=%%i echo %VERSION% ``` -------------------------------- ### Open MSI or MSP Files with MsiDatabase.Create Source: https://context7.com/activescott/lessmsi/llms.txt Use the factory method MsiDatabase.Create to open MSI or MSP files for reading. This method automatically handles both standard MSI files and patch files. Query the opened database using standard SQL-like syntax. ```csharp using LessMsi.Msi; using LessIO; using Microsoft.Tools.WindowsInstallerXml.Msi; // Open an MSI database var msiPath = new Path(@"C:\installer.msi"); using (Database db = MsiDatabase.Create(msiPath)) { // Query the Property table string query = "SELECT * FROM `Property`"; using (View view = db.OpenExecuteView(query)) { Record record; while (view.Fetch(out record)) { using (record) { string property = record[1]; string value = record[2]; Console.WriteLine($"{property} = {value}"); } } } } // Works with patch files too (.msp) var patchPath = new Path(@"C:\update.msp"); using (Database patchDb = MsiDatabase.Create(patchPath)) { // Query patch-specific tables string query = "SELECT * FROM `MsiPatchMetadata`"; // ... ``` -------------------------------- ### MsiDatabase.Create Source: https://context7.com/activescott/lessmsi/llms.txt Factory method to open an MSI database or patch file for reading, supporting both standard MSI and MSP files. ```APIDOC ## MsiDatabase.Create ### Description Factory method that opens an MSI database or MSI patch file (.msp) for reading. Handles both standard MSI files and patch files automatically. ### Method `MsiDatabase.Create` ### Parameters #### Path Parameters - **path** (Path) - Required - The path to the MSI or MSP file. ### Request Example ```csharp using LessMsi.Msi; using LessIO; using Microsoft.Tools.WindowsInstallerXml.Msi; // Open an MSI database var msiPath = new Path(@"C:\installer.msi"); using (Database db = MsiDatabase.Create(msiPath)) { // Query the Property table string query = "SELECT * FROM `Property`"; using (View view = db.OpenExecuteView(query)) { Record record; while (view.Fetch(out record)) { using (record) { string property = record[1]; string value = record[2]; Console.WriteLine($"{property} = {value}"); } } } } // Works with patch files too (.msp) var patchPath = new Path(@"C:\update.msp"); using (Database patchDb = MsiDatabase.Create(patchPath)) { // Query patch-specific tables string query = "SELECT * FROM `MsiPatchMetadata`"; // ... } ``` ### Response #### Success Response (200) - **db** (Database) - A `Database` object representing the opened MSI or MSP file. #### Response Example ```json { "db": "" } ``` ``` -------------------------------- ### Extract Files from MSI using Wixtracts.ExtractFiles Source: https://context7.com/activescott/lessmsi/llms.txt Use Wixtracts.ExtractFiles for extracting files from an MSI. Supports extracting all files, specific files by name, and includes options for progress callbacks and different extraction modes like preserving directories or overwriting duplicates. ```csharp using LessMsi.Msi; using LessIO; // Simple extraction - extract all files var msiPath = new Path(@"C:\installer.msi"); Wixtracts.ExtractFiles(msiPath, @"C:\output"); ``` ```csharp using LessMsi.Msi; using LessIO; // Extract specific files by name string[] filesToExtract = { "config.xml", "main.exe", "readme.txt" }; Wixtracts.ExtractFiles(msiPath, @"C:\output", filesToExtract); ``` ```csharp using LessMsi.Msi; using LessIO; // Extract with progress callback void ProgressCallback(IAsyncResult result) { var progress = result as Wixtracts.ExtractionProgress; if (progress != null && !string.IsNullOrEmpty(progress.CurrentFileName)) { Console.WriteLine($"{progress.FilesExtractedSoFar}/{progress.TotalFileCount}: {progress.CurrentFileName}"); } } Wixtracts.ExtractFiles( msiPath, @"C:\output", new string[0], // empty array = extract all files ProgressCallback, ExtractionMode.PreserveDirectoriesExtraction ); ``` ```csharp using LessMsi.Msi; using LessIO; // Extract with flat mode (overwrite duplicates) Wixtracts.ExtractFiles( msiPath, @"C:\flat-output", new string[0], null, ExtractionMode.OverwriteFlatExtraction ); ``` -------------------------------- ### Open GUI (o command) Source: https://context7.com/activescott/lessmsi/llms.txt Opens the specified MSI file in the graphical user interface for interactive browsing and extraction. Can also launch the GUI without a file. ```bash # Open MSI in GUI lessmsi o installer.msi # Open MSI from specific path lessmsi o "C:\Program Files\Installers\app.msi" # Launch GUI without opening a file (just run lessmsi with no arguments) lessmsi ``` -------------------------------- ### Build Lessmsi Project Source: https://github.com/activescott/lessmsi/blob/master/README.md Navigate to the source directory of the Lessmsi project and execute the build script. This script compiles the project and is typically run from a Developer Command Prompt for Visual Studio. ```sh cd \src\lessmsi\src .\build.bat ``` -------------------------------- ### Extract Files (x command) Source: https://context7.com/activescott/lessmsi/llms.txt Extracts all files from an MSI, preserving the directory structure. Specify an output directory or individual files. Shows progress during extraction. ```bash lessmsi x installer.msi # Extract all files to a specific output directory lessmsi x installer.msi C:\output\ # Extract specific files only (a.txt and b.txt) lessmsi x C:\downloads\installer.msi C:\extracted\ a.txt b.txt # Output shows extraction progress # Extracting 'installer.msi' to 'C:\extracted\'. # 1/15 config.xml # 2/15 main.exe # 3/15 readme.txt # ... ``` -------------------------------- ### Open MSI in GUI Source: https://github.com/activescott/lessmsi/wiki/Command-Line Opens the specified MSI file in the graphical user interface. No switches or file names are supported for this command. ```bash lessmsi o theinstall.msi ``` -------------------------------- ### Parse MSI Directories with C# Source: https://context7.com/activescott/lessmsi/llms.txt Parses the MSI Directory table to retrieve root and all directories hierarchically. Requires LessMsi.Msi and Microsoft.Tools.WindowsInstallerXml.Msi namespaces. ```csharp using LessMsi.Msi; using Microsoft.Tools.WindowsInstallerXml.Msi; using (var db = new Database(@"C:\installer.msi", OpenDatabase.ReadOnly)) { MsiDirectory[] rootDirectories; MsiDirectory[] allDirectories; MsiDirectory.GetMsiDirectories(db, out rootDirectories, out allDirectories); // Display root directories Console.WriteLine("Root Directories:"); foreach (var dir in rootDirectories) { Console.WriteLine($" {dir.Directory}: {dir.TargetName}"); PrintChildren(dir, " "); } // Display all directories with full paths Console.WriteLine("\nAll Directory Paths:"); foreach (var dir in allDirectories) { Console.WriteLine($" {dir.Directory} -> {dir.GetPath()}"); } } void PrintChildren(MsiDirectory parent, string indent) { foreach (MsiDirectory child in parent.Children) { Console.WriteLine($"{indent}{child.Directory}: {child.TargetName}"); PrintChildren(child, indent + " "); } } // Example output: // Root Directories: // TARGETDIR: SourceDir // ProgramFilesFolder: Program Files // INSTALLDIR: MyApplication // BinFolder: bin // ConfigFolder: config ``` -------------------------------- ### lessmsi - Open in GUI Source: https://github.com/activescott/lessmsi/wiki/Command-Line Opens the specified MSI file in the graphical user interface. ```APIDOC ## Command o: - Open in GUI ### Description Opens the specified `msi_name` in the GUI. ### Method Not applicable (command-line tool) ### Endpoint Not applicable (command-line tool) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example lessmsi o theinstall.msi ``` -------------------------------- ### List MSI Table as CSV Source: https://github.com/activescott/lessmsi/wiki/Command-Line Lists the contents of a specified MSI table (e.g., 'Component') as CSV data. Requires the '-t' switch to indicate the table name. ```bash lessmsi l -t Component c:\theinstall.msi ``` -------------------------------- ### C# MsiDirectory.GetMsiDirectories Source: https://context7.com/activescott/lessmsi/llms.txt Parses the MSI Directory table to retrieve root and all directories, including their hierarchical parent-child relationships. ```APIDOC ## MsiDirectory.GetMsiDirectories ### Description Parses the MSI Directory table and returns both root directories and all directories as hierarchical MsiDirectory objects with parent-child relationships. ### Method ```csharp public static void GetMsiDirectories(Database db, out MsiDirectory[] rootDirectories, out MsiDirectory[] allDirectories) ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp using (var db = new Database(@"C:\installer.msi", OpenDatabase.ReadOnly)) { MsiDirectory[] rootDirectories; MsiDirectory[] allDirectories; MsiDirectory.GetMsiDirectories(db, out rootDirectories, out allDirectories); // Display root directories Console.WriteLine("Root Directories:"); foreach (var dir in rootDirectories) { Console.WriteLine($" {dir.Directory}: {dir.TargetName}"); PrintChildren(dir, " "); } // Display all directories with full paths Console.WriteLine("\nAll Directory Paths:"); foreach (var dir in allDirectories) { Console.WriteLine($" {dir.Directory} -> {dir.GetPath()}"); } } void PrintChildren(MsiDirectory parent, string indent) { foreach (MsiDirectory child in parent.Children) { Console.WriteLine($"{indent}{child.Directory}: {child.TargetName}"); PrintChildren(child, indent + " "); } } ``` ### Response #### Success Response (200) - **rootDirectories** (MsiDirectory[]) - An array of root MsiDirectory objects. - **allDirectories** (MsiDirectory[]) - An array of all MsiDirectory objects. #### Response Example ```json // Example output: // Root Directories: // TARGETDIR: SourceDir // ProgramFilesFolder: Program Files // INSTALLDIR: MyApplication // BinFolder: bin // ConfigFolder: config ``` ``` -------------------------------- ### MsiFile.CreateMsiFilesFromMSI Source: https://context7.com/activescott/lessmsi/llms.txt Creates an array of MsiFile objects from an MSI database, providing metadata for each file contained within. ```APIDOC ## MsiFile.CreateMsiFilesFromMSI ### Description Creates an array of MsiFile objects representing all files contained within an MSI database. Each MsiFile contains metadata about the file including name, size, version, and directory location. ### Method `MsiFile.CreateMsiFilesFromMSI` ### Parameters #### Path Parameters - **msiPath** (Path) - Required - The path to the MSI file. ### Request Example ```csharp using LessMsi.Msi; using LessIO; var msiPath = new Path(@"C:\installer.msi"); MsiFile[] files = MsiFile.CreateMsiFilesFromMSI(msiPath); foreach (MsiFile file in files) { Console.WriteLine($"File: {file.LongFileName}"); Console.WriteLine($" Short Name: {file.ShortFileName}"); Console.WriteLine($" Size: {file.FileSize} bytes"); Console.WriteLine($" Version: {file.Version}"); Console.WriteLine($" Component: {file.Component}"); Console.WriteLine($" Directory: {file.Directory?.GetPath()}"); Console.WriteLine(); } ``` ### Response #### Success Response (200) - **files** (MsiFile[]) - An array of MsiFile objects, each containing metadata for a file within the MSI. #### Response Example ```json { "files": [ { "LongFileName": "application.exe", "ShortFileName": "APPLIC~1.EXE", "FileSize": 1048576, "Version": "1.0.0.0", "Component": "MainComponent", "Directory": { "Path": "Program Files\MyApp" } } ] } ``` ``` -------------------------------- ### lessmsi - Version (v) Source: https://github.com/activescott/lessmsi/wiki/Command-Line Prints out the version of the specified MSI file. ```APIDOC ## Command v: Version ### Description Prints out the MSI version. ### Method Not applicable (command-line tool) ### Endpoint Not applicable (command-line tool) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - `msi_name` (string) - Required - The name of the MSI to display the version from. ### Request Example lessmsi v theinstall.msi ``` -------------------------------- ### List Table Contents (l command) Source: https://context7.com/activescott/lessmsi/llms.txt Outputs the contents of a specific MSI database table in CSV format to stdout. Useful for inspecting MSI metadata. ```bash # List the Component table lessmsi l -t Component C:\installer.msi # List the Property table to see product information lessmsi l -t Property C:\installer.msi # List the File table to see all files lessmsi l -t File C:\installer.msi # Example output (Property table): # Property,Value # ProductName,My Application # ProductVersion,1.2.3 # Manufacturer,My Company # ProductCode,{GUID-HERE} # Redirect output to a file lessmsi l -t Component installer.msi > components.csv ``` -------------------------------- ### Wixtracts.ExtractFiles Source: https://context7.com/activescott/lessmsi/llms.txt Extracts compressed files from an MSI file to a specified output directory. Supports various extraction modes and progress callbacks. ```APIDOC ## Wixtracts.ExtractFiles ### Description Extracts compressed files from an MSI file to a specified output directory. Supports progress callbacks for monitoring extraction status. ### Method `Wixtracts.ExtractFiles` ### Parameters #### Path Parameters - **msiPath** (Path) - Required - The path to the MSI file. - **outputDirectory** (string) - Required - The directory where files will be extracted. - **filesToExtract** (string[]) - Optional - An array of specific file names to extract. If empty or null, all files are extracted. - **progressCallback** (Action) - Optional - A callback function to report extraction progress. - **extractionMode** (ExtractionMode) - Optional - Specifies the extraction mode (e.g., PreserveDirectoriesExtraction, OverwriteFlatExtraction). ### Request Example ```csharp using LessMsi.Msi; using LessIO; var msiPath = new Path(@"C:\installer.msi"); // Simple extraction - extract all files Wixtracts.ExtractFiles(msiPath, @"C:\output"); // Extract specific files by name string[] filesToExtract = { "config.xml", "main.exe", "readme.txt" }; Wixtracts.ExtractFiles(msiPath, @"C:\output", filesToExtract); // Extract with progress callback void ProgressCallback(IAsyncResult result) { var progress = result as Wixtracts.ExtractionProgress; if (progress != null && !string.IsNullOrEmpty(progress.CurrentFileName)) { Console.WriteLine($"{progress.FilesExtractedSoFar}/{progress.TotalFileCount}: {progress.CurrentFileName}"); } } Wixtracts.ExtractFiles( msiPath, @"C:\output", new string[0], // empty array = extract all files ProgressCallback, ExtractionMode.PreserveDirectoriesExtraction ); // Extract with flat mode (overwrite duplicates) Wixtracts.ExtractFiles( msiPath, @"C:\flat-output", new string[0], null, ExtractionMode.OverwriteFlatExtraction ); ``` ### Response This method does not return a value directly but performs file extraction operations. ``` -------------------------------- ### Display Public SSH Key Source: https://github.com/activescott/lessmsi/blob/master/README.md After generating the SSH key, display the public key using this command. Copy the output and register it on your GitHub account settings to enable authentication. ```bash cat ~/.ssh/id_ed25519.pub ``` -------------------------------- ### Flat Extract All Files (Overwrite) Source: https://github.com/activescott/lessmsi/wiki/Command-Line Extracts all files from the MSI archive into the specified directory, overwriting any files with identical names. The folder structure from the MSI is not preserved. ```bash lessmsi xfo theinstall.msi ``` -------------------------------- ### Clone Lessmsi Repository Source: https://github.com/activescott/lessmsi/blob/master/README.md Create a directory for your source code and clone the Lessmsi repository from GitHub using the SSH URL. This command assumes you have already set up your SSH keys. ```bash mkdir /c/src cd /c/src git clone git@github.com:activescott/lessmsi.git ``` -------------------------------- ### Query MSI Tables with C# ViewWrapper and TableRow Source: https://context7.com/activescott/lessmsi/llms.txt Utilizes ViewWrapper for structured access to MSI tables and TableRow for simpler row data retrieval. Requires LessMsi.Msi and Microsoft.Tools.WindowsInstallerXml.Msi namespaces. ```csharp using LessMsi.Msi; using Microsoft.Tools.WindowsInstallerXml.Msi; using System.Text; using (var db = new Database(@"C:\installer.msi", OpenDatabase.ReadOnly)) { // Using ViewWrapper for structured access string query = "SELECT * FROM `Component`"; using (var view = new ViewWrapper(db.OpenExecuteView(query))) { // Access column information Console.WriteLine("Columns:"); foreach (var col in view.Columns) { Console.WriteLine($" {col.Name} ({col.TypeName})"); } // Iterate records Console.WriteLine("\nRecords:"); foreach (var row in view.Records) { int componentIdx = view.ColumnIndex("Component"); int directoryIdx = view.ColumnIndex("Directory_"); Console.WriteLine($" Component: {row[componentIdx]}, Directory: {row[directoryIdx]}"); } } // Using TableRow for simpler access TableRow[] fileRows = TableRow.GetRowsFromTable(db, "File"); foreach (TableRow row in fileRows) { string fileName = row.GetString("FileName"); int fileSize = row.GetInt32("FileSize"); Console.WriteLine($" {fileName}: {fileSize} bytes"); } } ``` -------------------------------- ### Extract MSI Files with Python doExtraction Source: https://context7.com/activescott/lessmsi/llms.txt Provides a Pythonic interface for extracting files from MSI packages using Python.NET. Supports simple extraction, absolute paths, progress callbacks, and specific file extraction. ```python from LessMsi import doExtraction, ExtrProgress from pathlib import Path # Simple extraction doExtraction("installer.msi", "output_directory") # Extract with absolute paths doExtraction( Path("C:/downloads/installer.msi"), Path("C:/extracted/files") ) # Extract with progress callback def on_progress(progress: ExtrProgress): print(f"Extracting {progress.current}/{progress.total}: {progress.fileName}") doExtraction( "installer.msi", "output", progressCallback=on_progress ) # Extract specific files files_to_extract = ["config.xml", "main.exe"] doExtraction( "installer.msi", "output", filesToExtract=files_to_extract ) ``` ```python # With tqdm progress bar (if tqdm is installed) from LessMsi import doExtractionWithTqdmProgressBar doExtractionWithTqdmProgressBar( "installer.msi", "output_directory" ) # Output: Extracting: 100%|██████████| 42/42 [00:03<00:00, 12.5file/s] ``` -------------------------------- ### C# ViewWrapper and TableRow Source: https://context7.com/activescott/lessmsi/llms.txt Helper classes for querying and iterating over MSI database tables. ViewWrapper provides column information and record enumeration, while TableRow provides convenient access to row data. ```APIDOC ## ViewWrapper and TableRow ### Description Helper classes for querying and iterating over MSI database tables. ViewWrapper provides column information and record enumeration, while TableRow provides convenient access to row data. ### Method ```csharp // ViewWrapper methods for querying tables // TableRow methods for accessing row data ``` ### Parameters None ### Request Example ```csharp using (var db = new Database(@"C:\installer.msi", OpenDatabase.ReadOnly)) { // Using ViewWrapper for structured access string query = "SELECT * FROM `Component`"; using (var view = new ViewWrapper(db.OpenExecuteView(query))) { // Access column information Console.WriteLine("Columns:"); foreach (var col in view.Columns) { Console.WriteLine($" {col.Name} ({col.TypeName})"); } // Iterate records Console.WriteLine("\nRecords:"); foreach (var row in view.Records) { int componentIdx = view.ColumnIndex("Component"); int directoryIdx = view.ColumnIndex("Directory_"); Console.WriteLine($" Component: {row[componentIdx]}, Directory: {row[directoryIdx]}"); } } // Using TableRow for simpler access TableRow[] fileRows = TableRow.GetRowsFromTable(db, "File"); foreach (TableRow row in fileRows) { string fileName = row.GetString("FileName"); int fileSize = row.GetInt32("FileSize"); Console.WriteLine($" {fileName}: {fileSize} bytes"); } } ``` ### Response #### Success Response (200) - **ViewWrapper**: Provides access to table columns and records. - **TableRow**: Provides convenient access to row data by column name. #### Response Example ```json // Example output for columns: // Columns: // Component (String) // Directory_ (String) // Example output for records: // Records: // Component: MyComponent, Directory: INSTALLDIR // Example output for File table rows: // setup.exe: 102400 bytes // config.ini: 5120 bytes ``` ``` -------------------------------- ### Extract All Files from MSI Source: https://github.com/activescott/lessmsi/wiki/Command-Line Extracts all files from the specified MSI archive into the current directory. The 'x' command is for backward compatibility and may be removed in the future. ```bash lessmsi x theinstall.msi ``` -------------------------------- ### Windows Explorer Integration Source: https://context7.com/activescott/lessmsi/llms.txt Information regarding LessMsi's integration with Windows Explorer for context menu extraction. The ExplorerShortcutHelper manages registry modifications for this feature. ```csharp // The ExplorerShortcutHelper handles registry modifications // Enable via GUI: Edit menu -> Preferences -> Enable Explorer Integration // Registry entries created (for reference): // HKEY_CLASSES_ROOT\Msi.Package\shell\lessmsi // HKEY_CLASSES_ROOT\Msi.Package\shell\lessmsi\command // When enabled, right-clicking an MSI file shows "Extract Files" option // Files are extracted to a folder with the same name as the MSI in the same location ``` -------------------------------- ### Extract MSI Contents Command Line Source: https://github.com/activescott/lessmsi/blob/master/README.md Use this command to extract the contents of an MSI file to a specified directory. For more options, refer to the Command-Line wiki. ```bash lessmsi x [] ``` -------------------------------- ### Flat Extract Specific Files (Overwrite) Source: https://github.com/activescott/lessmsi/wiki/Command-Line Extracts specified files ('a.txt', 'b.txt') from an MSI archive into a target directory, overwriting existing files with the same name. The folder structure is not preserved. ```bash lessmsi xfo c:\theinstall.msi c:\theinstallextracted\ a.txt b.txt ``` -------------------------------- ### Flat Extract All Files (Rename) Source: https://github.com/activescott/lessmsi/wiki/Command-Line Extracts all files from the MSI archive into the specified directory, renaming files with identical names by adding a numerical suffix. The folder structure from the MSI is not preserved. ```bash lessmsi xfr theinstall.msi ``` -------------------------------- ### Flat Extract with Overwrite (xfo command) Source: https://context7.com/activescott/lessmsi/llms.txt Extracts all files to a single directory without preserving the folder structure. Later files overwrite earlier ones if they have identical names. ```bash # Extract all files flat to current directory lessmsi xfo installer.msi # Extract all files flat to specific directory lessmsi xfo C:\downloads\app.msi C:\flat-output\ # Extract specific files flat with overwrite lessmsi xfo installer.msi C:\output\ readme.txt license.txt ``` -------------------------------- ### lessmsi - Flat Extraction with Overwriting (xfo) Source: https://github.com/activescott/lessmsi/wiki/Command-Line Extracts files from an MSI archive without preserving the folder structure, overwriting any files with identical names. ```APIDOC ## Command xfo: - Flat extraction with identical file overwriting ### Description Extracts files from the specified archive without preserving the folder structure. All extracted files are saved in the same location, and any files with identical names are overwritten. ### Method Not applicable (command-line tool) ### Endpoint Not applicable (command-line tool) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - `msi_name` (string) - Required - Specifies the MSI to extract files from. - `path_to_extract` (string) - Optional - The path to extract the files to. MUST have a trailing backslash or it will be treated as one of the `file_names`. - `file_names` (string) - Optional - Names of files that you want to extract from the MSI. All files are extracted if not specified. ### Request Example Extracts all files from `theinstall.msi` into the current directory: lessmsi xfo theinstall.msi Extracts `a.txt` and `b.txt` from `c:\theinstall.msi` into the directory `c:\theinstallextracted`: lessmsi xfo c:\theinstall.msi c:\theinstallextracted\ a.txt b.txt ``` -------------------------------- ### Generate SSH Key for GitHub Source: https://github.com/activescott/lessmsi/blob/master/README.md Use this command in Git Bash to generate an SSH key pair for secure access to GitHub. Follow the prompts to set a passphrase or leave it empty. ```bash ssh-keygen ``` -------------------------------- ### Extract Specific Files from MSI Source: https://github.com/activescott/lessmsi/wiki/Command-Line Extracts specified files ('a.txt', 'b.txt') from an MSI archive to a target directory. Ensure the target directory path has a trailing backslash. Note that only file names can be specified, not paths within the MSI. ```bash lessmsi x c:\theinstall.msi c:\theinstallextracted\ a.txt b.txt ``` -------------------------------- ### Extract with Overwrite (xo command) Source: https://context7.com/activescott/lessmsi/llms.txt Extracts files, preserving directory structure, and overwrites existing files in the destination. Useful for re-extracting to an existing directory. ```bash # Extract all files, overwriting existing files lessmsi xo installer.msi C:\output\ # Extract specific files with overwrite lessmsi xo C:\downloads\app.msi C:\destination\ config.ini settings.xml ``` -------------------------------- ### lessmsi - Extract Files (x) Source: https://github.com/activescott/lessmsi/wiki/Command-Line Extracts files from a specified MSI archive. Supports extracting all files or specific files to a given path. ```APIDOC ## Command x: - Extract ### Description Extracts from the specified archive. Supports extracting all files or specific files to a given path. ### Method Not applicable (command-line tool) ### Endpoint Not applicable (command-line tool) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - `msi_name` (string) - Required - Specifies the MSI to extract files from. - `path_to_extract` (string) - Optional - The path to extract the files to. MUST have a trailing backslash or it will be treated as one of the `file_names`. - `file_names` (string) - Optional - Names of files that you want to extract from the MSI. All files are extracted if not specified. ### Request Example Extracts all files from `theinstall.msi` into the current directory: lessmsi x theinstall.msi Extracts `a.txt` and `b.txt` from `c:\theinstall.msi` into the directory `c:\theinstallextracted`: lessmsi x c:\theinstall.msi c:\theinstallextracted\ a.txt b.txt ``` -------------------------------- ### lessmsi - Flat Extraction with Renaming (xfr) Source: https://github.com/activescott/lessmsi/wiki/Command-Line Extracts files from an MSI archive without preserving the folder structure, renaming any files with identical names by adding a numerical suffix. ```APIDOC ## Command xfr: - Flat extraction with identical file renaming ### Description Extracts files from the specified archive without preserving the folder structure. Files with identical names are renamed by adding a numerical suffix indicating the order of occurrence. ### Method Not applicable (command-line tool) ### Endpoint Not applicable (command-line tool) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - `msi_name` (string) - Required - Specifies the MSI to extract files from. - `path_to_extract` (string) - Optional - The path to extract the files to. MUST have a trailing backslash or it will be treated as one of the `file_names`. - `file_names` (string) - Optional - Names of files that you want to extract from the MSI. All files are extracted if not specified. ### Request Example Extracts all files from `theinstall.msi` into the current directory: lessmsi xfr theinstall.msi Extracts `a.txt` and `b.txt` from `c:\theinstall.msi` into the directory `c:\theinstallextracted`: lessmsi xfr c:\theinstall.msi c:\theinstallextracted\ a.txt b.txt ``` -------------------------------- ### Flat Extract Specific Files (Rename) Source: https://github.com/activescott/lessmsi/wiki/Command-Line Extracts specified files ('a.txt', 'b.txt') from an MSI archive into a target directory, renaming files with identical names by adding a numerical suffix. The folder structure is not preserved. ```bash lessmsi xfr c:\theinstall.msi c:\theinstallextracted\ a.txt b.txt ``` -------------------------------- ### lessmsi - List Table (l) Source: https://github.com/activescott/lessmsi/wiki/Command-Line Lists the contents of a specified MSI table as CSV. ```APIDOC ## Command l: List ### Description Lists the specified file table as a CSV. ### Method Not applicable (command-line tool) ### Endpoint Not applicable (command-line tool) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - `-t` (string) - Required - Switch to specify which MSI table to extract. - `msi_name` (string) - Required - The name of the MSI to extract the table from. ### Request Example lessmsi l -t Component c:\theinstall.msi ``` -------------------------------- ### Python doExtraction Function Source: https://context7.com/activescott/lessmsi/llms.txt Python wrapper for LessMsi extraction functionality using Python.NET (pythonnet). Provides a Pythonic interface for extracting files from MSI packages with optional progress callbacks. ```APIDOC ## doExtraction Function ### Description Python wrapper for the LessMsi extraction functionality using Python.NET (pythonnet). Provides a Pythonic interface for extracting files from MSI packages with optional progress callbacks. ### Method ```python doExtraction(msiPath: str | Path, outputDir: str | Path, progressCallback: callable = None, filesToExtract: list[str] = None) doExtractionWithTqdmProgressBar(msiPath: str | Path, outputDir: str | Path) ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from LessMsi import doExtraction, ExtrProgress from pathlib import Path # Simple extraction doExtraction("installer.msi", "output_directory") # Extract with absolute paths doExtraction( Path("C:/downloads/installer.msi"), Path("C:/extracted/files") ) # Extract with progress callback def on_progress(progress: ExtrProgress): print(f"Extracting {progress.current}/{progress.total}: {progress.fileName}") doExtraction( "installer.msi", "output", progressCallback=on_progress ) # Extract specific files files_to_extract = ["config.xml", "main.exe"] doExtraction( "installer.msi", "output", filesToExtract=files_to_extract ) # With tqdm progress bar (if tqdm is installed) from LessMsi import doExtractionWithTqdmProgressBar doExtractionWithTqdmProgressBar( "installer.msi", "output_directory" ) ``` ### Response #### Success Response (200) Files are extracted to the specified output directory. #### Response Example ```json // Example output for progress callback: // Extracting 10/42: config.xml // Extracting 11/42: main.exe // Example output for tqdm progress bar: // Extracting: 100%|██████████| 42/42 [00:03<00:00, 12.5file/s] ``` ``` -------------------------------- ### Flat Extract with Rename (xfr command) Source: https://context7.com/activescott/lessmsi/llms.txt Extracts all files to a single directory without preserving folder structure. Renames duplicate filenames with numeric suffixes (e.g., file_1.txt). ```bash # Extract all files flat, renaming duplicates lessmsi xfr installer.msi # Extract to specific directory with automatic renaming lessmsi xfr C:\downloads\app.msi C:\flat-output\ # Example output with renamed duplicates: # config.xml # config_1.xml (second file named config.xml) # config_2.xml (third file named config.xml) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.