Manage create-service Scripts - Precisely_EnterWorks - EnterWorks - 11.0

EnterWorks Guide

Product type
Software
Portfolio
Verify
Product family
EnterWorks
Product
Precisely EnterWorks
Precisely EnterWorks > EnterWorks
Version
11.0
Language
English
Product name
Precisely EnterWorks
Title
EnterWorks Guide
Copyright
2024
First publish date
2007
Last updated
2025-01-07
Published on
2025-01-07T07:44:20.997000

Overview

Each microservice has a script that allows you to change the microservice's configuration and re-register the service.

These scripts are named:

create-enable-<service-name>-service.cmd
They are referred to as the create-service scripts. They are located on the VM hosting their microservice, in the folder:
<drive>:\Enterworks\enable2020\services\install

To reconfigure a microservice, edit its create-service script to set the desired options, then run the script as an administrator. It will stop the service, delete the service, then recreate the service, using the parameters defined in the script. If your EnterWorks system uses a network service account, after you run the script, you will need to set the service's Log On properties as described in Use a create-service Script.

Use a create-service Script

After you edit a create-service script, in order for the script to take effect, you must:

  1. If the Windows Services app window is open, close it. If it is open it can interfere with running the create-service script.
  2. Right-click the create-service script and run it as an administrator. This recreates the services.
  3. If this environment is distributed and uses a network service account that is not a mapped drive, you must set its Log On properties:
    1. Open the Services window, right-click the desired service, and select Properties. The Properties window will appear.
    2. Open the Log On tab.
    3. Select This account and enter the network service account's name and password.
    4. Click Apply.
  4. In order for the settings in the create-service script to take effect, you must restart the service. Depending on why you are recreating the service, you may not want to do restart the service at this time. In that case, the updated create-services settings will take effect the next time you restart the service or restart all EnterWorks services.

    To restart the service, open the Windows Services app, right-click the service, and select Restart.

Create a create-service Script

The create-scripts are installed with EnterWorks, so you should typically never need to create them. However, in the event a script is accidentally lost, you can recreate it.

The following is an example of a create-service script. Note that values shown here as <value> would be replaced with actual values. If -encryptedMode=true, the indicated values are encrypted. If it is false, they are not.

sc stop enable-channel-readiness-service
sc delete enable-channel-readiness-service

sc create enable-channel-readiness-service ^
 binPath= ^"D:\Enterworks\enable2020\services\bin\enable2020-channel-readiness-service.exe ^
 -rabbitServer=<encrypted-rabbit-connection> ^
 -dbConn=<encrypted-epim-database-connection> ^
 -loggingLevel=INFO ^
 -logDir="D:\Enterworks\logs\enable2020" ^
 -boltDir=D:\Enterworks\enable2020\db-channel-readiness ^
 -queueName=enableChannelReadiness ^
 -webcmBrokerQueue=webcmBrokered ^
 -enableApiQueue=enableApi ^
 -encryptedMode=true ^
 -systemLogin=<encrypted-epim-system-login-name> ^
 -systemPassword=<encrypted-epim-system-login-password> ^
 -exchange=enable2020"

sc description enable-channel-readiness-service "Enable Channel Readiness Service"
sc config enable-channel-readiness-service start=auto

PAUSE

To create a create-script:

  1. In Notepad++ or another editor, create an empty .cmd file with the appropriate create-script name. Scripts are named:
    create-enable-<service-name>-service.cmd
    To find the name of the service, open the Services window and locate the service.
  2. Copy the lines below into your new file.
    NET STOP enable-<service-name>-service
    sc delete enable-<service-name>-service
    sc create enable-<service-name>-service binpath=^"
    "
    Warning: Note that all double quotes in the file must be the ASCII straight double quote, not a beginning or ending curly quote your keyboard may enter. When you need to insert a double quote, the easiest way to ensure you are inserting the correct double quote is to copy it from someplace else in the file.
  3. In the first three lines, change the name of the service to match the actual name of the service. The following is an example.
  4. Open the Services window, right-click the desired service, and select Properties. The Properties window will appear.
  5. Drag-select the entire Path to executable string. It may be quite long so make sure you get it all.
  6. Paste the entire string into the new file, after the binpath=^" Your file will now look like the following. Note that your settings may be different than the one shown below.
  7. Enter the line breaks. Replace all - with ^\n-. There is a space before the - and before the ^. Set the Search Mode to Extended.
  8. Each setting in your file should now be on a separate line. On the last line in the file, remove the line break before the " so that the " moves to the end of the previous line.
  9. With the exception of the double quote in binpath=^" and the final double quote on the last line, add the escape character \ directly before all other double quotes appearing in the file. This escapes the double quotes. For example:
    -cliBuildFolder="D:\Enterworks\enable2020\enable2020" ^
    would become:
    -cliBuildFolder=\"D:\Enterworks\enable2020\enable2020\" ^
  10. Save the file.