Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

how to check for office/word version?


4 replies to this topic

lapino

lapino
  • Members
  • 1 posts

Posted 22 April 2003 - 14:05

I'm writing an installshield procedure for my employer but I need to find a way to figure out which office version the user has installed. I now use a dialogbox so the user can select his version (word97 - word2000 - wordXP) but I would rather have this selected automatically

How can I do this?

Xitch13

Xitch13
  • Members
  • 134 posts

Posted 22 April 2003 - 17:13

You could look for the registry keys under HKLM (HKEY_LOCAL_MACHINE). They can be found under SOFTWARE\Microsoft\Office...

I'm not sure what all the different keys would be, but you can probably find them with a Google search. On my machines the key is SOFTWARE\Microsoft\Office\9.0.

The code to find the different keys could look something like this:

CODE

RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
   
   szKey = "SOFTWARE\\Microsoft\\Office\\8.0";  
   if (RegDBKeyExist(szKey) = 0) then
           nWordVersion = 8;
   endif;
   szKey = "SOFTWARE\\Microsoft\\Office\\9.0";  
   if (RegDBKeyExist(szKey) = 0) then
           nWordVersion = 9;
   endif;
    .
    .
    .


That's just to give you an idea. Keep in mind that in most cases if you're customers are at home users, they may just have Word installed, so you will also want to find out the registry keys for that. Also, the code above is extremely inelegant. If I were doing it, I'd probably make a list of the possible keys and do a while loop.

Also, you may find in your research a registry key strictly devoted to this information, and would be able to just read that. i have a strong suspicion that would be the case, but don't know it off-hand.

Good luck and let us know if you need any more help

There is great chaos under heaven, and the situation is excellent. (Mao Tse Tung)

Perotin

Perotin
  • Full Members
  • 407 posts

Posted 23 April 2003 - 11:52

Notice that RegDBKeyExist returns "1" if successful.

MS Office versions will be found in registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office, run RegDBQueryKey to get the latest version ("7.0", "8.0", "9.0" ... ).

Gruß / regards
Thomas

Xitch13

Xitch13
  • Members
  • 134 posts

Posted 23 April 2003 - 15:43

Right. 1 is the TRUE statement. Should have been more careful with my copy/paste.

Do you happen to know the regitry entries for just Word?
There is great chaos under heaven, and the situation is excellent. (Mao Tse Tung)

Perotin

Perotin
  • Full Members
  • 407 posts

Posted 24 April 2003 - 10:03

I think for just one application like Word or Excel the key is the same.
In the office-key there are version keys like "8.0" and application keys like "Word", but installed Access does not show up here. So there might be not exact reference to installed programs.
Maybe the "App Paths" keys are more interesting.
In HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths you will find keys for registered programs, like "winword.exe", "msaccess.exe" etc.
You can find the path to these programs here too.
Gruß / regards
Thomas