2

I need to set up a launch condition in my installer to prevent the user from running the MSI file directly unless they are running an uninstall. (All other types of install should be run from the bootstrap app so that it can make sure that all of the preconditions are met.)

What conditions to I need to check for this? I tried REMOVE="ALL" OR BOOTSTRAP (BOOTSTRAP is a property that my bootstrap app defines on the command line when it launches the MSI), but that also triggers on a Repair install, which I don't want.

RobH
  • 1,607
  • 2
  • 24
  • 44

2 Answers2

0

Personally I go about this a different way. I expect that a user might run the MSI and not the SETUP.EXE so I intentionally duplicate all of my bootstrapper prereq checks in the MSI using AppSearch and LaunchConditions. That way if they either skip the bootstrapper or it somehow fails my MSI can still catch the problem.

I also follow the practice of appending "or Installed" on my conditions so that a missing prereq won't hinder uninstalls.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • That's fine for a simple installer. Mine, however is more complex. It installs a suite of programs, and the bootstrapper has to not only make sure that the prereqs are installed, it has to collect all of the information such as what the user wants to install (so that the bootstrapper can determine which prereqs are needed) and the various configuration info for what is to be installed. Except for uninstalls, my installer **must** go through the bootstrapper. – RobH Nov 10 '10 at 03:19
  • I've found it fine for very complex installers also. My typical bootstrapper has dozens of COTS\GOTS packages in it adding up to several gigabytes. I support multiple products off of a single reusable baseline with about 100 packages (25GB) that are possible to include into a product. – Christopher Painter Nov 10 '10 at 13:20
  • In my case, each of the products in the suite has a different set of prereqs, and we don't want to be installing any preqs that aren't needed. Since an installer cannot launch another installer, that task and the GUI for getting all of the info from the user falls to the bootstrapper. – RobH Nov 10 '10 at 17:37
  • I've done it a couple different ways. With InstallShield they have the concept of setup prereq and feature prereq. A feature prereq gets associated to a feature in the installer and only gets installed if that feature is being installed. Basically the UI sequence hands back to setup.exe which does the work then over the execute sequence for the normal stuff. – Christopher Painter Nov 10 '10 at 17:47
  • Another way is to not use LaunchConditions. I've created something called CustomFeatureConstraints that waits until after the features have been selected to enforce the required prereqs. Thay way I can do things like .NET is always required but IIS is only required if you are installing feature WS. – Christopher Painter Nov 10 '10 at 17:48
  • If Wise did that, we probably would have used that feature. Unfortunately, it didn't, so we're stuck with the way we're doing things now, as this is nearing production. – RobH Nov 10 '10 at 20:25
0

As far as I can tell, so far, there doesn't seem to be a way to prevent Repair installs from being run when an MSI is launched directly, so I had to add OR REINSTALL="ALL" to my launch condition. If someone knows of a way to allow Repairs to be done only via the bootstrapper, an explanation would be much appreciated.

RobH
  • 1,607
  • 2
  • 24
  • 44
  • This will be the accepted answer unless and until something comes along that actually does what I want to do. – RobH Nov 10 '10 at 20:36