Solved

how to make MSI prerequisite optional

Posted on 2008-10-24
6
644 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

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

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

732 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