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.

94 lines
2.2 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM hnw.cmd
  5. REM This will call iexpress to generate a self-extracting CAB that
  6. REM will be used when running our tool off of a floppy disk.
  7. REM
  8. REM Copyright (c) Microsoft Corporation. All rights reserved.
  9. REM
  10. REM ------------------------------------------------------------------
  11. if defined _CPCMAGIC goto CPCBegin
  12. perl -x "%~f0" %*
  13. goto :EOF
  14. #!perl
  15. use strict;
  16. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  17. use lib $ENV{RAZZLETOOLPATH};
  18. use PbuildEnv;
  19. use ParseArgs;
  20. sub Usage { print<<USAGE; exit(1) }
  21. hnw.cmd [-l <language>]
  22. This is for the Home Networking Wizard. It runs iexpress to generate
  23. a self-extracting CAB and install into support\tools.
  24. USAGE
  25. parseargs('?' => \&Usage);
  26. # *** NEXT FEW LINES ARE TEMPLATE ***
  27. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  28. __END__
  29. :CPCBegin
  30. set _CPCMAGIC=
  31. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  32. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  33. REM
  34. REM x86 only!
  35. REM
  36. if not defined x86 goto end
  37. REM
  38. REM Use iexpress.exe to generate the self-extracting executable;
  39. REM
  40. REM first update the sed with the proper binaries directory
  41. set hnw.sed=%temp%\hnw.sed
  42. set doubledpath=%_NtPostBld:\=\\%
  43. perl -n -e "s/BINARIES_DIR/%doubledpath%/g;print $_;" < %_NtPostBld%\hnw.sed > %hnw.sed%
  44. REM Now call iexpress on the new sed
  45. if not exist %hnw.sed% (
  46. call errmsg.cmd "File %hnw.sed% not found."
  47. popd& goto end
  48. )
  49. set outpath=%_NTPostBld%
  50. if exist %outpath%\netsetup.exe del /f %outpath%\netsetup.exe
  51. REM
  52. REM Munge the path so we use the correct wextract.exe to build the package with...
  53. REM NOTE: We *want* to use the one we just built (and for Intl localized)!
  54. REM
  55. set _NEW_PATH_TO_PREPEND=%RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\loc\%LANG%
  56. set _OLD_PATH_BEFORE_PREPENDING=%PATH%
  57. set PATH=%_NEW_PATH_TO_PREPEND%;%PATH%
  58. call ExecuteCmd.cmd "start /min /wait iexpress.exe /M /N /Q %hnw.sed%"
  59. REM
  60. REM Return the path to what it was before...
  61. REM
  62. set PATH=%_OLD_PATH_BEFORE_PREPENDING%
  63. if not exist %outpath%\netsetup.exe (
  64. call errmsg.cmd "IExpress.exe failed on %hnw.sed%."
  65. popd& goto end
  66. )
  67. popd
  68. :end
  69. seterror.exe "%errors%"& goto :EOF