wixwindows-installerupgrademerge-module

How does Wix handle merge modules requiring admin permissions?


I'm currently planning an installation and update scenario, using MSIs created using Wix. Initial installation will include third-party drivers as merge modules, which will require elevated permissions.

We want to automate software updates as much as possible, so will make updated MSI packages available on a regular basis. These will be downloaded in the background and installed the next time the user opens the application. We will implement processes to ensure changes to the driver modules will not be included in automatic updates.

Will Windows Installer execute these merge modules if they are not changed? What impact will this have on the overall installer? Would I be better off creating a separate MSI for these drivers, to isolate them completely from the core application package?


Solution

  • Here's some background to help clear things up. Merge modules are not "executed". In fact, once you build an installer they don't exist anymore. A merge module is merely a database containing MSI table data that gets merged into your MSI at build time. Think of it as an encapsulation of a collection of components and related metadata. It's like a C/C++ .LIB file that is statically linked inside an EXE.

    So if you have components ( from an MSI or from an MSM ) that require elevated permissions to install then the final MSI requires elevated permissions to intall.

    I've done this autoupdate process in the past. You want that process to have elevated rights and after it downloads the MSI "advertise" it as a managed per-machine (what I call "blessed" MSI ). This is done using the msiexec /jm foo.msi command. Then signal a user side process to install the MSI. If authored correctly the MSI will auto elevate without ever exposing admin rights to the user.