Dear Rulan,
it seems that exist a problem with setting the service dependencies (if more then one), using the "Install Service" command.
I'll log a note about this to our dev team.
Meanwhile, you can use the following workaround to solve your problem.
This consists on forcing the service dependence via system registry and the code sample below just does that.
Code: Select all
~InstallAware Clipboard Data~
~Set Variable~
~{6107F343-0643-44B3-BBA0-9B8FE73DA618}~
~NATIVE_ENGINE$MYAH$MYAH$FALSE~
~FALSE~
~Write Registry~
~{F4B48CD7-D7CA-47C5-A6E9-C899EA8D22EE}~
~0~
~2|~
~SYSTEM\ControlSet001\services\$MY_SERVICE_NAME$~
~DependOnService~
~$DEP$~
~FALSE~
~APPEND~
~Set Variable~
~{40050BDB-D02E-4A5B-B065-811380A6CFDA}~
~DEP$MYAH$MYAH$FALSE~
~SQLBrowser~
~Write Registry~
~{0023BF13-CCD1-44C2-AB7B-36BCC0A26920}~
~0~
~2|~
~SYSTEM\ControlSet001\services\$MY_SERVICE_NAME$~
~DependOnService~
~$DEP$~
~FALSE~
~APPEND~
~Set Variable~
~{DDB51185-BFCC-41CC-AC64-4FE02B584508}~
~DEP$MYAH$MYAH$FALSE~
~MSSQL$SQLEXPRESS~
~Set Variable~
~{13EA71E7-9688-4DF8-BD1A-DDFB7018327E}~
~MY_SERVICE_NAME$MYAH$MYAH$FALSE~
~MyService~
~Set Variable~
~{97E8B92B-9638-49B2-B92C-B4EE2B2E2DDC}~
~NATIVE_ENGINE$MYAH$MYAH$FALSE~
~TRUE~
To use the above sample code;
- Copy and paste the code snippet after Apply Install execution in your main script code.
- Remove any defined service dependencies from your "Install Service" command
- Define your effective service name with the MY_SERVICE_NAME variable declaration.
For test purpose the sample defines a dependence to "MSSQL$SQLEXPRESS" and to "SQLBrowser" (see DEV variable declaration).
In your code replace these dependencies as your service requires and obviously, repeat the "write registry" operation if you need to define any additional dependence.
I just tested the above code and it works fine.
Hope this helps you.
Regards