Show
Ignore:
Timestamp:
29.04.2009 15:37:50 (10 years ago)
Author:
ak19
Message:

Tries to generate the llssite.cfg file from llssite.cfg.in if it's not there already.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/runtime-src/src/w32server/fnord.cpp

    r18841 r19289  
    4141#include "startbrowser.h" 
    4242#include "d_winsock.h" 
     43#include "fileutil.h" 
    4344 
    4445#define MAINWINDOWWIDTH 400 
     
    911912} 
    912913 
     914 
     915// Tries to generate llssite.cfg from llssite.cfg.in in directory given 
     916// by location variable (assumes location is GSDLHOME), if llsite.cfg is missing 
     917void ensure_llssite_cfg(const text_t location) { 
     918  text_t configfile = location+"\llssite.cfg"; 
     919  text_t configtemplate = location+"\llssite.cfg.in"; 
     920 
     921  if(!file_exists (configfile)) { 
     922     
     923    if(file_exists (configtemplate)) { 
     924      // try creating llssite.cfg from the template configfile llssite.cfg.in 
     925      // by using a straightforward copy 
     926      file_copy(configtemplate, configfile); 
     927    } 
     928  } 
     929} 
     930 
     931 
    913932// Added code to allow for an 'init' run of the server which just creates the llssite.cfg file 
    914933int __stdcall WinMain(HINSTANCE Instance, HINSTANCE /*PrevInstance*/, LPSTR CmdLineStr, int /*CmdShow*/) { 
     
    926945  parse_args(CmdLineStr, location, config_file, command); 
    927946  gsdl_conffile = config_file; 
     947  
     948  // Try to generate the llssite.cfg file if it's missing 
     949  ensure_llssite_cfg(location); 
    928950 
    929951  // jmt12 18/11/2003