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.

211 lines
6.5 KiB

  1. #include "itemlist.hxx"
  2. #include "funcdict.hxx"
  3. #ifndef _INITAPP_H_
  4. #define _INITAPP_H_
  5. typedef PVOID HINF;
  6. #define USER_SPECIFIED_INFO_WWW_USER_NAME 0x00000001
  7. #define USER_SPECIFIED_INFO_WWW_USER_PASS 0x00000002
  8. #define USER_SPECIFIED_INFO_FTP_USER_NAME 0x00000004
  9. #define USER_SPECIFIED_INFO_FTP_USER_PASS 0x00000008
  10. #define USER_SPECIFIED_INFO_WAM_USER_NAME 0x00000010
  11. #define USER_SPECIFIED_INFO_WAM_USER_PASS 0x00000020
  12. #define USER_SPECIFIED_INFO_PATH_WWW 0x000000040
  13. #define USER_SPECIFIED_INFO_PATH_FTP 0x000000080
  14. #define USER_SPECIFIED_INFO_PATH_INETPUB 0x000000100
  15. // SvcManualStart settings
  16. #define USER_SPECIFIED_INFO_MANUAL_START_WWW 0x000000200
  17. #define USER_SPECIFIED_INFO_MANUAL_START_FTP 0x000000400
  18. int TCPIP_Check_Temp_Hack(void);
  19. void GetUserDomain(void);
  20. int AreWeCurrentlyInstalled();
  21. void Check_Custom_WWW_or_FTP_Path(void);
  22. void Check_Custom_Users(void);
  23. void Check_Unattend_Settings(void);
  24. int Check_Custom_InetPub(void);
  25. void Check_For_DebugServiceFlag(void);
  26. void Check_SvcManualStart( void );
  27. class CInitApp : public CObject
  28. {
  29. public:
  30. CInitApp();
  31. ~CInitApp();
  32. public:
  33. int m_err;
  34. HINF m_hInfHandle;
  35. HINF m_hInfHandleAlternate;
  36. BOOL m_bAllowMessageBoxPopups;
  37. BOOL m_bThereWereErrorsChkLogfile;
  38. BOOL m_bThereWereErrorsFromMTS;
  39. BOOL m_bWin95Migration;
  40. BOOL m_bIISAdminWasDisabled;
  41. // Product name and application name
  42. CString m_csAppName;
  43. CString m_csIISGroupName; // Start menu IIS Program Group Name
  44. // account + passwd for anonymous user
  45. CString m_csGuestName;
  46. CString m_csGuestPassword;
  47. CString m_csWAMAccountName;
  48. CString m_csWAMAccountPassword;
  49. CString m_csWWWAnonyName;
  50. CString m_csWWWAnonyPassword;
  51. CString m_csFTPAnonyName;
  52. CString m_csFTPAnonyPassword;
  53. // dwUnattendUserSpecified Values:
  54. // USER_SPECIFIED_INFO_WWW_USER_NAME
  55. // USER_SPECIFIED_INFO_WWW_USER_PASS
  56. // USER_SPECIFIED_INFO_FTP_USER_NAME
  57. // USER_SPECIFIED_INFO_FTP_USER_PASS
  58. // USER_SPECIFIED_INFO_WAM_USER_NAME
  59. // USER_SPECIFIED_INFO_WAM_USER_PASS
  60. // USER_SPECIFIED_INFO_PATH_WWW
  61. // USER_SPECIFIED_INFO_PATH_FTP
  62. // USER_SPECIFIED_INFO_PATH_INETPUB
  63. DWORD dwUnattendConfig;
  64. // storage for the user specified unattended iwam/iusr users
  65. CString m_csWAMAccountName_Unattend;
  66. CString m_csWAMAccountPassword_Unattend;
  67. CString m_csWWWAnonyName_Unattend;
  68. CString m_csWWWAnonyPassword_Unattend;
  69. CString m_csFTPAnonyName_Unattend;
  70. CString m_csFTPAnonyPassword_Unattend;
  71. // storage for the iusr/iwam accounts which need to get
  72. // removed during a removal, this could be different from
  73. // what is getting added -- since unattend parameters could
  74. // have been specified!
  75. CString m_csWAMAccountName_Remove;
  76. CString m_csWWWAnonyName_Remove;
  77. CString m_csFTPAnonyName_Remove;
  78. CMapStringToString m_cmssUninstallMapList;
  79. BOOL m_fUninstallMapList_Dirty;
  80. // machine status
  81. CString m_csMachineName;
  82. CString m_csUsersDomain;
  83. CString m_csUsersAccount;
  84. CString m_csWinDir;
  85. CString m_csSysDir;
  86. CString m_csSysDrive;
  87. CString m_csPathSource;
  88. CString m_csPathOldInetsrv;
  89. CString m_csPathInetsrv;
  90. CString m_csPathInetpub;
  91. CString m_csPathFTPRoot;
  92. CString m_csPathWWWRoot;
  93. CString m_csPathWebPub;
  94. CString m_csPathProgramFiles;
  95. CString m_csPathIISSamples;
  96. CString m_csPathScripts;
  97. CString m_csPathASPSamp;
  98. CString m_csPathAdvWorks;
  99. CString m_csPathIASDocs;
  100. CString m_csPathOldPWSFiles;
  101. CString m_csPathOldPWSSystemFiles;
  102. NT_OS_TYPE m_eNTOSType;
  103. OS m_eOS;
  104. DWORD m_dwOSBuild;
  105. DWORD m_dwOSServicePack;
  106. BOOL m_fNT5; // TRUE if OS is NT
  107. BOOL m_fW95; // TRUE if OS is NT
  108. CString m_csPlatform; // Alpha, Mips, PPC, i386
  109. DWORD m_dwNumberOfProcessors;
  110. BOOL m_fTCPIP; // TRUE if TCP/IP is installed
  111. UPGRADE_TYPE m_eUpgradeType; // UT_NONE, UT_10, UT_20, etc.
  112. BOOL m_bUpgradeTypeHasMetabaseFlag;
  113. INSTALL_MODE m_eInstallMode; // IM_FRESH, IM_MAINTENANCE, IM_UPGRADE
  114. DWORD m_dwSetupMode;
  115. BOOL m_bPleaseDoNotInstallByDefault;
  116. BOOL m_bRefreshSettings; // FALSE: refresh files only, TRUE: refresh files + refresh all settings
  117. ACTION_TYPE m_eAction; // AT_FRESH, AT_ADDREMOVE, AT_REINSTALL, AT_REMOVEALL, AT_UPGRADE
  118. // Some Specific flags set from ocmanage
  119. DWORDLONG m_fNTOperationFlags;
  120. BOOL m_fNTGuiMode;
  121. BOOL m_fNtWorkstation;
  122. BOOL m_fInvokedByNT; // superset of m_fNTGuiMode and ControlPanel which contains sysoc.inf
  123. BOOL m_fUnattended;
  124. CString m_csUnattendFile;
  125. HINF m_hUnattendFile;
  126. BOOL m_fEULA;
  127. BOOL m_fMoveInetsrv;
  128. CString m_csPathSrcDir;
  129. CString m_csPathNTSrcDir;
  130. CString m_csMissingFile;
  131. CString m_csMissingFilePath;
  132. BOOL m_fWebDownload;
  133. CFunctionDictionary FuncDict;
  134. public:
  135. // Implementation
  136. int MsgBox(HWND hWnd, int strID, UINT nType, BOOL bGlobalTitle);
  137. int MsgBox2(HWND hWnd, int iID,CString csInsertionString,UINT nType);
  138. public:
  139. BOOL InitApplication();
  140. void DumpAppVars();
  141. void ReGetMachineAndAccountNames();
  142. void DefineSetupModeOnNT();
  143. BOOL IsTCPIPInstalled();
  144. void SetInetpubDerivatives();
  145. void ResetWAMPassword();
  146. void UnInstallList_Add(CString csItemUniqueKeyName,CString csDataToAdd);
  147. void UnInstallList_DelKey(CString csItemUniqueKeyName);
  148. void UnInstallList_DelData(CString csDataValue);
  149. void UnInstallList_Dump();
  150. void UnInstallList_RegRead();
  151. void UnInstallList_RegWrite();
  152. void UnInstallList_SetVars();
  153. CString UnInstallList_QueryKey(CString csItemUniqueKeyName);
  154. BOOL IsUpgrade();
  155. DWORD GetUpgradeVersion();
  156. BOOL InitApplicationforSysPrep();
  157. private:
  158. BOOL GetSysDirs();
  159. BOOL GetOS();
  160. BOOL GetOSVersion();
  161. BOOL GetOSType();
  162. BOOL SetInstallMode();
  163. void GetPlatform();
  164. BOOL GetMachineStatus();
  165. BOOL GetMachineName();
  166. int SetUpgradeType();
  167. void SetSetupParams();
  168. void SetInetpubDir();
  169. void GetOldIISDirs();
  170. void GetOldWWWRootDir();
  171. void DeriveInetpubFromWWWRoot();
  172. void GetOldIISSamplesLocation();
  173. void GetOldInetSrvDir();
  174. int Check_Custom_InetPub();
  175. void Check_Unattend_Settings();
  176. };
  177. /////////////////////////////////////////////////////////////////////////////
  178. #endif // _INITAPP_H_