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
ComponentCheck.exe
echo %ERRORLEVEL%
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
Anonymous
July 14, 2009
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 http://msdn.microsoft.com/en-us/library/cc563937.aspx#VSTO3SolutionPart1_PreparingyourDevelopmentComputer 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).Anonymous
February 23, 2010
The comment has been removed