FGump
Posts: 65
Joined: Thu Jan 05, 2006 7:23 pm

Service Account based on Property?

Hello, I have a setup in where I created a custom dialog, after the welcome screen, asking the user to select the environment where my application will be installed. This is either TEST, SYST, or PROD. The selected value is stored in a property which I use to populate a value in a XML configuration file that is copied onto the system. My setup also installs and starts a service. I would like to setup the Service Account username/password, based on what they selected in the dropdown combobox list. I need to use different usernames based on if it's TEST, SYST, or PROD. I can see that I can add a property in the UserName field, but how do I add a condition (such as if([REGION_PROP]="TEST" use {ACCOUNT1] elseif([REGION_PROP]="SYST" use [ACCOUNT2], etc... ??

Thank you for your help. Any examples are greatly appreciated.

Kindest Regards,

FGump
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Service Account based on Property?

Hi,

You can achieve what you want by following the next steps:
- go in the custom dialog you created
- click on the "Next" button and create a new Published Event
- in the newly appeared dialog select the "Set installer property value" control event
- write the name of the property you want to store the usename in (for example [SERVICE_USER]. This property must correspond to the username field from your service).
- in the "Argument" field you must write the username corresponding to the first account.
- in the "Condition" field set the condition on the property corresponding to the combobox control you created (for example REGION_PROP = "test", where "test" is the value associated with the TEST control data you created in the combobox)

Follow the same steps for the password of the first account and for the other accounts.

Also, please take a look on the Install a service for a custom user article.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
FGump
Posts: 65
Joined: Thu Jan 05, 2006 7:23 pm

Re: Service Account based on Property?

UPDATE: This worked ok on a WinXP, but when attempted on a Windows 2003 server, the setup ends with an error "The setup has ended prematurely". It's as if on a server OS, it could not update the service account username/password. I'm currently using AI v9.6, not sure if this is a bug that was fixed or if I'm missing something else. Anyway that the install logs something I can look at to get an exact reason for the error?

Thank you again for your time,

FGump

---------------------------------------------------------------

Thank you very much Eusebiu. Worked pefect!! :D

Kindest Regards,

FGump

Return to “Building Installers”