Logtemp and SRVANY basics
Logtemp is a software for reading and processing Dallas 1-wire sensor measurements. You can use this method to run almost any application, as long as paths and names are updated.
Logtemp is designed to run on user desktop. On server environments, that would mean to enable AutoAdminLogon and call program from Start Menu\Startup. As we know, there are scenarios where we do not want automatic logon at startup.
There is a old tool called SRVANY to run any program as service. It was released in Windows Server 2003 Resource Kit Tools. In case of you cannot find that product, you can download SRVANY.zip from here.
This guide is intended to be used on Windows server 2008 R2 or Windows 7 x64 platforms. I prefer to use delayed-auto option for service to avoid excessive load at server startup. After all, my Logtemp measuring interval is 15 min. I run service as Local system. In advanced scenarios you may need to use local or domain user.
Install logtemp
- Install logtemp normally to C:\Program Files (x86)\LogTemp\
- Run software, configure 1-wire devices, pictures to generate, MySQL DB connections etc
- Make sure Logtemp starts automatically (General: select Automatically start measuring) and closes without prompt (General: disable Ask before closing LogTemp)
- Shut down logtemp
Create and configure service
- Extract SRVANY.zip to C:\Program Files (x86)\SrvAny\
- In elevated command prompt, type: sc create LogtempService binPath= "C:\Program Files (x86)\SrvAny\srvany.exe" start= delayed-auto DisplayName= "Logtemp Service"
- Open regedit.exe and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LogtempService
- Create subkey Parameters
- Under Parameters, Create string AppDirectory and give it value C:\Program Files (x86)\LogTemp
- Under Parameters, Create string Application and give it value C:\Program Files (x86)\LogTemp\LogTemp.exe
Go!
Now your done. Go to Services management (Control Panel, search View Local Services) and select Logtemp Sercvice. On top, you will find Start button.
Note! Do not start Logtemp as normal application while service is running. In order to do configuration changes, first stop service!
SRVANY works as a interface for Windows service manager. When service is started, SRVANY.exe is started. SRVANY will then start Logtemp as it would run on user context. You will see both of these applications running when service is running.
Delete service
- Shut down Logtemp service
- In elevated command prompt, type: sc delete LogtempService
- Verify that service no longer exists and delete SRVANY folders
- Optional: Uninstall Logtemp