View Single Post
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#62
Running Knots as a service.
Yes, this is a Windows guide. No, however tempting the urge may be, you cannot shoot me for making a Windows guide.

I really like Knots. I really do. Infact, I'll go as far as saying I love it. But the ruby window that was always there and having to start it up manually sucked.

Some presumptions on my part: I assume that:
a) You are running XP Pro/MCE. No, I do not know if Windows Vista/7 will work. Frankly, I couldn't give a **** about either one of them. I wasted £12 for Vista (yes, it was legal which is a surprise for me) and I ended up reformatting and reinstalling XP.
b) You're using ukki's latest server package; ya know: the one with the ruby folder.
c) It's installed in C:\knots. If not, you'll have to change the numerous C:\knots references to the path where you installed it to.
d) You are an Administrator. If not, and this is a family computer or something, get ophcrack or something.
e) You have an text editor that understands UNIX line endings. This is not Notepad. I used Notepad++.

1. Download srvany and instsrv and save them to C:\knots
These were taken from the Windows Server 2003 Resource Kit, and, yes, they work fine under XP. Seeing as I didn't need to pass WGA to download the Resource Kit; I assume that I can upload the two files in question to another site.
2. Start up a Command Prompt and type "cd C:\knots"
3. Type "instsrv.exe "Knots" C:\knots\srvany.exe"
4. You should get a message saying that the "Service was successfully installed" (or words to that effect).

Ah, we're done, right? Nope. We installed a service that starts up srvany. Not that useful.

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Use Registry Editor at your own risk.

5. Run "regedit" and you should get something like this coming up:

6. Go to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servi ces\Knots" and you should see something like (don't worry if you see things in this screenshot that are not in your Registry. WRT Knots, anyway.):

7. Right click the "Knots" key (the one with the folder icon beside it) and choose "New -> Key" and call this key "Parameters"
8. Go to the "Parameters" key and right click the blank area to the right and choose "New -> String Value". Call this "Application".
9. Double click it and enter the following in: "C:\knots\ruby\bin\ruby.exe C:\knots\knots.rb" in the "Value Data" box.
10. Click "OK" and you should have this:


11. Run a text editor on the knots.rb file that understands UNIX line endings and add "Dir.chdir("C:\\knots")" right under the "#!/usr/bin/env ruby" line:


12. Run "services.msc" and find the "Knots" service. Double click it, ensure it is set to "Automatic" and click "Log on as: Local System Account" and leave "Allow service to interact with desktop" unticked. And click "OK".
13. Right click the Knots service -> Start, and enjoy!


P.S: If anyone were to write a better guide, I'd be immensely greatful. As you may have guessed: Guide writing is not my forte.

Last edited by qwerty12; 2009-07-08 at 12:26. Reason: I can't count :(
 

The Following 7 Users Say Thank You to qwerty12 For This Useful Post: