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

Specifying Components

· 52CE 我爱测

The Windows Installer installs and removes blocks of resources referred to as Windows Installer Components. For more information, see Core Tables Group and Components and Features.

The Windows Installer installs and removes blocks of resources referred to as Windows Installer Components. For more information, see Core Tables Group and Components and Features.

In this section you add information about the components used by the Notepad example to the Component Table you created in Importing a Blank Database. For more information, see Organizing Applications into Components and Defining Installer Components.

The Notepad sample uses eight components to control resources.

Component Resources
Baseball Baseball.txt, sBaseball
Concert Concert.txt, sConcert
Dance Dance.txt, sDance
Football Football.txt, sFootball
Help Help.txt, sHelp
January January.txt, sJanuary
NewYears NewYears.txt, sNewYears
Notepad Redpark.exe, Readme.txt, sReadme, sNotepad, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Notepad Sample

Every component should be identified with a unique component ID GUID. If you are reproducing the sample, do not reuse the same component ID GUIDs in the following table. Instead use a utility such as Guidgen.exe to generate new GUIDs for your components.

Be sure that you use a GUID string consistent with the Windows Installer GUID data type. For more information, see Changing the Component Code and What happens if the component rules are broken?

Use Orca or another database editor to enter the following data into the blank Component Table of MNP2000.msi. Do not reuse the GUIDs shown below in the ComponentId column in your sample.

Component ComponentId Directory_ Attributes Condition Keypath
Baseball {F54ABAC0-33F2-11D3-91D7-00C04FD70856} SPORTDIR 2 Baseball.txt
Concert {76FA7A80-33F6-11D3-91D8-00C04FD70856} ARTSDIR 2 Concert.txt
Dance {CCF834A1-33F8-11D3-91D8-00C04FD70856} ARTSDIR 2 Dance.txt
Football {CCF834A0-33F8-11D3-91D8-00C04FD70856} SPORTDIR 2 Football.txt
Help {AD10EB50-33C1-11D3-91D6-00C04FD70856} NOTEPADDIR 2 Help.txt
January {CF0BC690-33C9-11D3-91D6-00C04FD70856} MONDIR 2 January.txt
NewYears {A42D9140-33D8-11D3-91D6-00C04FD70856} HOLDIR 2 NewYears.txt
Notepad {19BED232-30AB-11D3-91D3-00C04FD70856} NOTEPADDIR 2 Redpark.exe

The source and target directories for each component is specified by the value entered into the Directory_ column. The installer resolves the location of this directory using the information in the Directory table. The installer uses the key path files specified in the KeyPath column to detect each component. The remote execution attributes are set in the sample so that the components can be run-from-source or run-locally.

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)

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

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