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

Adding a Custom CustomUserAccounts Table

· 52CE 我爱测

A specification of the sample is that user account information be read from a custom table in the installation database and not hard-coded into the custom action.

A specification of the sample is that user account information be read from a custom table in the installation database and not hard-coded into the custom action.

Add a custom table to the sample installation database named CustomUserAccounts to hold user account information. See Examples of Database Queries Using SQL and Script for an example of how to add a custom table. Use the following schema for the CustomUserAccounts table. See Column Definition Format for an explanation of the column types.

Column Type Key Nullable Description
UserName s72 Y N Name of user account being created.
Password s72 N Name of property containing the password for the account. This is a public property set on the command line or through an edit control in the user interface. This edit control should have the Password Control Attribute.
Attributes i4 Y Attributes for account. These are defined as the DWORD values for the usri1_flags member of the USER_INFO_1 structure.

After the CustomUserAccounts table has been added to the database you may edit this table using Orca, a table editor provided with the Windows Installer SDK, or another editor. Enter the following record in the CustomUserAccounts table to create a password secured user account for a user called TestUser. Note that 512 is the numeric value for UF_NORMAL_ACCOUNT.

CustomUserAccounts Table

UserName Password Attributes
TestUser TESTUSERPASSWORD 512

Add the following records to the _Validation table for the custom table.

_Validation Table

Table Column Nullable MinValue MaxValue KeyTable KeyColumn Category Set Description
CustomUserAccounts UserName N Text
CustomUserAccounts Password N Identifier
CustomUserAccounts Attributes Y 0 2147483647 null

Continue to Authoring the ActionText and Error Tables.

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)

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

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