Solved

how to make MSI prerequisite optional

Posted on 2008-10-24
6
653 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

I have been scripting applications way too long and can never remember how to create an ISS file.  So I decided to write this article to act as my own knowledge base for future reference, and hope you will also benefit. An ISS file is a response …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

626 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