![]() Then, you can install and start the service directly from the tftpUtilSettings application. Into one directory and then launch tftpUtilSvcSettings from there (assumed the DotNet runtimes are already installed). ![]() This code has been integrated into the tftpUtilSvcSettings application (see ServiceUtils.cs) and so there is no real need for an installer. The tftp server service should later run on a Windows 2003 server and as I did not like to copy InstallUtil and possibly other files onto the server and then run InstallUtil.exe to install the service, I researched and found some cool CSharp code to install/uninstall/start/stop/restart a service from code. If a service gets into this state, the service control manager is unable to remove the service as " InstallUtil.exe /u" was unable to uninstall the ‘broken’ service. As the service remained in a disabled state, I had to rename all tftpUtilSvc service names to be able to test one more time without having to reboot my PC. As I did not like to change too much of the original tftpUtil class, there may be strange looking constructs and possible duplicate internal values.ĭuring my debugging tests, the service did not start/stop correctly sometimes, due to errors in code. Inside the class, ServerSettings.cs, the values are saved/restored to the registry. I implemented a ServerSettings class and changed all direct references to the registry to this class. Here is my ugly " tftpUtilSvcSettings" application:Īlthough the tftpUtil code from sourceforge already contained code to write/read tftp settings to/from registry, it was not very clear and straight. Did not find any reference, why the service cannot access other root registry trees. Although the registry location does not look nice (I mean service parameters have to reside below HKLM, but who cares), I tried the HKEY_USER.Default location and the service was able to load the values from the registry. The service was unable to access Software\tftpUtilSvc. I started with using the registry, but that did not work first. Resend, iTimeout, LoggingMethodInfo, BlockedIPs, ServerIPAddr) ĪddLog( " CreateTFTPFromReg everything seems to be OK") ĪddLog( " CreateTFTPFromReg EXCEPTION:" + ex.Message) Īs I would like to control the service later and change settings, I needed a way to ‘communicate’ with the server. ![]() Resend, iTimeout, LoggingMethodInfo, BlockedIPs) Tftp = new TFTPServer(ServerUDPPort, Path, LoggingLevel,ĭisplayLevel, FileAccess, AllowOptions, RRQWRQStateCheck, LoggingMethodInfo = svcSettings.LoggingOptions ĪddLog( " CreateTFTPFromReg reading BlockedIPs") ĪddLog( " CreateTFTPFromReg starting new TFTPServer(.)") LoggingMethodInfo = svcSettings.LoggingMethod Resend = Convert.ToInt32(svcSettings.Resend) ĪddLog( " CreateTFTPFromReg reading LoggingMethodInfo") ITimeout = Convert.ToInt32(svcSettings.Timeout) ServerUDPPort = Convert.ToInt32(svcSettings.ServerUDPPort) (IPstring, out ServerIPAddr) ĪddLog( " CreateTFTPFromReg reading ServerUDPPort") String IPstring = svcSettings.ServerIPAddr RRQWRQStateCheck = svcSettings.RRQWRQStateCheck ĪddLog( " CreateTFTPFromReg reading IPstring") AddLog( " CreateTFTPFromReg reading path") ĭisplayLevel = svcSettings.SendEventLevel
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |