Page 1 of 1

username in installing service

Posted: Wed Feb 22, 2017 5:02 pm
by frank.dangelo
I am trying to install a service with a user name and password. I get the values from a dialog box into servicename and servicepassword
When installing the service I put $servicename$ into the user name box and $servicepassword$ into the password box.
But when I look at the service after install it has the User name that was entered into the user field in the registration box.
I have checked the values just before the install and the values are correct.

Re: username in installing service

Posted: Thu Feb 23, 2017 11:08 am
by FrancescoT
Dear Frank,

I can only suppose that exist something wrong with the approach you used to handle your custom variables
At any rate, it's quite difficult to say where may be the error without knowing what your code does exactly.

How did you check the effective value of your custom script variables?

Regards

Re: username in installing service

Posted: Mon Feb 27, 2017 1:20 pm
by frank.dangelo
HI,
I displayed a message box just before the create service and the variables were set correctly. I placed these variables in the username box as $var$
and the same for password. but it ignored them

Re: username in installing service

Posted: Mon Feb 27, 2017 2:05 pm
by FrancescoT
Dear Frank,

do you any chance to post a very "VERY" minimal project that replicates the issue?

Regards

Re: username in installing service

Posted: Mon Feb 27, 2017 4:58 pm
by frank.dangelo
here is the project and the .exe files for service create a C;\installrtm directory and place files in there for project build

Re: username in installing service

Posted: Tue Feb 28, 2017 11:32 am
by FrancescoT
Dear Frank,

there are several errors with your project and one of these, it's that the "Install Service" command is not sequenced correctly in your install script. Due of this, the service will be never installed on the target system.

The "Install Service" command is a Windows Installer Command (PURPLE COMMANDS).

If your setup is based on Windows Installer Engine (which is by default), Windows Installer Commands (PURPLE COMMANDS) are not executed immediately but deferred to Apply Install execution.
http://www.installaware.com/forums/viewtopic.php?f=2&t=4338

*****
Attached you find my edited copy of your original project.

I used two new custom variables "SERVICE_USER" and "SERVICE_PASSWORD" to hold the Values passed to the the "Account Name" and "Account Password" parameters of the "Install Service" command. These variables are now declared within the "Define Setup Globals" Region (code line #65) of the install script.

PS
Note that the local ACCOUNTS have to be entered using the form ".\<USERNAME>
dialog.png
dialog.png (19.79 KiB) Viewed 5313 times


It's not necessary to change the location of the project source files ...I used relative paths.

Hope this helps you.

Regards

Re: username in installing service

Posted: Tue Feb 28, 2017 7:03 pm
by frank.dangelo
great that all worked
thank you very much