I want to replace a single file inside a msi. How to do it?
Right-click the document file the content of which you want to replace. Press the Alt key and select Operations > Replace with File... from the menu bar. Locate and select the file that you want to use for replacing the original file content. Click OK.
There is no limit in renaming MSI files.
Double-click the file to run it. This will start the installation wizard, and start installing the program. If you're prompted, click Run in the confirmation pop-up. Follow the installation wizard's prompts. The installation wizard will guide you throughout the setup and install the program contained in this MSI file.
* The original file will not be removed from the MSI, but simply orphaned (no component refers to it). It will not be installed, but will remain in the package. * * \param OriginalFileName (this is the files target name at the clients computer after installation.
The easiest way to do it is to repackage MSI: Open MSI file in Wise for Windows Installer. Choose an option to to extract files. Locate the file on disk and replace it. Build MSI.
Select the IT Pros tab and choose the MST project type - > New Transform template 3. Click on the [Create Project] button. 4. Choose the MSI file that you need to edit. 5. Once the MSI loads, start making the changes that you will need to be stored in the MST file. 6. Next, locate the file that you want to replace.
Use msi2xml.
This command extracts the MSI files:
msi2xml -c OutputDir TestMSI.MSI
Open OutputDir and modify the file.
To rebuild the MSI run:
xml2msi.exe -m TestMSI.xml
You need the -m to ignore the 'MD5 checksum test' that fails when an MSIs file(s) are modified.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With