Condividi tramite


Problems installing the Office 2010 PIA’s using the Microsoft Office 2010 Primary Interop Assemblies Bootstrapper Package

Have you tried using the Microsoft Office 2010 Primary Interop Assemblies Bootstrapper Package? Did you not run into any issues? Were you able to install the PIA’s with the default package? I was not so lucky!

One of my customer had created an add-in for Outlook 2010 and had included the Microsoft Office 2010 Primary Interop Assemblies Bootstrapper Package as part of his prerequisites for the add-in.The machine on which the add-in was being installed on did not have the PIA’s for any of the Office product installed. When the Setup.exe for the add-in was run, it still did not install the PIA’s. Why?

After banging my head for quite a while I discovered that the componentcheck.exe was causing the issue. It always returned a value of 1. What does that mean? It means that componentcheck.exe was finding a PIA component on the machine! What was it finding when none of the PIA’s were installed?

Componentcheck.exe checks for the following components and if it finds any one of them it returns 1.

  • Excel
  • InfoPath
  • Outlook
  • PowerPoint
  • Visio
  • Word
  • Project
  • Forms 2.0
  • Graph
  • Smart Tag
  • Office Shared

In my case Office.dll was always there on the machine and hence componentcheck.exe was returning a value of 1. How do I get my add-in setup to install the PIA’s?

The easiest solution is not to use the componentcheck.exe and always force the installation of the PIA’s. How can that be done? Easy…just modify the product.xml and remove the nodes for 1) PackageFile that relates to ComponentCheck.exe 2) The entire InstallChecks section as it is not needed any more 3) The BypassIf  install Condition related to PIAInstallAction and then rebuild you setup.

Below is how the altered product.xml would look after the modification:

 <?xml version="1.0" encoding="utf-8" ?>
<!--
***********************************************************************
 
  Copyright (C) Microsoft Corporation.  All rights reserved.
 
 THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
 PARTICULAR PURPOSE.
***********************************************************************
-->
<Product xmlns="https://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="Microsoft.Office.PIARedist.2010">
  <RelatedProducts>
    <EitherProducts>
      <DependsOnProduct Code="Microsoft.Net.Client.3.5" />  
      <DependsOnProduct Code=".NETFramework,Version=v4.0,Profile=Client" />
    </EitherProducts>
  </RelatedProducts>
  <PackageFiles>
    <PackageFile Name="o2010pia.msi" HomeSite="Office2010PIARedistMSI" 
            PublicKey="3082010A0282010100A2DB0A8DCFC2C1499BCDAA3A34AD23596BDB6CBE2122B794C8EAAEBFC6D526C232118BBCDA5D2CFB36561E152BAE8F0DDD14A36E284C
                       7F163F41AC8D40B146880DD98194AD9706D05744765CEAF1FC0EE27F74A333CB74E5EFE361A17E03B745FFD53E12D5B0CA5E0DD07BF2B7130DFC606A288575
                       8CB7ADBC85E817B490BEF516B6625DED11DF3AEE215B8BAF8073C345E3958977609BE7AD77C1378D33142F13DB62C9AE1AA94F9867ADD420393071E08D6746
                       E2C61CF40D5074412FE805246A216B49B092C4B239C742A56D5C184AAB8FD78E833E780A47D8A4B28423C3E2F27B66B14A74BD26414B9C6114604E30C882F3
                       D00B707CEE554D77D2085576810203010001"/>
  </PackageFiles>
  <Commands Reboot="Defer">
    <Command PackageFile="o2010pia.msi" Arguments="/quiet" EstimatedInstalledBytes="7000000"
      EstimatedInstallSeconds="60">
      <InstallConditions>
        <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired" />
      </InstallConditions>
      <ExitCodes>
        <ExitCode Value="0" Result="Success" />
        <ExitCode Value="1641" Result="SuccessReboot" />
        <ExitCode Value="3010" Result="SuccessReboot" />
        <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
      </ExitCodes>
    </Command>
  </Commands>
</Product>

The not so easy way to do it would be to write your own componentcheck.exe and build your own logic to return 1 or 0. The source for the componentcheck.exe for office 2010 is not available but as a starting point you can use something that was available for Office 2007. The Component IDs of the Redistributable Primary Interop Assemblies for Microsoft Office 2010 can be found here.

 

Enjoy!