Set Environment variable for Windows Service


This is intended for experienced users

 

  1. Open the Registry Editor
  2. Go to registry path:
    Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<service_name>
  3. Add a multi-string value and call it "Environment"
  4. Right click to modify and add the desired environment variables
    • Each string value should be a name=value pair, where the name is the environment variable name
  5. Now restart the service to apply

Example

Attention!

 

When using this to set the FileSearchPath for the USoft Rules Engine, make sure to use the USoft substitution variables for the application name and file extension.
For more information see:

 

You can query the rules engine property via HTTP request in your browser to verify if the rules engine picked up the environment variable correctly (this uses the GetProperty method).

http://localhost:<port>/<appname>/<app_username>/plain/SqlScript?$Password=<password>&$SQL=select%20rulesengine.getProperty(%27conceptualFile%27)

Example

http://localhost:9150/Travel/Karst/plain/SqlScript?$Password=MyVeryStrongPassword&$SQL=select%20rulesengine.getProperty(%27conceptualFile%27)


Use cases

This can be used in case you would like to setup 2 application versions (ie. Acceptance & Test) on a single server, while being able to use different flat file versions.


0 replies

Be the first to reply!

Reply