<p>I want to replace a single file inside a msi. How to do it?</p>

You need to extract the CAB file stream from your msi using
MsiDB.exe
(supplied with the
Windows Installer SDK
). Run it from the
command line with the -x option
and specify the name of the cab file - this is listed in the Media table in the msi database.
Alternatively you can skip this part if you specify the "Package Files as:" option in the VSI options to "Compresses in Cabinet Files" to have the cab file left out of the msi when it's built (it will be created in the same directory as the msi).
Once extracted you can change the specified file in the cab folder - its name has been mangled so you need to find out what msi name for the file is in the file table and then rename your new file to that.
Once done you can pop it back in with the
MsiDB utility using the -a option
.
Before you add with -a you need to use
msidb -k
to
remove the cab from the MSI
.