Fixing VLC’s MSI Package

VLC don’t shout about this too loudly, but they have offered an MSI package to download for some time from their FTP site:

https://download.videolan.org/pub/videolan/vlc/

However the packages suffer from a strange bug where any attempt to modify the tables or apply an MST (to delete the desktop shortcut for example) corrupts the database and breaks the installer. It turns out this is because the developers are building the MSI package on Linux with WiX running under WINE, which is listed as incompatible on WINE’s AppDB. There is an open ticket for this here:

https://trac.videolan.org/vlc/ticket/18985

I found a workaround by exporting the database tables to a new MSI and repacking the cab files (all of which can be done with several steps in InstEd Plus (if you deal with MSIs regularly you should buy it!). However I also now have a fully automated Powershell script to rebuild the MSI.

This script leverages Deployment Tools Foundation (DTF), a very useful .NET wrapper around the Windows Installer API that comes from the WiX Toolset. It also shoehorns in WiMakCab.vbs from the now defunct Windows Installer SDK to perform the cab file operations. However I’ve learnt a bit more about DTF whilst writing this and discovered I’ve re-inventing the wheel with some functions that are already covered in the API, so I aim to produce a 2.0 that handles the cabs natively!

Simply put your VLC MSI packages you want to rebuild into the Input folder and run Rebuild-Msi.ps1. Then you will be able to modify the package to tweak shortcuts, automatic updates, privacy settings, file associations, etc without it breaking on you.

Download the script below:

Leave a Reply