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.

217 lines
5.7 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CTaskCleanInstall.cpp
  7. //
  8. // Description:
  9. // Implementation file for the CTaskCleanInstall class.
  10. //
  11. // Header File:
  12. // CTaskCleanInstall.h
  13. //
  14. // Maintained By:
  15. // Vij Vasu (Vvasu) 18-APR-2000
  16. // Created this file.
  17. //
  18. //////////////////////////////////////////////////////////////////////////////
  19. //////////////////////////////////////////////////////////////////////////////
  20. // Include Files
  21. //////////////////////////////////////////////////////////////////////////////
  22. // Precompiled header for this DLL.
  23. #include "pch.h"
  24. // The header file for this module.
  25. #include "CTaskCleanInstall.h"
  26. //////////////////////////////////////////////////////////////////////////////
  27. // Macro Definitions
  28. //////////////////////////////////////////////////////////////////////////////
  29. // Needed for tracing.
  30. DEFINE_THISCLASS( "CTaskCleanInstall" )
  31. /////////////////////////////////////////////////////////////////////////////
  32. //++
  33. //
  34. // CTaskCleanInstall::CTaskCleanInstall
  35. //
  36. // Description:
  37. // Constructor of the CTaskCleanInstall class.
  38. //
  39. // Arguments:
  40. // const CClusOCMApp & rAppIn
  41. // Reference to the CClusOCMApp object that is hosting this task.
  42. //
  43. // Return Value:
  44. // None.
  45. //
  46. //--
  47. /////////////////////////////////////////////////////////////////////////////
  48. CTaskCleanInstall::CTaskCleanInstall( const CClusOCMApp & rAppIn )
  49. : BaseClass( rAppIn )
  50. {
  51. TraceFunc( "" );
  52. //
  53. // Make sure that this object is being instatiated only when required.
  54. //
  55. // Assert that we will install binaries only when none were installed
  56. // previously.
  57. Assert( rAppIn.CisGetClusterInstallState() == eClusterInstallStateUnknown );
  58. TraceFuncExit();
  59. } //*** CTaskCleanInstall::CTaskCleanInstall()
  60. /////////////////////////////////////////////////////////////////////////////
  61. //++
  62. //
  63. // CTaskCleanInstall::~CTaskCleanInstall
  64. //
  65. // Description:
  66. // Destructor of the CTaskCleanInstall class.
  67. //
  68. // Arguments:
  69. // None.
  70. //
  71. // Return Value:
  72. // None.
  73. //
  74. //--
  75. /////////////////////////////////////////////////////////////////////////////
  76. CTaskCleanInstall::~CTaskCleanInstall( void )
  77. {
  78. TraceFunc( "" );
  79. TraceFuncExit();
  80. } //*** CTaskCleanInstall::~CTaskCleanInstall()
  81. /////////////////////////////////////////////////////////////////////////////
  82. //++
  83. //
  84. // DWORD
  85. // CTaskCleanInstall::DwOcQueueFileOps
  86. //
  87. // Description:
  88. // This function handles the OC_QUEUE_FILE_OPS messages from the Optional
  89. // Components Manager. It installs the files needed for a clean install.
  90. //
  91. // Arguments:
  92. // HSPFILEQ hSetupFileQueueIn
  93. // Handle to the file queue to operate upon.
  94. //
  95. // Return Value:
  96. // NO_ERROR if all went well.
  97. // Other Win32 error codes on failure.
  98. //
  99. //--
  100. /////////////////////////////////////////////////////////////////////////////
  101. DWORD
  102. CTaskCleanInstall::DwOcQueueFileOps( HSPFILEQ hSetupFileQueueIn )
  103. {
  104. TraceFunc( "" );
  105. LogMsg( "Entering " __FUNCTION__ "()" );
  106. // The base class helper function does everything that we need to do here.
  107. // So, just call it.
  108. DWORD dwReturnValue = TW32( BaseClass::DwOcQueueFileOps( hSetupFileQueueIn, INF_SECTION_CLEAN_INSTALL ) );
  109. TraceFlow1( "Return Value is %#x.", dwReturnValue );
  110. LogMsg( "Return Value is %#x.", dwReturnValue );
  111. RETURN( dwReturnValue );
  112. } //*** CTaskCleanInstall::DwOcQueueFileOps()
  113. /////////////////////////////////////////////////////////////////////////////
  114. //++
  115. //
  116. // DWORD
  117. // CTaskCleanInstall::DwOcCompleteInstallation
  118. //
  119. // Description:
  120. // This function handles the OC_COMPLETE_INSTALLATION messages from the
  121. // Optional Components Manager during a clean install.
  122. //
  123. // Registry operations, COM component registrations, creation of servies
  124. // etc. are performed in this function.
  125. //
  126. // Arguments:
  127. // None.
  128. //
  129. // Return Value:
  130. // NO_ERROR if all went well.
  131. // Other Win32 error codes on failure.
  132. //
  133. //--
  134. /////////////////////////////////////////////////////////////////////////////
  135. DWORD
  136. CTaskCleanInstall::DwOcCompleteInstallation( void )
  137. {
  138. TraceFunc( "" );
  139. LogMsg( "Entering " __FUNCTION__ "()" );
  140. // The base class helper function does everything that we need to do here.
  141. // So, just call it.
  142. DWORD dwReturnValue = TW32( BaseClass::DwOcCompleteInstallation( INF_SECTION_CLEAN_INSTALL ) );
  143. TraceFlow1( "Return Value is %#x.", dwReturnValue );
  144. LogMsg( "Return Value is %#x.", dwReturnValue );
  145. RETURN( dwReturnValue );
  146. } //*** CTaskCleanInstall::DwOcCompleteInstallation()
  147. /////////////////////////////////////////////////////////////////////////////
  148. //++
  149. //
  150. // DWORD
  151. // CTaskCleanInstall::DwOcCleanup
  152. //
  153. // Description:
  154. // This function handles the OC_CLEANUP messages from the
  155. // Optional Components Manager during a clean install.
  156. //
  157. // If an error has previously occurred during this task, cleanup operations
  158. // are performed. Otherwise nothing is done by this function.
  159. //
  160. // Arguments:
  161. // None.
  162. //
  163. // Return Value:
  164. // NO_ERROR if all went well.
  165. // Other Win32 error codes on failure.
  166. //
  167. //--
  168. /////////////////////////////////////////////////////////////////////////////
  169. DWORD
  170. CTaskCleanInstall::DwOcCleanup( void )
  171. {
  172. TraceFunc( "" );
  173. LogMsg( "Entering " __FUNCTION__ "()" );
  174. // The base class helper function does everything that we need to do here.
  175. // So, just call it.
  176. DWORD dwReturnValue = TW32( BaseClass::DwOcCleanup( INF_SECTION_CLEAN_INSTALL_CLEANUP ) );
  177. TraceFlow1( "Return Value is %#x.", dwReturnValue );
  178. LogMsg( "Return Value is %#x.", dwReturnValue );
  179. RETURN( dwReturnValue );
  180. } //*** CTaskCleanInstall::DwOcCleanup()