If sys(2023) points to "Progrma Files" (a read only dir), then point to getenv("temp")

This commit is contained in:
fdbozzo
2017-04-15 23:32:54 +02:00
parent 5b5a7432b8
commit 0f3da5fd7a

View File

@@ -773,12 +773,13 @@ DEFINE CLASS c_foxbin2prg AS Session
c_Foxbin2prg_FullPath = ''
c_Foxbin2prg_ConfigFile = ''
c_CurDir = ''
c_TempDir = SYS(2023)
c_InputFile = ''
c_ClassToConvert = '' && Guarda el nombre de la clase a convertir, indicada en tcInputFile como "archivo.vcx::clase"
c_ClassOperationType = '' && (I)mport o (E)xport. Se usa solo para manejar clases individuales.
c_OriginalFileName = ''
c_LogFile = ADDBS( SYS(2023) ) + 'FoxBin2Prg_Debug.LOG'
c_ErrorLogFile = ADDBS( SYS(2023) ) + 'FoxBin2Prg_Error.LOG'
c_LogFile = ''
c_ErrorLogFile = ''
c_TextLog = ''
c_OutputFile = ''
c_Recompile = '1'
@@ -880,6 +881,14 @@ DEFINE CLASS c_foxbin2prg AS Session
THIS.declareDLL()
* Check if SYS(2023) point to "Program Files"
IF ATC("\PROGRAM FILES", THIS.c_TempDir) > 0 OR ATC("\ARCHIVOS DE PROGRAMA", THIS.c_TempDir) > 0
THIS.c_TempDir = GETENV("TEMP")
ENDIF
THIS.c_LogFile = ADDBS( THIS.c_TempDir ) + 'FoxBin2Prg_Debug.LOG'
THIS.c_ErrorLogFile = ADDBS( THIS.c_TempDir ) + 'FoxBin2Prg_Error.LOG'
IF ADIR(laDir, THIS.c_ErrorLogFile) > 0 THEN
IF ADIR(laDir, THIS.c_ErrorLogFile + '.BAK') > 0 THEN
THIS.changeFileAttribute( THIS.c_ErrorLogFile + '.BAK', '-R-S-H' )
@@ -8442,7 +8451,7 @@ DEFINE CLASS c_conversor_prg_a_bin AS c_conversor_base
lnSelect = SELECT()
SELECT 0
USE (THIS.c_InputFile) SHARED AGAIN ALIAS _TABLABIN
COPY STRUCTURE EXTENDED TO ( FORCEPATH( '_FRX_STRUC.DBF', ADDBS( SYS(2023) ) ) )
COPY STRUCTURE EXTENDED TO ( FORCEPATH( '_FRX_STRUC.DBF', ADDBS( THIS.c_TempDir ) ) )
**** CONTINUAR SI ES NECESARIO - SIN USO POR AHORA /// DO NOT USE - NOT IMPLEMENTED!
CATCH TO loEx