JDMils
Posts: 50
Joined: Tue Aug 10, 2010 12:42 pm

Can AI detect which, if any, Office interops are installed?

Most of today's VB.Net apps which interface with the Office components (Outlook, Excel, etc) need to have the Office interops installed in the target computer's Global Assembly Cache (GAC) before they will work. Can AI be setup to check which, if any, Office interops are installed in the target computer's GAC or do we have to run custom actions to check the target computer's registry for the interops' existence? Thanks.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Can AI detect which, if any, Office interops are installed?

Hello,

Yes, this can be set from Advanced Installer. It has predefined prerequisites as well as launch conditions that check for the Office PIA installation on the target machine which you can include as part of your installer project.

You can add the launch conditions from the Launch Conditions Page in the Software Launch Conditions tab( Installed Office PIA ) and the prerequisites in the Prerequisites Page, by selecting them from the "Add" menu on the right.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
JDMils
Posts: 50
Joined: Tue Aug 10, 2010 12:42 pm

Re: Can AI detect which, if any, Office interops are installed?

I'm not sure I understand how to set this up. This is what I require:

My requirements are:

* Check if Office 2007 Interops are installed (Outlook & Excel in particular)
* Check if Office 2010 Interops are installed (Outlook & Excel in particular)

If both are not installed then I would like my setup package to stop and display a message stating how the user could fix the issue (maybe display an RTF file or a clickable link to another site).

If this is possible then how do I set it up? Thanks.
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Can AI detect which, if any, Office interops are installed?

Hi,

You can check for PIA 2007 and 2010 separately, but cannot interconnect there result, i.e. if one of the searches fails the installer will not be installed on the
machine and the user will receive a message box notifying him about this.

Also, our support allows you to check only for a certain application, i.e Outlook or Excel, not both of them.

For more support you can create your own custom launch conditions, as in the following example.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
JDMils
Posts: 50
Joined: Tue Aug 10, 2010 12:42 pm

Re: Can AI detect which, if any, Office interops are installed?

I do not think AI can do this, and this is a basic function: Check if at least one MS Office Interop is installed for either Office 2003, 2007 or 2010. Here's why:

A VB.Net app which interfaces with MS Outlook 2007 uses the Office 2007 Interop to reference the Outlook object model. When this app is installed on a machine which has MS Office 2010 and executed, the DotNet Framework on that machine detects the app is trying to reference Office 2007, but since the target machine is Office 2010, Dot Net Framework automatically redirects the Office 2007 Interop calls to the installed Office 2010 Interops. So the Dot Net Framework acts as a sort of data traffic cop.

So, for my Dot Net app to run on the target machine which can contain either Office 2007 or Office 2010, it needs one of these interops installed. Caveat: If Office is installed on a Windows machine beforethe Dot Net Framework, the Office Interops are not installed!

Thus, AI needs to check both the following:

* If Office 2007 is installed, are the Office 2007 Interops installed?
* If Office 2010 is installed, are the Office 2010 Interops installed?

If both the above checks are false, then AI needs to either stop the installation and display an RTF file showing the user how to manually install the Interops or automatically launch the correct Interop installer for the installed Office version. For me at the moment, I am more than happy to use the former method and display the RTF file.

I have not been able to find a definitive method to determine if Office interops are installed, however I have discovered the following:

* If Office 2007 is installed but no interops:

Code: Select all

HKEY_CLASSES_ROOT\TypeLib\{00062FFF-0000-0000-C000-000000000046}\9.3 exists and contains:
     "(Default) = "Microsoft Outlook 12.0 Object Library".
* If Office 2007 is installed with interops:

Code: Select all

HKEY_CLASSES_ROOT\TypeLib\{00062FFF-0000-0000-C000-000000000046}\9.3 exists and contains "(Default) = "Microsoft Outlook 12.0 Object Library" and contains:
     "PrimaryInteropAssemblyName = "Microsoft.Office.Interop.Outlook, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"
* If Office 2010 is installed but no interops:

Code: Select all

HKEY_CLASSES_ROOT\TypeLib\{00062FFF-0000-0000-C000-000000000046}\9.4 exists and contains:
     "(Default) = "Microsoft Outlook 14.0 Object Library".
* If Office 2010 is installed with interops:

Code: Select all

HKEY_CLASSES_ROOT\TypeLib\{00062FFF-0000-0000-C000-000000000046}\9.4 exists and contains "(Default) = "Microsoft Outlook 14.0 Object Library" and contains:
     "PrimaryInteropAssemblyName = "Microsoft.Office.Interop.Outlook, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"
I tried using searches for each of the above criteria and then incorporate the results into a custom launch condition but the Expression textbox for the the condition cannot handle the number of characters I need to create the expression.

If you can put the above logic into AI then you're a genious! :D
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Can AI detect which, if any, Office interops are installed?

Hello,

You can try to assign the long strings to public properties with meaningful names and use those properties in the condition field.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
JDMils
Posts: 50
Joined: Tue Aug 10, 2010 12:42 pm

Re: Can AI detect which, if any, Office interops are installed?

Is there no way for AI to detect if ANY Office interops are installed and if not to install them from an MS redistributable? AI can do it for individual interops already so how does it do this?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Can AI detect which, if any, Office interops are installed?

Hello,

You can try to create a custom prerequisite which includes the searches from all three Office PIA predefined prerequisites. You can copy paste the searches so you don't have to manually create them.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
JDMils
Posts: 50
Joined: Tue Aug 10, 2010 12:42 pm

Re: Can AI detect which, if any, Office interops are installed?

There is no way to specify the following criteria:

If Office2007 installed but not Office 2007 Interops installed then ShowUserMsg(" You must install the Office 2007 Interops first")

OR

If Office2010 installed but not Office 2010 Interops installed then ShowUserMsg(" You must install the Office 2010 Interops first")



The aim of the test is to check which version of Office is installed and then determine if that Office's Interops are installed as well. If not, stop the installation and show a message or better show an RTF file.

The other thing I have done is written a Dot.Net command-line app which outputs "12" or "14" depending on which Office Interop is installed else outputs "00" to signify that there are no onterops installed. How can I integrate this into my launch conditions?
JDMils
Posts: 50
Joined: Tue Aug 10, 2010 12:42 pm

Re: Can AI detect which, if any, Office interops are installed?

I tried the following Launch Condition:

( OUTLOOK_2007_REGKEY = OUTLOOK2007_Found ) AND ( OUTLOOK_2007_INTEROP_REGKEY ~>< OUTLOOK_Interops_Found )

Where:

* OUTLOOK_2007_REGKEY, Custom Search:

Code: Select all

Root: HKEY_CLASSES_ROOT
Key: TypeLib\{00062FFF-0000-0000-C000-000000000046}\9.3
Name: [~]
* OUTLOOK2007_Found

Code: Select all

Value = "Microsoft Outlook 12.0 Object Library"
* OUTLOOK_2007_INTEROP_REGKEY, Custom Search:

Code: Select all

Root: HKEY_CLASSES_ROOT
Key: TypeLib\{00062FFF-0000-0000-C000-000000000046}\9.3
Name: "PrimaryInteropAssemblyName"
* OUTLOOK2007_Interops_Found

Code: Select all

Value = "Microsoft.Office.Interop.Outlook, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"
((Quotes in strings are there for visual delimiting purposes- don't put them into the AI values))

The logic is:

If OUTLOOK2007 is installed and the OUTLOOK2007 Interops are not, then stop the installation.

So this stops the installation of my app if Outlook 2007 is installed but the Outlook 2007 Interops are not. So how do I now display an RTF file showing the user how to fix this issue?

PS. I cannot use Prerequisites because they do not allow AND & OR combinations in logic searches.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Can AI detect which, if any, Office interops are installed?

Hello,
So how do I now display an RTF file showing the user how to fix this issue?
Unfortunately, there is no predefined way to display a .RTF file when a launch condition is not met. However you can display a custom message from the custom launch condition's Description field or implement it using custom behavior.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”