Issues with Office 2007 PIA redist and ComponentCheck.exe

A number of people (see this and this for starters) have reported weird behaviour with ComponentCheck.exe which is used as the prerequisite checker for the VSTO Office 2007 PIA redistributable package that was added in Visual Studio 2008 SP1.

For those of you unfamiliar with how the setup.exe is created when an add-in is published, it may come as a surprise to learn that ComponentCheck.exe ends up being embedded directly into setup.exe. When setup.exe is run on the target machine, ComponentCheck.exe is unpacked to a temporary directory and run from there.

If you're running into unexpected behaviour (e.g. the PIA installer running when you believe it shouldn't or, conversely, the PIA installer not running at all when you believe it should), you might want to try testing ComponentCheck.exe by copying it from the %ProgramFiles%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\Office2007PIARedist directory on your Visual Studio 2008 SP1 dev box to an arbitrary location on a test machine and running it from a batch file as follows:

@echo off

This just serves to run the program and echo its output/return value to the console. This script should echo 1 if the PIAs are already installed or 0 otherwise. The PIAInstallAction property is set to this return value and used to block or enable installation of the PIAs respectively (see the <BypassIf Property="PIAInstallAction" Compare="ValueNotEqualTo" Value="0" /> element in product.xml). You might want to consider trying this a machine with Office 2007 PIAs installed and another machine without the Office 2007 PIAs installed.

If you're seeing genuine issues with this component after running this short test, please don't hesitate to let us know.

Comments (2)

  1. andrewsimmans says:

    I have just upgraded to VS 2008 SP1 and to me the new Componentcheck is not working! In order to test I have uninstalled the Office 2007 PIAs on 2 computers and then try running the test outlined above and in each case the test returns 1 both when the PIAs were installed and then it also returns 1 when they are NOT installed?

    I have also tried removing the ".NET Programmability Support" option in Office 2007 set up (for Outlook) in case it was spotting that but it still returns 1.

    For the moment I am sticking with my old componentcheck, but I would prefer to use the new one as my old one only checks for Outlook PIAs being missing.

    My old componentcheck was built as per

    and I have tested it by having a bat file of

    @echo off

    ComponentCheck.exe {ED569DB3-58C4-4463-971F-4AAABB6440BD}

    echo %ERRORLEVEL%

    This works on both the machines I am testing (but is the "other way round" in that it returns a 0 if the Outlook PIA is present and returns 1607 if not present).

  2. tobyteel says:


    2 parts to this one.  First:

    I had a strange problem.  ComponentCheck.exe appeared to be returning 1, but a windows installer check during my install for the Office Core PIA and Outlook PIA was failing (I’m not sure which check was failing, as I stupidly gave them both the same error message).  

    I forced the user to download and install the o2007pia.msi outside of the bootstrapper, and my installer then worked, and the application installed.

    When does ComponentCheck.exe return 1, specifically what does it use to determine if the PIAs are installed?  Will ComponentCheck.exe return 1 even if not all of the PIAs are installed?  


    It seems to me that the bootstrapper package’s product.xml allows you to check if components are installed.  Why is ComponentCheck.exe used instead of component checks in the product.xml?


Skip to main content