the last days, I made some tests about the compatibility of fwh applications and vista and I found, the error logfile could not be written, if I follow the programming rules of vista (and XP also ! ).
The point is, that a normal user (without admin privilegs) is not allowed to write in the program directory. If we follow the programing rules, data has to be separated from the program. The applications has to be installed in the program directory and the data either in the homedir of the user or in the alluser homedir.
I made some small changes in errsysw.prg to take account of these rules.
With the new function SetErrorLog (cLogfile) you can decide, where the error.log will be written, default is the homedir of allusers.
- Code: Select all Expand view
external _fwGenError // Link FiveWin generic Error Objects Generator
STATIC cLog // NEW Stefan Haupt 20.12.2008
/*************
* ErrorSys()
*
* Note: automatically executes at startup
*/
proc ErrorSys()
SetErrorLog () // NEW Stefan Haupt 20.12.2008
ErrorBlock( { | e | ErrorDialog( e ) } )
return
proc ErrorLink()
return
//---------------------------------------------------
// Set errorlog file
// Stefan Haupt 20.12.2008
//---------------------------------------------------
PROCEDURE SetErrorLog (cLogFile)
DEFAULT cLogFile := IIF (IsWinVista(), GetEnv("AllUsersProfile")+"\Error.log",;
GetEnv("AllUsersProfile")+"\Anwendungsdaten\Temp\Error.log")
cLog := cLogFile
RETURN
//---------------------------------------------------
// Get errorlog file
// Stefan Haupt 20.12.2008
//---------------------------------------------------
FUNCTION GetErrorLog ()
RETURN (cLog)
.....
.....
// Generates a file with an Error Log
BEGIN SEQUENCE
oOldError = ErrorBlock( { || DoBreak() } )
//MemoWrit( "Error.log", cErrorLog )
MemoWrit( cLog, cErrorLog ) // NEW Stefan Haupt 20.12.2008
END SEQUENCE
ErrorBlock( oOldError )