部署包架构

用作 makepkg 工具的输入的映射文件有五个允许使用的元素,这些元素描述包的内容:包、区块、文件、过程和功能。 这些元素描述整体包、包的各个可流式处理段(区块),以及这些区块中每一个所包含的文件。 功能允许用户选择要安装或删除的区块组,而过程则允许将为给定安装启用的功能集与用户拥有的权利或用户的家用主机绑定在一起。

小型映射文件类似于以下代码示例。

<Package>
  <Chunk Id="1000" Marker="Launch">
    <FileGroup DestinationPath="\" SourcePath="X:\bin" Include="*.*"/>
  </Chunk>
  <Chunk Id="1001">
    <FileGroup DestinationPath="\Data\Maps" SourcePath="Y:\Maps\Level1" Include="*.map"/>
    <FileGroup DestinationPath="\Data\Maps" SourcePath="Y:\Maps\Level2" Include="*.map"/>
    <FileGroup DestinationPath="\Data\Maps" SourcePath="Y:\Maps\Level3" Include="*.map"/>
    <FileGroup DestinationPath="\Data\Maps" SourcePath="W:\ExtraMaps" Include="*.map"/>
    <FileGroup DestinationPath="\Data\Textures" SourcePath="M:\MapTextures" Include="*.png"/>
    <FileGroup DestinationPath="\Data\Textures" SourcePath="W:\ExtraMapTextures" Include="*.png"/>
  </Chunk>
</Package>  

生成软件包时,MicrosoftGame.config 和它引用的所有文件(例如,徽标、初始屏幕等)都应包含在文件组中。 不应将 GameOs.xvd 包含在映射文件中,因为它会在包生成期间自动嵌入到包中。

智能传递示例

下面的映射文件演示如何使用智能传递来控制系统安装的区块,并定义用户在安装时以及后续在 shell 中选择启用或禁用的功能。 每个区块都可以有一个说明符,这样就可以根据主机的设备类型和语言设置有选择地交付区块。 使用功能的任何包还必须指定默认的过程,并且可以选择指定其他过程。

<Package>
    <!-- Features bring down Chunks with the associated Tags.
         Users can override install defaults to deselect features they don't want,
         and can add/remove features from within the shell after install as well. -->
    <Features>
        <Feature Id="CampaignFeature" DisplayName="MyGame Campaign Name" Image="CampaignLogo.png" Tags="CampaignTag" />
        <Feature Id="MultiPlayerFeature" DisplayName="MyGame Multiplayer Name" Image="MPLogo.png" Tags="MPTag" />
        <Feature Id="PremiumFeature" Image="PremiumLogo.png" Tags="PremiumTag" />
    </Features>
    <!-- Recipes declare which Features are included for a given install.
         Recipes are additive, and persist for the life of an install,
         They are never removed, though users can choose to add/remove individual Features -->
    <Recipes>
        <!-- default Recipe is always active -->
        <Recipe Id="default" IncludedFeatures="CampaignFeature;MPFeature"/>
        <!-- PremiumProduct Recipe is active, causing PremiumFeature to be installed if user owns 9PXXXXXXXXXX -->
        <Recipe Id="PremiumProduct" IncludedFeatures="PremiumFeature">
            <StoreId>9PXXXXXXXXXX</StoreId>
        </Recipe>
    </Recipes>
    <Chunk Id="1000" Marker="Launch">
        <FileGroup DestinationPath="\" SourcePath="X:\bin" Include="*.*"/>
        <FileGroup DestinationPath="\Maps" SourcePath=".\Maps" Include="map.idx"/>
    </Chunk>
    <Chunk Id="2000">
        <FileGroup DestinationPath="\Maps" SourcePath=".\Maps" Include="*.map"/>
    </Chunk>
    <Chunk Id="3000">
        <FileGroup DestinationPath="\Maps" SourcePath="Z:\Extras" Include="*.map"/>
        <FileGroup DestinationPath="\Pics" SourcePath=".\Images" Include="*.png"/>
        <FileGroup DestinationPath="\Pics" SourcePath="Z:\Extras" Include="*.png"/>
    </Chunk>
    <!--Chunk 4000 will be installed if the best language fit for the console language is French-->
    <!--Make sure that any language specifiers used here are also in your MicrosoftGame.config-->
    <Chunk Id="4000" Languages="fr">
        <FileGroup DestinationPath="\Localized\Fr" SourcePath="Z:\Localized\fr" Include="*.dat"/>
    </Chunk>
    <!--Chunk 5000 will be installed on Anaconda consoles-->
    <Chunk Id="5000" Devices="Xbox-Anaconda">
        <FileGroup DestinationPath="\Anaconda" SourcePath="Z:\Anaconda" Include="*.dat"/>
    </Chunk>
    <!--Chunk 6000 contains the Campaign mode content-->
    <Chunk Id="6000" Tags="CampaignTag">
        <FileGroup DestinationPath="\Campaign" SourcePath="Z:\Campaign" Include="*.dat"/>
    </Chunk>
    <!--Chunk 6100 contains the Campaign mode content specific to French language-->
    <Chunk Id="6100" Tags="CampaignTag" Languages="fr">
        <FileGroup DestinationPath="\Campaign\fr" SourcePath="Z:\Campaign\fr" Include="*.dat"/>
    </Chunk>
    <!--Chunk 6200 contains the Campaign mode content specific to English language-->
    <Chunk Id="6200" Tags="CampaignTag" Languages="en">
        <FileGroup DestinationPath="\Campaign\en" SourcePath="Z:\Campaign\en" Include="*.dat"/>
    </Chunk>
    <!--Chunk 7000 contains the Multiplayer mode content-->
    <Chunk Id="7000" Tags="MPTag">
        <FileGroup DestinationPath="\Multiplayer" SourcePath="Z:\Multiplayer" Include="*.dat"/>
    </Chunk>
    <!--Chunk 7100 contains the Multiplayer mode content specific to French language-->
    <Chunk Id="7100" Tags="MPTag" Languages="fr">
        <FileGroup DestinationPath="\Multiplayer\fr" SourcePath="Z:\Multiplayer\fr" Include="*.dat"/>
    </Chunk>
    <!--Chunk 7200 contains the Multiplayer mode content specific to English language-->
    <Chunk Id="7200" Tags="MPTag" Languages="en">
        <FileGroup DestinationPath="\Multiplayer\en" SourcePath="Z:\Multiplayer\en" Include="*.dat"/>
    </Chunk>
    <!--Chunk 8000 contains the premium content which is triggered for download by the PremiumProduct
        Recipe if user owns ProductID 9PXXXXXXXXXX-->
    <Chunk Id="8000" Tags="PremiumTag">
        <FileGroup DestinationPath="\Premium" SourcePath="Z:\premium" Include="*.dat"/>
    </Chunk>
</Package>

本部分内容

区块
描述应作为一组安装的文件集合。

文件组
描述将文件添加到区块所依据的规则。


描述构成游戏的完整安装的区块集合。

另请参阅

生成包 (makepkg.exe)