The Studio Database Gateway is a network-based application that interacts with databases using the Microsoft .NET Framework. It can run on the same computer that is running the InduSoft Web Studio project or on a different computer.
In order to run the Studio Database Gateway on a remote computer, you must copy the gateway executable and supporting files to the remote computer. Copy the files called StADOSvr.exe, StADOSvr.ini, and StudioDataProtection.dll (if present) from the Bin folder of the InduSoft Web Studio installation folder on your development computer (e.g., C:\Program Files (x86)\InduSoft Web Studio v7.1\Bin or C:\Program Files\InduSoft Web Studio v7.1\Bin) to the remote computer. If you are using the Wonderware Historian connection that was introduced in InduSoft Web Studio v7.1 SP3, then you must also copy the file called aahClientManaged.dll to the remote computer. You can put these files anywhere on the remote computer, but all of them must be in the same folder. Our Best Practice recommendation would be to create a folder in the Program Files folder called InduSoft Studio Database Gateway (e.g., C:\Program Files (x86)\InduSoft Studio Database Gateway or C:\Program Files\InduSoft Studio Database Gateway).
You are now ready to configure the Studio Database Gateway to run as a Windows Service. These instructions use a program called SRVANY.EXE from the Windows Resource Kit Tools and the Windows Service Control program called SC.EXE. These instructions are for Windows 7 and higher and for Windows Server 2008 R2 and higher. If you have questions about configuring the Studio Database Gateway to run as a Windows Service on other versions of Windows operating systems, then please leave a reply.
Note: The Studio Database Gateway requires .NET Framework 4.0. Please ensure that it is installed prior to starting the gateway.
Install the Windows Resource Kit Tools
Download and install the Windows Resource Kit Tools. When you launch the installer, you may get a popup that looks similar to the following,
If so, then click the link called Run the program without getting help. The installer should launch and you should see something similar to the following,
Click the button labeled Next and follow the installation prompts to complete the installation. This will install the Windows Resource Kit Tools in your Program Files folder (e.g., C:\Program Files (x86)\Windows Resource Kits\Tools or C:\Program Files\Windows Resource Kits\Tools). The remainder of these instructions presume that that Windows Resource Kit Tools are installed in C:\Program Files (x86)\Windows Resource Kits\Tools. Please make the appropriate changes if they were installed in a different folder on your computer.
The next section will create a Windows Service using the Windows Resource Kit Tool called SRVANY.EXE to launch the Studio Database Gateway.
Create the Windows Service
Open a Windows Command Prompt with elevated permissions. Do this by right-clicking on the Command Prompt application in the Windows Start menu (or CMD.EXE) and selecting Run as administrator. Once the Command Prompt opens, run the SC.EXE command exactly as shown below,
The command is one command that will wrap depending on the width of your Command Prompt window. Also, note that the spaces following binPath=, DisplayName=, and start= are required. For your convenience, you can copy/paste the following command to your Command Prompt window and run it.
SC.EXE Create StADOSvr binPath= "C:\Program Files (x86)\Windows Resource Kits\Tools\srvany.exe" DisplayName= "InduSoft Studio Database Gateway" start= auto
Remember to change the path if the Windows Resource Kit Tools are installed in a different location on your computer.
This creates a Windows Service called StADOSvr that launches SRVANY.EXE. Next, we need to configure the service to launch the Studio Database Gateway. This step requires that you edit the Windows Registry. To quote Microsoft,
WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.
NOTE: You should back up the registry before you edit it.
Configure the Windows Service
Launch the Registry Editor (regedit.exe) and locate the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\StADOSvr
Click the key called StADOSvr, then you should see something similar to the following,
Right-click the key called StADOSvr, click New >> Key, and create a key called Parameters. You should see something similar to the following,
Right-click the new key called Parameters, click New >> String Value, and create a new string value called Application. You should see something similar to the following,
Right-click the new string value called Application and change the field called Value data to be the full path name of the Studio Database Gateway as shown below,
If you installed the Studio Database Gateway files in a different location, then change the path as required. Click the button labeled OK and you should see something similar to the following,
Close the Registry Editor.
You should now be able to start the InduSoft Studio Database Gateway service like you would other Windows Services. The service is also configured to automatically start whenever the computer starts. The final step is to configure the Windows Firewall to allow remote access to the gateway.
Configure the Windows Firewall
Open the Windows Firewall from the Windows Control Panel and click the link called Allow an app or feature through the Windows Firewall. You should see something similar to the following,
Click the button labeled Allow another app. If the button is not selectable, then you may need to click the button called Change Settings to enable the ability to allow an application through the firewall. You should see something similar to the following,
Click the button labeled Browse, browse for the file called StADOSvr.exe and click the button labeled Add. You should see something similar to the following
Tic the checkboxes that apply to the networks for which you want to grant access. Click OK when you are done.
Creating a Database Connection to use the remote Studio Database Gateway
When you create a database connection in InduSoft Web Studio, one of the advanced settings that you need to configure is the Database Gateway Host and Port as shown below,
(Advanced Database Settings in InduSoft Web Studio v7.1 SP3)
The Database Gateway Host specifies whether the gateway will be running on the local computer or on a remote computer. If you are using the local computer, then you should enter either localhost or 127.0.0.1 in the Host field. You do not need to worry about starting or stopping the gateway because it will be done automatically by the InduSoft runtime. On the other hand, when running the gateway remotely, you need to enter either the hostname or IP address of the remote computer in the Host field.
If you have any questions or comments, then please leave a reply.