大网数据广告活动
安装更新与部署

A Customization Transform Example

· 52CE 我爱测

This example illustrates how a customization transform may be used to disable features and add new resources.

This example illustrates how a customization transform may be used to disable features and add new resources.

An administrator can permanently disable a feature by using a customization transform to enter a 0 into the Level column of the Feature table. The application of the customization transform then prevents the installation and display of that feature even if the user selects a complete installation using the UI or by setting the ADDLOCAL property to ALL on the command line. For a discussion of installation level, see Feature table and INSTALLLEVEL property.

The resources needed to customize an application can be deployed by using a customization transform to add one or more new components. The transform must add one or more new features to contain these new components. For the rules that should be followed when deploying resources, such as files, registry keys, or shortcuts, see Using Transforms to Add Resources.

This example illustrates how to create a transform to customize the installation of the application described in An Installation Example. The original installation package installs all the features of the sample application, including the feature Gate, which enables users to view admissions information for the Red Park Arena. Some groups of users only need the application features that give event scheduling information, and do not need the Gate feature. These groups also need to get a special phone list. The transform must therefore do two things: 1) customize the installation so that this group only receives the application features they need and 2) provide the resources needed for the new phone list.

An example of a minimal user interface for this sample is provided in the Windows SDK Components for Windows Installer Developers as the file Uisample.msi. If you have the SDK, you have access to all the tools and data necessary to reproduce the sample installation package, user interface, and customization transform.

The customization transform has the following specifications:

  • The customization transform is embedded inside the MNP2000.msi file to guarantee that it is always available with the installation database.
  • Installing MNP2000.msi with the customization transform does not install the Gate feature, child features of the Gate feature, or any of the components of the Gate feature, even if the user selects the Complete type of installation.
  • Other applications may share some or all of the components of the Gate feature. The installation packages of these applications may install all their components on the user's computer.
  • Removing MNP2000.msi with the customization transform does not remove any of the Gate components that have been installed by other applications.
  • Installing MNP2000.msi with the customization transform also installs a new top level feature, Phone_List, and a new component, phone, which requires the installation of the resource, Phone.txt. The user accesses the Phone_List feature using a shortcut in the Menu directory.

Continue

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。