Scripting Question

Need a vbscript to add a file to an msi

02/18/2015 2790 views

We have some standard applications which needs to be repackaged every month. The repackaging process is same and does not change at least for these packages. So I was actually looking at automating these things.

What I did so far.

First we have created an object for Windows installer. I have then taken a copy of the original msi and then opened the database of this temporary msi database in transact mode. Once the database is opened we can use select, insert, update and delete statements to update the database.  

I could successfully add a registry to the msi. The component is also added successfully to the component table. I also could make changes to the Property table.

The tricky part comes with the addition of file to the file table.

The addition of file requires the following steps.

1. Add a new row to the file table. This can be done with the Insert statement.

2. We then need to associate the file to a new component or any other component already existing in the msi. In my case I am creating a new component.

3. We then have to associate this components to a feature in the FeatureComponents table.

4. Since the file I am adding is a non-versioned file, a new row also has to be added to the MSIFILEHASH table.

I could see the changes that I have done using the mst. But when I try to install the msi with the mst, I get the error 2725. I checked everything. All the other steps except for the file addition works fine.

Skipped the file addition part to the msi. Every other change that I make works and I am able to install the msi with the mst successfully.

If you guys think, that this is not a right forum for this question, please let me know the right forum. I have been stuck with this issue from the past 6 months. Any help would really be appreciated.

1 Comment   [ + ] Show comment


  • Cvvamsi could you please provide the vbscript to add registry file

Community Chosen Answer

2725 indicates that one of the tables is bad. I suspect you may have either an insufficient number of columns in your INSERT statement of have invalid data in a row (too many characters, incorrect data type, etc.)

Have you considered using Wix? A lot of software houses use it to automate the building of their installers.
Answered 02/19/2015 by: anonymous_9363
Red Belt

All Answers


Hi All,

Can you please provide me the vbscript to add the reg file even I am looking for the same on urgent basis

Answered 02/22/2016 by: gornalsadmin
White Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ