Since I am the one that suggested the INI file many years back, I think it's
about time I looked at a new approach.  

So, starting with the default file association for XLS files, you could
trace it back to the exe that it wants to use, and then get a version from
the associated file...

Namely, connecting to the registry and HKCR, then looking at the default
association for .XLS
HKCR\.XLS

Finding out that the default type for .XLS is an object of type
Excel.Sheet.8 (for XP, but older versions are undoubtedly different).
HKCR\Excel.Sheet.8

Then looking up the Default CLSID for Excel.Sheet.8 that you find from the
previous Key.
HKCR\CLSID\{00020820-0000-0000-C000-000000000046}

Then look up the Default LocalServer for that CLSID (executable name),
HKCR\CLSID\{00020820-0000-0000-C000-000000000046}\LocalServer

And lastly doing a FileVersion for the Executable.
if (Win32::AdminMisc::GetFileInfo(
"C:\PROGRA~1\MICROS~3\Office10\excel.exe", \%Attribute)){
    print "Excel has the following version:
$Attribute{FileInfo}{ProductVersion}\n";
}

I get 10.0.2614.0, which I am not certain about, but I believe it is Office
XP SP 1 or 2 

Then you have to translate it to a valid version and SP with the info you
get based on a hash of possible Product Versions that you would have to
assemble or find listed in a Q article somewhere.

It looks like a lot, but will probably boil down to 30 lines of code.  (Do I
hear someone that can do it in 29 or less?  ["Name that Perl script"])

Steven

-----Original Message-----
From: Bateman, John (IQAUS is) [mailto:[EMAIL PROTECTED]] 
Sent: Friday, October 04, 2002 12:33 PM
To: [EMAIL PROTECTED]
Subject: Determining which version of ms office installed and it's service
pack...


Hello,
        I did some searching through the archives to try to find a way to
determine the version of office if xp and then find the service pack.
I found some postings for people determining if it is 97 by looking for an
ini file.  I had thought about this route also but am unable to find a ini
file with such description for office xp.  This can sometimes get sticky on
non English windows pcs with other versions of office as well.  I then
thought about the wmi, but am afraid have struck out there as well.  There
are application classes, but none seem to identify what I am looking for.

Has anyone tried this?

Any help is appreciated.
Thanks
John
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to