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

Customizing an Original Database

· 52CE 我爱测

Make a copy of the sample Windows Installer installation package MNP2000.msi and rename this copy MNP2000t.msi.

Make a copy of the sample Windows Installer installation package MNP2000.msi and rename this copy MNP2000t.msi. In the following steps you will customize this file using a database table editor such as Orca, which is provided with the SDK, or another database editor.

Include the new resource file for the phone list, Phone.txt, in the Notepad folder with the other source files.

File Description Path to source Path to target
phone.txt A resource for the Phone_List feature. C:\Sample\Notepad\phone.txt [ProgramFilesFolder]\Red_Park\phone.txt

Use your database editor to add a record to the File table of MNP2000t.msi for the new file.

File Table

File Component_ FileName FileSize Version Language Attributes Sequence
Phone.txt Phone Phone.txt 1000 0 1

As explained in the section: Using Transforms to Add Resources, the transform should add one or more new components to the installation database to contain the new phone list feature. Use your database editor to add the following record to the Component table of MNP2000t.msi.

The Phone component should be identified with a unique component ID GUID. If you are reproducing the sample, do not reuse the same component ID GUID as in the following table. Instead use a utility such as Guidgen.exe to generate a new GUID. Be sure that you use a GUID string consistent with the Windows Installer GUID data type.

Component Table

Component ComponentId Directory_ Attributes Condition Keypath
Phone {D152A1EC-9F7A-4E45-B0DC-ED6EE5D829F8} NOTEPADDIR 2 Phone.txt

Use your database editor to modify the data in the Feature table of MNP2000t.msi. Enter 0 into the Level column of the Gate feature record. This disables the Gate feature and its child features and hides these features from the UI. Note that because the INSTALLLEVEL property is set to 3 in the Property table, the installer does not install features with a Level of 0. Add a record for the new Phone_List feature.

Feature Table

Feature Feature_Parent Title Description Display Level Directory_ Attributes
Arts Arts Arts events at Red Park. 20 3 NOTEPADDIR 0
Baseball Sport Baseball Baseball Games 17 3 SPORTDIR 32
Concert Arts Concert Concert events at Red Park 21 3 ARTSDIR 2
Dance Arts Dance Dance events at Red Park 23 3 ARTSDIR 2
Football Sport Football Football Games 19 3 SPORTDIR 2
Gate Gate Red Park's Admissions 6 0 NOTEPADDIR 0
Help Notepad Help Help file. 5 3 NOTEPADDIR 1
January Gate January January Admissions 10 3 MONDIR 2
NewYears January New Years Day New Years Day Admissions 11 3 HOLDIR 2
Notepad Notepad Notepad Editor 1 3 NOTEPADDIR 0
Readme Notepad Readme Readme File 3 3 NOTEPADDIR 0
Sport Sport Events Sport Events at Red Park 14 3 NOTEPADDIR 0
Phone_List Phone List Phone List 24 3 NOTEPADDIR 0

Add the following record to the FeatureComponents table of MNP2000t.msi.

FeatureComponents Table

Feature_ Component_
Phone_List Phone

Add a new record in the Shortcut table to create a shortcut to the Phone_List feature.

Shortcut Table

Shortcut Directory_ Name Component_ Target Arguments Description Hotkey Icon_ IconIndex ShowCmd WkDir
sPhone MENUDIR Phone.txt Phone [#Phone.txt]

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)

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

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