Creating Predetermined User Accounts at Run Time
InstallShield 2020
Project:This information applies to the following project types:
• | Basic MSI |
• | InstallScript MSI |
InstallShield has support for creating one or more Windows user accounts in groups without using logon dialogs. This support requires using three Windows Installer properties for the user account, group, and password of each account that you want to be set up at run time.
Properties for Creating User Accounts
Use the following properties to create user accounts at run time:
• | ISNetApiLogonUsername—Set the value of this property to the user account that you want the installation to create. Use either of the following formats: |
• | MachineName\UserName |
• | DomainName\UserName |
• | ISNetApiLogonGroup—Set the value of this property to the group to which you want the user account to belong. |
• | ISNetApiLogonPassword—Set the value of this property to the password that you want to be configured for the user account. |
To configure the required properties and their values, use the Properties view. For instructions on how to do this, see Creating Properties in Windows Installer–Based Projects.
Guidelines for Creating User Accounts
To create more than one user account, separate each entry for the ISNetApiLogonUsername property value with a tilde that is enclosed in square brackets: [~]. For example, to create a user named User1 on a domain named Domain1 and a user named User2 on a machine named Machine2, use the following format:
Domain1\User1[~]Machine2\User2
Each user account that you specify for the ISNetApiLogonUsername property must have a corresponding group in the ISNetApiLogonGroup property and a corresponding password in the ISNetApiLogonPassword property. If these three properties do not have the same number of entries, a run-time error occurs.
The following table shows sample properties and their corresponding values for the creation of three different user accounts:
Property Name |
Property Value |
ISNetApiLogonUsername |
Domain1\User1[~]Domain1\User2[~]Domain2\User3 |
ISNetApiLogonGroup |
Users[~]Users[~]Administrators |
ISNetApiLogonPassword |
Password1![~]Password1![~]Password1! |
In this example, User1 is part of the Users group and has a password of Password1! for the Domain1 domain. User2 is part of the Users group and has a password of Password1! for the Domain1 domain. User3 is part of the Administrators group and has a password of Password1! for the Domain2 domain.
The ISNetApiLogonUsername, ISNetApiLogonGroup, and ISNetApiLogonPassword properties are formatted properties. Thus, the value of these properties can be a different property, an environment variable, a file path, or a component directory path. For example:
• | [PROPERTYNAME]—At run time, this resolves to the value of the specified property. |
• | [%EnvironmentVariable]—At run time, this resolves to the value of the specified environment variable. |
• | [#FileKey]—At run time, this resolves to the full path of the file that has the specified file key in the File table. |
• | [$ComponentName]—At run time, this resolves to the installation location of the specified component. |
See Also
Adding the Ability to Create or Set an Existing User Account