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.

  • 0
    点赞
  • 0
    收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:大白 设计师:CSDN官方博客 返回首页
评论

打赏作者

Cline

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值