Hello Srikanth,
First of all, you can ignore the second part of the
"How to install a service for a custom user", since it works to create an user in your main package as well, using
"Users and Groups" page from the
"System Changes" group.
Now, please keep in mind that a service uses a Windows User credentials (the username and password you use to log-in to a computer). So, we will have to dynamically create an user. In order to do that, we will firstly create a dialog which will ask you to input an username and a password, then we will use the properties which store the values of the username and password fields to dynamically create an user.
Here is a step-by-step way you can follow to achieve what we earlier mentioned:
1) Go to
"Dialogs" page from the
"User Interface" group and create a new dialog using
"New Dialog" button from the toolbar.
2) Now, on the earlier created dialog, add two
"Edit Boxes" using the
"Control Toolbox" from the toolbar. Please keep in mind that one of the edit boxes will store our username and the other one will store the password. To make this more intuitive, you can add two
"Static Texts" which will display the
"Username:", respectively
"Password:" texts.
3) Click on the earlier created
"Edit Boxes" and change the properties name from the right pane,
"Properties" tab, to something more intuitive. For example, we can use
"USERNAME_PROP" for the first edit box and
"PASSWORD_PROP" for the second edit box.
4) Now that we have created the dialog which will help us create an user based on your input, we now have to configure the user creation from the
"Users and Groups" page,
"System Changes" group.
5) Click on the
"New User" button from the toolbar. For the user name, use the property we earlier named in the
"Dialogs" page for the user. In our example, the user will be called
[USER_PROP]. Now, in the
"Password" tab, select the "Use a property to set a password" option and in the field, type on "..." button and select the property we defined earlier in the
"Dialogs" page. In our example, we have used the PASSWORD_PROP property name. Please keep in mind that this property is not an user defined property, so it will not appear under "User Defined" folder. Press the
">" button near the
"User Interface" and select it from there.
6) Now that we have created an user, we have to configure the service to install under the earlier created user domain. In order to do this, you can go to "Services" page from the
"Resources" group, click on your service which will be installed and under
"Account" tab, introduce the properties we have used to create the user credentials. In our example, we have used
[USERNAME_PROP] and
[PASSWORD_PROP] so your fields should look like this:
and
Please make sure not to have any typing errors when you introduce the password property, because it is shown with
"*"
Here is a project which implements the steps presented above:
Hope this helps!
Regards,
Catalin