Advertisement
Guest User

Untitled

a guest
May 15th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.      if lDoNotChangeFolder
  2.         ** If not changing folders (i.e. dev mode) just check for the system and main INI files
  3.         if file(addbs(lcStartPath) + .cServerName + '_system.ini')
  4.            .cINIfile_system   = addbs(lcStartPath) + .cServerName + '_system.ini'
  5.         else
  6.             llRetVal  = .F.
  7.             lcDisplayMsg = lcDisplayMsg + .cServerName + '_system.ini does not exist in ' + lcStartPath +'.' + CRLF + CRLF
  8.             lcMsg  = 'Configuration error:  ' + .cServerName + '_system.ini does not exist in ' + lcStartPath +'.  '+;
  9.                      'If upgrading to version 4.1, c_CommonUpdate_4101.exe may have failed to run.  '+;
  10.                      'Please run it manually with local administrative privileges.'
  11.             .write_log(lcMsg, program(), '0')
  12.             .write_LongCall_log(lcMsg, program(), '0')
  13.         endif
  14.         if file(addbs(.cProgramDataPath) + .cServerName + '.ini')
  15.            .cINIfile = addbs(.cProgramDataPath) + .cServerName + '.ini'
  16.         else
  17.            llRetVal  = .F.
  18.            lcDisplayMsg = lcDisplayMsg + .cServerName + '.ini does not exist in ' + .cProgramDataPath + CRLF + CRLF
  19.            lcMsg  = 'Configuration error:  ' + .cServerName + '.ini does not exist in ' + .cProgramDataPath +'.  '+;
  20.                     'If upgrading to version 4.1, c_CommonUpdate_4101.exe may have failed to run.  '+;
  21.                     'Please run it manually with local administrative privileges.'
  22.            .write_log(lcMsg, program(), '0')
  23.            .write_LongCall_log(lcMsg, program(), '0')
  24.         endif
  25.      else
  26.         ** Check for the system INI in the installed folder
  27.         if file(addbs(lcStartPath) + .cServerName + '_system.ini')
  28.            .cINIfile_system   = addbs(lcStartPath) + .cServerName + '_system.ini'
  29.         else
  30.            llRetVal  = .F.
  31.            lcDisplayMsg = lcDisplayMsg + .cServerName + '_system.ini does not exist in ' + lcStartPath +'.' + CRLF + CRLF
  32.            lcMsg  = 'Configuration error:  ' + .cServerName + '_system.ini does not exist in ' + lcStartPath +'.  '+;
  33.                     'If upgrading to version 4.1, c_CommonUpdate_4101.exe may have failed to run.  '+;
  34.                     'Please run it manually with local administrative privileges.'
  35.            .write_log(lcMsg, program(), '0')
  36.            .write_LongCall_log(lcMsg, program(), '0')
  37.         endif
  38.  
  39.         ** Check for the ProgramDataPath setting in the system INI
  40.         if llRetVal
  41.            lcProgramDataDir = addbs(.read_ini(.cINIFile_system, 'Data', 'ProgramDataPath', ''))
  42.            if empty(lcProgramDataDir)
  43.               llRetVal  = .F.
  44.               lcDisplayMsg = lcDisplayMsg + 'The "ProgramDataPath" setting does not exist in the [Data] section of the ' + ;
  45.                              .cServerName + '_system.ini file.  '+ CRLF + CRLF
  46.               lcMsg  = 'Configuration error:  The "ProgramDataPath" setting does not exist in the [Data] section of the ' + ;
  47.                         .cServerName + '_system.ini file.  '+;
  48.                        'If upgrading to version 4.1, c_CommonUpdate_4101.exe may have failed to run.  '+;
  49.                        'Please run it manually with local administrative privileges.'
  50.               .write_log(lcMsg, program(), '0')
  51.               .write_LongCall_log(lcMsg, program(), '0')
  52.            endif
  53.         endif
  54.  
  55.         ** Check for the existence of the ProgramDataPath folder
  56.         if llRetVal
  57.            if ! directory(lcProgramDataDir)
  58.               llRetVal  = .F.
  59.               lcDisplayMsg = lcDisplayMsg + 'The "'+lcProgramDataDir+'" folder does not exist, as specified in the ProgramDataPath setting in the ' + ;
  60.                             .cServerName + '_system.ini file.'+ CRLF + CRLF
  61.               lcMsg  = 'The "'+lcProgramDataDir+'" folder does not exist, as specified in the ProgramDataPath setting in the ' + ;
  62.                        .cServerName + '_system.ini file.  '+;
  63.                        'If upgrading to version 4.1, c_CommonUpdate_4101.exe may have failed to run.  '+;
  64.                        'Please run it manually with local administrative privileges.'
  65.               .write_log(lcMsg, program(), '0')
  66.               .write_LongCall_log(lcMsg, program(), '0')
  67.            endif
  68.         endif
  69.  
  70.         ** If we have a good ProgramData folder, set it to the default folder and set the log file locations there as well
  71.         if llRetVal
  72.            if upper(addbs(lcStartPath)) <> upper(addbs(lcProgramDataDir))
  73.               set default to (lcProgramDataDir)
  74.               set path to (lcStartPath) additive
  75.               .cProgramDataPath   = lcProgramDataDir
  76.               .cLogFile           = addbs(lcProgramDataDir) + lcOrigLogName
  77.               .cLongCallLogFile   = addbs(lcProgramDataDir) + .cServerName + '_LongCallsAndErrors_log.txt'
  78.            endif
  79.         endif
  80.  
  81.         ** Check for the existence of the INI file in the ProgramDataPath folder
  82.         if llRetVal
  83.            if file(lcProgramDataDir + .cServerName + '.ini')
  84.               .cINIfile = lcProgramDataDir + .cServerName + '.ini'
  85.            else
  86.               llRetVal  = .F.
  87.               lcDisplayMsg = lcDisplayMsg + .cServerName + '.ini does not exist in ' + lcProgramDataDir + '.' + CRLF + CRLF
  88.               lcMsg  = 'Configuration error:  ' + .cServerName + '.ini does not exist in ' + lcProgramDataDir +'.  '+;
  89.                        'If upgrading to version 4.1, c_CommonUpdate_4101.exe may have failed to run.  '+;
  90.                        'Please run it manually with local administrative privileges.'
  91.               .write_log(lcMsg, program(), '0')
  92.               .write_LongCall_log(lcMsg, program(), '0')
  93.            endif
  94.         endif
  95.      endif  && lDoNotChangeFolder
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement