srikanth4sree
Posts: 17
Joined: Tue Jun 12, 2018 10:25 am

Install Service with custom login

Tue Jul 10, 2018 12:35 pm

Hi team,
I want Installer few services in custom user, but while installing i need to set dynamic password of services password in Each installation.
I.e if i am installing X system password is "abcd@123", If i am installing in y system password Should be "xusg@123".
For that purpose i have Create custom action "PasswordUpdate" in my project.

Bust Custom user creation should done in separate Project, as per this Custom User Guild (https://www.advancedinstaller.com/user- ... rvice.html).

If i create new project as per-requisite, how can i pass the custom password to my Main Project.

I also Attached my project File. can you please modify the project file send it to me to full fill my requirement.
Attachments
base.aip
(135.31KiB)Downloaded 328 times

Catalin
Posts: 6544
Joined: Wed Jun 13, 2018 7:49 am

Re: Install Service with custom login

Wed Jul 11, 2018 11:52 am

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:

Code: Select all

.\[USERNAME_PROP]
and

Code: Select all

[PASSWORD_PROP]
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:
Service Example Srikanth.aip
(34.36KiB)Downloaded 309 times
Hope this helps!

Regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

srikanth4sree
Posts: 17
Joined: Tue Jun 12, 2018 10:25 am

Re: Install Service with custom login

Wed Jul 11, 2018 12:20 pm

Thanks for replay Catalin,

but this is not exactly i want, in my current project i have added one custom action "PasswordUpdate" in Install execution Stage, that will create dynamic password while installing.What ever the password we have crated, user don't want to see that password. If we give the Dialogs to user, user knows about service account details.

I need to have separate project as mention in the "https://www.advancedinstaller.com/user- ... rvice.html" Url.

that project is prerequisite for my existing project, like that i need it. any way we are using 12.8 version of the advanced installer.
but what ever the password i have created same password i need to pass it to my existing project.
if you can create those projects, that will be great.

Also After uninstall, Project Icon from Control panel is not removing.


Thanks
Srikanth

Catalin
Posts: 6544
Joined: Wed Jun 13, 2018 7:49 am

Re: Install Service with custom login

Fri Jul 13, 2018 11:20 am

Hello Srikanth,

I am afraid you can not pass a value from your pre-install prerequisite to the main package through a property.

As a workaround, you can create a registry entry in your prerequisite package which will contain the user you have just created and, after the prerequisite is installed, you can create a "Search" in your main package which will search for the registry key that contains your user.

In order to create a search, you can go to "Search" page from the "Custom Behavior" group, click on the "New Search" button from the toolbar and then a new search will be created under the "Target Computer". After that, right click on the new created search --> "Add search location" --> "Registry". The result of this search will be stored in a public property which you can name as you wish (the default name of the search is "RESULT_PROPERTY").

Hope this helps!

Regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

srikanth4sree
Posts: 17
Joined: Tue Jun 12, 2018 10:25 am

Re: Install Service with custom login

Sat Jul 14, 2018 6:40 pm

Thanks for replay,
i will work on your suggestion. But one more thing .
Also After uninstall, Project Icon from Control panel is not removing.

Catalin
Posts: 6544
Joined: Wed Jun 13, 2018 7:49 am

Re: Install Service with custom login

Mon Jul 16, 2018 8:41 am

Hello Srikanth,

I am not sure why you encounter this behavior.

Can you please try to disable "Override Windows Installer programs list entry" option from "Product Details" page --> "Product Details" tab and retest it ?

If this does not help, can you please try to create a "verbose log" of the uninstallation process and send it by e-mail at support at advancedinstaller dot com so we can further investigate it ?

Regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

srikanth4sree
Posts: 17
Joined: Tue Jun 12, 2018 10:25 am

Re: Install Service with custom login

Mon Jul 16, 2018 3:04 pm

Thanks for replay,


after changing the icon, this behavior we are seen.Below seeting we have updated.

oldValue: <ROW Name="apt.exe" SourcePath="Assets\apt.ico" Index="0"/>

New Value : <ROW Name="apt.exe" SourcePath="Assets\apt_icon_new.ico" Index="0"/>

after removing the check box , custom UI Not displaying while UN-installing.

Thanks
Srikanth

Catalin
Posts: 6544
Joined: Wed Jun 13, 2018 7:49 am

Re: Install Service with custom login

Tue Jul 17, 2018 7:55 am

Hello Srikanth,

In order for the the UI to be showed upon uninstalling, you can check the "Disable Remove" option from "Product Details" page --> "Add or Remove Programs (Control Panel)".

Hope this helps!

Regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”