Dica do dia: variável de ambiente

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

Dica do dia: variável de ambiente

Mensagem por JoséQuintas »

Acho que o fonte diz tudo:

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
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

Dica do dia: variável de ambiente

Mensagem por JoséQuintas »

Ou talvez não...
Resultado após a execução:
setvar.png
A partir de agora, se precisar reinstalar Windows, meu aplicativo de build configura automático.
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