1

WiX can be installed silently by passing in a flag, but can I design the setup in such a way that it will run silently by default, require the flag, or otherwise prevent the user from attempting to install it non silently?

reason: This is to be released as a distributable for other software projects to include in their application, and we would like to avoid any expectation of localizations/ui issues/ etc.

Mike
  • 33
  • 5

1 Answers1

1

You can compile a setup without a GUI at all. Then it will install directly when you launch the MSI I believe. Frankly I am not sure if this works properly with the UAC (elevation prompt), but I think it does.

As I answered in your other question, you can also use a merge module to allow your setup content to be merged into another setup at build / compile time instead of running as a setup in its own right.

If you want an MSI, I don't think it matters that much if you do not localize the setup to all kinds of languages. Just link a default English GUI. You can even include ready-made translations for several languages as far as I know (been ages since I have done real localization).

The real point is that your customer can kick off your install in silent mode easily from within their own setup.exe, so your setup GUI will never be shown - just make sure to document this for your customers so they know how to do it.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • _"setup GUI will never be shown"_ -- except for progress and error messages, which might be shown in a custom UI of the "main" setup. So it makes sense to include the "ready-made translations" (see link in post) from the WiX toolset for all languages it supports. If you have any custom actions that send progress and/or error messages you might want to localize these aswell. – zett42 Jul 11 '18 at 12:27
  • _"you can also use a merge module"_ -- I would advise against merge modules for redistributables. If there is any problem in a merge module that you include, it can and will fail your whole setup and customers will blame *your* installer for that. Analyzing the problem can also prove difficult, as the merge module is intermingled with your own setup logic. Compare that with a standalone redistributable that is run separately from your main setup. Customers can download a newer version from the original manufacturer and you get a separate installation log which simplifies error analysis. – zett42 Jul 11 '18 at 12:37
  • 1
    Yes, I pointed this out in my other answer (linked). Essentially de-coupling by providing your own MSI (or some other self-installing mechanism) for distribution. Then you can update it yourself at any time, and distribute it to clients without rebuilding all setups with the embedded merge module. As such a merge module is tight coupling. However, it should be pointed out that a single setup with an updated merge module in it, will update the runtime for all packages on the box in question. A weird form of "static linking" I tell myself, but that is not accurate either. Higher version wins. – Stein Åsmul Jul 11 '18 at 12:56
  • GUI: I believe a setup can indeed be silenced completely, with no GUI at all, not even error messages by using [the `/QN` option](https://superuser.com/a/1248364/11906) for `msiexec.exe`? (barring erronouos CA GUI showing up). I am not sure if you get something showing up when implementing your own, external GUI (suppressing the internal one) and hooking up to messages. I have never tried. And any custom GUI added will certainly need to be localized by yourself - obviously - if you want to run in GUI mode. Thanks for commenting, good to clarify things a bit when we take too much for granted. – Stein Åsmul Jul 11 '18 at 13:14
  • And the glitch in the matrix: `REINSTALLMODE = "amus"`. I have a whole article written (but not shared, it got too crazy) about the impact of this mad construct, one of which is for merge modules to downgrade shared files (even shared Windows files - unless they are under [resource protection](https://en.wikipedia.org/wiki/Windows_Resource_Protection)). – Stein Åsmul Jul 11 '18 at 13:31
  • _"I pointed this out in my other answer"_ -- sorry, a case of laziness for me not following your links. – zett42 Jul 11 '18 at 15:24
  • No worries. I too have mixed impressions of merge modules. – Stein Åsmul Jul 11 '18 at 15:26
  • _"I am not sure if you get something showing up when implementing your own, external GUI (suppressing the internal one) and hooking up to messages"_ -- You can supress the internal UI while still getting progress values, progress messages, and modal messages send to your application if you opt in for that. I know, because we are doing exactly that with a custom bootstrapper application (similar to Burn). For this use case, it can be confusing if the foreign setups don't have localized progress and error messages because from the point of the user it is just a single, unified setup experience. – zett42 Jul 11 '18 at 15:30