Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to make MSI prerequisite optional

Posted on 2008-10-24
6
Medium Priority
?
661 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
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 

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 2000 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Installations often have prerequisites, such as “Microsoft .Net framework is required for this product”. The usual implementation in MSI installations is system search for a particular registry setting representing the required prerequisite, followe…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

722 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