Manifest w WDK / build.exe

0

Mam problem z automatycznym dołączeniem manifestu do zasobów pliku wykonywalnego tworzonego przy pomocy build.exe w WDK.

W Visual Studio tradycyjnie robi się to poprzez proste ustawienie nazwy pliku z manifestem w Properties / Manifest Tool / Input and Output. Tyle wystarczy i manifest jest poprawnie dołączany do zasobów.

W bin\makefile.new w liniach 1893-1948 należącego do WDK w wersji 7.1.0 czytamy, że:

# SideBySide (SXS) Build
#
# Step by Step instructions
#
# For building a monolithic application, foo.ext (where .ext is usually .exe but for example .scr).
# For building an application that hosts arbitrary (3rd party) code.
# For building a single file component like comctl32.dll.
# For building a multiple file component.
#
# Reference
#
# An assembly contains a manifest and one or more files, usually .dlls.
# The manifest can be in a resource in one of the files, or it can be in a seperate
#   .manifest file. For purposes of fitting on an 8.3 CD, .man is allowed.
# Build.exe is generally limited to building one .dll per directory, so
#   you can be building files for an assembly without building a manifest.
#
# To build/binplace a manifest:
#
#  SXS_MANIFEST required
#    This is the source file that contains your manifest.
#    It must end in .manifest.
#    It is always preprocessed. Available macros include:
#      SXS_ASSEMBLY_NAME
#      SXS_ASSEMBLY_VERSION
#      SXS_ASSEMBLY_LANGUAGE
#      SXS_PROCESSOR_ARCHITECTURE
#
#  SXS_MANIFEST_IN_RESOURCES optional
#    This is defined or not, so you just say
#      SXS_MANIFEST_IN_RESOURCES=
#    or don't say anything.
#
#  SXS_ASSEMBLY_NAME and/or SXS_SHORT_ASSEMBLY_NAME required
#    One can be generated from the other.
#    SXS_SHORT_ASSEMBLY_NAME is used where 8.3 limits apply, like on the product CD.
#    Both of these macros can be hierarchical, using dot, dash, or underscore to seperate
#    elements. SXS_SHORT_ASSEMBLY_NAME should actually only contain 8 character elements.
#
#  SXS_ASSEMBLY_VERSION optional, defaults to 5.1.
#
#  SXS_ASSEMBLY_LANGUAGE or SXS_ASSEMBLY_LANGUAGE_INDEPENDENT required
#    SXS_ASSEMBLY_LANGUAGE_INDEPENDENT is defined or not.
#    SXS_ASSEMBLY_LANGUAGE is four digits like
#      0409 for English US
#      0009 for English
#      0000 for language independent
#    We should make this easier as is done for resources (LANGUAGE => RCCODEPAGE), but for now we don't.
#
# To build/binplace a file into an assembly, a subset of the information
# needed for manifests is needed:
#
#  SXS_ASSEMBLY_NAME and/or SXS_SHORT_ASSEMBLY_NAME
#  SXS_ASSEMBLY_VERSION
#  SXS_ASSEMBLY_LANGUAGE or SXS_ASSEMBLY_LANGUAGE_INDEPENDENT

Także w pliku sources umieszczam:

SXS_MANIFEST=myapp.manifest
SXS_ASSEMBLY_NAME=Program
SXS_ASSEMBLY_VERSION=1.0
SXS_ASSEMBLY_LANGUAGE=0000

Uruchamiam build, kompilacja przebiega pomyślnie. Część logów dotyczących manifestu:

1>Generating Code...
1> del c:\users\rev\documents\visual~1\projects\program\objfre_wxp_x86\i386\myapp.o_manifest c:\users\rev\documents\visual~1\projects\program\objfre_wxp_x86\i386\myapp.o_manifest.temp 2>nul
1> preprocessor -o c:\users\rev\documents\visual~1\projects\program\objfre_wxp_x86\i386\myapp.o_manifest.temp -i .\myapp.manifest -DSXS_ASSEMBLY_NAME="\"Program\"" -DSXS_LANGUAGE="\"0000\"" -DSXS_ASSEMBLY_LANGUAGE="\"0000\"" -DSXS_PROCESSOR_ARCHITECTURE="\"x86\""  -DSXS_TARGET="\"program.exe\""   -DSYSTEM_COMPATIBLE_ASSEMBLY_NAME="\"Microsoft.Windows.SystemCompatible\""  -DLSYSTEM_COMPATIBLE_ASSEMBLY_NAME=L"\"Microsoft.Windows.SystemCompatible\""   -DSXS_ASSEMBLY_VERSION="\"1.0.0.0\""
1> move c:\users\rev\documents\visual~1\projects\program\objfre_wxp_x86\i386\myapp.o_manifest.temp c:\users\rev\documents\visual~1\projects\program\objfre_wxp_x86\i386\myapp.o_manifest >nul

Faktycznie tworzy się myapp.o_manifest z poprawnym manifestem, ale w zasobach nic nie ma.

Dopiero po osobnym dołączeniu manifestu poprzez mt.exe -manifest myapp.o_manifest -outputresource:Program.exe jest wszystko w porządku.

myapp.manifest: http://pastebin.com/1UeK3gmi
sources: http://pastebin.com/vSvUSEPe

1

Nie prościej załączyć plik .rc do SOURCES, a sam manifest wpisać w pliku rc ?

sources.

SOURCES=                \
        main.c      \
        main.rc

main.rc
1 24 "mymanifest.xml"

1 użytkowników online, w tym zalogowanych: 0, gości: 1