addPLM Service Handler documentation

Usage:
  addPLMServiceHandler [options]

Options:

  --action <InstallService|NetworkAuth|StartService|UninstallService> (REQUIRED)  Specifies the action to execute.

  --forceReinstall                                                                If specified, any existing service with the same name will be removed before installation.

  --monitorAndRestartServiceAfterSeconds <monitorAndRestartServiceAfterSeconds>   Can be used to monitor and re-start the actual service.
                                                                                  Set to the amount of seconds to wait before automatically re-start the actual service if stopped.
                                                                                  By default this feature is disabled (null).

  --serviceName <serviceName>                                                     A name for the service to handle as shown in windows service dialog.
                                                                                  The actual service will be named as specified.
                                                                                  The handler service will be names as "ServiceName_Handler"

  --serviceDescription <serviceDescription>                                       The description for the service to handle as shown in windows service dialog.
                                                                                  Will be used for both the actual service and the handler service.

  --serviceExe <serviceExe>                                                       Location of the actual services executable.
                                                                                  This file is typically specified as relative to --serviceLocalRoot_DP.
                                                                                  In special cases, the file can also be specified as a fully qualified path.

  --serviceExeParameters <serviceExeParameters>                                   Commandline parameters for the actual service program.
                                                                                  The token #ServiceName# will be replaced with the name of the handled service.
                                                                                  The token #ServiceHandlerExe# will be replaced with the actual path of the service handlers executable.
                                                                                  At the command line, double-quotes must be duplicated to be effective.
                                                                                  In JSON arguments file, double quotes must be specified as two single quotes ('').
                                                                                  CMD-Example: --serviceExeParameters "/p1 Value1 /p2 ""quoted value"" /p3 Value3"
                                                                                  JSON-Example: "serviceExeParameters": "/p1 Value1 /p2 ''quoted value'' /p3 Value3"

  --serviceExeParametersBase64 <serviceExeParametersBase64>                       Provides an alternative safe way to specify commandline parameters for the actual service program.
                                                                                  Because of the base64 encoding there will be no issues with escaping or quoting.
                                                                                  If both --serviceExeParameters and --serviceExeParametersBase64 are specified, they will be combined.
                                                                                  As with the --serviceExeParameters Parameter, #ServiceName# and #ServiceHandlerExe# will be replaced.
                                                                                  To create a Base64 encoded commandline one can use online tools like https://www.base64encode.org/ or the following powershell command:
                                                                                  'Commandline -to encode' | % { [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($_)) }

  --serviceExeParametersBase64Encoding <serviceExeParametersBase64Encoding>       Specifies the encoding used for the --serviceExeParametersBase64 parameter.
                                                                                  The default encoding is utf-8 (or codepage 65001).
                                                                                  Can be specified as Name like "utf-8", "iso-8859-1" or "us-ascii",
                                                                                  Or as an integer codepage number like 850 for Western-Europe-DOS or 1250 Western-Europe-Windows. [default: utf-8]

  --serviceAccount <serviceAccount>                                               The service will run under the specified account.
                                                                                  If the required 'Log on as a Service' permission (SeServiceLogonRight) is missing, it will be granted locally to this account.
                                                                                  The username and the password can be specified in an encrypted form, generated by the JFTools.Encryptor.exe tool.
                                                                                  The declaring labels (USER= and PASS=) are optional and only for better readability.
                                                                                  General syntax: --serviceAccount "[USER=]username[<sep>[PASS=]password]" (where <sep> can be a combination of ' ', '|', ';' or '/')
                                                                                  Examples 1: --serviceAccount "SYSTEM"; --serviceAccount "NT AUTHORITY\NetworkService"; --serviceAccount "LocalUser Password"
                                                                                  Examples 2: --serviceAccount "LocalUser; Password" --serviceAccount "USER=LocalUser; PASS=Password"
                                                                                  Examples 3: --serviceAccount "DOMAIN\User; Password" --serviceAccount "USER=User@domain.org; PASS=Password" [default: NT AUTHORITY\LocalService]

  --networkAuth <networkAuth>                                                     Declares authentication to network resources. Can be specified multiple times.
                                                                                  Important: This will only work when using the local system account as ServiceAccount!
                                                                                  Syntax: --networkAuth "\\server <credentials>"
                                                                                  For a documentation how to specify the <credentials>, see --serviceAccount parameter.

  --networkMap <networkMap>                                                       Declares mapped drives to network shares. Can be specified multiple times.
                                                                                  Important: This will only work when using the local system account as ServiceAccount!
                                                                                  Syntax: --networkMap "X: \\server\share[\path]"

  --preServiceStartScript_DPNE <preServiceStartScript_DPNE>                       This script will be executed before the actual service is started. (.cmd or .ps1)
                                                                                  It can for example be used for custom update of the actual server files.
                                                                                  The following arguments are passed to the script:
                                                                                  P1: "serviceName"
                                                                                  P2: "serviceInstallOrUpdateSourceRootDP"
                                                                                  P3: "serviceLocalRootDP"

  --serviceInstallOrUpdateSourceRoot_DP <serviceInstallOrUpdateSourceRoot_DP>     Source path for installing and updating the actual service.
                                                                                  Will be used on installing to Robocopy to --serviceLocalRoot_DP.
                                                                                  Is required for the --autoCopyServiceFiles argument.
                                                                                  Will be passed as argument 2 to --preServiceStartScript_DPNE.

  --serviceLocalRoot_DP <serviceLocalRoot_DP>                                     Local program folder for the actual service.
                                                                                  Is required for the --autoCopyServiceFiles argument.
                                                                                  Will be passed as argument 3 to --preServiceStartScript_DPNE. [default: "%ProgramData%\%ServiceName%.ServiceLocalRoot"]

  --autoCopyServiceFiles                                                          By default, the local service folder will be initial created and populated from the source root folder during installation.
                                                                                  In addition, on each service start, the files will be updated from the source root folder before the --preServiceStartScript_DPNE script is executed.
                                                                                  This is done using Robocopy mirror from --serviceInstallOrUpdateSourceRoot_DP to --serviceLocalRoot_DP.
                                                                                  To disable this feature, specify: --autoCopyServiceFiles false. [default: True]

  --autoUpdateWhenIsNewerFile <autoUpdateWhenIsNewerFile>                         Specify a file sub-path relative to --serviceInstallOrUpdateSourceRoot_DP and --serviceLocalRoot_DP.
                                                                                  Monitors the specified file and immediately initiates a service update when the source is newer.
                                                                                  This argument can be specified multiple times.

  --stopServiceCommandSequence <stopServiceCommandSequence>                       This sequence will be used to stop the actual service when the handler service is stopped
                                                                                       using service management or when the actual service needs an update.
                                                                                  Syntax: COMMAND[:WaitSec];COMMAND[:WaitSec];COMMAND[:WaitSec];...
                                                                                  COMMAND can be one of common STOP, PAUSE, CONTINUE commands,
                                                                                          or a custom numeric command between 128 and 255.
                                                                                  In case of the common commands, WaitSec is a timeout value.
                                                                                  In case of a custom command, WaitSec is an actual wait duration.
                                                                                  Is WaitSec is omitted, a default value of 60sec is used. [default: STOP]

  --selfUpdateExeSource_DPNE <selfUpdateExeSource_DPNE>                           If specified, the helper service executable will be automatically updated if this file is newer.

  --argumentsJson_DPNE <argumentsJson_DPNE>                                       The commandline arguments can be read from the given JSON file instead on in addition.
                                                                                  Commandline arguments have higher priority than the settings from a JSON config file.
                                                                                  If a JSON file exists with the same name as the .exe but with .json, this is used automatically.
                                                                                  Example:
                                                                                  {
                                                                                    "action": "InstallService",
                                                                                    "serviceExePath": "C:\\Path\\to\\service.exe"
                                                                                    "serviceExeParameters": "/p1 Value1 /p2 \"quoted value\" /p3 Value3"
                                                                                  }

  --version                                                                       Show version information
  -?, -h, --help                                                                  Show help and usage information



