Source code of Windows XP (NT5)
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.

152 lines
3.3 KiB

  1. // Copyright (c) 1997-2001 Microsoft Corporation
  2. //
  3. // File: InstallationUnit.h
  4. //
  5. // Synopsis: Declares an InstallationUnit
  6. // An InstallationUnit represents a single
  7. // entity that can be installed. (i.e. DHCP, IIS, etc.)
  8. //
  9. // History: 02/03/2001 JeffJon Created
  10. #ifndef __CYS_INSTALLATIONUNIT_H
  11. #define __CYS_INSTALLATIONUNIT_H
  12. #include "pch.h"
  13. // These are the values that can be returned from
  14. // InstallationUnit::InstallService()
  15. typedef enum
  16. {
  17. INSTALL_SUCCESS,
  18. INSTALL_FAILURE,
  19. // this means that there should be no
  20. // logging and reboot is handled by DCPromo
  21. // or Terminal Services installation
  22. INSTALL_SUCCESS_REBOOT,
  23. // this means that the finish page should
  24. // prompt the user to reboot
  25. INSTALL_SUCCESS_PROMPT_REBOOT,
  26. // No changes were selected while going
  27. // through the wizard
  28. INSTALL_NO_CHANGES,
  29. // Installation was cancelled
  30. INSTALL_CANCELLED
  31. } InstallationReturnType;
  32. // This array of strings if for the UI log debugging only
  33. // It should match the values in the InstallationReturnType
  34. // above. The values of the enum are used to index this array
  35. extern String installReturnTypeStrings[];
  36. // This macro is used to make it easier to log the return value from
  37. // the InstallService() methods. It takes a InstallationReturnType
  38. // and uses that to index into the installReturnTypeStrings to get
  39. // a string that is then logged to the the UI debug logfile
  40. #define LOG_INSTALL_RETURN(returnType) LOG(installReturnTypeStrings[returnType]);
  41. // This enum defines the installation unit types. It is used as the key to
  42. // the map in the InstallationUnitProvider to get the InstallationUnit
  43. // associated with the type
  44. typedef enum
  45. {
  46. DNS_INSTALL,
  47. DHCP_INSTALL,
  48. WINS_INSTALL,
  49. RRAS_INSTALL,
  50. NETWORKSERVER_INSTALL,
  51. APPLICATIONSERVER_INSTALL,
  52. FILESERVER_INSTALL,
  53. PRINTSERVER_INSTALL,
  54. SHAREPOINT_INSTALL,
  55. MEDIASERVER_INSTALL,
  56. WEBSERVER_INSTALL,
  57. EXPRESS_INSTALL,
  58. DC_INSTALL,
  59. CLUSTERSERVER_INSTALL,
  60. NO_INSTALL
  61. } InstallationUnitType;
  62. class InstallationUnit
  63. {
  64. public:
  65. // Constructor
  66. InstallationUnit(
  67. unsigned int serviceNameID,
  68. unsigned int serviceDescriptionID,
  69. const String finishPageHelpString,
  70. InstallationUnitType newInstallType = NO_INSTALL);
  71. // Destructor
  72. virtual
  73. ~InstallationUnit() {}
  74. // Installation virtual method
  75. virtual
  76. InstallationReturnType
  77. InstallService(HANDLE logfileHandle, HWND hwnd) = 0;
  78. virtual
  79. bool
  80. IsServiceInstalled() { return false; }
  81. // Return true if the installation unit will make some
  82. // changes during InstallService. Return false if
  83. // if it will not
  84. virtual
  85. bool
  86. GetFinishText(String& message) = 0;
  87. // Data accessors
  88. virtual
  89. String
  90. GetServiceName();
  91. virtual
  92. String
  93. GetServiceDescription();
  94. virtual
  95. String
  96. GetFinishHelp();
  97. InstallationUnitType
  98. GetInstallationUnitType() { return installationUnitType; }
  99. protected:
  100. String name;
  101. String description;
  102. String finishHelp;
  103. unsigned int nameID;
  104. unsigned int descriptionID;
  105. private:
  106. InstallationUnitType installationUnitType;
  107. };
  108. #endif // __CYS_INSTALLATIONUNIT_H