How to add or replace files within MSI file.
2011-01-19 12:18
465 查看
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 fromhttp://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.
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 fromhttp://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.
相关文章推荐
- How can I add files to a Jar file? (or add a file to a zip archive)
- How to add, modify, or delete registry subkeys and values by using a registration entries (.reg) file
- How To Create Patch Files for the MSDE 2000 Sample.msi File
- How to add one or more control files
- How to create .lib file when you only have .dll and .h files
- How to Add Custom Field Type (in SPFieldType Enum) Programatically or any other way
- How to add multiple static library files with different architectures to Xcode
- Spring MVC – How To Include JS Or CSS Files In A JSP Page
- the diary of how to get a random word within a file
- stropts.h: No such file or directory – How to Fix
- How can I monitor a given folder to see, for example, when a file was added, deleted, or modified?
- How To Add/Increase The Size Of Redo Log Files In Rac Environment? (文档 ID 779306.1)
- How To Add Simple "Install WebPart" Menu to the Right Click On a CAB File
- How to add or remove a static ARP entry on Linux
- how to generate pb file from ckpt files?
- In C how do you redirect stdin/stdout/stderr to files when making an execvp() or similar call?
- Configuration of DLL usage in VS2005--how to add additionl lib and head file
- How to add the selinux policy access for the new created linux file node.
- [Drupal] How to add the js file and js code block in Drupal
- How to Interpret the oraparam.ini File [ID 237097.1]