How to add or replace files within MSI file.

These days, I was asked to made an installer for SP1 of the last release of our product. Because the person who made the installer quit, and there are  too many script files (py, bat) to make the installer from getting source code, updating related files, calling deven.exe /rebuild, updating wxs files, calling candle.exe & light.exe, to posting the output msi file to a specified location, neither I or other team members can make it work.

 

But we can make the project build process work, therefore we can generate the new module files. However, it is really hard to make the process generating MSI work, and there are 7 loccalized installers which need to be updated too. Therefore I planed to directly update MSI file. I searched information from google, but there is no a simple solution, for example, http://www.gameaddict.eu/how-to-add-and-or-replace-files-into-an-msi-file/, and InstEdit can be download from http://www.instedit.com/. Because there are some relationship amoung tables, and the MsiFileHash table will be updated too. In one word, I failed to get it worked.

 

Finally, an old co-worker suggested me to decompile the MSI to create WXS file and other files, then replace/add files and update the WXS file, lastly compile the WXS to generate new MSI file. I did according to his advice. It did work. What I did are:

 

1. Use dark.exe tool to decompile the MSI file.

2. Replace/Add files in the folder created by the dark tool.

3. Update the WXS file generated by the dark tool.

4. Use candle.exe and light.exe to create new MSI.

 

To update all localized installers, I wrote a tool to update the WXS file and some batch script to automatically call the WIX tools.

 

It is very simple, hope you will obtain help if you run into the same problem.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值