I have a MSM file from a third party tool. We customize the MSM with a small script and this tool is integrated into our installer and works fine. All modification is done with VBscript using COM and "WindowsInstaller.Installer"
But sometimes our support needs just this tool as standalone installer package.
Is there a simple way to convert a MSM file into and full installer MSI package on the command line?
Using VBscript or the COM Module with the "WindowsInstaller.Installer" is OK. Knowing the way how to to convert it, I would also write a small C++ program doing performing the changes and setting the appropriate information and conversion.
I need to command line to, to integrate the MSM conversion into our build process.
What I searched and found:
I saw some tools like ORCA and other MSI tools in the SDK, but none of some are doing what I need. ORCA can save an MSM as a MSI file but I can't see options doing this on the command line.
Note: I found an old tool msm2msi, but it doesn't work with my MSM file and crashes, and there is no source available.
Edit About the changes we apply:
The reasons for the change are simple. The thirdparty module has a "so called server mode" usually it is only used on 1 machine, but the MSM enables it for every machine. So wie decided to disable it, in changing a property. And some more changes.
So it is more about the primary installation. When an update comes, this settings are never touched.
Also the MSM installs its own UI, that we don't want and need. All controlling is done through our software... So we install the components but we remove that menu entries in the Start folder.
Any MSI Tool can consume an MSM file and compile a MSI from it, with whatever additional constructs you want - conceivably also the changes you make to the MSM?
The free and open source WiX Toolkit would certainly be able to compile an MSI from an MSI via the command line, and it is free and open source as well. WiX Quick Start Suggestions.
However, there is cause for concern with regards to the modifications you intend to make in the MSM. This is very bad news indeed, since MSM files are specifically made to not be change by end users. It would be very good if you can find an alternative way to do the changes needed, for example custom actions inside the MSI file you compile.
Although WiX is quite involved at times to deal with, merging and MSM could not be simpler:
Full sample here: How To: Install the Visual C++ Redistributable with your installer. And the documentation: Merge Element.
Why do you want to merge this MSM every time? Is it continually updated? If so, can the vendor change it so that you do not need to post process it? If it is not updated, can you just change the MSM itself? Not great to do - in fact quite terrible - but it might be less error prone than continuously fiddling with its settings.