Solved

how to make MSI prerequisite optional

Posted on 2008-10-24
6
627 Views
Last Modified: 2013-11-26
I am using Visual Studio 2005 setup project to build a msi and setup.exe with a custom prerequisite. Is there a way I can make the prerequisite install optional?

The prereq is not mandatory for my application and some users do not want to install it.

Thanks in advance.
0
Comment
Question by:vizagboy
  • 3
  • 3
6 Comments
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 22800464
The right way to do it is a Feature, like you see in installation of Microsoft Office - the user can make the choice whether to install Powerpoint or not. Prerequisite, by definition, is mandatory..

The bad news: if I'm not mistaken, Visual Studio setup and deployment project does not support Features. You'd have to look for more advanced MSI-authoring tool.
0
 

Author Comment

by:vizagboy
ID: 22800506
Thanks for the response. If there could be a way I can bring up a diaglog in the Bootstrapper to prompt the user to install that component or not, that would have been great :-) Will wait for any others to respond.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 22812006
I think the only way you can try is by custom action. Custom action would either ask the user if he wants to install your optional component, or use a property supplied by custom dialog that you can add. If yes, then try to launch another installation - either directly from the custom action (which most likely will fail), or as described here (only you'd launch another setup.exe rather than installed application).

But I think you will achieve much better results, in the long run as well, if you look at other MSI authoring tools.
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

Author Comment

by:vizagboy
ID: 22813665
How does the custom action work here? when do they get executed?
This is my understanding of the flow. setup.exe will initially kick off the prereq's dialog and once the prereq's are installed, setup.exe will invoke msiexec to install the msi. Then the custom actions in the msi will get called.
0
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 500 total points
ID: 22814325
MSI installation has 3 phases; the 1st phase is called "user interface" where it shows the dialogs and asks about the choices; at that point, nothing is being installed. Then goes 2nd and 3rd phases where things are actually installed. When that happens, Installer does not allow another instance of itself, so another installation can't be nested. You could invoke that custom action either at the user sequence, which would be not good (if the main installation fails, this one will still be installed), or after the main installation is finished. This is all nontrivial by itself, but in visual studio it's even harder because it's kinda black box and does things in its own special way, often violating msi standards; add to this the fact that custom actions in v.s. are of course managed, which makes them incompatible with MSI to begin with
Amazing, isn't it.

Forget about prerequisites, it's not even the right term here. Prerequisite is something that is mandatory, no options, and if it's not installed, then main installation won't go on.

Try to put custom action in the very end, on commit event, and see if you can launch your setup from there.

Once again, I guarantee that even if you manage to accomplish what you want, you will spend 5 times more time than if you get more MSI-friendly tool than visual studio. Visual Studio setup projects are for the trivial installations.
0
 

Author Closing Comment

by:vizagboy
ID: 31509819
Thanks for the info Vadim. We decided its not worth the effort and are going to remove the prereq from the install as by definition, our app is not mandatory. We decided to provide a URL where users can download and install it if needed.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question