Step-by-step guide: Applying MSI Compat Transform to virtualized apps
1. Purpose
MSI Compatibility Transform (MSI Compat Transform) adjusts an MSI installer so it installs and behaves correctly inside an application virtualization container (e.g., Microsoft App-V, VMware ThinApp). This guide assumes you need to modify an MSI to avoid hard-coded paths, system-level actions, or unsupported services during virtualization.
2. Prerequisites
- Windows machine with admin rights.
- The MSI to be transformed.
- Tools: Orca (Windows SDK), mstcreate or InstEd/Advanced Installer (to create .mst transforms), and a virtualization sequencer (App-V Sequencer, ThinApp, etc.).
- Backup copy of original MSI and system snapshot if sequencing.
3. Overview of steps
- Inspect MSI and identify problematic actions.
- Create a transform (.mst) that modifies tables/values.
- Test transform in a sequencing/virtualization environment.
- Iterate fixes and retest.
- Package final MSI + transform into your virtualization workflow.
4. Detailed steps
- Inspect the MSI
- Open MSI in Orca or InstEd.
- Review tables: InstallExecuteSequence, InstallUISequence, Component, Feature, CustomAction, File, Registry, ServiceInstall, ServiceControl.
- Note actions that: install services, write to HKLM, modify system drivers, create scheduled tasks, hard-code C:\Program Files paths, require reboots.
- Create transform (.mst)
- Open MSI in Orca → Transform → New Transform.
- Modify offending entries:
- Disable or remove ServiceInstall/ServiceControl entries, or change to no-op custom actions.
- Redirect registry writes: remove HKLM writes or change to HKCU where appropriate.
- Change InstallExecuteSequence to skip actions that perform system changes (set condition to 0 or add a property check).
- Adjust File table paths or component GUIDs if sequencing requires isolation.
- Use Component and Feature settings to mark per-user installation where possible.
- Save Transform → Transform → Generate Transform, name myfix.mst.
- Apply and test transform locally
- Install using msiexec: msiexec /i path\package.msi TRANSFORMS=path\myfix.mst /qn
- Verify installer logs: msiexec /i … /l*v install.log and review for skipped actions and errors.
- Confirm no services installed, registry writes only to intended hives, files placed under virtualized container paths.
- Sequence with your virtualization tool
- Launch sequencer (App-V Sequencer example).
- Start capture, run msiexec with TRANSFORMS parameter to apply MST during sequencing.
- Complete sequencing to generate virtual package.
- Test virtualized app for functionality and for absence of unsupported system changes.
- Iterate
- If runtime errors occur, inspect logs inside virtual environment, re-open MSI + MST and adjust.
- Common fixes: mark COM registration as vitualized, change custom action sequencing, add shimmed registry entries into the package.
- Final packaging & deployment
- Embed MST in deployment process or transform MSI into a repackaged installer that includes fixes.
- Document transform changes and maintain versioning.
- Deploy virtual package through your distribution system and monitor.
5. Troubleshooting tips
- Use verbose MSI logs (/l*v) and sequencer logs.
- If a service is required, consider creating a companion Windows service outside virtualization or use a compatibility shim.
- For per-user registry needs, provision keys at first-run via scripted initialization inside the virtual environment.
- Watch for custom actions that run external EXEs — treat them as installers and virtualize accordingly.
6. Safety and rollback
- Always keep original MSI backups and transform source.
- Test on isolated VMs and keep snapshots before sequencing.
- Use versioned transforms and maintain changelog.
7. Quick checklist
- Inspect MSI tables
- Create .mst with targeted changes
- Install with TRANSFORMS and review logs
- Sequence with transform applied
- Test and iterate
- Document and deploy
If you want, I can generate an example Orca change log or a sample .mst edit list for a specific MSI—provide the MSI’s key problematic entries (e.g., ServiceInstall names, registry paths).
Leave a Reply