I am on an interesting project right now where I have to make a number of changes to a large existing installer.  The installer is complicated so this is taking some analysis.  One of the requirements is that they do not want to blindly install prerequisites on a user's system anymore.  Let me clarify.

This client's product is generally used by people on an enterprise system, meaning a corporate intranet.  The client told me that their customers, and especially administrators in their customer's companies, were not happy about installing prerequisites on a network system.  The client wants to now check if the prerequisite is present, and if not present, display a message alerting the customer to that fact, but not actually installing the prerequisite on their system.  So, what's the easiest way to do this?

There are two methods to do this:

  1. Go to the Redistributables view of the IDE, find the prerequisite you need to check for, but not install, right-click on it, and select Edit Prerequisite.  Then go to the Conditions tab.  There you will find a list of conditions that are checked for.  The conditions determine whether the prerequisite needs to be installed or not.  So, you can just copy these conditions and write an InstallScript function to perform the checks.  If you are in a Basic MSI project, you would need to write an InstallScript Custom Action.  The only problem with this is that not all prerequisites can be edited.  Just go randomly select any prerequisite, right-click it and see if the Edit Prerequisite choice is enabled.  If not, you have to try the next tactic.
  2. Go to Microsoft, more specifically MSDN, and search for "How to detect if XXX is currently installed", or something similar.  Microsoft tends to have a lot of articles on how to check if one of their technologies is present.  You just have to sift through everything on their website to find it.

These are the methods I use to accomplish checking for a prerequisite.  I hope you get some use out of them.

 

Moving Features and Components from One Installation to Another

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • Yahoo! Buzz
  • Twitter
  • Technorati
  • Live
  • LinkedIn
  • MySpace

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Security Code: