To download NI software, including the products shown below, visit ni.com/downloads.
This VI will automate the process of installing a application as a windows service to run in the background
This VI automates the steps described in the following KB in order to install an application as a Windows Service:
It requires that the Microsoft Resource Kit be installed. This kit can be installed for the following operating systems:
When installing the Microsoft Resource Kit in Windows 7, a compatibility issue pop up will appear. Skip it and continue with the installation.
4. Steps to Implement or Execute Code
5. Additional Information or References
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
It worked nicely, however, if the service name has space in it, it must be enclosed within a pair of quotes "%s". In fact, i used this with a "Format Into String" primitive vi:
"%s" "%s" "%s"
"path_to_instsrv.exe" "my service name" "path_to_srvany.exe"
Service name with spaces and version number does not work. Any solutions? No even surrounding the service name with quotes did not help. The service name would register but then it would not start, not even manully, from windows services applet.
will this work for Windows Server 2008?
GretchenSkellyZimmer, I cannot confirm that it does but this post suggests that it will work: http://social.technet.microsoft.com/Forums/en-US/winserverMigration/thread/98a97aee-c62b-4683-94ab-3...
I am running windows server 2008 R2 64bit. I noticed that on the Microsoft Resource Kit download page, the notes at the requirements states that it will not supported on 64 bit platforms. What should I do in this case?
Is this solution still applicable for Windows 7 and 8.1??
I haven't tried this code on windows 7 or 8 so I can't confirm. Best thing to do would be try it and report back on your findings. I did however find this forum that suggests that the Windows 2003 Resources will function in later versions of the OS, but that it might have limited capabilities.
If I find time to test it I will let you know what I find.
I had tried it on a Win7 machine and am getting Error2- LabVIEW memory is Full error.
Any ideas ?
That sounds like a run-time issue related tot the application. Do you receive any issues when you are installing the service? Can you create a simple application to test that the service installs correctly?
This error is coming from the System Exec.vi function. Hence, the service is not created/installed.
I have resolved the error now. The changes are refelcted in the registry but it doesn't have the registry key 'Application' = "App path".
And its not visible in the 'servcies.msc' list.
Create indicators for the system exec standard output and error output. I ran a test on a win 7 computer and received permissions errors for the instsrv call. You will have to run this with administrative privileges. You might find this forum thread of interest: Running system exec vi as administrator in win7
Note: The Windows Server 2003 Resource Kit Tools are not supported on 64-bit platforms.This is from the system requirements at the Microsoft download site. So... how does one install a LabVIEW application as a WinService on Win 7 - 64-bit since this resource kit cannot be used.
I did it the same way. It is a pain. But I found that it is much easier with this: https://nssm.cc/
It has an User Interface to create the Service easily. It much better & Freeware and there is also a 64 Bit Version.
It is working on W7 without any problems.