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.
91 lines
2.7 KiB
91 lines
2.7 KiB
REM ------------------------------------------------------------------
|
|
REM
|
|
REM sxs_generate_msm.cmd
|
|
REM Generates msms for assembly which provide componentID as well
|
|
REM as ModuleID
|
|
REM
|
|
REM Copyright (c) Microsoft Corporation. All rights reserved.
|
|
REM
|
|
REM ------------------------------------------------------------------
|
|
if defined _CPCMAGIC goto CPCBegin
|
|
perl -x "%~f0" %*
|
|
goto :EOF
|
|
#!perl
|
|
use strict;
|
|
use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
|
|
use lib $ENV{RAZZLETOOLPATH};
|
|
use PbuildEnv;
|
|
use ParseArgs;
|
|
|
|
sub Usage { print<<USAGE; exit(1) }
|
|
sxs_generate_msm
|
|
|
|
Generate Msi Merge Module for Side-By-Side win32 assemblies
|
|
|
|
USAGE
|
|
|
|
parseargs('?' => \&Usage);
|
|
|
|
# *** NEXT FEW LINES ARE TEMPLATE ***
|
|
$ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
|
|
__END__
|
|
:CPCBegin
|
|
set _CPCMAGIC=
|
|
setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
|
|
REM *** BEGIN YOUR CMD SCRIPT BELOW ***
|
|
|
|
set BINPLACE_LOG=%BINPLACE_LOG%_sxs_msm.cmd.log
|
|
set in=%BINPLACE_LOG%\..\sxsMsmList*.txt
|
|
|
|
REM
|
|
REM if sxsMsmList.txt does not exist or empty, it means no requirement to generate merge module,
|
|
REM just goto :eof
|
|
REM
|
|
if not EXIST %in% (
|
|
call logmsg.cmd "no merge module generation requirement!"
|
|
goto :eof
|
|
)
|
|
|
|
REM
|
|
REM sort.exe|unique.exe the msm-request logfile generated by makefile.def,
|
|
REM and pretty print the content as readable columns.
|
|
REM
|
|
|
|
set out=%BINPLACE_LOG%\..\combined_sxsMsmList.txt
|
|
|
|
if EXIST %out% del /f /q %out%
|
|
echo>>%out% ;"%in% is produced by SXS_LOG in makefile.def"
|
|
echo>>%out% ;"then %in% processed by perl | columns.exe | sort.exe | unique.exe in %0 to produce %out%"
|
|
echo>>%out% ;"MSM-ModuleGUID | MSM Filename| Assembly-Source-Location | MSM-ComponentGUID"
|
|
echo>>%out% ;============================================================================================
|
|
call logmsg.cmd "start perl | columns.exe | sort.exe | unique.exe"
|
|
type %in% | columns.exe | sort.exe | unique.exe > %out%
|
|
call logmsg.cmd "end perl | columns.exe | sort.exe | unique.exe"
|
|
|
|
REM
|
|
REM for each entry in the combined logfile, call sxs_msmgen.exe to generate msm
|
|
REM and put it into the specified destination path
|
|
REM
|
|
|
|
set TempWorkingDir=%RANDOM%
|
|
md %_NTPOSTBLD%\!TempWorkingDir!
|
|
pushd %_NTPOSTBLD%\!TempWorkingDir!
|
|
if "!errorlevel!" == "1" (
|
|
call errmsg.cmd "cd /d %%_NTPOSTBLD%% failed! from sxs_msm.cmd"
|
|
goto :EOF
|
|
)
|
|
|
|
set sxs_msmgen_cmd=sxs_msmgen.exe mangroup %out% -template %RazzleToolPath%\sxs_msmgen.msm
|
|
call logmsg.cmd "Generating merge module for Side-By-Side Win32 Assemblies"
|
|
call ExecuteCmd.cmd "%%sxs_msmgen_cmd%%"
|
|
if "!errorlevel!" == "1" (
|
|
call errmsg.cmd "Generate msm failed for %%_NTPOSTBLD%%\%%i"
|
|
goto :Eof
|
|
)
|
|
:Eof
|
|
popd
|
|
rmdir /s /q %_NTPOSTBLD%\!TempWorkingDir!
|
|
|
|
|
|
|
|
|