Ignore:
Timestamp:
08/17/10 11:23:57 (21 months ago)
Author:
jay
Message:

-- win32service application with start, stop, uninstall service, and start server normally integrated into one package. This is the initial commit for this approach.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/win32service/win32service/readme.txt

    r73 r78  
    33Source: http://msdn.microsoft.com/en-us/library/bb540476%28v=VS.85%29.aspx 
    44 
    5 Brief Description: 
    6 win32service is a win32 console application that installs a service named "evo".  
    7 This service can be started and stopped using the Services Administrative Tool seen from the Control Panel. 
     5BRIEF DESCRIPTION: 
     6win32service is a win32 console application that runs the following command: 
     71. Installs a Windows service named "evo" 
     82. Uninstalls the service named "evo" 
     93. Starts the service 
     104. Stops the service 
     115. Starts the rtmpserver normally in the console. 
     12In addition, the service can also be started and stopped using the Services Administrative Tool seen from the Control Panel. 
    813 
    9 Additional Applications: 
    10 There are other applications outside win32service that can be useful in testing: 
    11 1. SvcControl - is a console application that can start and stop the service. More commands can be done here (refer to Source) 
    12 2. SvcConfig - is a consol application that can be used to delete the service. More commands can be done here (refer to Source) 
     14MODULES: 
     151. svcconfig - contains the function that deletes/uninstalls the service. This is also where the application checks if a service is already installed. 
     162. svccontrol - contains the functions that starts and stops the service. 
     173. svc - contains the "main" function. When the service is created, the SvcMain acts as the main function of the thread when the service starts. 
     184. rtmpserver - is the application that runs the server. 
    1319 
    14 Instruction (How to use?): 
     20Instruction (How to use): 
    1521To start/stop service: 
    16221. Compile the application. 
    17232. Open a command prompt as administrator (right click on command prompt, select "Run as Administrator"). 
    18243. cd to directory of win32service. 
    19 4. Type "win32service install" and wait for "Service installed successfuly" to appear. 
     254. Type "win32service installService" and wait for "Service installed successfuly" to appear. 
    20265. Check the Service admin tool and look for "evo" service. 
    21276. Start/Stop evo service. 
    2228 
    23 To delete the service: compile SvcConfig, cd to the dir of svcconfig.exe, type "svcconfig delete evo". 
    24  
    25 To start/stop rtmpserver (Will be improved soon) 
     29To start/stop rtmpserver 
    2630rtmpserver should start when evo service starts. To make sure that it starts successfuly: 
    2731- Put the exact path of rtmpserver.lua in line#-84 of rtmpserver.cpp. 
    2832- Assign a "mediaFolder" parameter in rtmpserver.lua 
    29 Stop the evo service to stop rtmpserver. 
     33Start the server by starting the service using the 'startService' command. 
     34Stop the server by stopping the service using the 'stopService' command. 
     35If the service is not installed, start the server normally by running the application without any command parameter. 
     36 
     37To uninstall the service, enter the 'uninstallService' command. 
     38 
     39SOME TECHNICAL DETAILS: 
     40- The application makes sure that when the service is installed, the user will not be able to start the server normally. 
     41- To check if the service is installed, the application queries information about the service. If the query returns a value, the server will not be started normally. 
     42- Running the application without any command assumes that the user is attempting to start the server in a normal way. 
     43- svcconfig and svccontrol have other functions that can be useful during testing and in future implementations, hence a lot of codes remain intact. 
    3044 
    3145NOTES: 
     46- [as of commit in 08-17-2010] The config file is hard-coded in rtmpserver.cpp 
    3247- Currently, the rtmpserver logs is saved to C:\\RTMPServerlogs.txt. 
    3348- There are limited sample applications in the net that implements this model.  
    34 - In most of the sample apps, they loop a "while()" during the service's RUNNING state, simulating a running thread (since SvcMain acts like a thread). 
     49- In most of the sample apps, they loop a "while()" during the service's RUNNING state, simulating a running thread (since SvcMain acts as a thread). 
Note: See TracChangeset for help on using the changeset viewer.