Saturday, May 9, 2009

Detect if PIA 2007 is installed on a computer

Distributing applications that uses the Redistributable Primary Interop Assemblies for the 2007 Microsoft Office System. Can be a challenge. A article on MSDN written by Wouter van Vugt and Ted Pattison Deploying a Visual Studio Tools for the Office System 3.0… really helped me along…

I am using Setup Factory by Indigo Rose to create my MSI package. During the initial setup I can define various launch conditions for my MSI. The launch conditions are defined by the results returned from searching for files, registry entries, components etc.

As described in the article mentioned above I am checking for the component identifier for the product that my deployed application is dependent on. In my case MS Outlook 2007.

Outlook Component ID

This will successfully detect if Outlook 2007 PIA is installed on the system. But when I removed Office 2007 PIA from the system (Not a reboot) The component search still returned true (The location in the GAC). So to modify the launch condition query I also added a folder search in the Installer directory.

Outlook Folder ID

So my launch condition for the MSI that is dependent on the Office 2007 PIA checks the presence of the installer files from the PIA MSI and the Component ID of the Outlook PIA to make sure that Outlook PIA is installed on the system.

Launch conditions