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

-- Added svcregistry module. This is the initial commit for using the windows registry to store the configuration file's path. The config path is hard-coded

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/win32service/win32service/src/svc/svc.cpp

    r86 r97  
    2828    if( lstrcmpi( argv[1], TEXT("installService")) == 0 ) 
    2929    { 
    30                 SvcInstall(); 
    31                 //OpenRegistry(); 
     30                if(GetSvcRegistry() != REGIST_ERROR) 
     31                        SvcInstall(); 
     32                else 
     33                        printf("\n The service is not installed because of error(s) in registry\n"); 
    3234        return; 
    3335    }else if( lstrcmpi( argv[1], TEXT("uninstallService")) == 0) 
     
    6567                        if (!DoQuerySvc){ 
    6668                                printf("Server will start normally.\n\n"); 
    67                                 rtmpserver(); 
     69                                rtmpserver(GetSvcRegistry()); 
    6870                                return; 
    6971                        }else{ 
    70                                 printf("\nERROR: Server cannot be started normally.\n\n"); 
    71                                 printf("Service described above is already installed.\n"); 
     72                                printf("\nERROR: Server cannot be started normally because the service described above is already installed. .\n\n"); 
    7273                                printf("Start/Stop the server by starting/stopping the service.\n\n"); 
    7374                                printf("To start server normally, enter 'uninstallService' command to delete the service.\n\n"); 
     
    392393DWORD WINAPI ThreadProc( __in  LPVOID lpParameter) 
    393394{ 
    394         rtmpserver(); 
     395        rtmpserver(SvcRegistry(GET_KEY_VALUE)); 
    395396        //the lines below works too. 
    396397        /*if(Initialize()) 
Note: See TracChangeset for help on using the changeset viewer.