Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
3.2 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name :
  4. compinst.hxx
  5. Abstract:
  6. Base classes that are used to define the different
  7. instalations
  8. Author:
  9. Christopher Achille (cachille)
  10. Project:
  11. Internet Services Setup
  12. Revision History:
  13. April 2002: Created
  14. --*/
  15. #ifndef INCLUDE_COMPINST_HXX
  16. #define INCLUDE_COMPINST_HXX
  17. #define COMPONENTS_MAXNUMBER 15
  18. // CInstallComponent
  19. //
  20. // This is the base class that describes what the inheritted classes (features) must
  21. // do to conform to this instalation method
  22. //
  23. class CInstallComponent {
  24. protected:
  25. static BOOL IsUpgrade(); // Is this an upgrade
  26. DWORD GetUpgradeVersion(); // Get the version we are upgrading from
  27. public:
  28. virtual BOOL Initialize(); // Initialization work if any needed
  29. virtual BOOL PreInstall(); // Work to be done before real instalation
  30. virtual BOOL Install(); // The main instalation work
  31. virtual BOOL PostInstall(); // What is done after all the instalation is done
  32. virtual BOOL PreUnInstall(); // Work to be done before uninstall
  33. virtual BOOL UnInstall(); // Work to do Uninstall
  34. virtual BOOL PostUnInstall(); // Work to be done after install
  35. virtual BOOL IsInstalled( LPBOOL pbIsInstalled ); // Is this component installed already?
  36. // Query Information about component
  37. virtual LPTSTR GetName() = 0; // What is the name for this components (used in OCManager)
  38. virtual BOOL GetFriendlyName( TSTR *pstrFriendlyName ); // Get friendly name for component
  39. virtual BOOL GetSmallIcon( HBITMAP *phIcon ); // Query Icon
  40. };
  41. // CComponentList
  42. //
  43. // This is a collection of all the components we install. This is so that we can
  44. // easily call install and uninstall on these components
  45. //
  46. class CComponentList {
  47. private:
  48. CInstallComponent *m_pComponentList[COMPONENTS_MAXNUMBER]; // The List of Components
  49. DWORD m_dwNumberofComponents;
  50. CInstallComponent *FindComponent(LPCTSTR szComponentName); // Find a component by name
  51. DWORD GetNumberofComponents();
  52. public:
  53. CComponentList();
  54. ~CComponentList();
  55. BOOL Initialize(); // Initialize the list of components
  56. BOOL PreInstall(LPCTSTR szComponentName); // Do PreInstall Work for a component
  57. BOOL Install(LPCTSTR szComponentName); // Do Install Work for component
  58. BOOL PostInstall(LPCTSTR szComponentName); // Do Post Install work for component
  59. BOOL PreUnInstall(LPCTSTR szComponentName); // Do Pre Uninstall Work for a component
  60. BOOL UnInstall(LPCTSTR szComponentName); // Do Uninstall work for a component
  61. BOOL PostUnInstall(LPCTSTR szComponentName); // Do Post Uninstall work for a component
  62. BOOL IsInstalled(LPCTSTR szComponentName,
  63. LPBOOL pbIsInstalled ); // Is the component installed already?
  64. BOOL GetFriendlyName( LPCTSTR szComponentName, TSTR *pstrFriendlyName ); // Get friendly name
  65. BOOL GetSmallIcon( LPCTSTR szComponentName, HBITMAP *phIcon ); // Get Icon
  66. };
  67. #endif