File: embedman.bat

package info (click to toggle)
allegro4.4 2:4.4.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 20,744 kB
  • sloc: ansic: 164,458; asm: 17,620; cpp: 3,848; objc: 1,687; sh: 1,107; python: 676; pascal: 179; makefile: 55; perl: 29; lisp: 1
file content (66 lines) | stat: -rwxr-xr-x 1,691 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@ECHO OFF
REM *** embedman.bat is a helper tool for MSVC8.
REM     It embeds all XML manifest files into its corresponding executable.

REM ======== DISPATCHING ========
IF "%1" == "" GOTO usage
IF "%1" == "all" IF "%2" == "" GOTO search
IF "%2" == "" GOTO bad_usage
IF NOT EXIST "%1" GOTO file_not_found
IF NOT EXIST "%1.manifest" GOTO no_manifest

REM ======== EMBED MANIFEST ========
mt -nologo -manifest %1.manifest -outputresource:%1;%2
IF NOT "%ERRORLEVEL%" == "0" GOTO mt_fail
del %1.manifest
GOTO end

REM ======== SEARCH AND EMBED ========
:search
FOR /R %%v IN (*.exe) DO CALL %0 %%v 1 -silent
FOR /R %%v IN (*.scr) DO CALL %0 %%v 1 -silent
FOR /R %%v IN (*.dll) DO CALL %0 %%v 2 -silent

GOTO end

REM ======== ERRORS ========
:usage
ECHO.
ECHO Running embedman.bat with "all" as the first and only parameter causes it to 
ECHO search for all executables and DLLs with manifest files, and embed them.
ECHO.
ECHO %0 all
ECHO.
ECHO Alternatively, you can specify an exact file:
ECHO.
ECHO %0 file.exe 1
ECHO %0 file.dll 2
ECHO.
ECHO In every case, the manifest file must exist in the same folder with the same
ECHO name as the executable for it to work. The manifest file is then deleted.
GOTO end

:bad_usage
ECHO.
ECHO You must specify whether the file is an executable or DLL via the second
ECHO parameter.
ECHO.
ECHO 1 = Executable
ECHO 2 = DLL
GOTO end

:file_not_found
ECHO.
ECHO The file "%1" was not found.
GOTO end

:mt_fail
ECHO Unable to embed %1.manifest! Make sure mt.exe is in the path.
GOTO end

:no_manifest
IF NOT "%3" == "-silent" ECHO No manifest found for %1


REM ======== THE END ========
:end