Step-by-Step Tutorial: Editing MSI Tables via XML

Written by

in

Editing MSI tables via XML is a highly efficient technique used by deployment engineers to modify a Windows Installer (MSI) database without relying on graphical UI editors like Orca. Because an MSI file is a relational database, utilities like msi2xml and xml2msi allow you to export the database tables into a text-based XML format, make precise or automated bulk edits using a text editor or scripts, and compile the XML back into a functional MSI package.

This step-by-step tutorial covers the exact pipeline required to deconstruct, edit, and reconstruct an MSI using XML. Prerequisites & Tools Needed Target MSI File: The installer package you want to modify.

msi2xml / xml2msi: The open-source, bi-directional command-line converter utilities available on the msi2xml SourceForge Page.

Text/XML Editor: Any robust text editor like Notepad++, VS Code, or Visual Studio. Step-by-Step Tutorial Step 1: Deconstruct the MSI into XML

First, extract the internal database tables of your installer into an XML structure. Open your command prompt (cmd) or PowerShell.

Navigate to the folder containing your tools and target MSI. Run the following command: msi2xml.exe -c output_cabs_folder input_installer.msi Use code with caution.

What this does: The -c switch extracts any embedded .cab installation files into a separate folder, leaving you with a clean, raw input_installer.xml file that contains all database tables (e.g., Property, Registry, Shortcut, File). Step 2: Locate and Edit the Target Tables

Open the generated .xml file in your preferred text editor. Each table from the MSI is represented by a

tag, and each row is a tag.

Example 1: Editing a Property (e.g., Changing Manufacturer or App Name)Find the

section. To update a value, simply modify the text between the column data tags:

Property Value

ProductName Old Application Name

Use code with caution. Change Old Application Name to your desired name.

Example 2: Forcing a Silent/No-Reboot FlagFind or add a row in the Property table to suppress reboots during deployment:

REBOOT ReallySuppress

Use code with caution. Step 3: Rebuild the XML back into an MSI

Once your structural changes are saved, you must compile the plain-text XML layout back into a binary Windows Installer database. Return to your command prompt. Execute the compilation utility: xml2msi.exe -c output_cabs_folder input_installer.xml Use code with caution.

What this does: This stitches the modified XML table definitions and the extracted application assets (.cab files) back together, outputting a brand new, fully functional .msi file. Critical Benefits of the XML Method How to Parse XML Files Easily Using Power Query

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *