views:

1420

answers:

3

Has anyone out there actually succeeded in creating a prerequisitie for o2003.msi?

There are a lot of people out there asking about this, but I cannot find anyone who actually succeeded. I find some extremely complicated solutions where you are required to comple .cpp-files for which the soure may or may not be supplied. I even tried to complie one of those but got configuration error on the target machine... :-(

If I don't install o2003.msi, my Office "Shared Add-In" will throw an exception because office.dll cannot be found. So I would very much like to have it included in my installer.

And a second question, regardless of the outcome of the previous one: what about a machine with Office 2007? 02203.msi complains that Office 2003 is not installed, so there seems to be a lot of things I need to get done in order to create a working installer for an "Office Shared Add-In"... anyone else going through the same nightmare?

Update: It seems to be the PIA for Office.Core / "office.dll" which is the really thing to get on the traget machine. None of the "complicated" solutions (which I know I can get to work if I put some effort in it) talks how to detect this particular file, just PIAs for Word & Excel and then some. These seems to be in place anyway. It's office.dll that is the important file to check for and install o2003pia.msi if it is not properly installed!

A: 

No answer? Well, it doesn't matter that much - since both 02003pia.msi and o2007pia.msi can be installed multiple times without complaining, it is not that important to check if it is already installed.

danbystrom
+2  A: 

Hey Dan,

This is probably too little too late, but here's a solution I've done for installing our company's office 2003 and 2007 addins using a small bit of C# code. Maybe it could work for you.

I use the Product Codes for both the o2003pia and the o2007pia installations which are:

2003: {91490409-6000-11D3-8CFE-0150048383C9}

2007: {50120000-1105-0000-0000-0000000FF1CE}

Then, by calling the MSI API you can get the install state for each. Here's an example of finding the 2003:

[DllImport("msi.dll")]
    private static extern MsiInstallState MsiQueryProductState
        (string productGuid);
    [DllImport("msi.dll")]
    private static extern uint MsiGetProductInfo
        (string productGuid, string propertyName, StringBuilder valueBuffer, ref Int32 bufferSize);

    bool IsPia2003Installed()
    {
        MsiInstallState state = MsiQueryProductState("{91490409-6000-11D3-8CFE-0150048383C9}");

        return (state == MsiInstallState.msiInstallStateDefault);
    }

If you're trying to accomplish all of this entirely inside the setup project (I assume you're using Visual Studio?) then you can add a "Windows Installer Search" launch condition that checks for the above mentioned ProductCodes. If it's satisfied you can run a custom action that installs the PIAs.

For more information on this solution I'd suggest starting here here.

Mel Green
Great, thanks! We haven't begun creating our "final" installation package yet, so this is valuable information. Trying to use C# code before .NET has installed is doomed I'm afraid, so guess I have to resort to plain C++...
danbystrom
Hey Dan, I'm glad I could help. This is a tricky business to accomplish. What we do is have a C++ app that runs before our installation and checks-for/installs .Net. Then during our installation we can do all the fancy stuff to install our addins. Good luck to you!
Mel Green
+1  A: 

Not sure why, but I looked at the O2003PIA.MSI and O2007PIA.MSI, and got the following product codes:

O2003PIAProductCode = "{90409419-0006-3D11-C8EF-10054038389C}"

O2007PIAProductCode = "{00002105-5011-0000-0000-000000F01FEC}"