Removing Default dialogs from MSI

2019-01-29 00:59发布

问题:

I have a bootstrapper which wraps many msi files. Some of them require user input to configure some features. These msi files that need custom configuration show too many dialogs that I need to remove, such as WelcomeDlg.

I've read around but I ain't found any solution that suits my actual requirement so I'm wondering if it's feasible actually. So, would it be possible to just show up the dialogs that need the user interaction, avoiding the Welcome or the Finish dialogs, for instance?

Thanks in advance!

回答1:

WiX Alternatives: After describing WiX's Burn feature, I started thinking that it might not be what you need to get your job done. It is developer heavy and involved - though it should be perfectly manageable for a developer to implement what is needed without too many problems. Flexibility is very high.

Commercial deployment tool options Installshield and Advanced Installer have GUI-interfaces you can use to create a setup.exe which will kick off MSI files with parameters you gather.

Installshield

In Installshield there is a rather new feature in recent editions called Installshield Suite Projects. I am not sure what editions it is available in (higher editions - for example "Premium"). It allows you to install a variety of files "in sequence": MSI, MSP, EXE, MSU, etc....

Though I have never used it much, I am pretty sure you can create a suite GUI fairly easily, and control what dialogs show from what setup. I would install them all silently with a command line. Do check out at least the first link below - the screen shots. It should give you the basic idea of things.

Some Links:

  • Screen shot of the Suite GUI
  • A Flexera / Installshield Video Sample
  • And another video sample with poor resolution, but it might still be useful
  • And a video with some slides on the subject

Advanced Installer

Advanced Installer features advanced options to include prerequisites and packages with your main MSI installer, and allows you to create new dialogs just like Installshield. Yet again I haven't had the time to test it fully, but below are some pointers on its use.

The features for this center around the views "Prerequisites", "Build" and "Dialogs". In the "Build" view set EXE output. In "Prerequisites" select the top level "Packages" item to get a list of built-in, available prerequisites. Right click "Pre-Install" to add your own package. I am not familiar with the dialog details, but you can work on them in the "Dialogs" view. Not rocket science is the good news.

Some Links:

  • WYSIWYG dialogs editor for pre-install prererequisites
  • Creating Installer EXE using Advance Installer 11.2 with Script, Prerequisite, SQL Express
  • Conditionally install a prerequisite based on the user's selection
  • And I will just add a general youtube search (in case new videos are added)

I will stop at that. Too many links already.



回答2:

Customized GUI: To answer tersely at the top here: you can write your own GUI which gives you control of "everything" in the setup GUI, suppressing each MSI's own, internal GUI whilst installing.

You gather parameters via your own GUI - designed whichever way you chose - and invoke the install of each MSI file in silent mode - with the given parameters - using commands to do so from within the custom bootstrapper application. This is possible, but no picnic. Please read the summary below - not enough, but that is what I got for you.

Note that the WiX installer itself uses such a custom Burn GUI (and hence works as a live-sample of what such a custom GUI can look like). And here is WiX's own installer source code for its Managed Bootstrapper Application - for the actual WiX 3 installer itself - in other words.


Burn

Burn is a bootstrapper, downloader, chainer, and an engine. Every Burn bundle (setup.exe) features a "Bootstrapper Application" which essentially constitutes the setup's GUI - it drives the Burn engine. There is a standard bootstrapper application that is used by default, but you can write your own bootstrapper GUI entirely. The bootstrapper application (BA) is a DLL loaded by the Burn engine.

The standard bootstrapper application is customizable in various ways, whereas a custom bootstrapper application is entirely customizable - obviously. That bootstrapper application can be written in managed code or native code.

Read the Burn documentation starting from here: Building Installation Package Bundles.

1 - Standard Bootstrapper Application

Here is an extract from the official WiX documentation to see the basic markup needed to "summon" the standard bootstrapper application to be compiled into your setup.exe (chant "668 - the neighbour of the beast" a few times and hit "Build" if you are in Visual Studio) :

<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Bundle>
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
    <Chain>
    </Chain>
  </Bundle>
</Wix>

Let me not duplicate any more content, but send you to the official documentation on the subject instead: Working with WiX Standard Bootstrapper Application.

And before moving on to custom bootstrappers:

  • A real-world Burn snippet (including prerequisites).
  • A hello-world Burn snippet (with lots of further links to Burn info).

2 - Custom Bootstrapper Application

Writing a custom bootstrapper application is no walk in the park as far as I understand it, and not something I have ever had the chance to do. Documentation appears scarce: Building a Custom Bootstrapper Application (official documentation that I know about).

I have found the following real-world samples here and there, but have not tried them on for size yet. Please share your observations should you venture down this path:

  • Write your own WiX Burn setup GUI application (advanced)

  • https://github.com/rstropek/Samples/tree/master/WiXSamples/CustomBurnUI

    • More WiX samples for other aspects of WiX found a level or two higher

Some More:

  • Visual Studio 2017 Installer Project - include VC++ 2015 Redistributable
  • SQL Server named instance with Visual Studio 2017 Installer project (lots of further Burn links)
  • Wix burn doesn't allow to remove file
  • Combine exe and msi file in one installer
  • WIX Installer with modern look and feel
  • https://github.com/frederiksen/Classic-WiX-Burn-Theme (a nice Burn sample using the standard bootstrapper application here)
  • https://www.firegiant.com/wix/tutorial/net-and-net/bootstrapping/