Adding the Ability to Create or Set an Existing User Account
InstallShield 2016
Project • This information applies to the following project types:
Project-specific differences are noted where appropriate.
Many server applications require the specification of a user account during installation. Having a user account available is often necessary because it enables a server application to access resources that are restricted to other users. InstallShield offers support for setting an existing Windows user account or creating a new one during installation by enabling you to add the appropriate run-time dialogs to your installation.
Project-Specific Details for Adding User Account Support
|
|
Basic MSI
|
For Basic MSI projects, the specified user name, password, and group information entered in the LogonInformation dialogs are stored in the following properties:
|
•
|
IS_NET_API_LOGON_USERNAME |
|
•
|
IS_NET_API_LOGON_PASSWORD |
|
InstallScript
|
For InstallScript projects, the specified user name, password, and group information entered by the end user in the LogonInformation dialogs are stored in the following global variables:
|
•
|
IFX_NETAPI_USER_ACCOUNT |
|
InstallScript MSI
|
For InstallScript MSI projects, the specified user account, group, and password are stored in the following global variables and properties:
|
•
|
IFX_NETAPI_USER_ACCOUNT |
|
•
|
IS_NET_API_LOGON_USERNAME |
|
•
|
IS_NET_API_LOGON_PASSWORD |
|
Adding Support for the LogonInformation Dialogs to a Basic MSI Project
To add the LogonInformation dialogs to a Basic MSI project:
|
1.
|
In the View List under User Interface, click Dialogs. |
|
2.
|
In the Dialogs explorer, right-click All Dialogs, and click New Dialog. The New Dialog Wizard opens. |
|
3.
|
Complete each panel of the wizard. In the Dialog Template panel, select Logon Information Panel and Associated Child Dialogs. |
When you are done completing each panel of the New Dialog Wizard, build and run your installation project. When the dialog sequence in which the LoginInformationDialog dialog is executed, the appropriate dialogs are displayed.
Adding Support for the LogonInformation Dialogs to an InstallScript or InstallScript MSI Project
To add support for the LogonInformation dialogs to either an InstallScript or InstallScript MSI project:
|
1.
|
Navigate to the location in your InstallScript code where you want to insert the LogonInformation dialog set. In most situations, you will add it within OnFirstUIBefore. For example: |
Dlg_SdLogon:
nResult = SdLogonUserInformation(szTitle, szMsg, szAccount, szPassword);
if (nResult = BACK) goto Dlg_SdWelcome;
|
2.
|
In InstallScript MSI projects, add the following function so that the Windows Installer properties are set to the same value as the InstallScript global variables. You can add it after calling SdLogonUserInformation. |
OnLogonUserSetMsiProperties();
|
3.
|
On the Build menu, click Settings. The Settings dialog box opens. |
|
4.
|
Click the Compile/Link tab. |
|
5.
|
In the Libraries (.obl) box, enter the name of your new library file (*.obl): |
NetApiRT.obl
Note • You should add the new library file name before the isrt.obl file name.
Once you have added the InstallScript code, build and run your installation. When the script is executed, the appropriate dialogs are displayed.
Limitations of the LogonInformation Dialogs in Basic MSI, InstallScript, and InstallScript MSI Projects
When an end user attempts to use the LogonInformation dialogs, they may encounter a blank list of domains, or they may encounter a “Server not found” error. The following scenarios may cause this behavior:
|
•
|
The target system is not on a domain. |
|
•
|
The Computer Browser service is not enabled on the target system. |
|
•
|
A firewall is configured without an exception for the Computer Browser service. |
|
•
|
NetBIOS over TCP/IP is not enabled on the target system. |
|
•
|
No master browser server is configured on the network. |
|
•
|
Broadcast traffic is disabled on the network. |
See Also
Creating Predetermined User Accounts at Run Time
Settings Dialog Box
SdLogonUserInformation
SdLogonUserListGroups
SdLogonUserListServers
SdLogonUserListUsers
SdLogonUserBrowse
SdLogonUserCreateUser
Open topic with navigation