Задача: Утилиты
Исходник: Проверка установлен ли офис, язык: vb [code #541, hits: 10123]
автор: - [добавлен: 17.12.2007]
  1. function MsiEnumProducts(iComponentIndex: Integer; lpComponentBuf: String): Integer; external 'MsiEnumProductsA@MSI.DLL stdcall';
  2.  
  3. function IsProductInstalled(szCheckedProduct: String): Boolean;
  4. var
  5. index: integer;
  6. szProduct: String;
  7. begin
  8. Result := False;
  9. index := 0;
  10. szProduct := '{00000000-0000-0000-0000-000000000000}';
  11.  
  12. while True do
  13. begin
  14. if 0 <> MsiEnumProducts(index,szProduct) then
  15. break;
  16.  
  17. if szProduct = szCheckedProduct then
  18. Result := True;
  19. index := index + 1;
  20. end;
  21. end;
  22.  
  23.  
  24. function IsOfficeInstalled(): Boolean;
  25. var
  26. Office,Excel: string;
  27. Office2k,OfficeXP,Office2k3: Boolean;
  28. begin
  29. //Office 2k
  30. Office := '{00000409-78E1-11D2-B60F-006097C998E7}';
  31. Office2k := IsProductInstalled(Office);
  32.  
  33. //Office XP
  34. Office := '{20280409-6000-11D3-8CFE-0050048383C9}';
  35. OfficeXP := IsProductInstalled(Office);
  36.  
  37. //Office XP + FrontPage
  38. Office := '{90280409-6000-11D3-8CFE-0050048383C9}';
  39. OfficeXP := OfficeXP OR IsProductInstalled(Office);
  40.  
  41. //Office 2k3 Prof
  42. Office := '{90110409-6000-11D3-8CFE-0150048383C9}';
  43. Office2k3 := IsProductInstalled(Office);
  44.  
  45. //Office 2k3 Std
  46. Office := '{91120409-6000-11D3-8CFE-0150048383C9}';
  47. Office2k3 := Office2k3 OR IsProductInstalled(Office);
  48.  
  49. Result := Office2k OR OfficeXP OR Office2k3;
  50. end;
Источник: http://rsdn.ru/forum/Message.aspx?mid=2335244&only=1

+добавить реализацию