Leaked source code of windows server 2003
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.

99 lines
2.5 KiB

  1. @REM -----------------------------------------------------------------
  2. @REM
  3. @REM hnw.cmd - TinQian
  4. @REM This will call iexpress to generate a self-extracting CAB that
  5. @REM will be used when running our tool off of a floppy disk.
  6. @REM
  7. @REM Copyright (c) Microsoft Corporation. All rights reserved.
  8. @REM
  9. @REM -----------------------------------------------------------------
  10. @if NOT defined HOST_PROCESSOR_ARCHITECTURE set HOST_PROCESSOR_ARCHITECTURE=%PROCESSOR_ARCHITECTURE%
  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. # *** TEMPLATE CODE ***
  27. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  28. __END__
  29. @:CPCBegin
  30. @set _CPCMAGIC=
  31. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  32. @if not defined DEBUG echo off
  33. @REM *** CMD SCRIPT BELOW ***
  34. REM
  35. REM x86 only!
  36. REM
  37. if not defined x86 goto end
  38. REM
  39. REM Use iexpress.exe to generate the self-extracting executable;
  40. REM
  41. REM first update the sed with the proper binaries directory
  42. set hnw.sed=%temp%\hnw.sed
  43. set doubledpath=%_NtPostBld:\=\\%
  44. perl -n -e "s/BINARIES_DIR/%doubledpath%/g;print $_;" < %_NtPostBld%\hnw.sed > %hnw.sed%
  45. REM Now call iexpress on the new sed
  46. if not exist %hnw.sed% (
  47. call errmsg.cmd "File %hnw.sed% not found."
  48. popd& goto end
  49. )
  50. set outpath=%_NTPostBld%
  51. if exist %outpath%\netsetup.exe del /f %outpath%\netsetup.exe
  52. REM
  53. REM Munge the path so we use the correct wextract.exe to build the package with...
  54. REM NOTE: We *want* to use the one we just built (and for Intl localized)!
  55. REM
  56. set _NEW_PATH_TO_PREPEND=%RazzleToolPath%\%HOST_PROCESSOR_ARCHITECTURE%\loc\%LANG%
  57. set _OLD_PATH_BEFORE_PREPENDING=%PATH%
  58. set PATH=%_NEW_PATH_TO_PREPEND%;%PATH%
  59. call ExecuteCmd.cmd "start /min /wait iexpress.exe /M /N /Q %hnw.sed%"
  60. REM
  61. REM Return the path to what it was before...
  62. REM
  63. set PATH=%_OLD_PATH_BEFORE_PREPENDING%
  64. if not exist %outpath%\netsetup.exe (
  65. call errmsg.cmd "IExpress.exe failed on %hnw.sed%."
  66. popd& goto end
  67. )
  68. if not exist %_NTPostBld%\netsetup md %_NTPostBld%\netsetup
  69. call ExecuteCmd.cmd "copy %outpath%\netsetup.exe %_NTPostBld%\netsetup"
  70. popd
  71. :end
  72. seterror.exe "%errors%"& goto :EOF