Merge modules (.msm) are similar in structure to a simplified Windows Installer file (.msi). A merge module cannot be installed alone, it must be merged into a .msi file. The best alternative is to obtain a freely distributed merge tool or purchase one of the merging tools available from independent software vendors. You can then use the functionality provided by Mergemod.dll.
The intended use of merge modules was to provide a standard method for developers to deliver shared Windows Installer components and setup logic to their applications. Merging is therefore something typically done by the author of the installation package prior to deployment. Trying to determine and perform the correct merge when the application is being installed does not seem like the best approach.
You could instead create a separate .msi for each target platform. Merge the appropriate .dll into each package. Then include logic in your setup application to check the user’s system and then install the correct package.
As was suggested by the previous answer, you could merge all the .dlls into a single installation package which you have authored such that the installation of certain features and components are conditional upon Operating System Property Values .
You can consider Using Transitive Components in your package. The typical use for transitive components is to prepare a product to reinstall during a system upgrade. The author of the installation package specifies those components that need to be swapped out during a system upgrade as having the transitive attribute. When the user later upgrades the system, the product must be reinstalled. Upon this reinstall, the installer removes the earlier components and installs the later components, without having to install the entire product. This might serve your scenario well if you expect your users to upgrade their systems.