Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if lDoNotChangeFolder
- ** If not changing folders (i.e. dev mode) just check for the system and main INI files
- if file(addbs(lcStartPath) + .cServerName + '_system.ini')
- .cINIfile_system = addbs(lcStartPath) + .cServerName + '_system.ini'
- else
- llRetVal = .F.
- lcDisplayMsg = lcDisplayMsg + .cServerName + '_system.ini does not exist in ' + lcStartPath +'.' + CRLF + CRLF
- lcMsg = 'Configuration error: ' + .cServerName + '_system.ini does not exist in ' + lcStartPath +'. '+;
- 'If upgrading to version 4.1, c_CommonUpdate_4101.exe may have failed to run. '+;
- 'Please run it manually with local administrative privileges.'
- .write_log(lcMsg, program(), '0')
- .write_LongCall_log(lcMsg, program(), '0')
- endif
- if file(addbs(.cProgramDataPath) + .cServerName + '.ini')
- .cINIfile = addbs(.cProgramDataPath) + .cServerName + '.ini'
- else
- llRetVal = .F.
- lcDisplayMsg = lcDisplayMsg + .cServerName + '.ini does not exist in ' + .cProgramDataPath + CRLF + CRLF
- lcMsg = 'Configuration error: ' + .cServerName + '.ini does not exist in ' + .cProgramDataPath +'. '+;
- 'If upgrading to version 4.1, c_CommonUpdate_4101.exe may have failed to run. '+;
- 'Please run it manually with local administrative privileges.'
- .write_log(lcMsg, program(), '0')
- .write_LongCall_log(lcMsg, program(), '0')
- endif
- else
- ** Check for the system INI in the installed folder
- if file(addbs(lcStartPath) + .cServerName + '_system.ini')
- .cINIfile_system = addbs(lcStartPath) + .cServerName + '_system.ini'
- else
- llRetVal = .F.
- lcDisplayMsg = lcDisplayMsg + .cServerName + '_system.ini does not exist in ' + lcStartPath +'.' + CRLF + CRLF
- lcMsg = 'Configuration error: ' + .cServerName + '_system.ini does not exist in ' + lcStartPath +'. '+;
- 'If upgrading to version 4.1, c_CommonUpdate_4101.exe may have failed to run. '+;
- 'Please run it manually with local administrative privileges.'
- .write_log(lcMsg, program(), '0')
- .write_LongCall_log(lcMsg, program(), '0')
- endif
- ** Check for the ProgramDataPath setting in the system INI
- if llRetVal
- lcProgramDataDir = addbs(.read_ini(.cINIFile_system, 'Data', 'ProgramDataPath', ''))
- if empty(lcProgramDataDir)
- llRetVal = .F.
- lcDisplayMsg = lcDisplayMsg + 'The "ProgramDataPath" setting does not exist in the [Data] section of the ' + ;
- .cServerName + '_system.ini file. '+ CRLF + CRLF
- lcMsg = 'Configuration error: The "ProgramDataPath" setting does not exist in the [Data] section of the ' + ;
- .cServerName + '_system.ini file. '+;
- 'If upgrading to version 4.1, c_CommonUpdate_4101.exe may have failed to run. '+;
- 'Please run it manually with local administrative privileges.'
- .write_log(lcMsg, program(), '0')
- .write_LongCall_log(lcMsg, program(), '0')
- endif
- endif
- ** Check for the existence of the ProgramDataPath folder
- if llRetVal
- if ! directory(lcProgramDataDir)
- llRetVal = .F.
- lcDisplayMsg = lcDisplayMsg + 'The "'+lcProgramDataDir+'" folder does not exist, as specified in the ProgramDataPath setting in the ' + ;
- .cServerName + '_system.ini file.'+ CRLF + CRLF
- lcMsg = 'The "'+lcProgramDataDir+'" folder does not exist, as specified in the ProgramDataPath setting in the ' + ;
- .cServerName + '_system.ini file. '+;
- 'If upgrading to version 4.1, c_CommonUpdate_4101.exe may have failed to run. '+;
- 'Please run it manually with local administrative privileges.'
- .write_log(lcMsg, program(), '0')
- .write_LongCall_log(lcMsg, program(), '0')
- endif
- endif
- ** If we have a good ProgramData folder, set it to the default folder and set the log file locations there as well
- if llRetVal
- if upper(addbs(lcStartPath)) <> upper(addbs(lcProgramDataDir))
- set default to (lcProgramDataDir)
- set path to (lcStartPath) additive
- .cProgramDataPath = lcProgramDataDir
- .cLogFile = addbs(lcProgramDataDir) + lcOrigLogName
- .cLongCallLogFile = addbs(lcProgramDataDir) + .cServerName + '_LongCallsAndErrors_log.txt'
- endif
- endif
- ** Check for the existence of the INI file in the ProgramDataPath folder
- if llRetVal
- if file(lcProgramDataDir + .cServerName + '.ini')
- .cINIfile = lcProgramDataDir + .cServerName + '.ini'
- else
- llRetVal = .F.
- lcDisplayMsg = lcDisplayMsg + .cServerName + '.ini does not exist in ' + lcProgramDataDir + '.' + CRLF + CRLF
- lcMsg = 'Configuration error: ' + .cServerName + '.ini does not exist in ' + lcProgramDataDir +'. '+;
- 'If upgrading to version 4.1, c_CommonUpdate_4101.exe may have failed to run. '+;
- 'Please run it manually with local administrative privileges.'
- .write_log(lcMsg, program(), '0')
- .write_LongCall_log(lcMsg, program(), '0')
- endif
- endif
- endif && lDoNotChangeFolder
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement