Tips and tricks for authoring the MSI Media table for a setup
Since Visual Studio is one of the few multi-disk MSI packages that I am aware of, our team has had more experience using the Media table and run into more problems while trying to release builds on CD and DVD than any other team I know of within Microsoft. The Media table is documented in the Windows Installer MSDN documentation (this is a good starting point). Here is a list of some random information (and a couple of bugs in our products) that we discovered about the Media table during the process of shipping VS .NET 2002 and 2003 and the .NET Framework 1.0 and 1.1:
- The value listed in the VolumeLabel column of the table much match the volume label of the physical disk being installed from if the product is being installed from a removable media drive. If the physical disk has a different volume label than what is listed in the Media table for the file that the MSI is attempting to install, you will get a dialog asking you to swap disks.
- The documentation shows that you can leave the VolumeLabel column blank, but if you do this, make sure that your entire setup package fits on a single disk or else your users will not receive proper disk swap notifications and the installation will fail because Windows Installer won't be able to find files it needs to install.
- Windows Installer treats local CD and DVD drives as removable media, and uses the values in the VolumeLabel column of the Media table if installation happens from one of those locations.
- Windows Installer does not treat a shared network drive that maps to a CD/DVD drive as a removable drive, and if you install from such a shared drive you will receive a 1308 (file not found) error for the first file that is expected to appear on disk 2. When that happens you will have to swap disks on the machine that has its CD/DVD drive shared out and then press retry on the 1308 error dialog on the machine you are installing on.
- If you provide a volume label for one of the entries in the Media table of an MSI and there are multiple entries, then MSI will check the volume label to make sure it matches even for an installation that does not span multiple disks. We ran into this for the .NET Framework - the product is small enough to fit on a single disk, but we had several embedded CAB files (which each require their own Media table entry) and a set of files in an external cab that we listed with the volume label URTSTDD1. When installing from the self-extracting dotnetfx.exe package, setup always copies itself to the local hard drive (in a folder under %temp%) so MSI never considered that to be a removable media installation. When one of our partners tried to extract the contents of dotnetfx.exe and ship this on their installation media and install by calling netfx.msi directly, they started getting prompted to swap disks. We have fixed this in the .NET Framework 2.0 by calculating in our build process that the .NET Framework is less than the size of a burned CD and leaving the VolumeLabel columns in the Media table blank for all entries.
- Windows Installer does not support CD/DVD jukebox installation scenarios. Once you start installing from a specific CD/DVD drive letter, you will have to swap disks on that drive to complete installation even if you have other CD/DVD drives on your machine.