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.

437 lines
14 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. // All rights reserved.
  5. //
  6. // Filename:
  7. // setupmgr.h
  8. //
  9. // Description:
  10. // This is the top-level include file for all setupmgr source files.
  11. //
  12. //----------------------------------------------------------------------------
  13. #ifndef _SETUPMGR_H_
  14. #define _SETUPMGR_H_
  15. #include <opklib.h>
  16. #include <windows.h>
  17. #include <windowsx.h>
  18. #include <prsht.h>
  19. #include <stdlib.h>
  20. #include <stdio.h>
  21. #include <tchar.h>
  22. #include <commdlg.h>
  23. #include <setupapi.h>
  24. #include <shlobj.h>
  25. #include <shellapi.h>
  26. #include "wizard.h"
  27. #include "main.h"
  28. #include "comres.h"
  29. #include "supplib.h"
  30. #include "netshrd.h"
  31. #include "timezone.h"
  32. #include "dlgprocs.h"
  33. #include "oc.h"
  34. //
  35. // Global types & buffer dimensions for main pages
  36. //
  37. #define MAX_CMDLINE 1024
  38. //
  39. // Global types & buffer dimensions for base pages
  40. //
  41. #define MAX_PASSWORD 127
  42. #define MAX_NAMEORG_NAME 50
  43. #define MAX_NAMEORG_ORG 50
  44. #define MAX_COMPUTERNAME 63
  45. #define MAX_PRINTERNAME 127 // arbitrarily chosen
  46. #define MAX_SHARENAME 63 // arbitrarily chosen
  47. #define MAX_TARGPATH 63 // arbitrarily chosen
  48. #define MAX_DIST_FOLDER 200
  49. #define MAX_WORKGROUP_LENGTH 128
  50. #define MAX_DOMAIN_LENGTH 128
  51. #define MAX_USERNAME_LENGTH 31
  52. #define MAX_DOMAIN_PASSWORD_LENGTH 255
  53. #define MAX_NETWORK_ADDRESS_LENGTH 80
  54. #define MAX_SIF_DESCRIPTION_LENGTH 65
  55. #define MAX_SIF_HELP_TEXT_LENGTH 260
  56. #define MAX_OEMDUPSTRING_LENGTH 255
  57. #define MAX_HAL_NAME_LENGTH MAX_INILINE_LEN
  58. #define MAX_INS_LEN MAX_PATH
  59. #define MAX_AUTOCONFIG_LEN 1024
  60. #define MAX_PROXY_LEN 1024
  61. #define MAX_PROXY_PORT_LEN 256
  62. #define MAX_EXCEPTION_LEN 4096
  63. #define MAX_HOMEPAGE_LEN 1024
  64. #define MAX_HELPPAGE_LEN 1024
  65. #define MAX_SEARCHPAGE_LEN 1024
  66. #define MAX_ZONE_LEN 256
  67. #define MAX_PID_FIELD 5
  68. #define NUM_PID_FIELDS 5
  69. #define MIN_SERVER_CONNECTIONS 5
  70. typedef TCHAR PRODUCT_ID_FIELD[MAX_PID_FIELD + 1];
  71. //
  72. // We identify a valid cd or netshare as having dosnet.inf. Note, do not
  73. // localize these strings.
  74. //
  75. #define OEM_TXTSETUP_NAME _T("txtsetup.oem")
  76. #define I386_DIR _T("i386")
  77. #define ALPHA_DIR _T("alpha")
  78. #define DOSNET_INF _T("dosnet.inf")
  79. #define I386_DOSNET I386_DIR _T("\\") DOSNET_INF
  80. #define ALPHA_DOSNET ALPHA_DIR _T("\\") DOSNET_INF
  81. typedef enum {
  82. LOAD_UNDEFINED,
  83. LOAD_NEWSCRIPT_DEFAULTS,
  84. LOAD_FROM_ANSWER_FILE,
  85. } LOAD_TYPES;
  86. typedef enum {
  87. PRODUCT_UNATTENDED_INSTALL,
  88. PRODUCT_REMOTEINSTALL,
  89. PRODUCT_SYSPREP
  90. } PRODUCT_TYPES;
  91. typedef enum {
  92. PLATFORM_WORKSTATION = 0x0001,
  93. PLATFORM_SERVER = 0x0002,
  94. PLATFORM_ENTERPRISE = 0x0004,
  95. PLATFORM_WEBBLADE = 0x0008,
  96. PLATFORM_PERSONAL = 0x0010
  97. } PLATFORM_TYPES;
  98. // Groups of platforms
  99. //
  100. #define PLATFORM_NONE (PLATFORM_SERVER)
  101. #define PLATFORM_ALL (PLATFORM_WORKSTATION | PLATFORM_SERVER | PLATFORM_ENTERPRISE | PLATFORM_WEBBLADE | PLATFORM_PERSONAL)
  102. #define PLATFORM_SERVERS (PLATFORM_SERVER | PLATFORM_ENTERPRISE | PLATFORM_WEBBLADE)
  103. #define PLATFORM_USER (PLATFORM_WORKSTATION | PLATFORM_PERSONAL)
  104. typedef enum {
  105. UMODE_GUI_ATTENDED,
  106. UMODE_PROVIDE_DEFAULT,
  107. UMODE_DEFAULT_HIDE,
  108. UMODE_READONLY,
  109. UMODE_FULL_UNATTENDED
  110. } UMODE_TYPES;
  111. typedef enum {
  112. TARGPATH_UNDEFINED,
  113. TARGPATH_WINNT,
  114. TARGPATH_AUTO,
  115. TARGPATH_SPECIFY
  116. } TARGPATH_TYPES;
  117. typedef enum {
  118. TYPICAL_NETWORKING,
  119. CUSTOM_NETWORKING,
  120. DONOTCHANGE_NETWORKING
  121. } NETWORKING_TYPES;
  122. typedef enum {
  123. IE_NO_CUSTOMIZATION,
  124. IE_USE_BRANDING_FILE,
  125. IE_SPECIFY_SETTINGS
  126. } IE_CUSTOMIZATION_TYPES;
  127. typedef enum {
  128. REGIONAL_SETTINGS_NOT_SPECIFIED,
  129. REGIONAL_SETTINGS_SKIP,
  130. REGIONAL_SETTINGS_DEFAULT,
  131. REGIONAL_SETTINGS_SPECIFY
  132. } REGIONAL_SETTINGS_TYPES;
  133. //
  134. // "Fixed globals". Setupmgr will never reset anything in this struct.
  135. // (see load.c, newedit.c, scanreg.c)
  136. //
  137. typedef struct {
  138. HINSTANCE hInstance;
  139. HFONT hBigBoldFont;
  140. HFONT hBoldFont;
  141. LOAD_TYPES iLoadType; // new/edit page
  142. TCHAR ScriptName[MAX_PATH + 1]; // new/edit page
  143. TCHAR UdfFileName[MAX_PATH + 1]; // set by save page
  144. TCHAR BatchFileName[MAX_PATH + 1]; // set by save page
  145. TIME_ZONE_LIST *TimeZoneList; // filled in at wizard init time
  146. LANGUAGELOCALE_LIST *LanguageLocaleList; // filled in at wizard init time
  147. LANGUAGEGROUP_LIST *LanguageGroupList; // filled in at wizard init time
  148. NAMELIST *LangGroupAdditionalFiles; // filled in at wizard init time
  149. TCHAR szSavePath[MAX_PATH + 1]; // save screen page
  150. } FIXED_GLOBALS;
  151. //
  152. // Global data for the "main" wizard pages.
  153. //
  154. typedef struct {
  155. BOOL bNewScript; // new/edit page
  156. BOOL bStandAloneScript; // standalone page
  157. BOOL bCreateNewDistFolder; // distfolder page
  158. TCHAR DistFolder[MAX_DIST_FOLDER + 1]; // distfolder page
  159. TCHAR UncDistFolder[MAX_PATH]; // distfolder page
  160. TCHAR DistShareName[MAX_SHARENAME + 1]; // distfolder page
  161. TCHAR OemFilesPath[MAX_PATH]; // computed by distfolder.c
  162. TCHAR OemPnpDriversPath[MAX_PATH]; // computed by adddirs.c
  163. PRODUCT_TYPES iProductInstall; // unattended/RIS/sysprep page
  164. PLATFORM_TYPES iPlatform; // platform page
  165. BOOL bDoAdvancedPages; // advanced page
  166. BOOL bCopyFromPath; // copyfiles1
  167. TCHAR CopySourcePath[MAX_PATH]; // copyfiles1
  168. TCHAR CdSourcePath[MAX_PATH]; // copyfiles1 (computed)
  169. TCHAR Architecture[MAX_PATH]; // copyfiles1 (computed)
  170. } WIZGLOBALS;
  171. //
  172. // Type to hold settings for the general settings (base settings).
  173. //
  174. typedef struct {
  175. UMODE_TYPES iUnattendMode; // unattend mode page
  176. BOOL bSkipEulaAndWelcome; // Accept EULA page
  177. PRODUCT_ID_FIELD ProductId[NUM_PID_FIELDS]; // PID page(s)
  178. BOOL bPerSeat; // srv licensing
  179. int NumConnections; // srv licensing
  180. TCHAR UserName[MAX_NAMEORG_NAME + 1]; // name/org page
  181. TCHAR Organization[MAX_NAMEORG_ORG + 1]; // name/org page
  182. NAMELIST ComputerNames; // compname page
  183. BOOL bAutoComputerName; // compname page
  184. NAMELIST RunOnceCmds; // runonce page
  185. NAMELIST PrinterNames; // printers page
  186. int TimeZoneIdx; // timezone page
  187. TARGPATH_TYPES iTargetPath; // targpath page ISSUE-2002/02/28-stelo- verify max width
  188. TCHAR TargetPath[MAX_TARGPATH + 1]; // targpath page
  189. BOOL bSpecifyPassword; // admin passwd page
  190. TCHAR AdminPassword[MAX_PASSWORD + 3]; // admin passwd page (+3 is for surrounding quotes and '\0')
  191. TCHAR ConfirmPassword[MAX_PASSWORD + 1]; // admin passwd page
  192. BOOL bEncryptAdminPassword; // admin passwd page
  193. BOOL bAutoLogon; // admin passwd page
  194. int nAutoLogonCount; // admin passwd page
  195. int DisplayColorBits; // display page
  196. int DisplayXResolution; // display page
  197. int DisplayYResolution; // display page
  198. int DisplayRefreshRate; // display page
  199. TCHAR lpszLogoBitmap[MAX_PATH]; // OEM Ads page
  200. TCHAR lpszBackgroundBitmap[MAX_PATH]; // OEM Ads page
  201. DWORD dwCountryCode; // TAPI page
  202. INT iDialingMethod; // TAPI page
  203. TCHAR szAreaCode[MAX_PHONE_LENGTH + 1]; // TAPI page
  204. TCHAR szOutsideLine[MAX_PHONE_LENGTH + 1]; // TAPI page
  205. BOOL bSysprepLangFilesCopied;
  206. REGIONAL_SETTINGS_TYPES iRegionalSettings; // Regional settings page
  207. BOOL bUseCustomLocales; // Regional settings page
  208. NAMELIST LanguageGroups; // Regional settings page
  209. NAMELIST LanguageFilePaths; // Regional settings page
  210. TCHAR szLanguage[MAX_LANGUAGE_LEN + 1]; // Regional settings page
  211. TCHAR szMenuLanguage[MAX_LANGUAGE_LEN + 1]; // Regional settings page
  212. TCHAR szNumberLanguage[MAX_LANGUAGE_LEN + 1]; // Regional settings page
  213. TCHAR szKeyboardLayout[MAX_KEYBOARD_LAYOUT + 1]; // Regional settings page
  214. TCHAR szLanguageLocaleId[MAX_LANGUAGE_LEN + 1]; // Regional settings page
  215. TCHAR szSifDescription[MAX_SIF_DESCRIPTION_LENGTH + 1]; // Sif text page
  216. TCHAR szSifHelpText[MAX_SIF_HELP_TEXT_LENGTH + 1]; // Sif text page
  217. BOOL bCreateSysprepFolder; // Sysprep folder page
  218. TCHAR szOemDuplicatorString[MAX_OEMDUPSTRING_LENGTH + 1]; // OEM Dup string page
  219. NAMELIST MassStorageDrivers; // SCSI drivers page
  220. NAMELIST OemScsiFiles; // SCSI drivers page
  221. TCHAR szHalFriendlyName[MAX_INILINE_LEN]; // HAL page
  222. NAMELIST OemHalFiles; // HAL page
  223. IE_CUSTOMIZATION_TYPES IeCustomizeMethod; // IE page
  224. TCHAR szInsFile[MAX_INS_LEN + 1]; // IE page
  225. BOOL bUseAutoConfigScript; // IE page
  226. TCHAR szAutoConfigUrl[MAX_AUTOCONFIG_LEN + 1]; // IE page
  227. TCHAR szAutoConfigUrlJscriptOrPac[MAX_AUTOCONFIG_LEN + 1]; // IE page
  228. BOOL bUseProxyServer; // IE page
  229. BOOL bBypassProxyForLocalAddresses; // IE page
  230. TCHAR szHttpProxyAddress[MAX_PROXY_LEN + 1]; // IE page
  231. TCHAR szHttpProxyPort[MAX_PROXY_PORT_LEN + 1]; // IE page
  232. TCHAR szSecureProxyAddress[MAX_PROXY_LEN + 1]; // IE page
  233. TCHAR szSecureProxyPort[MAX_PROXY_PORT_LEN + 1]; // IE page
  234. TCHAR szFtpProxyAddress[MAX_PROXY_LEN + 1]; // IE page
  235. TCHAR szFtpProxyPort[MAX_PROXY_PORT_LEN + 1]; // IE page
  236. TCHAR szGopherProxyAddress[MAX_PROXY_LEN + 1]; // IE page
  237. TCHAR szGopherProxyPort[MAX_PROXY_PORT_LEN + 1]; // IE page
  238. TCHAR szSocksProxyAddress[MAX_PROXY_LEN + 1]; // IE page
  239. TCHAR szSocksProxyPort[MAX_PROXY_PORT_LEN + 1]; // IE page
  240. BOOL bUseSameProxyForAllProtocols; // IE page
  241. TCHAR szProxyExceptions[MAX_EXCEPTION_LEN + 1]; // IE page
  242. TCHAR szHomePage[MAX_HOMEPAGE_LEN + 1]; // IE page
  243. TCHAR szHelpPage[MAX_HELPPAGE_LEN + 1]; // IE page
  244. TCHAR szSearchPage[MAX_SEARCHPAGE_LEN + 1]; // IE page
  245. NAMELIST Favorites; // IE page
  246. DWORD64 dwWindowsComponents;
  247. } GENERAL_SETTINGS;
  248. //
  249. // Struct to hold the net settings
  250. //
  251. typedef struct {
  252. NETWORKING_TYPES iNetworkingMethod;
  253. BOOL bCreateAccount;
  254. BOOL bWorkgroup; // True if joining a workgroup, False if joining a domain
  255. TCHAR WorkGroupName[MAX_WORKGROUP_LENGTH + 1];
  256. TCHAR DomainName[MAX_DOMAIN_LENGTH + 1];
  257. TCHAR DomainAccount[MAX_USERNAME_LENGTH + 1];
  258. TCHAR DomainPassword[MAX_DOMAIN_PASSWORD_LENGTH + 1];
  259. TCHAR ConfirmPassword[MAX_DOMAIN_PASSWORD_LENGTH + 1];
  260. //
  261. // TCPIP variables
  262. //
  263. BOOL bObtainDNSServerAutomatically;
  264. NAMELIST TCPIP_DNS_Domains;
  265. BOOL bIncludeParentDomains;
  266. BOOL bEnableLMHosts;
  267. //
  268. // IPX variables
  269. //
  270. TCHAR szInternalNetworkNumber[MAX_INTERNAL_NET_NUMBER_LEN + 1];
  271. //
  272. // Appletalk variables
  273. //
  274. TCHAR szDefaultZone[MAX_ZONE_LEN + 1];
  275. //
  276. // Client for MS Networks variables
  277. //
  278. MS_CLIENT NameServiceProvider;
  279. INT iServiceProviderName;
  280. TCHAR szNetworkAddress[MAX_NETWORK_ADDRESS_LENGTH + 1];
  281. //
  282. // Client Service for Netware
  283. //
  284. BOOL bDefaultTreeContext;
  285. TCHAR szPreferredServer[MAX_PREFERRED_SERVER_LEN + 1];
  286. TCHAR szDefaultTree[MAX_DEFAULT_TREE_LEN + 1];
  287. TCHAR szDefaultContext[MAX_DEFAULT_CONTEXT_LEN + 1];
  288. BOOL bNetwareLogonScript;
  289. INT iNumberOfNetworkCards;
  290. INT iCurrentNetworkCard;
  291. NETWORK_ADAPTER_NODE *pCurrentAdapter;
  292. //
  293. // Initial 11, grows only when the user selects the "Have Disk" option
  294. // and adds a new client, service, or protocol
  295. // (the "Have Disk" feature is not currently implemented)
  296. //
  297. INT NumberOfNetComponents;
  298. NETWORK_COMPONENT *NetComponentsList;
  299. //
  300. // List that contains one node for each network card in the system
  301. //
  302. NETWORK_ADAPTER_NODE *NetworkAdapterHead;
  303. } NET_SETTINGS;
  304. //
  305. // Declare the global vars
  306. //
  307. #ifdef _SMGR_DECLARE_GLOBALS_
  308. FIXED_GLOBALS FixedGlobals = {0};
  309. WIZGLOBALS WizGlobals = {0};
  310. GENERAL_SETTINGS GenSettings = {0};
  311. NET_SETTINGS NetSettings = {0};
  312. TCHAR *g_StrWizardTitle;
  313. #else
  314. EXTERN_C FIXED_GLOBALS FixedGlobals;
  315. EXTERN_C WIZGLOBALS WizGlobals;
  316. EXTERN_C GENERAL_SETTINGS GenSettings;
  317. EXTERN_C NET_SETTINGS NetSettings;
  318. EXTERN_C TCHAR *g_StrWizardTitle;
  319. #endif // _SMGR_DECLARE_GLOBALS
  320. //
  321. // The exports from the common directory. These are the basic operations
  322. // of this wizard that effect all pages.
  323. //
  324. VOID InitTheWizard(VOID);
  325. VOID StartTheWizard(HINSTANCE hInstance);
  326. VOID CancelTheWizard(HWND hwnd);
  327. VOID TerminateTheWizard(int iErrorID);
  328. BOOL SaveAllSettings(HWND hwnd);
  329. BOOL LoadAllAnswers(HWND hwnd, LOAD_TYPES iOrigin);
  330. int StartWizard(HINSTANCE, LPSTR);
  331. #endif