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.
 
 
 
 
 
 

258 lines
4.9 KiB

@echo off
@if NOT defined HOST_PROCESSOR_ARCHITECTURE set HOST_PROCESSOR_ARCHITECTURE=%PROCESSOR_ARCHITECTURE%
if defined _echo echo on
if defined verbose echo on
setlocal ENABLEEXTENSIONS
REM -----------------------------------------------------------------------------------
REM tagmsi - Script written by VijeshS
REM -----------------------------------------------------------------------------------
REM ------------------------------------------------------------------------------------
REM
REM tagmsi.cmd <MSI package> <script dir> <Destination> <infofile> <language>
REM
REM Note : All paths are relative
REM
REM <MSI package> - winnt32 MSI mackage that is checked in (relative path)
REM
REM <script dir> - Path to the location of the Package Update script (relative path)
REM
REM <Destination> - Destination MSI package
REM
REM <Infofile> - File that contains product-specific information
REM
REM <Language> - Language being used
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM ------------------------------------------------------------------------------------
goto MAIN
:START
REM Start Process
REM
REM Get the value of the locale ID (LCID) for the current language,
REM per public\tools\codes.txt.
REM USA is the default language.
REM
set lang=%5
if not defined lang set lang=USA
call :SetLCID %lang%
echo %LCID%
if errorlevel 1 goto errend
set arch=%HOST_PROCESSOR_ARCHITECTURE%
REM
REM Get the (prodnomajor), (bldnomajor), and (prodnominor), (bldnominor) n.n.nnnn.nnnn from buildno.txt
REM
call :SetBldno
if errorlevel 1 goto errend
REM
REM Define "mybinaries" as the directory of binaries to be processed by this
REM build rule option. On US build machine, the files to be processed reside
REM in %binaries%. On international build machines the files to be processed
REM are in a directory called "relbins". %Relbins% contains the localized
REM version of the files from %binaries%.
REM
REM Do not redefine mybinaries if already defined.
REM
REM
REM Make external deployment winnt32.msi files.
REM
set ERROR=
echo Copying %1 to %3
echo
compdir /deknstz %1 %3
if NOT "%errorlevel%" == "0" (
call errmsg.cmd "Copying %1 to %3 failed"
goto errend
)
set ERROR=
call :ExecuteCmd "cscript.exe %2\updateos.vbs %3 %arch% %prodnomajor% %prodnominor% %bldno% %bldnoMin% %LCID% %4"
if errorlevel 1 set /A ERROR=1
if defined ERROR goto errend
goto end
REM BEGIN
:MAIN
REM
REM Define SCRIPT_NAME. Used by the logging scripts.
REM
set script_name=TAGMSI
REM
REM Save the command line.
REM
set cmdline=%script_name% %*
REM
REM Mark the beginning of script's execution.
REM
REM
REM Execute the build rule option.
REM
call :START %1 %2 %3 %4 %5
if errorlevel 1 (set /A ERRORS=%errorlevel%) else (set /A ERRORS=0)
REM
REM Mark the end of script's execution.
REM
if "%ERRORS%" == "0" goto end_main
goto errend_main
:end_main
endlocal
goto end
:errend_main
endlocal
goto errend
:errend
seterror.exe 1
goto :EOF
:end
seterror.exe 0
goto :EOF
REM END
:SetLCID
REM First parameter must be language
if "%1" == "" (
echo "TAGMSIinternal error: GetLCID requires language as parameter"
goto errend
)
set codes=%_ntbindir%\tools\codes.txt
if not exist %codes% (
call errmsg.cmd "File %codes% not found."
goto errend
)
set LCID=
for /f "tokens=3 eol=;" %%i in ('findstr /ib /c:"%1 " %codes%') do (
set LCID=%%i
)
if "%LCID%" == "" (
call errmsg.cmd "Unable to find LCID for %1 in %codes%."
goto errend
)
goto end
:Set Product Number
:SetBldno
set ntverfile=%_NTPostBld%\congeal_scripts\setupmsi\buildno.txt
if not exist %ntverfile% (
call errmsg.cmd "File %ntverfile% not found."
goto errend
)
set prodnomajor=
for /f "tokens=2" %%i in ('findstr /c:"prodnomajor " %ntverfile%') do (
set prodnomajor=%%i
)
set prodnominor=
for /f "tokens=2" %%i in ('findstr /c:"prodnominor " %ntverfile%') do (
set prodnominor=%%i
)
set bldno=
for /f "tokens=2" %%i in ('findstr /c:"major " %ntverfile%') do (
set bldno=%%i
)
set bldnoMin=
for /f "tokens=2" %%i in ('findstr /c:"minor " %ntverfile%') do (
set bldnoMin=%%i
)
if "%prodnomajor%" == "" (
call errmsg.cmd "Unable to define prodNoMajor per %ntverfile%"
goto errend
)
if "%prodnominor%" == "" (
call errmsg.cmd "Unable to define prodnominor per %ntverfile%"
goto errend
)
if "%bldno%" == "" (
call errmsg.cmd "Unable to define bldnoMajor per %ntverfile%"
goto errend
)
if "%bldnoMin%" == "" (
call errmsg.cmd "Unable to define bldnoMin per %ntverfile%"
goto errend
)
goto end
:ExecuteCmd
set cmd=%1
set cmd=%cmd:"=%
REM call logmsg.cmd "Running %cmd%." %tmpfile%
%cmd%
if NOT "%errorlevel%" == "0" (
call errmsg.cmd "%cmd% Failed"
goto errend
)
goto end