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.

199 lines
6.0 KiB

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