Solved

how to make MSI prerequisite optional

Posted on 2008-10-24
6
591 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:vizagboy
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now