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.

1597 lines
47 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. // All rights reserved.
  5. //
  6. // File Name:
  7. // savefile.c
  8. //
  9. // Description:
  10. // The wizard pages plug in here to get there settings queued to
  11. // the answer file. We read the globals in setupmgr.h and figure
  12. // out what needs to be written or deleted.
  13. //
  14. //----------------------------------------------------------------------------
  15. #include "pch.h"
  16. #include "allres.h"
  17. #include "encrypt.h"
  18. #include "optcomp.h"
  19. //
  20. // String constants
  21. //
  22. static const LPTSTR StrConstYes = _T("Yes");
  23. static const LPTSTR StrConstNo = _T("No");
  24. static const LPTSTR StrConstStar = _T("*");
  25. static const LPTSTR StrComma = _T(",");
  26. //
  27. // local prototypes
  28. //
  29. // NTRAID#NTBUG9-551746-2002/02/27-stelo,swamip - Unused code, should be removed
  30. //
  31. static VOID WriteOutOemBootFiles( VOID );
  32. static VOID WriteOutMassStorageDrivers( VOID );
  33. static VOID WriteOutTapiSettings(VOID);
  34. static VOID WriteOutRegionalSettings(VOID);
  35. static VOID WriteOutRemoteInstallSettings(VOID);
  36. static VOID WriteOutIeSettings(VOID);
  37. //
  38. // Call out to savenet.c to save the network settings
  39. //
  40. extern VOID WriteOutNetSettings( HWND );
  41. //----------------------------------------------------------------------------
  42. //
  43. // Function: QueueSettingsToAnswerFile
  44. //
  45. // Purpose: This function looks at the global structs that dlgprocs
  46. // have been scribbling into and queues up all the settings
  47. // in preparation to be written out to disk.
  48. //
  49. // This function is called by the SaveScript page indirectly.
  50. // See common\save.c for details.
  51. //
  52. // The answer file queue (and the .udf queue) is initialized
  53. // with the original settings in the answer file loaded near
  54. // the beginning of the wizard.
  55. //
  56. // Ensure that you clear settings that should not be present
  57. // in the answer file.
  58. //
  59. // Arguments: VOID
  60. //
  61. // Returns: BOOL
  62. //
  63. //----------------------------------------------------------------------------
  64. BOOL
  65. QueueSettingsToAnswerFile(HWND hwnd)
  66. {
  67. TCHAR *lpValue;
  68. TCHAR Buffer[MAX_INILINE_LEN];
  69. HRESULT hrPrintf;
  70. //
  71. // Create each of the sections in the order we want them to appear
  72. // in the outputed answer file.
  73. //
  74. SettingQueue_AddSetting(
  75. _T("Data"), _T(""), _T(""), SETTING_QUEUE_ANSWERS);
  76. SettingQueue_AddSetting(
  77. _T("SetupData"), _T(""), _T(""), SETTING_QUEUE_ANSWERS);
  78. SettingQueue_AddSetting(
  79. _T("Unattended"), _T(""), _T(""), SETTING_QUEUE_ANSWERS);
  80. SettingQueue_AddSetting(
  81. _T("GuiUnattended"), _T(""), _T(""), SETTING_QUEUE_ANSWERS);
  82. SettingQueue_AddSetting(
  83. _T("UserData"), _T(""), _T(""), SETTING_QUEUE_ANSWERS);
  84. SettingQueue_AddSetting(
  85. _T("Display"), _T(""), _T(""), SETTING_QUEUE_ANSWERS);
  86. SettingQueue_AddSetting(
  87. _T("LicenseFilePrintData"), _T(""), _T(""), SETTING_QUEUE_ANSWERS);
  88. SettingQueue_AddSetting(
  89. _T("TapiLocation"), _T(""), _T(""), SETTING_QUEUE_ANSWERS);
  90. SettingQueue_AddSetting(
  91. _T("RegionalSettings"), _T(""), _T(""), SETTING_QUEUE_ANSWERS);
  92. SettingQueue_AddSetting(
  93. _T("MassStorageDrivers"), _T(""), _T(""), SETTING_QUEUE_ANSWERS);
  94. SettingQueue_AddSetting(
  95. _T("OEMBootFiles"), _T(""), _T(""), SETTING_QUEUE_ANSWERS);
  96. SettingQueue_AddSetting(
  97. _T("OEM_Ads"), _T(""), _T(""), SETTING_QUEUE_ANSWERS);
  98. SettingQueue_AddSetting(
  99. _T("SetupMgr"), _T(""), _T(""), SETTING_QUEUE_ANSWERS);
  100. // Let networking go last, then remaining RIS sections
  101. //
  102. // Set the UnattendMode
  103. //
  104. lpValue = _T("");
  105. //
  106. // Don't write out the Unattend Mode on a sysprep
  107. //
  108. if( WizGlobals.iProductInstall != PRODUCT_SYSPREP ) {
  109. switch ( GenSettings.iUnattendMode ) {
  110. case UMODE_GUI_ATTENDED: lpValue = _T("GuiAttended"); break;
  111. case UMODE_PROVIDE_DEFAULT: lpValue = _T("ProvideDefault"); break;
  112. case UMODE_DEFAULT_HIDE: lpValue = _T("DefaultHide"); break;
  113. case UMODE_READONLY: lpValue = _T("ReadOnly"); break;
  114. case UMODE_FULL_UNATTENDED: lpValue = _T("FullUnattended"); break;
  115. default:
  116. AssertMsg(FALSE, "Bad case for UnattendMode");
  117. break;
  118. }
  119. }
  120. SettingQueue_AddSetting(_T("Unattended"),
  121. _T("UnattendMode"),
  122. lpValue,
  123. SETTING_QUEUE_ANSWERS);
  124. //
  125. // Skip the EULA if they said 'yes' on the EULA page
  126. //
  127. if( GenSettings.bSkipEulaAndWelcome ) {
  128. SettingQueue_AddSetting(_T("Unattended"),
  129. _T("OemSkipEula"),
  130. StrConstYes,
  131. SETTING_QUEUE_ANSWERS);
  132. }
  133. //
  134. // Write out OemPreInstall depending how user answer StandAlone page
  135. //
  136. if( WizGlobals.iProductInstall == PRODUCT_REMOTEINSTALL )
  137. lpValue = StrConstNo;
  138. else if( WizGlobals.iProductInstall == PRODUCT_SYSPREP )
  139. lpValue = _T("");
  140. else
  141. lpValue = WizGlobals.bStandAloneScript ? StrConstNo : StrConstYes;
  142. SettingQueue_AddSetting(_T("Unattended"),
  143. _T("OemPreinstall"),
  144. lpValue,
  145. SETTING_QUEUE_ANSWERS);
  146. //
  147. // Write out the PnpDriver path that was computed in adddirs.c
  148. //
  149. SettingQueue_AddSetting(_T("Unattended"),
  150. _T("OemPnPDriversPath"),
  151. WizGlobals.OemPnpDriversPath,
  152. SETTING_QUEUE_ANSWERS);
  153. if( WizGlobals.iProductInstall == PRODUCT_SYSPREP )
  154. {
  155. TCHAR szDrive[MAX_PATH];
  156. TCHAR szSysprepPath[MAX_PATH] = _T("");
  157. ExpandEnvironmentStrings( _T("%SystemDrive%"),
  158. szDrive,
  159. MAX_PATH );
  160. // Note-ConcatenatePaths truncates to prevent overflow
  161. ConcatenatePaths( szSysprepPath,
  162. szDrive,
  163. _T("\\sysprep\\i386"),
  164. NULL );
  165. SettingQueue_AddSetting(_T("Unattended"),
  166. _T("InstallFilesPath"),
  167. szSysprepPath,
  168. SETTING_QUEUE_ANSWERS);
  169. }
  170. //
  171. // Don't write out the AutoPartition, MsDosInitiated and the
  172. // UnattendedInstall keys on a sysprep install.
  173. //
  174. if( WizGlobals.iProductInstall != PRODUCT_SYSPREP )
  175. {
  176. SettingQueue_AddSetting(_T("Data"),
  177. _T("AutoPartition"),
  178. _T("1"),
  179. SETTING_QUEUE_ANSWERS);
  180. SettingQueue_AddSetting(_T("Data"),
  181. _T("MsDosInitiated"),
  182. _T("\"0\""),
  183. SETTING_QUEUE_ANSWERS);
  184. SettingQueue_AddSetting(_T("Data"),
  185. _T("UnattendedInstall"),
  186. _T("\"Yes\""),
  187. SETTING_QUEUE_ANSWERS);
  188. }
  189. //
  190. // Product ID
  191. //
  192. Buffer[0] = _T('\0');
  193. if ( GenSettings.ProductId[0][0] != _T('\0') ) {
  194. hrPrintf=StringCchPrintf(Buffer, AS(Buffer),
  195. _T("%s-%s-%s-%s-%s"),
  196. GenSettings.ProductId[0],
  197. GenSettings.ProductId[1],
  198. GenSettings.ProductId[2],
  199. GenSettings.ProductId[3],
  200. GenSettings.ProductId[4]);
  201. }
  202. SettingQueue_AddSetting(_T("UserData"),
  203. _T("ProductKey"),
  204. Buffer,
  205. SETTING_QUEUE_ANSWERS);
  206. SettingQueue_AddSetting(_T("UserData"),
  207. _T("ProductId"),
  208. NULLSTR,
  209. SETTING_QUEUE_ANSWERS);
  210. //
  211. // Username & org
  212. //
  213. {
  214. TCHAR szName[MAX_PATH],
  215. szOrg[MAX_PATH];
  216. hrPrintf=StringCchPrintf(szName, AS(szName), _T("\"%s\""), GenSettings.UserName);
  217. hrPrintf=StringCchPrintf(szOrg, AS(szOrg), _T("\"%s\""), GenSettings.Organization);
  218. SettingQueue_AddSetting(_T("UserData"),
  219. _T("FullName"),
  220. szName,
  221. SETTING_QUEUE_ANSWERS);
  222. SettingQueue_AddSetting(_T("UserData"),
  223. _T("OrgName"),
  224. szOrg,
  225. SETTING_QUEUE_ANSWERS);
  226. }
  227. #ifdef OPTCOMP
  228. //
  229. // Write out the windows component settings only if doing an unattended installation
  230. //
  231. if ( WizGlobals.iProductInstall == PRODUCT_UNATTENDED_INSTALL )
  232. {
  233. DWORD dwIndex;
  234. BOOL bInstallComponent = FALSE;
  235. // Iterate through each component and determine if we should install
  236. //
  237. for (dwIndex=0;dwIndex<AS(s_cComponent);dwIndex++)
  238. {
  239. // Determine if the component should be installed and write out proper setting
  240. //
  241. bInstallComponent = (GenSettings.dwWindowsComponents & s_cComponent[dwIndex].dwComponent) ? TRUE : FALSE;
  242. SettingQueue_AddSetting(_T("Components"), s_cComponent[dwIndex].lpComponentString, (bInstallComponent ? _T("On") : _T("Off")), SETTING_QUEUE_ANSWERS);
  243. }
  244. }
  245. #endif
  246. //
  247. // Write out IE settings
  248. //
  249. WriteOutIeSettings();
  250. //
  251. // Set the [LicenseFilePrintData] section.
  252. //
  253. // Note that we'll allow changing product type between workstation and
  254. // server on an edit, so be sure to clear these settings in case we're
  255. // changing from server to workstation.
  256. //
  257. {
  258. TCHAR *pAutoMode = _T("");
  259. TCHAR *pAutoUsers = _T("");
  260. if ( WizGlobals.iPlatform == PLATFORM_SERVER || WizGlobals.iPlatform == PLATFORM_ENTERPRISE || WizGlobals.iPlatform == PLATFORM_WEBBLADE) {
  261. if ( GenSettings.bPerSeat ) {
  262. pAutoMode = _T("PerSeat");
  263. } else {
  264. pAutoMode = _T("PerServer");
  265. hrPrintf=StringCchPrintf(Buffer, AS(Buffer), _T("%d"), GenSettings.NumConnections);
  266. pAutoUsers = Buffer;
  267. }
  268. }
  269. SettingQueue_AddSetting(_T("LicenseFilePrintData"),
  270. _T("AutoMode"),
  271. pAutoMode,
  272. SETTING_QUEUE_ANSWERS);
  273. SettingQueue_AddSetting(_T("LicenseFilePrintData"),
  274. _T("AutoUsers"),
  275. pAutoUsers,
  276. SETTING_QUEUE_ANSWERS);
  277. }
  278. //
  279. // Computer name(s).
  280. //
  281. // ComputerName=* means setup should autogenerate a name
  282. //
  283. {
  284. INT nEntries = GetNameListSize(&GenSettings.ComputerNames);
  285. INT i;
  286. LPTSTR pName;
  287. //
  288. // Figure out computername setting. Make sure it is not present
  289. // in the case of multiple computer names.
  290. //
  291. if ( (GenSettings.bAutoComputerName && GenSettings.Organization[0]) || ( nEntries > 1 ) )
  292. pName = StrConstStar;
  293. else if ( nEntries == 1 )
  294. pName = GetNameListName(&GenSettings.ComputerNames, 0);
  295. else
  296. pName = _T("");
  297. SettingQueue_AddSetting(_T("UserData"),
  298. _T("ComputerName"),
  299. pName,
  300. SETTING_QUEUE_ANSWERS);
  301. //
  302. // If multiple computer names, we need to queue the proper settings
  303. // to the .udf.
  304. //
  305. // ISSUE-2002/02/27-stelo -Should read the .udf instead of saving in [SetupMgr]
  306. //
  307. // Here is a sample udf
  308. // [UniqueIds]
  309. // foo0=UserData
  310. // foo1=UserData
  311. //
  312. // [foo0:UserData]
  313. // ComputerName=foo0
  314. //
  315. // [foo1:UserData]
  316. // ComputerName=foo1
  317. //
  318. if ( nEntries > 1 ) {
  319. for ( i=0; i<nEntries; i++ ) {
  320. pName = GetNameListName(&GenSettings.ComputerNames, i);
  321. hrPrintf=StringCchPrintf(Buffer, AS(Buffer), _T("ComputerName%d"), i);
  322. SettingQueue_AddSetting(_T("SetupMgr"),
  323. Buffer,
  324. pName,
  325. SETTING_QUEUE_ANSWERS);
  326. //
  327. // Write the UniqueIds entry to the udf
  328. //
  329. SettingQueue_AddSetting(_T("UniqueIds"),
  330. pName,
  331. _T("UserData"),
  332. SETTING_QUEUE_UDF);
  333. //
  334. // Now write the foo0:UserData section for this pName
  335. //
  336. hrPrintf=StringCchPrintf(Buffer, AS(Buffer), _T("%s:UserData"), pName);
  337. SettingQueue_AddSetting(Buffer,
  338. _T("ComputerName"),
  339. pName,
  340. SETTING_QUEUE_UDF);
  341. }
  342. }
  343. }
  344. //
  345. // Targetpath
  346. //
  347. if ( GenSettings.iTargetPath == TARGPATH_WINNT )
  348. lpValue = _T("\\WINDOWS");
  349. else if ( GenSettings.iTargetPath == TARGPATH_SPECIFY )
  350. lpValue = GenSettings.TargetPath;
  351. else if ( GenSettings.iTargetPath == TARGPATH_AUTO )
  352. lpValue = StrConstStar;
  353. else
  354. lpValue = _T("");
  355. SettingQueue_AddSetting(_T("Unattended"),
  356. _T("TargetPath"),
  357. lpValue,
  358. SETTING_QUEUE_ANSWERS);
  359. //
  360. // Write out the HAL to be used
  361. //
  362. // ISSUE-2002/02/27-stelo -There are spaces in the friendly name so it gets quoted but I assume
  363. // the ,OEM has to be outside the quotes
  364. if( GenSettings.szHalFriendlyName[0] != _T('\0') ) {
  365. hrPrintf=StringCchPrintf( Buffer, AS(Buffer), _T("\"%s\",OEM"), GenSettings.szHalFriendlyName );
  366. SettingQueue_AddSetting(_T("Unattended"),
  367. _T("ComputerType"),
  368. Buffer,
  369. SETTING_QUEUE_ANSWERS);
  370. }
  371. WriteOutMassStorageDrivers();
  372. WriteOutOemBootFiles();
  373. //
  374. // Write out OEM Ads Logo and Background bitmaps
  375. //
  376. if ( ! (lpValue = MyGetFullPath( GenSettings.lpszLogoBitmap ) ) )
  377. lpValue = _T("");
  378. SettingQueue_AddSetting(_T("OEM_Ads"),
  379. _T("Logo"),
  380. lpValue,
  381. SETTING_QUEUE_ANSWERS);
  382. if ( ! (lpValue = MyGetFullPath( GenSettings.lpszBackgroundBitmap ) ) )
  383. lpValue = _T("");
  384. SettingQueue_AddSetting(_T("OEM_Ads"),
  385. _T("Background"),
  386. lpValue,
  387. SETTING_QUEUE_ANSWERS);
  388. //
  389. // Admin password
  390. //
  391. if ( GenSettings.bSpecifyPassword )
  392. {
  393. if ( GenSettings.AdminPassword[0] )
  394. {
  395. lpValue = GenSettings.AdminPassword;
  396. // See if we should encrypt the admin password
  397. if (GenSettings.bEncryptAdminPassword)
  398. {
  399. TCHAR owfPwd[STRING_ENCODED_PASSWORD_SIZE];
  400. if (StringEncodeOwfPassword (lpValue, owfPwd, NULL))
  401. {
  402. lpValue = (LPTSTR) owfPwd;
  403. }
  404. else
  405. {
  406. // Error Case. Popup up a message box asking if the user
  407. // wants to continue using an non-encrypted password
  408. int iRet = ReportErrorId(hwnd,
  409. MSGTYPE_YESNO,
  410. IDS_ERR_PASSWORD_ENCRYPT_FAILED);
  411. if ( iRet == IDYES )
  412. {
  413. GenSettings.bEncryptAdminPassword = FALSE;
  414. }
  415. else
  416. {
  417. SetLastError(ERROR_CANCELLED);
  418. return FALSE;
  419. }
  420. }
  421. }
  422. // Now make sure that the password is surrounded by quotes (if it hasn't been encrypted)
  423. //
  424. if (!GenSettings.bEncryptAdminPassword)
  425. {
  426. TCHAR szTemp[MAX_PASSWORD + 3]; // +3 is for surrounding quotes and terminating '\0"
  427. lstrcpyn(szTemp, GenSettings.AdminPassword,AS(szTemp));
  428. hrPrintf=StringCchPrintf(GenSettings.AdminPassword,AS(GenSettings.AdminPassword), _T("\"%s\""), szTemp);
  429. }
  430. }
  431. else
  432. {
  433. lpValue = StrConstStar; // blank password
  434. GenSettings.bEncryptAdminPassword = FALSE; // Cannot encrypt a blank password
  435. }
  436. }
  437. else
  438. {
  439. lpValue = _T(""); // prompt user
  440. GenSettings.bEncryptAdminPassword = FALSE; // Cannot encrypt nothing
  441. }
  442. SettingQueue_AddSetting(_T("GuiUnattended"),
  443. _T("AdminPassword"),
  444. lpValue,
  445. SETTING_QUEUE_ANSWERS);
  446. // set the value in the answer file indicating that
  447. // state of the admin password
  448. SettingQueue_AddSetting(_T("GuiUnattended"),
  449. _T("EncryptedAdminPassword"),
  450. GenSettings.bEncryptAdminPassword ? _T("Yes") : _T("NO"),
  451. SETTING_QUEUE_ANSWERS);
  452. {
  453. TCHAR *lpAutoLogonCount;
  454. if( GenSettings.bAutoLogon )
  455. {
  456. lpValue = StrConstYes;
  457. hrPrintf=StringCchPrintf( Buffer, AS(Buffer), _T("%d"), GenSettings.nAutoLogonCount );
  458. lpAutoLogonCount = Buffer;
  459. }
  460. else
  461. {
  462. lpValue = _T("");
  463. lpAutoLogonCount= _T("");
  464. }
  465. SettingQueue_AddSetting(_T("GuiUnattended"),
  466. _T("AutoLogon"),
  467. lpValue,
  468. SETTING_QUEUE_ANSWERS);
  469. SettingQueue_AddSetting(_T("GuiUnattended"),
  470. _T("AutoLogonCount"),
  471. lpAutoLogonCount,
  472. SETTING_QUEUE_ANSWERS);
  473. }
  474. //
  475. // Write out whether to show Regional Settings pages in NT setup
  476. //
  477. lpValue = _T("");
  478. //
  479. // If they didn't do advanced pages and
  480. //
  481. if( ! WizGlobals.bDoAdvancedPages ) {
  482. if( GenSettings.iUnattendMode == UMODE_FULL_UNATTENDED ) {
  483. lpValue = _T("1");
  484. }
  485. }
  486. else {
  487. switch( GenSettings.iRegionalSettings ) {
  488. case REGIONAL_SETTINGS_NOT_SPECIFIED:
  489. AssertMsg(FALSE, "User went to the regional settings page but regional settings data never got set.");
  490. break;
  491. case REGIONAL_SETTINGS_SKIP:
  492. lpValue = _T("0");
  493. break;
  494. case REGIONAL_SETTINGS_DEFAULT:
  495. case REGIONAL_SETTINGS_SPECIFY:
  496. lpValue = _T("1");
  497. break;
  498. default:
  499. AssertMsg(FALSE, "Bad case for Regional Settings");
  500. break;
  501. }
  502. }
  503. SettingQueue_AddSetting(_T("GuiUnattended"),
  504. _T("OEMSkipRegional"),
  505. lpValue,
  506. SETTING_QUEUE_ANSWERS);
  507. //
  508. // Write out Sysprep OEM Duplicator string
  509. //
  510. lpValue = _T("");
  511. if ( WizGlobals.iProductInstall == PRODUCT_SYSPREP )
  512. lpValue = GenSettings.szOemDuplicatorString;
  513. SettingQueue_AddSetting(_T("GuiUnattended"),
  514. _T("OEMDuplicatorstring"),
  515. lpValue,
  516. SETTING_QUEUE_ANSWERS);
  517. //
  518. // Display settings
  519. //
  520. lpValue = _T("");
  521. if ( GenSettings.DisplayColorBits >= 0 ) {
  522. hrPrintf=StringCchPrintf(Buffer, AS(Buffer), _T("%d"), GenSettings.DisplayColorBits);
  523. lpValue = Buffer;
  524. }
  525. SettingQueue_AddSetting(_T("Display"),
  526. _T("BitsPerPel"),
  527. lpValue,
  528. SETTING_QUEUE_ANSWERS);
  529. lpValue = _T("");
  530. if ( GenSettings.DisplayXResolution >= 0 ) {
  531. hrPrintf=StringCchPrintf(Buffer, AS(Buffer), _T("%d"), GenSettings.DisplayXResolution);
  532. lpValue = Buffer;
  533. }
  534. SettingQueue_AddSetting(_T("Display"),
  535. _T("Xresolution"),
  536. lpValue,
  537. SETTING_QUEUE_ANSWERS);
  538. lpValue = _T("");
  539. if ( GenSettings.DisplayYResolution >= 0 ) {
  540. hrPrintf=StringCchPrintf(Buffer, AS(Buffer), _T("%d"), GenSettings.DisplayYResolution);
  541. lpValue = Buffer;
  542. }
  543. SettingQueue_AddSetting(_T("Display"),
  544. _T("YResolution"),
  545. lpValue,
  546. SETTING_QUEUE_ANSWERS);
  547. lpValue = _T("");
  548. if ( GenSettings.DisplayRefreshRate >= 0 ) {
  549. hrPrintf=StringCchPrintf(Buffer, AS(Buffer), _T("%d"), GenSettings.DisplayRefreshRate);
  550. lpValue = Buffer;
  551. }
  552. SettingQueue_AddSetting(_T("Display"),
  553. _T("Vrefresh"),
  554. lpValue,
  555. SETTING_QUEUE_ANSWERS);
  556. //
  557. // RunOnce commands
  558. //
  559. {
  560. TCHAR szCommandLineBuffer[MAX_INILINE_LEN + 1];
  561. INT nEntries = GetNameListSize(&GenSettings.RunOnceCmds);
  562. INT i;
  563. LPTSTR pName;
  564. for ( i=0; i<nEntries; i++ )
  565. {
  566. hrPrintf=StringCchPrintf(Buffer,AS(Buffer), _T("Command%d"), i);
  567. pName = GetNameListName(&GenSettings.RunOnceCmds, i);
  568. //
  569. // Force the command line to always be quoted
  570. //
  571. hrPrintf=StringCchPrintf( szCommandLineBuffer,AS(szCommandLineBuffer), _T("\"%s\""), pName );
  572. SettingQueue_AddSetting(_T("GuiRunOnce"),
  573. Buffer,
  574. pName,
  575. SETTING_QUEUE_ANSWERS);
  576. }
  577. }
  578. //
  579. // Timezone
  580. //
  581. // Must handle the case that the user never went to the timezone page
  582. //
  583. if ( GenSettings.TimeZoneIdx == TZ_IDX_UNDEFINED )
  584. {
  585. if ( WizGlobals.iProductInstall == PRODUCT_REMOTEINSTALL )
  586. GenSettings.TimeZoneIdx = TZ_IDX_SETSAMEASSERVER;
  587. else
  588. GenSettings.TimeZoneIdx = TZ_IDX_DONOTSPECIFY;
  589. }
  590. if( GenSettings.TimeZoneIdx == TZ_IDX_SETSAMEASSERVER )
  591. lpValue = _T("%TIMEZONE%");
  592. else if ( GenSettings.TimeZoneIdx == TZ_IDX_DONOTSPECIFY )
  593. lpValue = _T("");
  594. else {
  595. hrPrintf=StringCchPrintf(Buffer, AS(Buffer),_T("%d"), GenSettings.TimeZoneIdx);
  596. lpValue = Buffer;
  597. }
  598. SettingQueue_AddSetting(_T("GuiUnattended"),
  599. _T("TimeZone"),
  600. lpValue,
  601. SETTING_QUEUE_ANSWERS);
  602. //
  603. // Skip the Welcome page if they said 'yes' on the EULA page
  604. //
  605. if( GenSettings.bSkipEulaAndWelcome ) {
  606. SettingQueue_AddSetting(_T("GuiUnattended"),
  607. _T("OemSkipWelcome"),
  608. _T("1"),
  609. SETTING_QUEUE_ANSWERS);
  610. }
  611. //
  612. // Write out the distribution share to the [SetupMgr] section so
  613. // that we remember it on an edit.
  614. //
  615. if( WizGlobals.bStandAloneScript ) {
  616. lpValue = _T("");
  617. }
  618. else {
  619. lpValue = WizGlobals.DistFolder;
  620. }
  621. SettingQueue_AddSetting(_T("SetupMgr"),
  622. _T("DistFolder"),
  623. lpValue,
  624. SETTING_QUEUE_ANSWERS);
  625. lpValue = !WizGlobals.bStandAloneScript ? WizGlobals.DistShareName : _T("");
  626. SettingQueue_AddSetting(_T("SetupMgr"),
  627. _T("DistShare"),
  628. lpValue,
  629. SETTING_QUEUE_ANSWERS);
  630. //
  631. // Write out [Identification] section
  632. //
  633. {
  634. LPTSTR lpWorkgroup = _T("");
  635. LPTSTR lpDomain = _T("");
  636. LPTSTR lpAdmin = _T("");
  637. LPTSTR lpPassword = _T("");
  638. if( WizGlobals.iProductInstall == PRODUCT_REMOTEINSTALL ) {
  639. lpDomain = _T("%MACHINEDOMAIN%");
  640. } else if ( NetSettings.bWorkgroup ) {
  641. lpWorkgroup = NetSettings.WorkGroupName;
  642. } else {
  643. lpDomain = NetSettings.DomainName;
  644. if ( NetSettings.bCreateAccount ) {
  645. lpAdmin = NetSettings.DomainAccount;
  646. lpPassword = NetSettings.DomainPassword;
  647. }
  648. }
  649. SettingQueue_AddSetting(_T("Identification"),
  650. _T("JoinWorkgroup"),
  651. lpWorkgroup,
  652. SETTING_QUEUE_ANSWERS);
  653. SettingQueue_AddSetting(_T("Identification"),
  654. _T("JoinDomain"),
  655. lpDomain,
  656. SETTING_QUEUE_ANSWERS);
  657. SettingQueue_AddSetting(_T("Identification"),
  658. _T("DomainAdmin"),
  659. lpAdmin,
  660. SETTING_QUEUE_ANSWERS);
  661. SettingQueue_AddSetting(_T("Identification"),
  662. _T("DomainAdminPassword"),
  663. lpPassword,
  664. SETTING_QUEUE_ANSWERS);
  665. }
  666. //
  667. // Write out network settings
  668. //
  669. WriteOutNetSettings( hwnd );
  670. //
  671. // TAPI and regional settings
  672. //
  673. WriteOutTapiSettings();
  674. WriteOutRegionalSettings();
  675. //
  676. // Write out the remaining RIS specific settings
  677. //
  678. if( WizGlobals.iProductInstall == PRODUCT_REMOTEINSTALL ) {
  679. WriteOutRemoteInstallSettings();
  680. }
  681. return TRUE;
  682. }
  683. //
  684. // NTRAID#NTBUG9-551746-2002/02/27-stelo,swamip - Unused code, should be removed
  685. //
  686. //----------------------------------------------------------------------------
  687. //
  688. // Function: WriteOutMassStorageDrivers
  689. //
  690. // Purpose:
  691. //
  692. // Arguments: VOID
  693. //
  694. // Returns: VOID
  695. //
  696. //----------------------------------------------------------------------------
  697. static VOID
  698. WriteOutMassStorageDrivers( VOID ) {
  699. INT i;
  700. TCHAR *lpValue;
  701. INT iEntries = GetNameListSize( &GenSettings.MassStorageDrivers );
  702. for( i = 0; i < iEntries; i++ ) {
  703. lpValue = GetNameListName( &GenSettings.MassStorageDrivers, i );
  704. SettingQueue_AddSetting(_T("MassStorageDrivers"),
  705. lpValue,
  706. _T("OEM"),
  707. SETTING_QUEUE_ANSWERS);
  708. }
  709. }
  710. //
  711. // NTRAID#NTBUG9-551746-2002/02/27-stelo,swamip - Unused code, should be removed
  712. //
  713. //----------------------------------------------------------------------------
  714. //
  715. // Function: WriteOutOemBootFiles
  716. //
  717. // Purpose: Write out OEM Boot files (this includes the filenames for the
  718. // HAL and SCSI drivers)
  719. //
  720. // Arguments: VOID
  721. //
  722. // Returns: VOID
  723. //
  724. //----------------------------------------------------------------------------
  725. static VOID
  726. WriteOutOemBootFiles( VOID ) {
  727. INT i;
  728. TCHAR *lpValue;
  729. INT iHalEntries = GetNameListSize( &GenSettings.OemHalFiles );
  730. INT iScsiEntries = GetNameListSize( &GenSettings.OemScsiFiles );
  731. if( iHalEntries != 0 || iScsiEntries != 0 ) {
  732. //
  733. // Write out the txtsetup.oem file
  734. //
  735. SettingQueue_AddSetting(_T("OEMBootFiles"),
  736. _T(""),
  737. OEM_TXTSETUP_NAME,
  738. SETTING_QUEUE_ANSWERS);
  739. //
  740. // Write out all the HAL and SCSI files
  741. //
  742. for( i = 0; i < iHalEntries; i++ ) {
  743. lpValue = GetNameListName( &GenSettings.OemHalFiles, i );
  744. SettingQueue_AddSetting(_T("OEMBootFiles"),
  745. _T(""),
  746. lpValue,
  747. SETTING_QUEUE_ANSWERS);
  748. }
  749. for( i = 0; i < iScsiEntries; i++ ) {
  750. lpValue = GetNameListName( &GenSettings.OemScsiFiles, i );
  751. SettingQueue_AddSetting(_T("OEMBootFiles"),
  752. _T(""),
  753. lpValue,
  754. SETTING_QUEUE_ANSWERS);
  755. }
  756. }
  757. }
  758. //----------------------------------------------------------------------------
  759. //
  760. // Function: WriteOutTapiSettings
  761. //
  762. // Purpose: Queue up the remaining settings that need to be in the
  763. // answerfile tapi settings.
  764. //
  765. // Arguments: VOID
  766. //
  767. // Returns: VOID
  768. //
  769. //----------------------------------------------------------------------------
  770. static VOID
  771. WriteOutTapiSettings( VOID ) {
  772. TCHAR Buffer[MAX_INILINE_LEN];
  773. TCHAR *lpValue;
  774. HRESULT hrPrintf;
  775. //
  776. // Set or clear the country code. If user selected DONTSPECIFY, be
  777. // sure the setting is removed.
  778. //
  779. Buffer[0] = _T('\0');
  780. if( GenSettings.dwCountryCode != DONTSPECIFYSETTING )
  781. {
  782. hrPrintf=StringCchPrintf(Buffer, AS(Buffer),_T("%d"), GenSettings.dwCountryCode);
  783. }
  784. SettingQueue_AddSetting(_T("TapiLocation"),
  785. _T("CountryCode"),
  786. Buffer,
  787. SETTING_QUEUE_ANSWERS);
  788. //
  789. // Set or clear the dialing method. Make sure it is cleared if "Don't
  790. // specify setting" was selected.
  791. //
  792. if ( GenSettings.iDialingMethod == TONE )
  793. lpValue = _T("Tone");
  794. else if ( GenSettings.iDialingMethod == PULSE )
  795. lpValue = _T("Pulse");
  796. else
  797. lpValue = _T("");
  798. SettingQueue_AddSetting( _T("TapiLocation"),
  799. _T("Dialing"),
  800. lpValue,
  801. SETTING_QUEUE_ANSWERS );
  802. SettingQueue_AddSetting( _T("TapiLocation"),
  803. _T("AreaCode"),
  804. GenSettings.szAreaCode,
  805. SETTING_QUEUE_ANSWERS );
  806. Buffer[0] = _T('\0');
  807. if( GenSettings.szOutsideLine[0] != _T('\0') )
  808. {
  809. hrPrintf=StringCchPrintf( Buffer,AS(Buffer), _T("\"%s\""), GenSettings.szOutsideLine );
  810. }
  811. SettingQueue_AddSetting( _T("TapiLocation"),
  812. _T("LongDistanceAccess"),
  813. Buffer,
  814. SETTING_QUEUE_ANSWERS );
  815. }
  816. //----------------------------------------------------------------------------
  817. //
  818. // Function: WriteOutRegionalSettings
  819. //
  820. // Purpose: Queue up the remaining settings that need to be in the
  821. // answerfile regional settings.
  822. //
  823. // Arguments: VOID
  824. //
  825. // Returns: VOID
  826. //
  827. //----------------------------------------------------------------------------
  828. static VOID
  829. WriteOutRegionalSettings( VOID ) {
  830. TCHAR Buffer[MAX_INILINE_LEN] = _T("");
  831. LPTSTR lpLanguageGroup = _T("");
  832. LPTSTR lpLanguage = _T("");
  833. LPTSTR lpSystemLocale = _T("");
  834. LPTSTR lpUserLocale = _T("");
  835. LPTSTR lpInputLocale = _T("");
  836. if( GenSettings.iRegionalSettings == REGIONAL_SETTINGS_SPECIFY ) {
  837. if( GenSettings.bUseCustomLocales ) {
  838. lpSystemLocale = GenSettings.szMenuLanguage;
  839. lpUserLocale = GenSettings.szNumberLanguage;
  840. lpInputLocale = GenSettings.szKeyboardLayout;
  841. }
  842. else {
  843. lpLanguage = GenSettings.szLanguage;
  844. }
  845. }
  846. if( GetNameListSize( &GenSettings.LanguageGroups ) > 0 ) {
  847. NamelistToCommaString( &GenSettings.LanguageGroups, Buffer, AS(Buffer) );
  848. lpLanguageGroup = Buffer;
  849. }
  850. SettingQueue_AddSetting(_T("RegionalSettings"),
  851. _T("LanguageGroup"),
  852. lpLanguageGroup,
  853. SETTING_QUEUE_ANSWERS);
  854. SettingQueue_AddSetting(_T("RegionalSettings"),
  855. _T("Language"),
  856. lpLanguage,
  857. SETTING_QUEUE_ANSWERS);
  858. SettingQueue_AddSetting(_T("RegionalSettings"),
  859. _T("SystemLocale"),
  860. lpSystemLocale,
  861. SETTING_QUEUE_ANSWERS);
  862. SettingQueue_AddSetting(_T("RegionalSettings"),
  863. _T("UserLocale"),
  864. lpUserLocale,
  865. SETTING_QUEUE_ANSWERS);
  866. SettingQueue_AddSetting(_T("RegionalSettings"),
  867. _T("InputLocale"),
  868. lpInputLocale,
  869. SETTING_QUEUE_ANSWERS);
  870. }
  871. //----------------------------------------------------------------------------
  872. //
  873. // Function: WriteOutRemoteInstallSettings
  874. //
  875. // Purpose: Queue up the remaining settings that need to be in the
  876. // answerfile for a remote install to work.
  877. //
  878. // Arguments: VOID
  879. //
  880. // Returns: VOID
  881. //
  882. //----------------------------------------------------------------------------
  883. //
  884. // Some long string constants used by this function
  885. //
  886. #define RIS_ORISRC _T("\"\\\\%SERVERNAME%\\RemInst\\%INSTALLPATH%\"")
  887. #define RIS_SRCDEVICE _T("\"\\Device\\LanmanRedirector\\") \
  888. _T("%SERVERNAME%\\RemInst\\%INSTALLPATH%\"")
  889. #define RIS_LAUNCHFILE _T("\"%INSTALLPATH%\\%MACHINETYPE%\\templates\\startrom.com\"")
  890. static VOID
  891. WriteOutRemoteInstallSettings(VOID)
  892. {
  893. SettingQueue_AddSetting(_T("Data"),
  894. _T("floppyless"),
  895. _T("\"1\""),
  896. SETTING_QUEUE_ANSWERS);
  897. SettingQueue_AddSetting(_T("Data"),
  898. _T("msdosinitiated"),
  899. _T("\"1\""),
  900. SETTING_QUEUE_ANSWERS);
  901. SettingQueue_AddSetting(_T("Data"),
  902. _T("OriSrc"),
  903. RIS_ORISRC,
  904. SETTING_QUEUE_ANSWERS);
  905. SettingQueue_AddSetting(_T("Data"),
  906. _T("OriTyp"),
  907. _T("\"4\""),
  908. SETTING_QUEUE_ANSWERS);
  909. SettingQueue_AddSetting(_T("Data"),
  910. _T("LocalSourceOnCD"),
  911. _T("1"),
  912. SETTING_QUEUE_ANSWERS);
  913. //
  914. // [SetupData] section. This section is only written out if RIS.
  915. //
  916. SettingQueue_AddSetting(_T("SetupData"),
  917. _T("OsLoadOptions"),
  918. _T("/noguiboot /fastdetect"),
  919. SETTING_QUEUE_ANSWERS);
  920. SettingQueue_AddSetting(_T("SetupData"),
  921. _T("SetupSourceDevice"),
  922. RIS_SRCDEVICE,
  923. SETTING_QUEUE_ANSWERS);
  924. //
  925. // Write some RIS specific settings to [Unattended]. Only write settings
  926. // that QueueSettingsToAnswerFile() does not write.
  927. //
  928. // RIS requires these settings to be present in the .sif and requires
  929. // them to have a fixed value. We will not preserve the value we read
  930. // on an edit (in case user changed it by hand).
  931. //
  932. SettingQueue_AddSetting(_T("Unattended"),
  933. _T("FileSystem"),
  934. _T("LeaveAlone"),
  935. SETTING_QUEUE_ANSWERS);
  936. SettingQueue_AddSetting(_T("Unattended"),
  937. _T("NtUpgrade"),
  938. StrConstNo,
  939. SETTING_QUEUE_ANSWERS);
  940. SettingQueue_AddSetting(_T("Unattended"),
  941. _T("OverwriteOemFilesOnUpgrade"),
  942. StrConstNo,
  943. SETTING_QUEUE_ANSWERS);
  944. //
  945. // Additional settings for
  946. // [RemoteInstall]
  947. // [Display]
  948. // [Networking]
  949. // [Identification]
  950. // [OSChooser]
  951. //
  952. SettingQueue_AddSetting(_T("RemoteInstall"),
  953. _T("Repartition"),
  954. StrConstYes,
  955. SETTING_QUEUE_ANSWERS);
  956. SettingQueue_AddSetting(_T("Networking"),
  957. _T("ProcessPageSections"),
  958. StrConstYes,
  959. SETTING_QUEUE_ANSWERS);
  960. SettingQueue_AddSetting(_T("Identification"),
  961. _T("DoOldStyleDomainJoin"),
  962. StrConstYes,
  963. SETTING_QUEUE_ANSWERS);
  964. SettingQueue_AddSetting(_T("OSChooser"),
  965. _T("Description"),
  966. GenSettings.szSifDescription,
  967. SETTING_QUEUE_ANSWERS);
  968. SettingQueue_AddSetting(_T("OSChooser"),
  969. _T("Help"),
  970. GenSettings.szSifHelpText,
  971. SETTING_QUEUE_ANSWERS);
  972. SettingQueue_AddSetting(_T("OSChooser"),
  973. _T("LaunchFile"),
  974. RIS_LAUNCHFILE,
  975. SETTING_QUEUE_ANSWERS);
  976. SettingQueue_AddSetting(_T("OSChooser"),
  977. _T("ImageType"),
  978. _T("Flat"),
  979. SETTING_QUEUE_ANSWERS);
  980. }
  981. //
  982. // Write out the IE Favorites
  983. //
  984. static VOID
  985. WriteOutIeFavorites( VOID )
  986. {
  987. INT nEntries = GetNameListSize( &GenSettings.Favorites );
  988. INT i;
  989. INT iEntryNumber;
  990. LPTSTR pFriendlyName;
  991. LPTSTR pWebAddress;
  992. TCHAR Key[MAX_INILINE_LEN + 1];
  993. TCHAR Value[MAX_INILINE_LEN + 1];
  994. HRESULT hrPrintf;
  995. // ISSUE-2002/02/27-stelo - make sure to clear the entries if they are no favorites
  996. for( i = 0; i < nEntries; i = i + 2 )
  997. {
  998. iEntryNumber = ( i / 2 ) + 1;
  999. pFriendlyName = GetNameListName( &GenSettings.Favorites, i );
  1000. pWebAddress = GetNameListName( &GenSettings.Favorites, i + 1 );
  1001. hrPrintf=StringCchPrintf( Key,AS(Key),
  1002. _T("Title%d"),
  1003. iEntryNumber );
  1004. //
  1005. // Always quote the friendly name
  1006. //
  1007. hrPrintf=StringCchPrintf( Value,AS(Value),
  1008. _T("\"%s.url\""),
  1009. pFriendlyName );
  1010. SettingQueue_AddSetting( _T("FavoritesEx"),
  1011. Key,
  1012. Value,
  1013. SETTING_QUEUE_ANSWERS );
  1014. hrPrintf=StringCchPrintf( Key,AS(Key),
  1015. _T("URL%d"),
  1016. iEntryNumber );
  1017. //
  1018. // Always quote the web address
  1019. //
  1020. hrPrintf=StringCchPrintf( Value,AS(Value),
  1021. _T("\"%s\""),
  1022. pWebAddress );
  1023. SettingQueue_AddSetting( _T("FavoritesEx"),
  1024. Key,
  1025. Value,
  1026. SETTING_QUEUE_ANSWERS );
  1027. }
  1028. }
  1029. static LPTSTR
  1030. AllocateAddressPortString( LPTSTR lpszAddressString, LPTSTR lpszPortString )
  1031. {
  1032. LPTSTR lpszAddressPortString;
  1033. int iAddressPortStringLen;
  1034. HRESULT hrCat;
  1035. iAddressPortStringLen=(lstrlen(lpszAddressString) + lstrlen(lpszPortString) + 2);
  1036. lpszAddressPortString = MALLOC(iAddressPortStringLen * sizeof(TCHAR) );
  1037. if ( lpszAddressPortString )
  1038. {
  1039. lstrcpyn( lpszAddressPortString, lpszAddressString, iAddressPortStringLen);
  1040. if ( *lpszPortString )
  1041. {
  1042. hrCat=StringCchCat( lpszAddressPortString, iAddressPortStringLen, _T(":") );
  1043. hrCat=StringCchCat( lpszAddressPortString, iAddressPortStringLen, lpszPortString );
  1044. }
  1045. }
  1046. return lpszAddressPortString;
  1047. }
  1048. //----------------------------------------------------------------------------
  1049. //
  1050. // Function: WriteOutIeSettings
  1051. //
  1052. // Purpose: Queue up the answerfile settings for IE.
  1053. //
  1054. // Arguments: VOID
  1055. //
  1056. // Returns: VOID
  1057. //
  1058. //----------------------------------------------------------------------------
  1059. static VOID
  1060. WriteOutIeSettings( VOID )
  1061. {
  1062. LPTSTR lpIeBrandingFile = _T("");
  1063. LPTSTR lpAutoConfig = _T("");
  1064. LPTSTR lpAutoConfigUrl = _T("");
  1065. LPTSTR lpAutoConfigUrlJscript = _T("");
  1066. LPTSTR lpUseProxyServer = _T("");
  1067. LPTSTR lpUseSameProxyForAllProtocols = _T("");
  1068. LPTSTR lpProxyExceptions = _T("");
  1069. LPTSTR lpHomePage = _T("");
  1070. LPTSTR lpHelpPage = _T("");
  1071. LPTSTR lpSearchPage = _T("");
  1072. LPTSTR lpHttpProxy = NULL;
  1073. LPTSTR lpSecureProxy = NULL;
  1074. LPTSTR lpFtpProxy = NULL;
  1075. LPTSTR lpGopherProxy = NULL;
  1076. LPTSTR lpSocksProxy = NULL;
  1077. LPTSTR lpUseUnattendFileForBranding = _T("Yes");
  1078. HRESULT hrCat;
  1079. if( GenSettings.IeCustomizeMethod == IE_NO_CUSTOMIZATION )
  1080. {
  1081. //
  1082. // Don't write out any IE keys when the choose not to customize IE
  1083. //
  1084. return;
  1085. }
  1086. else if( GenSettings.IeCustomizeMethod == IE_USE_BRANDING_FILE )
  1087. {
  1088. lpIeBrandingFile = GenSettings.szInsFile;
  1089. lpUseUnattendFileForBranding = _T("No");
  1090. //
  1091. // Write out the Auto Config settings
  1092. //
  1093. if( GenSettings.bUseAutoConfigScript )
  1094. {
  1095. lpAutoConfig = _T("1");
  1096. lpAutoConfigUrl = GenSettings.szAutoConfigUrl;
  1097. lpAutoConfigUrlJscript = GenSettings.szAutoConfigUrlJscriptOrPac;
  1098. }
  1099. else
  1100. {
  1101. lpAutoConfig = _T("0");
  1102. }
  1103. }
  1104. //
  1105. // Write out the proxy settings
  1106. //
  1107. if( GenSettings.bUseProxyServer )
  1108. {
  1109. lpUseProxyServer = _T("1");
  1110. }
  1111. else
  1112. {
  1113. lpUseProxyServer = _T("0");
  1114. }
  1115. if( GenSettings.bUseSameProxyForAllProtocols )
  1116. {
  1117. lpUseSameProxyForAllProtocols = _T("1");
  1118. }
  1119. else
  1120. {
  1121. lpUseSameProxyForAllProtocols = _T("0");
  1122. }
  1123. //
  1124. // For each proxy server, if the port is not empty concatenate it.
  1125. //
  1126. lpHttpProxy = AllocateAddressPortString( GenSettings.szHttpProxyAddress, GenSettings.szHttpProxyPort );
  1127. //
  1128. // Only write out the proxy server if they aren't using the same one
  1129. //
  1130. if( ! GenSettings.bUseSameProxyForAllProtocols )
  1131. {
  1132. lpSecureProxy = AllocateAddressPortString( GenSettings.szSecureProxyAddress, GenSettings.szSecureProxyPort );
  1133. lpFtpProxy = AllocateAddressPortString( GenSettings.szFtpProxyAddress, GenSettings.szFtpProxyPort );
  1134. lpGopherProxy = AllocateAddressPortString( GenSettings.szGopherProxyAddress, GenSettings.szGopherProxyPort );
  1135. lpSocksProxy = AllocateAddressPortString( GenSettings.szSocksProxyAddress, GenSettings.szSocksProxyPort );
  1136. }
  1137. //
  1138. // Append the string <local> to the exception list if the user wants to
  1139. // bypass the proxy for local addresses
  1140. //
  1141. if( GenSettings.bBypassProxyForLocalAddresses )
  1142. {
  1143. if( GenSettings.szProxyExceptions[0] != _T('\0') )
  1144. {
  1145. INT iLastChar;
  1146. iLastChar = lstrlen( GenSettings.szProxyExceptions );
  1147. if( GenSettings.szProxyExceptions[iLastChar - 1] != _T(';') )
  1148. {
  1149. hrCat=StringCchCat( GenSettings.szProxyExceptions, AS(GenSettings.szProxyExceptions),_T(";") );
  1150. }
  1151. }
  1152. hrCat=StringCchCat( GenSettings.szProxyExceptions, AS(GenSettings.szProxyExceptions),_T("<local>") );
  1153. }
  1154. lpProxyExceptions = GenSettings.szProxyExceptions;
  1155. lpHomePage = GenSettings.szHomePage;
  1156. lpHelpPage = GenSettings.szHelpPage;
  1157. lpSearchPage = GenSettings.szSearchPage;
  1158. //
  1159. // Write out the IE Favorites...
  1160. //
  1161. WriteOutIeFavorites( );
  1162. SettingQueue_AddSetting( _T("Branding"),
  1163. _T("BrandIEUsingUnattended"),
  1164. lpUseUnattendFileForBranding,
  1165. SETTING_QUEUE_ANSWERS );
  1166. SettingQueue_AddSetting( _T("Branding"),
  1167. _T("IEBrandingFile"),
  1168. lpIeBrandingFile,
  1169. SETTING_QUEUE_ANSWERS );
  1170. SettingQueue_AddSetting( _T("URL"),
  1171. _T("AutoConfig"),
  1172. lpAutoConfig,
  1173. SETTING_QUEUE_ANSWERS );
  1174. SettingQueue_AddSetting( _T("URL"),
  1175. _T("AutoConfigURL"),
  1176. lpAutoConfigUrl,
  1177. SETTING_QUEUE_ANSWERS );
  1178. SettingQueue_AddSetting( _T("URL"),
  1179. _T("AutoConfigJSURL"),
  1180. lpAutoConfigUrlJscript,
  1181. SETTING_QUEUE_ANSWERS );
  1182. SettingQueue_AddSetting( _T("Proxy"),
  1183. _T("Proxy_Enable"),
  1184. lpUseProxyServer,
  1185. SETTING_QUEUE_ANSWERS );
  1186. SettingQueue_AddSetting( _T("Proxy"),
  1187. _T("Use_Same_Proxy"),
  1188. lpUseSameProxyForAllProtocols,
  1189. SETTING_QUEUE_ANSWERS );
  1190. SettingQueue_AddSetting( _T("Proxy"),
  1191. _T("HTTP_Proxy_Server"),
  1192. lpHttpProxy ? lpHttpProxy : _T(""),
  1193. SETTING_QUEUE_ANSWERS );
  1194. SettingQueue_AddSetting( _T("Proxy"),
  1195. _T("Secure_Proxy_Server"),
  1196. lpSecureProxy ? lpSecureProxy : _T(""),
  1197. SETTING_QUEUE_ANSWERS );
  1198. SettingQueue_AddSetting( _T("Proxy"),
  1199. _T("FTP_Proxy_Server"),
  1200. lpFtpProxy ? lpFtpProxy : _T(""),
  1201. SETTING_QUEUE_ANSWERS );
  1202. SettingQueue_AddSetting( _T("Proxy"),
  1203. _T("Gopher_Proxy_Server"),
  1204. lpGopherProxy ? lpGopherProxy : _T(""),
  1205. SETTING_QUEUE_ANSWERS );
  1206. SettingQueue_AddSetting( _T("Proxy"),
  1207. _T("Socks_Proxy_Server"),
  1208. lpSocksProxy ? lpSocksProxy : _T(""),
  1209. SETTING_QUEUE_ANSWERS );
  1210. SettingQueue_AddSetting( _T("Proxy"),
  1211. _T("Proxy_Override"),
  1212. lpProxyExceptions,
  1213. SETTING_QUEUE_ANSWERS );
  1214. SettingQueue_AddSetting( _T("URL"),
  1215. _T("Home_Page"),
  1216. lpHomePage,
  1217. SETTING_QUEUE_ANSWERS );
  1218. SettingQueue_AddSetting( _T("URL"),
  1219. _T("Help_Page"),
  1220. lpHelpPage,
  1221. SETTING_QUEUE_ANSWERS );
  1222. SettingQueue_AddSetting( _T("URL"),
  1223. _T("Search_Page"),
  1224. lpSearchPage,
  1225. SETTING_QUEUE_ANSWERS );
  1226. //
  1227. // Free any memory we may have allocated...
  1228. //
  1229. if ( lpHttpProxy )
  1230. FREE ( lpHttpProxy );
  1231. if ( lpSecureProxy )
  1232. FREE ( lpSecureProxy );
  1233. if ( lpFtpProxy )
  1234. FREE ( lpFtpProxy );
  1235. if ( lpGopherProxy )
  1236. FREE ( lpGopherProxy );
  1237. if ( lpSocksProxy )
  1238. FREE ( lpSocksProxy );
  1239. }