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.

753 lines
22 KiB

  1. /*
  2. * 10.23.97 Joe Holman Make our 3 boot disks for a product.
  3. * This program needs to do the following:
  4. *
  5. * 1. calculate if the boot files value
  6. * is adequate
  7. * 2. create a list of files that can be used
  8. * to make the boot floppies.
  9. *
  10. * 11.02.98 Joe Holman Modified per new key names.
  11. * 11.19.98 Elliott Munger Made changes to suport 4 bootdisks
  12. */
  13. #include <stdlib.h>
  14. #include <direct.h>
  15. #include <sys\types.h>
  16. #include <sys\stat.h>
  17. #include <io.h>
  18. #include <conio.h>
  19. #include <errno.h>
  20. #include <string.h>
  21. #include <stdio.h>
  22. #include <process.h>
  23. #include <ctype.h>
  24. #include <windows.h>
  25. #include <time.h>
  26. #include <setupapi.h>
  27. int __cdecl main( int, char ** );
  28. FILE * logFile;
  29. HANDLE hDosnetInf;
  30. CHAR returnBuffer[MAX_PATH];
  31. CHAR returnBuffer2[MAX_PATH];
  32. CHAR szWrite[MAX_PATH];
  33. CHAR szFloppyDump[MAX_PATH];
  34. CHAR szLog[MAX_PATH];
  35. CHAR szReleaseShare[MAX_PATH];
  36. DWORD dwRequiredSize;
  37. CHAR szDosnetPath[MAX_PATH];
  38. CHAR szLayoutPath[MAX_PATH];
  39. CHAR szRenamedFile[MAX_PATH];
  40. CHAR szBootSector[MAX_PATH];
  41. BOOL bHasRenamedFile = FALSE;
  42. BOOL bMakeNECBoot = FALSE;
  43. //
  44. // Macro for rounding up any number (x) to multiple of (n) which
  45. // must be a power of 2. For example, ROUNDUP( 2047, 512 ) would
  46. // yield result of 2048.
  47. //
  48. #define ROUNDUP2( x, n ) (((x) + ((n) - 1 )) & ~((n) - 1 ))
  49. #define _hK 512
  50. #define _1K 1*1024
  51. #define _2K 2*1024
  52. #define _4K 4*1024
  53. #define _8K 8*1024
  54. #define _16K 16*1024
  55. #define _32K 32*1024
  56. #define _64K 64*1024
  57. #define _128K 128*1024
  58. #define _256K 256*1024
  59. // System parition values per cluster size for
  60. // files that go in the ~BT directory.
  61. //
  62. DWORD dw_hK = 0;
  63. DWORD dw_1K = 0;
  64. DWORD dw_2K = 0;
  65. DWORD dw_4K = 0;
  66. DWORD dw_8K = 0;
  67. DWORD dw_16K = 0;
  68. DWORD dw_32K = 0;
  69. DWORD dw_64K = 0;
  70. DWORD dw_128K = 0;
  71. DWORD dw_256K = 0;
  72. void Msg ( const char * szFormat, ... ) {
  73. va_list vaArgs;
  74. va_start ( vaArgs, szFormat );
  75. vprintf ( szFormat, vaArgs );
  76. vfprintf ( logFile, szFormat, vaArgs );
  77. va_end ( vaArgs );
  78. }
  79. void Usage( void ) {
  80. printf ( "Usage: boot logFile dosnet.inf-path output-file-for-dmf flat-uncompressed-share path-for-floppy-files x86orNECbootdisk" );
  81. exit (1);
  82. }
  83. void Header(argv)
  84. char* argv[];
  85. {
  86. time_t t;
  87. Msg ("\n=========== BOOT.EXE =============\n");
  88. Msg ("LogFile : %s\n",argv[1]);
  89. Msg ("DosNet.INF path : %s\n",argv[2]);
  90. Msg ("Output file path : %s\n",argv[3]);
  91. Msg ("Flat uncompressed share: %s\n", argv[4] );
  92. Msg ("Path to put floppy files:%s\n", argv[5] );
  93. Msg ("X86 or NEC Boot sector : %s\n", argv[6] );
  94. time(&t);
  95. Msg ("Time : %s",ctime(&t));
  96. Msg ("================================\n\n");
  97. }
  98. void WriteToFile ( char * fileName, char flopNum ) {
  99. FILE * fHandle;
  100. CHAR Line[MAX_PATH];
  101. CHAR szPath[MAX_PATH];
  102. sprintf ( szPath, "%s\\b%c.txt", szFloppyDump, flopNum );
  103. fHandle = fopen ( szPath, "a" );
  104. if ( fHandle == NULL ) {
  105. Msg ( "ERROR Couldn't open file with fopen: %s\n", szPath );
  106. }
  107. else {
  108. // This denotes that it is the first floppy,
  109. // which needs to have the boot sector put on it.
  110. //
  111. if ( strstr ( fileName, "disk1" ) && flopNum == '0' ) {
  112. if ( bMakeNECBoot ) {
  113. strcpy ( Line, "-bnt35nec98setup\n" );
  114. }
  115. else {
  116. strcpy ( Line, "-bnt35setup\n" );
  117. }
  118. fwrite ( Line, 1, strlen(Line), fHandle );
  119. Msg ( "\nWritingToFile: %s\n%s\n\n", szPath, Line );
  120. }
  121. if ( bHasRenamedFile ) {
  122. sprintf ( Line, "%s=%s\n", fileName, returnBuffer2 );
  123. }
  124. else {
  125. sprintf ( Line, "%s\n" , fileName );
  126. }
  127. fwrite ( Line, 1, strlen(Line), fHandle );
  128. Msg ( "\nWritingToFile: %s\n%s\n\n", szPath, Line );
  129. fclose ( fHandle );
  130. }
  131. }
  132. VOID MakeCompName ( const char * inFile, char * outFile ) {
  133. unsigned i;
  134. unsigned period;
  135. strcpy( outFile, inFile );
  136. for ( period=(unsigned)(-1), i = 0 ; i < strlen(inFile); i++ ) {
  137. if ( inFile[i] == '.' ) {
  138. period = i;
  139. }
  140. }
  141. if ( period == (strlen(inFile)-4) ) {
  142. outFile[strlen(outFile)-1] = '_';
  143. }
  144. else if ( period == (unsigned)(-1)) {
  145. strcat ( outFile, "._");
  146. }
  147. else {
  148. strcat ( outFile, "_");
  149. }
  150. }
  151. void ChangeFileNameToCompressNameIfNeeded ( char * fileName ) {
  152. HANDLE hLayoutInf;
  153. // See if the file is going to come over as compressed or not.
  154. // If so, change it's name so we can process it.
  155. //
  156. // Special case for files not stored in the INF.
  157. //
  158. if ( strstr ( fileName, "disk1" ) ||
  159. strstr ( fileName, "setupldr.bin" ) ||
  160. strstr ( fileName, "usetup.exe" ) ) {
  161. goto no_processing;
  162. }
  163. // Open layout.inf to find out if the file is to be compressed or not.
  164. //
  165. hLayoutInf = SetupOpenInfFile ( szLayoutPath, NULL, INF_STYLE_WIN4, NULL );
  166. if ( hLayoutInf == INVALID_HANDLE_VALUE ) {
  167. Msg ( "ERROR: ChangeFileNameToCompressNameIfNeeded could not open INF: %s\n", szLayoutPath );
  168. }
  169. else {
  170. BOOL b;
  171. DWORD requiredSize;
  172. INFCONTEXT ic;
  173. CHAR returnBuffer[MAX_PATH];
  174. b = SetupFindFirstLine ( hLayoutInf,
  175. (LPSTR) "SourceDisksFiles",
  176. (LPSTR) fileName,
  177. &ic );
  178. if ( !b ) {
  179. // If we get an error, perhaps the file is in the .x86 section.
  180. //
  181. b = SetupFindFirstLine (hLayoutInf,
  182. (LPSTR) "SourceDisksFiles.x86",
  183. (LPSTR) fileName,
  184. &ic );
  185. if ( !b ) {
  186. Msg ( "ERROR: CopyTheFile SetupFindFirstLine couldn't find file in section: gle = %x, >>>%s<<<\n",
  187. GetLastError(), fileName );
  188. }
  189. else {
  190. goto continue_here;
  191. }
  192. }
  193. else {
  194. continue_here:;
  195. // Look at the 7th field.
  196. //
  197. b = SetupGetStringField ( &ic,
  198. 7,
  199. (LPSTR) returnBuffer,
  200. sizeof ( returnBuffer ),
  201. &dwRequiredSize );
  202. if ( !b ) {
  203. Msg ( "ERROR: CopyTheFile SetupGetStringField gle = %ld\n", GetLastError());
  204. }
  205. else {
  206. char * p;
  207. Msg ( "++++ returnBuffer = %s\n", returnBuffer );
  208. // Get to the character that determines if we compress or not.
  209. //
  210. p = returnBuffer;
  211. if ( *p != '_' ) {
  212. CHAR commandBuffer[MAX_PATH];
  213. CHAR szTmp[MAX_PATH];
  214. // Since we are going to be using a compressed filename,
  215. // turn the uncompressed filename into a compressed filename.
  216. //
  217. MakeCompName ( fileName, szTmp );
  218. strcpy ( fileName, szTmp );
  219. Msg ( "using compressed filename, so now it is: %s\n", fileName );
  220. }
  221. else {
  222. Msg ( "leaving filename alone, still: %s\n", fileName );
  223. }
  224. }
  225. }
  226. SetupCloseInfFile ( hLayoutInf );
  227. }
  228. no_processing:;
  229. }
  230. void AddInSize ( char * fileName ) {
  231. CHAR szPath[MAX_PATH];
  232. HANDLE h;
  233. WIN32_FIND_DATA wfd;
  234. sprintf ( szPath, "%s\\%s", szReleaseShare, fileName );
  235. Msg ( "\n+++ AddInSize for: %s +++\n", szPath );
  236. h = FindFirstFile ( szPath, &wfd );
  237. if ( h == INVALID_HANDLE_VALUE ) {
  238. Msg ( "ERROR: FindFirstFile on %s, gle = %ld\n", szPath, GetLastError() );
  239. }
  240. else {
  241. dw_hK += ROUNDUP2 ( wfd.nFileSizeLow, 512 );
  242. dw_1K += ROUNDUP2 ( wfd.nFileSizeLow, _1K );
  243. dw_2K += ROUNDUP2 ( wfd.nFileSizeLow, _2K );
  244. dw_4K += ROUNDUP2 ( wfd.nFileSizeLow, _4K );
  245. dw_8K += ROUNDUP2 ( wfd.nFileSizeLow, _8K );
  246. dw_16K += ROUNDUP2 ( wfd.nFileSizeLow, _16K );
  247. dw_32K += ROUNDUP2 ( wfd.nFileSizeLow, _32K );
  248. dw_64K += ROUNDUP2 ( wfd.nFileSizeLow, _64K );
  249. dw_128K += ROUNDUP2 ( wfd.nFileSizeLow, _128K );
  250. dw_256K += ROUNDUP2 ( wfd.nFileSizeLow, _256K );
  251. /*
  252. Msg ( "dw_hK = %ld\n", dw_hK );
  253. Msg ( "dw_1K = %ld\n", dw_1K );
  254. Msg ( "dw_2K = %ld\n", dw_2K );
  255. Msg ( "dw_4K = %ld\n", dw_4K );
  256. Msg ( "dw_8K = %ld\n", dw_8K );
  257. Msg ( "dw_16K = %ld\n", dw_16K );
  258. Msg ( "dw_32K = %ld\n", dw_32K );
  259. Msg ( "dw_64K = %ld\n", dw_64K );
  260. Msg ( "dw_128K = %ld\n", dw_128K );
  261. Msg ( "dw_256K = %ld\n", dw_256K );
  262. */
  263. FindClose ( h );
  264. }
  265. }
  266. void CopyTheFile ( CHAR * fileName, CHAR flopNum ) {
  267. CHAR szPath1[MAX_PATH];
  268. CHAR szPath2[MAX_PATH];
  269. BOOL b;
  270. Msg ( "CopyTheFile: %s\n", fileName );
  271. // Copy the file.
  272. //
  273. sprintf ( szPath1, "%s\\%s", szReleaseShare, fileName );
  274. sprintf ( szPath2, "%s\\%s", szFloppyDump, fileName );
  275. b = CopyFile ( szPath1, szPath2, FALSE );
  276. if ( !b ) {
  277. Msg ( "ERROR: CopyFile failed, gle = %ld, >>>%s<<< >>>%s<<<\n",
  278. GetLastError(), szPath1, szPath2 );
  279. }
  280. else {
  281. Msg ( "CopyFile: %s %s [ok]\n", szPath1, szPath2 );
  282. SetFileAttributes ( szPath2, FILE_ATTRIBUTE_NORMAL );
  283. }
  284. // Write the name of the file to B?.txt file in the specified directory.
  285. //
  286. WriteToFile ( fileName, flopNum );
  287. }
  288. void GetFloppy ( char Floppy ) {
  289. BOOL b;
  290. INFCONTEXT ic;
  291. char szSection[MAX_PATH];
  292. sprintf ( szSection, "%s%c", "FloppyFiles.", Floppy );
  293. Msg ( "\nGetting for section: %s\n\n", szSection );
  294. // Get the first line in the section, ie FloppyFiles.N.
  295. // Note: Be sure to look for files that maybe renamed:
  296. //
  297. // d1,disk1,disk101
  298. // disk1=disk101 for the output file.
  299. //
  300. b = SetupFindFirstLine ( hDosnetInf,
  301. szSection,
  302. NULL,
  303. &ic );
  304. if ( !b ) {
  305. Msg ( "ERROR: SetupFindFirstLine not found in %s\n", szSection );
  306. }
  307. else {
  308. // Get the 2nd field's filename, such as in d1,disk1,disk101
  309. // would be disk1.
  310. //
  311. b = SetupGetStringField ( &ic,
  312. 2,
  313. (LPSTR) &returnBuffer,
  314. sizeof ( returnBuffer ),
  315. &dwRequiredSize );
  316. if ( !b ) {
  317. Msg ( "ERROR: SetupGetStringField gle = %ld\n", GetLastError());
  318. }
  319. // See if we need to compress this file and
  320. // add in the size for the ~bt directory.
  321. //
  322. ChangeFileNameToCompressNameIfNeeded ( returnBuffer );
  323. AddInSize ( returnBuffer );
  324. // Get the 3rd field's filename, such as in d1,disk1,disk101
  325. // would be disk101.
  326. // This is the case where we need to stick disk1=disk101 for
  327. // the output file for disk imaging.
  328. //
  329. // Note: we don't check for errors here because 3rd field
  330. // because this renamed file is optional.
  331. //
  332. b = SetupGetStringField ( &ic,
  333. 3,
  334. (LPSTR) &returnBuffer2,
  335. sizeof ( returnBuffer2 ),
  336. &dwRequiredSize );
  337. // Note - not checking for errors here.
  338. //
  339. if ( b ) {
  340. bHasRenamedFile = TRUE;
  341. }
  342. else {
  343. bHasRenamedFile = FALSE;
  344. }
  345. // Copy the file to the specified directory.
  346. //
  347. CopyTheFile ( returnBuffer, Floppy );
  348. while ( 1 ) {
  349. // Get the next line in the section.
  350. //
  351. b = SetupFindNextLine ( &ic,
  352. &ic );
  353. if ( !b ) {
  354. // Denotes that there is NOT another line.
  355. //
  356. Msg ( "\n" );
  357. break;
  358. }
  359. else {
  360. // Get the 2nd field's filename,
  361. // such as in d1,disk1,disk101
  362. // would be disk1.
  363. //
  364. b = SetupGetStringField ( &ic,
  365. 2,
  366. (LPSTR) &returnBuffer,
  367. sizeof ( returnBuffer ),
  368. &dwRequiredSize );
  369. if ( !b ) {
  370. Msg ( "ERROR: SetupGetStringField gle = %ld\n", GetLastError());
  371. break;
  372. }
  373. //Msg ( "returnBuffer = %s\n", returnBuffer );
  374. ChangeFileNameToCompressNameIfNeeded ( returnBuffer );
  375. AddInSize ( returnBuffer );
  376. // Get the 3rd field's filename, such as in
  377. // d1,disk1,disk101
  378. // would be disk101.
  379. // This is the case where we need to stick
  380. // disk1=disk101 for
  381. // the output file for disk imaging.
  382. //
  383. // Note: we don't check for errors here because 3rd field
  384. // because this renamed file is optional.
  385. //
  386. b = SetupGetStringField ( &ic,
  387. 3,
  388. (LPSTR) &returnBuffer2,
  389. sizeof ( returnBuffer2 ),
  390. &dwRequiredSize );
  391. // Note - not checking for errors here.
  392. //
  393. if ( b ) {
  394. bHasRenamedFile = TRUE;
  395. }
  396. else {
  397. bHasRenamedFile = FALSE;
  398. }
  399. // Copy the file to the specified directory.
  400. //
  401. CopyTheFile ( returnBuffer, Floppy );
  402. }
  403. }
  404. }
  405. }
  406. DWORD Get2ndSize ( char * key ) {
  407. CHAR returnedString[MAX_PATH];
  408. #define OHPROBLEM "OH OH"
  409. DWORD dwSize = 666;
  410. char * p;
  411. GetPrivateProfileString ( "DiskSpaceRequirements",
  412. key,
  413. OHPROBLEM,
  414. returnedString,
  415. MAX_PATH,
  416. szDosnetPath );
  417. if ( strncmp ( returnedString, OHPROBLEM, sizeof ( OHPROBLEM ) ) == 0 ) {
  418. Msg ( "ERROR: section >>>%s<<< not found.\n", key );
  419. }
  420. //Msg ( ">>> %s\n", returnedString );
  421. // Find the ',' which denotes the ~BT data.
  422. //
  423. p = strstr ( returnedString, "," );
  424. if ( !p ) {
  425. Msg ( "ERROR: returnedString has no ',' in it: %s\n", returnedString );
  426. dwSize = 0;
  427. }
  428. else {
  429. ++p; // point to the number, not the ','
  430. dwSize = atoi ( p );
  431. //Msg ( ">+BT dwSize = %ld, p = %s\n", dwSize, p );
  432. }
  433. return (dwSize);
  434. }
  435. DWORD GetBT ( DWORD ClusterSize ) {
  436. switch ( ClusterSize ) {
  437. case _hK :
  438. return Get2ndSize ( "TempDirSpace512" );
  439. break;
  440. case _1K :
  441. return Get2ndSize ( "TempDirSpace1K" );
  442. break;
  443. case _2K :
  444. return Get2ndSize ( "TempDirSpace2K" );
  445. break;
  446. case _4K :
  447. return Get2ndSize ( "TempDirSpace4K" );
  448. break;
  449. case _8K :
  450. return Get2ndSize ( "TempDirSpace8K" );
  451. break;
  452. case _16K :
  453. return Get2ndSize ( "TempDirSpace16K" );
  454. break;
  455. case _32K :
  456. return Get2ndSize ( "TempDirSpace32K" );
  457. break;
  458. case _64K :
  459. return Get2ndSize ( "TempDirSpace64K" );
  460. break;
  461. case _128K :
  462. return Get2ndSize ( "TempDirSpace128K" );
  463. break;
  464. case _256K :
  465. return Get2ndSize ( "TempDirSpace256K" );
  466. break;
  467. default :
  468. Msg ( "ERROR: ClusterSize not known: %ld\n", ClusterSize );
  469. break;
  470. }
  471. return 0;
  472. }
  473. void VerifyTotalSizeIsAdaquate ( void ) {
  474. // Make sure that the total size we need is specified in dosnet.inf.
  475. //
  476. Msg ( "\n\nVerifyTotalSizeIsAdaquate...\n" );
  477. // Dosnet.inf's [SpaceRequirements] cluster fields should look like:
  478. //
  479. // 512 = xxxxxx, yyyyyy where x is for the ~LS files and
  480. // where y is for the ~BT files.
  481. //
  482. #define FUDGE 1*1024*1024 // to make sure we have enough for dir entries in FAT.
  483. if ( dw_hK > GetBT ( _hK ) ) {
  484. Msg ( "matth ERROR: Dosnet.inf's [DiskSpaceRequirements]'s 512 ~BT too small, %ld, use: %ld\n", GetBT ( _hK ), dw_hK+FUDGE );
  485. }
  486. if ( dw_1K > GetBT ( _1K ) ) {
  487. Msg ( "matth ERROR: Dosnet.inf's [DiskSpaceRequirements]'s 1K ~BT too small, %ld, use: %ld\n", GetBT ( _1K ), dw_1K+FUDGE );
  488. }
  489. if ( dw_2K > GetBT ( _2K ) ) {
  490. Msg ( "matth ERROR: Dosnet.inf's [DiskSpaceRequirements]'s 2K ~BT too small, %ld, use: %ld\n", GetBT ( _2K ), dw_2K+FUDGE );
  491. }
  492. if ( dw_4K > GetBT ( _4K ) ) {
  493. Msg ( "matth ERROR: Dosnet.inf's [DiskSpaceRequirements]'s 4K ~BT too small, %ld, use: %ld\n", GetBT ( _4K ), dw_4K+FUDGE );
  494. }
  495. if ( dw_8K > GetBT ( _8K ) ) {
  496. Msg ( "matth ERROR: Dosnet.inf's [DiskSpaceRequirements]'s 8K ~BT too small, %ld, use: %ld\n", GetBT ( _8K ), dw_8K+FUDGE );
  497. }
  498. if ( dw_16K > GetBT ( _16K ) ) {
  499. Msg ( "matth ERROR: Dosnet.inf's [DiskSpaceRequirements]'s 16K ~BT too small, %ld, use: %ld\n", GetBT ( _16K ), dw_16K+FUDGE );
  500. }
  501. if ( dw_32K > GetBT ( _32K ) ) {
  502. Msg ( "matth ERROR: Dosnet.inf's [DiskSpaceRequirements]'s 32K ~BT too small, %ld, use: %ld\n", GetBT ( _32K ), dw_32K+FUDGE );
  503. }
  504. if ( dw_64K > GetBT ( _64K ) ) {
  505. Msg ( "matth ERROR: Dosnet.inf's [DiskSpaceRequirements]'s 64K ~BT too small, %ld, use: %ld\n", GetBT ( _64K ), dw_64K+FUDGE );
  506. }
  507. if ( dw_128K > GetBT ( _128K ) ) {
  508. Msg ( "matth ERROR: Dosnet.inf's [DiskSpaceRequirements]'s 128K ~BT too small, %ld, use: %ld\n", GetBT ( _128K ), dw_128K+FUDGE );
  509. }
  510. if ( dw_256K > GetBT ( _256K ) ) {
  511. Msg ( "matth ERROR: Dosnet.inf's [DiskSpaceRequirements]'s 256K ~BT too small, %ld, use: %ld\n", GetBT ( _256K ), dw_256K+FUDGE );
  512. }
  513. }
  514. void MyDeleteFile ( char Num ) {
  515. BOOL b;
  516. CHAR szPath[MAX_PATH];
  517. sprintf ( szPath, "%s\\b%c.txt", szFloppyDump, Num );
  518. Msg ( "Deleting: %s\n", szPath );
  519. b = DeleteFile ( szPath );
  520. if ( !b ) {
  521. if ( GetLastError() != ERROR_FILE_NOT_FOUND ) {
  522. Msg ( "ERROR: DeleteFile, gle = %ld, %s\n", GetLastError(), szPath );
  523. }
  524. }
  525. }
  526. __cdecl main ( int argc, char * argv[] ) {
  527. if ( argc != 7) {
  528. Usage();
  529. exit(1);
  530. }
  531. if ((logFile=fopen(argv[1],"a"))==NULL) {
  532. printf("ERROR Couldn't open logFile: %s\n",argv[1]);
  533. return(1);
  534. }
  535. Header(argv);
  536. Msg ( "%s %s %s %s %s %s %s\n", argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6] );
  537. // Copy paths into appropriate string variables.
  538. //
  539. strcpy ( szLog, argv[1] );
  540. Msg ( "szLog = %s\n", szLog );
  541. strcpy ( szDosnetPath, argv[2] );
  542. Msg ( "szDosnetPath = %s\n", szDosnetPath );
  543. strcpy ( szReleaseShare, argv[4] );
  544. Msg ( "szReleaseShare = %s\n", szReleaseShare );
  545. sprintf ( szLayoutPath, "%s\\%s", argv[4], "layout.inf" );
  546. Msg ( "szLayoutPath = %s\n", szLayoutPath );
  547. strcpy ( szFloppyDump, argv[5] );
  548. Msg ( "szFloppyDump = %s\n", szFloppyDump );
  549. strcpy ( szBootSector, argv[6] );
  550. Msg ( "szBootSector = %s\n", szBootSector );
  551. if ( strstr ( szBootSector, "NEC" ) ) {
  552. bMakeNECBoot = TRUE;
  553. Msg ( "Making this boot floppy #1 NEC98 bootable...\n" );
  554. }
  555. //
  556. //
  557. hDosnetInf = SetupOpenInfFile ( szDosnetPath, NULL, INF_STYLE_WIN4, NULL );
  558. if ( hDosnetInf == INVALID_HANDLE_VALUE ) {
  559. Msg ( "ERROR: boot.exe - could not open INF: %s\n", szDosnetPath );
  560. }
  561. else {
  562. CHAR szPath[MAX_PATH];
  563. BOOL b;
  564. // Delete the files that hold the file list.
  565. //
  566. MyDeleteFile ( '0' );
  567. MyDeleteFile ( '1' );
  568. MyDeleteFile ( '2' );
  569. MyDeleteFile ( '3' );
  570. GetFloppy ( '0' );
  571. GetFloppy ( '1' );
  572. GetFloppy ( '2' );
  573. GetFloppy ( '3' );
  574. SetupCloseInfFile ( hDosnetInf );
  575. VerifyTotalSizeIsAdaquate ();
  576. }
  577. }