Zerei toda configuração da minha máquina.
Quero testar minhas ferramentas e etc.
E mostrar, assim vocês fazem igual, se gostarem.

Moderador: Moderadores
d:\cdrom\FONTES\build\build.exe %*
libpaths=d:/cdrom/fontes/integra/sefazclass
libpaths=d:/cdrom/fontes/integra/libjpa
libpaths=d:/github/hwgui
libpaths=d:/github/hmge
STATIC FUNCTION CheckPath()
LOCAL cFile, cPathFile, cPath, cPathList
cPathList := GetEnv( "PATH" )
FOR EACH cPath IN { "d:\harbour\bin", "d:\harbour\comp\winlib32\bin", "d:\tools\util" }
IF ! Lower( cPath ) $ Lower( GetEnv( "PATH" ) )
cPathList += ";" + cPath
ENDIF
ShellExecuteOpen( "setx.exe", "PATH" + " " + cPathList )
NEXT
FOR EACH cFile IN { "c.bat" }
IF Empty( CheckFileOnPath( cFile ) )
ShowAlert( cFile + " not in PATH" )
ENDIF
NEXT
FOR EACH cFile IN { "hbmk2.exe", "harbour.exe", "upx.exe" } // "gcc.exe",
cPathFile := CheckFileOnPath( cFile )
IF Empty( cPathFile )
ShowAlert( cFile + " not in PATH" )
ELSEIF ! TestExeAssinado( cPathFile + cFile )
ShowAlert( cPathFile + cFile + " nao assinado" )
ENDIF
NEXT
RETURN Nil
STATIC FUNCTION CheckGetEnv()
LOCAL oElement
LOCAL aList := { ;
{ "HB_BUILD_DYN", "no" }, ;
{ "HB_BUILD_CONTRIB_DYN", "no" }, ;
{ "HB_BUILD_STRIP", "all" }, ;
{ "HB_BUILD_SHARED", "no" }, ;
{ "HB_COMPILER", "mingw" }, ;
{ "HB_INSTALL_PREFIX", "d:\harbour" } }
/*
{ "HB_WITH_ADS", "no" }, ;
{ "HB_WITH_CURL", "no" }, ;
{ "HB_WITH_CAIRO", "no" }, ;
{ "HB_WITH_RABBITMQ", "no" }, ;
{ "HB_WITH_FIREBIRD", "no" }, ;
{ "HB_WITH_FREEIMAGE", "no" }, ;
{ "HB_WITH_ICU", "no" }, ;
{ "HB_WITH_GD", "no" }, ;
{ "HB_WITH_GS", "no" }, ;
{ "HB_WITH_LIBMAGIC", "no" }, ;
{ "HB_WITH_MYSQL", "no" }, ;
{ "HB_WITH_OPENSSL", "no" }, ;
{ "HB_WITH_PGSQL", "no" }, ;
{ "HB_WITH_OCILIB", "no" } }
*/
FOR EACH oElement IN aList
IF GetEnv( oElement[ 1 ] ) != oElement[ 2 ] .OR. Empty( GetEnv( oElement[ 1 ] ) )
ShowAlert( "Not found SET " + oElement[ 1 ] + "=" + oElement[ 2 ] )
ShellExecuteOpen( "setx.exe", oElement[ 1 ] + " " + oElement[ 2 ], 0 )
ENDIF
NEXT
RETURN Nil
STATIC FUNCTION CheckHbmkHbc()
LOCAL lUpdate := .F., cParam, cTxt := "", cFileHbmk, cPath
LOCAL aParams := { ;
"mt=yes", ;
"gui=yes", ;
"strip=yes", ;
"fullstatic=yes", ;
"{hbexe}compr=yes", ;
"libpaths=d:/cdrom/fontes/integra/sefazclass", ;
"libpaths=d:/cdrom/fontes/integra/libjpa", ;
"{mingw}CFLAGS=" + ;
" -Wno-implicit-fallthrough" + ;
" -Wno-cast-function-type" + ;
" -Wno-misleading-indentation", ;
"PRGFLAGS=-m -n -w3 -es2 -ge1" }
cPath := CheckFileOnPath( "hbmk2.exe" )
IF Empty( cPath )
ShowAlert( "hbmk2.exe not found on PATH to check hbmk.hbc" )
RETURN Nil
ENDIF
IF Right( cPath, 1 ) != "\"
cPath += "\"
ENDIF
cFileHbmk := cPath + "hbmk.hbc"
IF File( cFileHbmk )
cTxt := MemoRead( cFileHbmk )
IF Right( cTxt, 2 ) != hb_Eol()
cTxt += hb_Eol()
ENDIF
ENDIF
IF "xharbour" $ Lower( cPath )
AAdd( aParams, "-xhb" )
ENDIF
FOR EACH cParam IN aParams
IF ! cParam $ cTxt
cTxt += cParam + hb_Eol()
ShowAlert( "hbmk.hbc adding " + cParam )
stErro := .T.
lUpdate := .T.
ENDIF
NEXT
IF lUpdate
hb_MemoWrit( cFileHbmk, cTxt )
ENDIF
RETURN Nil
STATIC FUNCTION WriteBat( aParams )
LOCAL oElement, cPath, cCmd := "", cBatFile := "d:\tools\util\c.bat"
cPath := Upper( hb_cwd() )
IF Len( aParams ) != 0 .AND. aParams[ 1 ] == "/cmd"
hb_ADel( aParams, 1, .T. )
ELSE
IF AScan( aParams, { | e | e $ "|-w0|-w1|-w2|-w3|" } ) == 0
AAdd( aParams, "-w3" )
ENDIF
IF AScan( aParams, { | e | e $ "|-es0|-es1|-es2|" } ) == 0
AAdd( aParams, "-es2" )
ENDIF
IF AScan( aParams, "-m" ) == 0
AAdd( aParams, "-m" )
ENDIF
IF ASCan( aParams, "-n" ) == 0
AAdd( aParams, "-n" )
ENDIF
IF Len( Directory( "*.hbp" ) ) != 0
AAdd( aParams, "*.hbp" )
ELSEIF Len( Directory( "*.prg" ) ) != 0
AAdd( aParams, "*.prg" )
AAdd( aParams, "*.rc" )
ELSE
ShowNormal( hb_cwd() )
ENDIF
ENDIF
AAdd( aParams, "-strip" )
AAdd( aParams, "-compr" )
AAdd( aParams, "-workdir=c:\temp" )
AAdd( aParams, "-q" )
AAdd( aParams, "-I" + hb_FNameDir( hb_ProgName() ) )
cCmd += "HBMK2 "
FOR EACH oElement IN aParams
cCmd += oElement + " "
NEXT
cCmd := hb_ProgName() + " %*" + hb_Eol() + cCmd + hb_Eol()
DO CASE
CASE "\SJPA\" $ cPath; cCmd += "if exist ..\sjpa.exe call assina.bat ..\sjpa.exe" + hb_Eol()
CASE "\HAROLDO\" $ cPath; cCmd += "if exist hl.exe call assina.bat hl.exe" + hb_Eol()
CASE "\LABOROIL\" $ cPath; cCmd += "if exist nfe.exe call assina.bat nfe.exe" + hb_Eol()
CASE "\BUILD\" $ cPath; cCmd += "if exist build.exe call assina.bat build.exe" + hb_Eol()
CASE "\INTEGRA\" $ cPath; cCmd += "if exist jpa.exe call assina.bat jpa.exe" + hb_Eol()
ENDCASE
IF ! hb_DirExists( "c:\temp" )
hb_DirCreate( "c:\temp" )
ShowAlert( "Created c:\temp" )
ENDIF
//ShowNormal( "Atualizando " + cBatFile )
hb_MemoWrit( cBatFile, cCmd )
RETURN Nil
Retornar para Contribuições, Dicas e Tutoriais
Usuários vendo este fórum: Nenhum usuário registrado online e 15 visitantes