Configurando com ajuda de programa

Aqui você poderá oferecer suas Contribuições, Dicas e Tutoriais (Texto ou Vídeo) que sejam de interesse de todos.

Moderador: Moderadores

Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Configurando com ajuda de programa

Mensagem por JoséQuintas »

Zerei toda configuração da minha máquina.
Quero testar minhas ferramentas e etc.
E mostrar, assim vocês fazem igual, se gostarem.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Configurando com ajuda de programa

Mensagem por JoséQuintas »

Primeiro, como não tem nada configurado, vou lá na pasta do meu build.exe e executo.
build.png
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Configurando com ajuda de programa

Mensagem por JoséQuintas »

Ele já configura o que conhece.
build2.png
as outras coisas que me mostrou, é porque de repente posso estar testando uma variação.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Configurando com ajuda de programa

Mensagem por JoséQuintas »

Acrescento o path das outras coisas que ele me mostrou.
build3.png
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Configurando com ajuda de programa

Mensagem por JoséQuintas »

Agora chamo de novo, pra ele conferir
Ele me mostra que criou o hbmk.hbc em \harbour\bin
Lógico, meu padrão de uso.
build4.png
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Configurando com ajuda de programa

Mensagem por JoséQuintas »

Vou na pasta da sefazclass

C <ENTER>

Vou na pasta de minha lib

C <ENTER>

Vou na pasta do meu aplicativo

C <ENTER>
build5.png
Ainda não coloquei HWGUI no build....

no hbmk.hbc, preciso acrescentar libpaths=d:\github\hwgui, aproveitar e já acrescentar d:\github\hmge

nota: estou fazendo conforme estou postando.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Configurando com ajuda de programa

Mensagem por JoséQuintas »

Vou lá na pasta da hwgui

C <ENTER>

Volto lá no aplicativo

C <ENTER>
build6.png
Prontinho e testado.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Configurando com ajuda de programa

Mensagem por JoséQuintas »

Vamos complicar.... HMG Extended

vou lá na pasta da hmg extended

C <ENTER>
build7.png
Quantos BATs eu tenho?
Somente o C.BAT

Complicado o BAT?

Esta linha:

Código: Selecionar todos

d:\cdrom\FONTES\build\build.exe %*
Porque tá tão simples?
Ué... eu sou programador... criei um programa pra me ajudar.
Nem tem nada demais pra compilar, basicamente é: se encontrar HBP na pasta, hbmk2 *.hbp
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Configurando com ajuda de programa

Mensagem por JoséQuintas »

A configuração das LIBs ficou assim:

Código: Selecionar todos

libpaths=d:/cdrom/fontes/integra/sefazclass
libpaths=d:/cdrom/fontes/integra/libjpa
libpaths=d:/github/hwgui
libpaths=d:/github/hmge
Não uso HMGE, mas, também não atrapalha deixar configurado.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Configurando com ajuda de programa

Mensagem por JoséQuintas »

O Windows 10, dependendo da atualização, APAGA a pasta C:\TEMP
Acrescentei no meu build pra criar essa pasta, caso não exista.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Configurando com ajuda de programa

Mensagem por JoséQuintas »

Faltou o fonte....
Mas não é nada diferente do que seria feito manualmente.

Verificar se meus paths padrão estão em PATH, e se as ferramentas estão no PATH do sistema operacional, já configura se precisar

Código: Selecionar todos

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
Verificar as variáveis de ambiente, e já configura se precisar

Código: Selecionar todos

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
Como uso o HARBOUR/BIN/HBMK.HBC, verifico se contém meu padrão de compilação, e configuro se precisar

Código: Selecionar todos

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
Ele é meu gerenciador de compilação, não apenas pra verificar a máquina.
Tem também o default da minha compilação normal, onde ele chama o hbmk2.

Código: Selecionar todos

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
Basicamente digito C <ENTER>
Ele verifica se tá tudo configurado no PATH, se ferramentas estão no PATH, se meu Harbour tá configurado.
Se tudo ok, chama o hbmk2, e o hbmk2 faz o resto.

A única exceção é se realmente a máquina estiver totalmente desconfigurada.
Nesse caso tenho que chamar o BUILD.EXE diretamente na primeira vez.

Também daria pra colocar lembrete de outras configurações, ou de programas a serem instalados.
Ou até lembretes de senhas, sei lá.... assim fica tudo anotado, disponível e pronto pra uso, sem ter que ficar procurando alguma coisa.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Responder