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.

133 lines
5.0 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name :
  4. webcomp.hxx
  5. Abstract:
  6. Class used to install the World Wide Web component
  7. Author:
  8. Christopher Achille (cachille)
  9. Project:
  10. Internet Services Setup
  11. Revision History:
  12. April 2002: Created
  13. --*/
  14. #include "compinst.hxx"
  15. #include "iadmw.h"
  16. #include "iiscnfg.h"
  17. #include "mdkey.h"
  18. /*
  19. This is a simple class, that makes two arrays to be seen like one without any overhead
  20. See usage in the class bellow
  21. */
  22. template <typename T, T* FIRST, T* SECOND, int SIZE_FIRST, int SIZE_SECOND>
  23. class TwoArraysLikeOne
  24. {
  25. public:
  26. static const ARRAY_SIZE = SIZE_FIRST + SIZE_SECOND;
  27. static const ASIZE_FIRST = SIZE_FIRST;
  28. static const ASIZE_SECOND = SIZE_SECOND;
  29. static T& Element( int i )
  30. {
  31. if ( i < SIZE_FIRST )
  32. {
  33. return FIRST[ i ];
  34. }
  35. else if ( i < ( SIZE_SECOND + SIZE_FIRST ) )
  36. {
  37. return SECOND[ i - SIZE_FIRST ];
  38. }
  39. else
  40. {
  41. _ASSERT( false ); // Invalid index
  42. return FIRST[ 0 ];
  43. }
  44. }
  45. // Check if an index is part of the first or the second array
  46. static bool IsIndexInFirst( int iIndex )
  47. {
  48. return ( iIndex < SIZE_FIRST );
  49. }
  50. };
  51. class CWebServiceInstallComponent : public CInstallComponent
  52. {
  53. private:
  54. static const int EXTENSIONS_EXTERNAL = 3;
  55. static sOurDefaultExtensions m_aExternalExt[ EXTENSIONS_EXTERNAL ]; // External extensionto chech for 404.dll
  56. typedef TwoArraysLikeOne< sOurDefaultExtensions,
  57. g_OurExtensions,
  58. m_aExternalExt,
  59. EXTENSION_ENDOFLIST,
  60. EXTENSIONS_EXTERNAL> TExtToCheck;
  61. private:
  62. BOOL m_bMofCompRun : 1;
  63. BOOL m_bWebDavIsDisabled : 1;
  64. TSTR_MSZ m_mstrOldCgiRestList;
  65. TSTR_MSZ m_mstrOldIsapiRestList;
  66. static BOOL SetAppropriateRegistryAcls(); // Set Registry ACL's for the WWW service
  67. BOOL SetApplicationDependencies(); // Set the application dependencies in the metabase
  68. BOOL SetRestrictionList(); // Set the restriction list
  69. BOOL DisableW3SVCOnUpgrade(); // DisableW3SVCOnWin2kUpgrade
  70. BOOL SetServiceToManualIfNeeded(); // Set the service to manual if specified
  71. BOOL UpgradeWAMUsers(); // Moves all MD_WAM_USER_NAMEs and "Web Application" members to the IIS_WPG group
  72. BOOL UpgradeRestrictedExtensions(); // Move restricted extension to the new WebSvcExtRestrictionList
  73. BOOL UpdateScriptMapping( LPCWSTR wszMBKey, LPCWSTR wszExt, DWORD iExtInfo );
  74. BOOL DisableIUSRandIWAMLogons(); // Disable Logons via Terminal Services and RAS
  75. BOOL RunMofCompOnIISFiles(); // Run MofComp on our IIS Files
  76. BOOL LogWarningonFAT(); // Log a warning to the log file about FAT drives
  77. BOOL CheckIfWebDavIsDisabled(); // Check if WebDav is disabled
  78. BOOL DisabledWebDavOnUpgrade(); // If webdav was disabled before upgrade, then disable
  79. static BOOL SetWWWRootAclonDir(LPTSTR szPhysicalPath, BOOL bAddIusrDeny );
  80. static BOOL SetPassportAcls( BOOL bAdd ); // Add (TRUE) or Remove (FALSE) IIS_WPG acl to passport
  81. static BOOL RemoveOurAcls( LPTSTR szPhysicalPath); // Remove our acl's from a file/dir
  82. BOOL SetVersionInMetabase(); // Set the IIS version info in the metabase
  83. BOOL RemoveIISHelpVdir( LPCTSTR szMetabasePath, LPCTSTR szPhysicalPath1, LPCTSTR szPhysicalPath2 );
  84. BOOL RemoveHelpVdironUpgrade(); // Remove the iis Help vdir on upgrade
  85. BOOL InitialMetabaseBackUp( BOOL bAdd); // Create/delete a backup of the metabase at the end of setup
  86. BOOL AddInheritFlagToSSLUseDSMap(); // If during upgrade, this metabase setting is set, add the inherit flag to it
  87. BOOL SetRegEntries( BOOL bAdd ); // Set appropriate Registry Entries
  88. BOOL UpdateSiteFiltersAcl(); // Update all the site FilterAcl with the new one
  89. BOOL RetrieveFiltersAcl(CMDValue *pcmdValue); // Retrieve the ACL to use
  90. BOOL IsNumber( LPWSTR szString ); // Determine if the string is a number
  91. static BOOL SetIISTemporaryDirAcls( BOOL bAdd ); // Set ACL's on IIS's Temporary Dirs
  92. static BOOL SetAdminScriptsAcl(); // Set the ACL on the AdminScripts directory
  93. public:
  94. BOOL PreInstall();
  95. BOOL Install();
  96. BOOL PostInstall();
  97. BOOL PreUnInstall();
  98. BOOL UnInstall();
  99. BOOL GetFriendlyName( TSTR *pstrFriendlyName );
  100. LPTSTR GetName();
  101. CWebServiceInstallComponent();
  102. static BOOL RemoveAppropriateFileAcls(); // Remove File ACL's set by out install
  103. static BOOL SetAppropriateFileAcls(); // Set File ACL's for the WWW service
  104. static BOOL SetAppropriateFileAclsforDrive( WCHAR cDriveLetter); // Set File ACL's for the WWW service for a specific drive
  105. static BOOL SetAspTemporaryDirAcl( BOOL bAdd); // Set the ACL on IIS Temporary Directory
  106. };