Skip to main content
Windward

How does MS Word determine if it has Service Pack 2 installed?

autotag-wiki-logo.pngOverview

How does MS Word determine if it has Service Pack 2 installed?

Resolution

  1. Verifies HKEY_CLASSES_ROOT\Word.Application is in the registry.
  2. Uses HKEY_CLASSES_ROOT\Word.Application\CLSID to then read either
    HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{000209FF-0000-0000-C000-000000000046
    or
    HKEY_CLASSES_ROOT\CLSID\{000209FF-0000-0000-C000-000000000046}
    Which generally returns: C:\\PROGRA~2\\MICROS~1\\Office14\\WINWORD.EXE (removing all text after the first space).
  3. Calls FileVersionInfo.GetVersionInfo(appPath) (where appPath is the C:\\PROGRA~2\\MICROS~1\\Office14\\WINWORD.EXE returned from the registry).
  4. For Word 2007 (version 12) it then returns:
// No service pack
if (dllVersionMinor == 0)
    if (dllVersionBuild < 6213)
        return 0;
    else if ((dllVersionBuild == 6214) && (dllVersionPrivate < 1000))
        return 0;

// Service pack 1
if (dllVersionMinor == 0)
    if (dllVersionBuild < 6425)
        return 1;
    else if ((dllVersionBuild == 6425) && (dllVersionPrivate < 1000))
        return 1;

// Service pack 2
return 2;
  • Was this article helpful?