Creating create-service Scripts

During the installation of EnterWorks 10.3 or later, a set of scripts is created that make it easier for you to later change the configuration options for services as needed and re-register the services. There is one for each microservice and they are named create-enable-<service-name>-service.cmd, (or create-enable2020-<service-name>-service.cmd).

In the event that a service needs to be reconfigured, 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.

Fresh installations of EnterWorks 10.3 or later automatically generate the create-scripts. If you are running a version of EnterWorks earlier than 10.3, you may have to create the scripts manually.

The create-service scripts are located in:

<install drive>:\Enterworks\enable2020\services\install

To list a microservice's parameters, run the executable with the -h option as shown in the example below.

<install-drive>:\EnterWorks\enable2020\services\bin\<service-name>.exe -h

To Create a create-service Script

The following is an example of a create-service script. (Note that <hostname> would be replaced with the actual host name.)

NET STOP enable-web-server-service
sc delete enable-web-server-service
sc create enable-web-server-service binpath=^"D:\Enterworks\enable2020\services\bin\enable2020-web-server-service.exe ^
-rabbitServer=enable2020:enable2020@<hostname> ^
-epimHost=<hostname>:8090 ^
-port=80 ^
-cliBuildFolder=D:\Enterworks\enable2020\enable2020 ^
-uploadFolder=D:\Enterworks\enable2020\services\uploads ^
-epxHost=<hostname> ^
-sessionDbFile=D:\Enterworks\enable2020\sessions\enable2020-session.db ^
-loggingLevel=INFO ^
-logDir=D:\Enterworks\logs\enable2020 ^
-exchange=enable2020 ^
-esBrokerQueue=elasticSearchBroker ^
-webcmBrokerQueue=webcmBrokered ^
-enableDamQueue=enableDam ^
-enableApiQueue=enableApi ^
-channelReadinessQueue=enableChannelReadiness ^
-epxBrokerQueue=epxBrokerQueue ^
-disableAdmin=false ^
-disableReport=false ^
-disableSystem=false"

To create a create-script:

  1. In Notepad++ or another editor, create an empty .cmd or .bat file with the appropriate create-script name. Open the Services window to find the name of the service. Note that depending on how your EnterWorks system was installed, your services may be named enable-<service-name>-service.cmd or enable2020-<service-name>-service.cmd.

  2. Copy the lines below into your new file.

    Copy
    NET STOP enable-<service-name>-service
    sc delete enable-<service-name>-service
    sc create enable-<service-name>-service binpath=^"
    "

    WARNING: Note that any time a double quote appears in your file, it must be the ASCII straight double quote, not a beginning or ending quote you type in from the keyboard. 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 below. 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. For example:

    -cliBuildFolder="D:\Enterworks\enable2020\enable2020" ^

    would become:

    -cliBuildFolder=\"D:\Enterworks\enable2020\enable2020\" ^
  10. Save the file.

In order for your script to take effect, run it as an administrator.