Commit 2964646d0cdb2e8d778bd684ed938685bb4b5c37
1 parent
6f95d8e8
Exists in
master
Agente-Windows: Adaptacao em CreateSampleProcess parametrizando o tipo de exibic…
…ao da janela do processo criado, ajustes no uso de CreateSampleProcess pelos agentes, correcoes logicas e melhorias em Informacoes Gerais do menu pop-up do Agente Principal, recepcao e uso do valor para TimeOut de Suporte Remoto Seguro em ociosidade, inicio de acoes para evitar que a execucao do MapaCACIC dependa da finalizacao do Agente Principal. git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/agente-windows@812 fecfc0c7-e812-0410-ae72-849f08638ee7
Showing
22 changed files
with
105 additions
and
40 deletions
Show diff stats
CACIC_Library.pas
| @@ -102,7 +102,7 @@ type | @@ -102,7 +102,7 @@ type | ||
| 102 | function getWinDir() : string; | 102 | function getWinDir() : string; |
| 103 | function getHomeDrive() : string; | 103 | function getHomeDrive() : string; |
| 104 | function isWindowsAdmin() : boolean; | 104 | function isWindowsAdmin() : boolean; |
| 105 | - function createSampleProcess(p_cmd: string; p_wait: boolean ) : boolean; | 105 | + function createSampleProcess(p_cmd: string; p_wait: boolean; p_showWindow : word): boolean; |
| 106 | procedure showTrayIcon(p_visible:boolean); | 106 | procedure showTrayIcon(p_visible:boolean); |
| 107 | end; | 107 | end; |
| 108 | 108 | ||
| @@ -641,10 +641,12 @@ end; | @@ -641,10 +641,12 @@ end; | ||
| 641 | Executa commandos, substitui o WinExec | 641 | Executa commandos, substitui o WinExec |
| 642 | 642 | ||
| 643 | @autor: Marcos Dell Antonio | 643 | @autor: Marcos Dell Antonio |
| 644 | - @param p_cmd Comando a ser executado | ||
| 645 | - @param p_wait TRUE se deve aguardar término da excução, FALSE caso contrário | 644 | + @adaptações: Anderson Peterle |
| 645 | + @param p_cmd Comando a ser executado | ||
| 646 | + @param p_wait TRUE se deve aguardar término da excução, FALSE caso contrário | ||
| 647 | + @param p_showWindow Constante que define o tipo de exibição da janela do aplicativo | ||
| 646 | -------------------------------------------------------------------------------} | 648 | -------------------------------------------------------------------------------} |
| 647 | -function TCACIC_Windows.createSampleProcess(p_cmd: string; p_wait: boolean ): boolean; | 649 | +function TCACIC_Windows.createSampleProcess(p_cmd: string; p_wait: boolean; p_showWindow : word): boolean; |
| 648 | var | 650 | var |
| 649 | SUInfo: TStartupInfo; | 651 | SUInfo: TStartupInfo; |
| 650 | ProcInfo: TProcessInformation; | 652 | ProcInfo: TProcessInformation; |
| @@ -652,7 +654,7 @@ begin | @@ -652,7 +654,7 @@ begin | ||
| 652 | FillChar(SUInfo, SizeOf(SUInfo), #0); | 654 | FillChar(SUInfo, SizeOf(SUInfo), #0); |
| 653 | SUInfo.cb := SizeOf(SUInfo); | 655 | SUInfo.cb := SizeOf(SUInfo); |
| 654 | SUInfo.dwFlags := STARTF_USESHOWWINDOW; | 656 | SUInfo.dwFlags := STARTF_USESHOWWINDOW; |
| 655 | - SUInfo.wShowWindow := SW_HIDE; | 657 | + SUInfo.wShowWindow := p_showWindow; |
| 656 | 658 | ||
| 657 | Result := CreateProcess(nil, | 659 | Result := CreateProcess(nil, |
| 658 | PChar(p_cmd), | 660 | PChar(p_cmd), |
cacic2.res
No preview for this file type
cacicservice/CACICsvc.res
No preview for this file type
cacicservice/CACICsvcMain.pas
| @@ -175,7 +175,7 @@ Begin | @@ -175,7 +175,7 @@ Begin | ||
| 175 | // Executo o CHKsis, verificando a estrutura do sistema | 175 | // Executo o CHKsis, verificando a estrutura do sistema |
| 176 | Try | 176 | Try |
| 177 | CACICservice.logDEBUG('TCACICservice.ExecutaCACIC : winExec => '+g_oCacic.getWinDir + 'chksis.exe'); | 177 | CACICservice.logDEBUG('TCACICservice.ExecutaCACIC : winExec => '+g_oCacic.getWinDir + 'chksis.exe'); |
| 178 | - g_oCacic.createSampleProcess(g_oCacic.getWinDir + 'chksis.exe',false); | 178 | + g_oCacic.createSampleProcess(g_oCacic.getWinDir + 'chksis.exe',false,SW_HIDE); |
| 179 | Except | 179 | Except |
| 180 | End; | 180 | End; |
| 181 | 181 | ||
| @@ -185,7 +185,7 @@ Begin | @@ -185,7 +185,7 @@ Begin | ||
| 185 | // Executo o Agente Principal do CACIC | 185 | // Executo o Agente Principal do CACIC |
| 186 | Try | 186 | Try |
| 187 | CACICservice.logDEBUG('TCACICservice.ExecutaCACIC : winExec => '+g_oCacic.getCacicPath + 'cacic2.exe'); | 187 | CACICservice.logDEBUG('TCACICservice.ExecutaCACIC : winExec => '+g_oCacic.getCacicPath + 'cacic2.exe'); |
| 188 | - g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'cacic2.exe',false); | 188 | + g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'cacic2.exe',false,SW_NORMAL); |
| 189 | Except | 189 | Except |
| 190 | End; | 190 | End; |
| 191 | End; | 191 | End; |
chkcacic/FormConfig.dfm
| @@ -32,9 +32,9 @@ object Configs: TConfigs | @@ -32,9 +32,9 @@ object Configs: TConfigs | ||
| 32 | object lbMensagemNaoAplicavel: TLabel | 32 | object lbMensagemNaoAplicavel: TLabel |
| 33 | Left = 265 | 33 | Left = 265 |
| 34 | Top = 25 | 34 | Top = 25 |
| 35 | - Width = 200 | 35 | + Width = 192 |
| 36 | Height = 13 | 36 | Height = 13 |
| 37 | - Caption = '(N'#227'o aplic'#225'vel ao ChkCacic do NetLogon)' | 37 | + Caption = '(N'#227'o aplicar ao chkCACIC do NetLogon)' |
| 38 | Font.Charset = DEFAULT_CHARSET | 38 | Font.Charset = DEFAULT_CHARSET |
| 39 | Font.Color = clRed | 39 | Font.Color = clRed |
| 40 | Font.Height = -11 | 40 | Font.Height = -11 |
| @@ -155,7 +155,7 @@ object Configs: TConfigs | @@ -155,7 +155,7 @@ object Configs: TConfigs | ||
| 155 | end | 155 | end |
| 156 | object Button_Gravar: TButton | 156 | object Button_Gravar: TButton |
| 157 | Left = 48 | 157 | Left = 48 |
| 158 | - Top = 325 | 158 | + Top = 314 |
| 159 | Width = 214 | 159 | Width = 214 |
| 160 | Height = 35 | 160 | Height = 35 |
| 161 | Caption = 'Concluir Instala'#231#227'o/Atualiza'#231#227'o' | 161 | Caption = 'Concluir Instala'#231#227'o/Atualiza'#231#227'o' |
| @@ -170,7 +170,7 @@ object Configs: TConfigs | @@ -170,7 +170,7 @@ object Configs: TConfigs | ||
| 170 | end | 170 | end |
| 171 | object btSair: TButton | 171 | object btSair: TButton |
| 172 | Left = 291 | 172 | Left = 291 |
| 173 | - Top = 325 | 173 | + Top = 314 |
| 174 | Width = 150 | 174 | Width = 150 |
| 175 | Height = 35 | 175 | Height = 35 |
| 176 | Caption = 'Sair' | 176 | Caption = 'Sair' |
| @@ -185,7 +185,7 @@ object Configs: TConfigs | @@ -185,7 +185,7 @@ object Configs: TConfigs | ||
| 185 | end | 185 | end |
| 186 | object pnVersao: TPanel | 186 | object pnVersao: TPanel |
| 187 | Left = 426 | 187 | Left = 426 |
| 188 | - Top = 302 | 188 | + Top = 354 |
| 189 | Width = 58 | 189 | Width = 58 |
| 190 | Height = 14 | 190 | Height = 14 |
| 191 | BevelOuter = bvLowered | 191 | BevelOuter = bvLowered |
chkcacic/chkcacic.res
No preview for this file type
chksis/chksis.res
No preview for this file type
col_anvi/col_anvi.res
No preview for this file type
col_comp/col_comp.res
No preview for this file type
col_hard/col_hard.res
No preview for this file type
col_moni/col_moni.res
No preview for this file type
col_patr/col_patr.res
No preview for this file type
col_soft/col_soft.res
No preview for this file type
col_undi/col_undi.res
No preview for this file type
ger_cols/ger_cols.dpr
| @@ -2436,6 +2436,7 @@ Begin | @@ -2436,6 +2436,7 @@ Begin | ||
| 2436 | SetValorDatMemoria('Configs.TE_JANELAS_EXCECAO' ,g_oCacic.deCrypt(XML_RetornaValor('te_janelas_excecao' , strRetorno)) , v_tstrCipherOpened); | 2436 | SetValorDatMemoria('Configs.TE_JANELAS_EXCECAO' ,g_oCacic.deCrypt(XML_RetornaValor('te_janelas_excecao' , strRetorno)) , v_tstrCipherOpened); |
| 2437 | SetValorDatMemoria('TcpIp.TE_ENDERECOS_MAC_INVALIDOS' ,g_oCacic.deCrypt(XML_RetornaValor('te_enderecos_mac_invalidos' , strRetorno)) , v_tstrCipherOpened); | 2437 | SetValorDatMemoria('TcpIp.TE_ENDERECOS_MAC_INVALIDOS' ,g_oCacic.deCrypt(XML_RetornaValor('te_enderecos_mac_invalidos' , strRetorno)) , v_tstrCipherOpened); |
| 2438 | SetValorDatMemoria('Configs.NU_PORTA_SRCACIC' ,g_oCacic.deCrypt(XML_RetornaValor('nu_porta_srcacic' , strRetorno)) , v_tstrCipherOpened); | 2438 | SetValorDatMemoria('Configs.NU_PORTA_SRCACIC' ,g_oCacic.deCrypt(XML_RetornaValor('nu_porta_srcacic' , strRetorno)) , v_tstrCipherOpened); |
| 2439 | + SetValorDatMemoria('Configs.NU_TIMEOUT_SRCACIC' ,g_oCacic.deCrypt(XML_RetornaValor('nu_timeout_srcacic' , strRetorno)) , v_tstrCipherOpened); | ||
| 2439 | SetValorDatMemoria('Configs.CS_PERMITIR_DESATIVAR_SRCACIC' ,g_oCacic.deCrypt(XML_RetornaValor('cs_permitir_desativar_srcacic' , strRetorno)) , v_tstrCipherOpened); | 2440 | SetValorDatMemoria('Configs.CS_PERMITIR_DESATIVAR_SRCACIC' ,g_oCacic.deCrypt(XML_RetornaValor('cs_permitir_desativar_srcacic' , strRetorno)) , v_tstrCipherOpened); |
| 2440 | SetValorDatMemoria('Configs.DT_HR_COLETA_FORCADA' ,stringreplace(stringreplace(stringreplace(g_oCacic.deCrypt(XML_RetornaValor('dt_hr_coleta_forcada' , strRetorno)),'-','',[rfReplaceAll]),' ','',[rfReplaceAll]),':','',[rfReplaceAll]), v_tstrCipherOpened); | 2441 | SetValorDatMemoria('Configs.DT_HR_COLETA_FORCADA' ,stringreplace(stringreplace(stringreplace(g_oCacic.deCrypt(XML_RetornaValor('dt_hr_coleta_forcada' , strRetorno)),'-','',[rfReplaceAll]),' ','',[rfReplaceAll]),':','',[rfReplaceAll]), v_tstrCipherOpened); |
| 2441 | SetValorDatMemoria('Configs.DT_HR_COLETA_FORCADA_ANVI' ,stringreplace(stringreplace(stringreplace(g_oCacic.deCrypt(XML_RetornaValor('dt_hr_coleta_forcada_anvi', strRetorno)),'-','',[rfReplaceAll]),' ','',[rfReplaceAll]),':','',[rfReplaceAll]), v_tstrCipherOpened); | 2442 | SetValorDatMemoria('Configs.DT_HR_COLETA_FORCADA_ANVI' ,stringreplace(stringreplace(stringreplace(g_oCacic.deCrypt(XML_RetornaValor('dt_hr_coleta_forcada_anvi', strRetorno)),'-','',[rfReplaceAll]),' ','',[rfReplaceAll]),':','',[rfReplaceAll]), v_tstrCipherOpened); |
ger_cols/ger_cols.res
No preview for this file type
ini_cols/ini_cols.res
No preview for this file type
main.dfm
| @@ -1374,30 +1374,53 @@ object FormularioGeral: TFormularioGeral | @@ -1374,30 +1374,53 @@ object FormularioGeral: TFormularioGeral | ||
| 1374 | Top = 86 | 1374 | Top = 86 |
| 1375 | object Mnu_LogAtividades: TMenuItem | 1375 | object Mnu_LogAtividades: TMenuItem |
| 1376 | Caption = 'Log de Atividades' | 1376 | Caption = 'Log de Atividades' |
| 1377 | + Hint = | ||
| 1378 | + 'Exibe as atividades desempenhadas pelos agentes do CACIC nesta d' + | ||
| 1379 | + 'ata.' | ||
| 1377 | OnClick = ExibirLogAtividades | 1380 | OnClick = ExibirLogAtividades |
| 1378 | end | 1381 | end |
| 1379 | object Mnu_Configuracoes: TMenuItem | 1382 | object Mnu_Configuracoes: TMenuItem |
| 1380 | Caption = 'Configura'#231#245'es' | 1383 | Caption = 'Configura'#231#245'es' |
| 1384 | + Hint = | ||
| 1385 | + 'Permite a reconfigura'#231#227'o de endere'#231'o do Servidor de Aplica'#231#227'o e ' + | ||
| 1386 | + 'Servidor de Atualiza'#231#245'es' | ||
| 1381 | OnClick = ExibirConfiguracoes | 1387 | OnClick = ExibirConfiguracoes |
| 1382 | end | 1388 | end |
| 1383 | object Mnu_ExecutarAgora: TMenuItem | 1389 | object Mnu_ExecutarAgora: TMenuItem |
| 1384 | Caption = 'Executar Agora' | 1390 | Caption = 'Executar Agora' |
| 1391 | + Hint = | ||
| 1392 | + 'Ordena ao Agente Principal que inicie as a'#231#245'es fora do intervalo' + | ||
| 1393 | + ' previamente configurado no m'#243'dulo Gerente WEB' | ||
| 1385 | OnClick = ExecutaCacic | 1394 | OnClick = ExecutaCacic |
| 1386 | end | 1395 | end |
| 1387 | object Mnu_InfosTCP: TMenuItem | 1396 | object Mnu_InfosTCP: TMenuItem |
| 1388 | Caption = 'Informa'#231#245'es Gerais' | 1397 | Caption = 'Informa'#231#245'es Gerais' |
| 1398 | + Hint = | ||
| 1399 | + 'Exibe um resumo de informa'#231#245'es relevantes coletadas neste comput' + | ||
| 1400 | + 'ador' | ||
| 1389 | OnClick = Mnu_InfosTCPClick | 1401 | OnClick = Mnu_InfosTCPClick |
| 1390 | end | 1402 | end |
| 1391 | object Mnu_InfosPatrimoniais: TMenuItem | 1403 | object Mnu_InfosPatrimoniais: TMenuItem |
| 1392 | Caption = 'Informa'#231#245'es &Patrimoniais' | 1404 | Caption = 'Informa'#231#245'es &Patrimoniais' |
| 1405 | + Hint = | ||
| 1406 | + 'Caso a op'#231#227'o de coleta autom'#225'tica esteja ativa no m'#243'dulo Gerente' + | ||
| 1407 | + ' WEB, esta op'#231#227'o executar'#225' o M'#243'dulo Coletor de Informa'#231#245'es Patri' + | ||
| 1408 | + 'moniais' | ||
| 1393 | OnClick = Mnu_InfosPatrimoniaisClick | 1409 | OnClick = Mnu_InfosPatrimoniaisClick |
| 1394 | end | 1410 | end |
| 1395 | object Mnu_SuporteRemoto: TMenuItem | 1411 | object Mnu_SuporteRemoto: TMenuItem |
| 1396 | - Caption = 'Ativar Suporte Remoto' | 1412 | + Caption = 'Ativar Suporte Remoto Seguro' |
| 1413 | + Hint = | ||
| 1414 | + 'Caso a op'#231#227'o de Suporte Remoto Seguro esteja ativa no m'#243'dulo Ger' + | ||
| 1415 | + 'ente WEB para esta subrede, esta op'#231#227'o executar'#225' o M'#243'dulo Servid' + | ||
| 1416 | + 'or de Suporte Remoto Seguro' | ||
| 1397 | OnClick = Mnu_SuporteRemotoClick | 1417 | OnClick = Mnu_SuporteRemotoClick |
| 1398 | end | 1418 | end |
| 1399 | object Mnu_FinalizarCacic: TMenuItem | 1419 | object Mnu_FinalizarCacic: TMenuItem |
| 1400 | Caption = 'Finalizar o CACIC' | 1420 | Caption = 'Finalizar o CACIC' |
| 1421 | + Hint = | ||
| 1422 | + 'Ordenar'#225' ao Agente Principal que auto-finalize-se. '#201' necess'#225'rio ' + | ||
| 1423 | + 'conhecer a senha configurada previamente no m'#243'dulo Gerente WEB.' | ||
| 1401 | OnClick = Sair | 1424 | OnClick = Sair |
| 1402 | end | 1425 | end |
| 1403 | end | 1426 | end |
main.pas
| @@ -441,21 +441,25 @@ end; | @@ -441,21 +441,25 @@ end; | ||
| 441 | 441 | ||
| 442 | 442 | ||
| 443 | function Pode_Coletar : boolean; | 443 | function Pode_Coletar : boolean; |
| 444 | -var v_JANELAS_EXCECAO, v_plural1, v_plural2 : string; | 444 | +var v_JANELAS_EXCECAO, |
| 445 | + v_plural1, | ||
| 446 | + v_plural2 : string; | ||
| 445 | tstrJANELAS : TStrings; | 447 | tstrJANELAS : TStrings; |
| 446 | h : hwnd; | 448 | h : hwnd; |
| 447 | v_contador, intContaJANELAS, intAux : integer; | 449 | v_contador, intContaJANELAS, intAux : integer; |
| 448 | Begin | 450 | Begin |
| 449 | - // Se eu conseguir matar o arquivo abaixo é porque Ger_Cols e Ini_Cols já finalizaram suas atividades... | 451 | + // Se eu conseguir matar os arquivos abaixo é porque srCACICsrv, Ger_Cols, Ini_Cols e mapaCACIC já finalizaram suas atividades... |
| 450 | FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_SRCACIC.txt'); | 452 | FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_SRCACIC.txt'); |
| 451 | FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_GER.txt'); | 453 | FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_GER.txt'); |
| 452 | FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_INI.txt'); | 454 | FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_INI.txt'); |
| 455 | + FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_MAPACACIC.txt'); | ||
| 453 | intContaJANELAS := 0; | 456 | intContaJANELAS := 0; |
| 454 | h := 0; | 457 | h := 0; |
| 455 | 458 | ||
| 456 | if (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_GER.txt') and | 459 | if (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_GER.txt') and |
| 457 | not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_SRCACIC.txt') and | 460 | not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_SRCACIC.txt') and |
| 458 | - not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_INI.txt')) then | 461 | + not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_INI.txt') and |
| 462 | + not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_MAPACACIC.txt')) then | ||
| 459 | Begin | 463 | Begin |
| 460 | FormularioGeral.CipherOpen; | 464 | FormularioGeral.CipherOpen; |
| 461 | // Verificação das janelas abertas para que não aconteça coletas caso haja aplicações pesadas rodando (configurado no Módulo Gerente) | 465 | // Verificação das janelas abertas para que não aconteça coletas caso haja aplicações pesadas rodando (configurado no Módulo Gerente) |
| @@ -509,19 +513,28 @@ Begin | @@ -509,19 +513,28 @@ Begin | ||
| 509 | (h = 0) and | 513 | (h = 0) and |
| 510 | (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_GER.txt')) and | 514 | (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_GER.txt')) and |
| 511 | (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_SRCACIC.txt')) and | 515 | (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_SRCACIC.txt')) and |
| 516 | + (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_MAPACACIC.txt')) and | ||
| 512 | (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_INI.txt')) then | 517 | (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_INI.txt')) then |
| 513 | Result := true | 518 | Result := true |
| 514 | else | 519 | else |
| 515 | Begin | 520 | Begin |
| 516 | FormularioGeral.log_DEBUG('Ação NEGADA!'); | 521 | FormularioGeral.log_DEBUG('Ação NEGADA!'); |
| 517 | if (intContaJANELAS=0) then | 522 | if (intContaJANELAS=0) then |
| 518 | - if (FileExists(g_oCacic.getCacicPath + 'temp\aguarde_SRCACIC.txt')) then | ||
| 519 | - FormularioGeral.log_DEBUG('Suporte Remoto em atividade.') | ||
| 520 | - else if (FileExists(g_oCacic.getCacicPath + 'temp\aguarde_GER.txt')) then | ||
| 521 | - FormularioGeral.log_DEBUG('Gerente de Coletas em atividade.') | ||
| 522 | - else if (FileExists(g_oCacic.getCacicPath + 'temp\aguarde_INI.txt')) then | ||
| 523 | - FormularioGeral.log_DEBUG('Inicializador de Coletas em atividade.') | ||
| 524 | - else FormularioGeral.CipherClose; | 523 | + Begin |
| 524 | + if (FileExists(g_oCacic.getCacicPath + 'temp\aguarde_SRCACIC.txt')) then | ||
| 525 | + FormularioGeral.log_DEBUG('Suporte Remoto em atividade.'); | ||
| 526 | + | ||
| 527 | + if (FileExists(g_oCacic.getCacicPath + 'temp\aguarde_GER.txt')) then | ||
| 528 | + FormularioGeral.log_DEBUG('Gerente de Coletas em atividade.'); | ||
| 529 | + | ||
| 530 | + if (FileExists(g_oCacic.getCacicPath + 'temp\aguarde_INI.txt')) then | ||
| 531 | + FormularioGeral.log_DEBUG('Inicializador de Coletas em atividade.'); | ||
| 532 | + | ||
| 533 | + if (FileExists(g_oCacic.getCacicPath + 'temp\aguarde_MAPACACIC.txt')) then | ||
| 534 | + FormularioGeral.log_DEBUG('Módulo Avulso para Coleta de Patrimônio em atividade.'); | ||
| 535 | + End | ||
| 536 | + else | ||
| 537 | + FormularioGeral.CipherClose; | ||
| 525 | Result := false; | 538 | Result := false; |
| 526 | End; | 539 | End; |
| 527 | 540 | ||
| @@ -822,7 +835,7 @@ Begin | @@ -822,7 +835,7 @@ Begin | ||
| 822 | 835 | ||
| 823 | log_diario('Acionando recuperador de Módulo Gerente de Coletas.'); | 836 | log_diario('Acionando recuperador de Módulo Gerente de Coletas.'); |
| 824 | log_DEBUG('Recuperador de Módulo Gerente de Coletas: '+g_oCacic.getWinDir + 'chksis.exe'); | 837 | log_DEBUG('Recuperador de Módulo Gerente de Coletas: '+g_oCacic.getWinDir + 'chksis.exe'); |
| 825 | - g_oCacic.createSampleProcess(g_oCacic.getWinDir + 'chksis.exe',false); | 838 | + g_oCacic.createSampleProcess(g_oCacic.getWinDir + 'chksis.exe',false,SW_HIDE); |
| 826 | 839 | ||
| 827 | sleep(30000); // 30 segundos de espera para download do ger_cols.exe | 840 | sleep(30000); // 30 segundos de espera para download do ger_cols.exe |
| 828 | v_Tamanho_Arquivo := Get_File_Size(g_oCacic.getCacicPath + 'modulos\ger_cols.exe',true); | 841 | v_Tamanho_Arquivo := Get_File_Size(g_oCacic.getCacicPath + 'modulos\ger_cols.exe',true); |
| @@ -1322,7 +1335,7 @@ begin | @@ -1322,7 +1335,7 @@ begin | ||
| 1322 | CipherClose; | 1335 | CipherClose; |
| 1323 | log_diario('Invocando Gerente de Coletas com ação: "'+p_acao+'"'); | 1336 | log_diario('Invocando Gerente de Coletas com ação: "'+p_acao+'"'); |
| 1324 | Timer_Nu_Exec_Apos.Enabled := False; | 1337 | Timer_Nu_Exec_Apos.Enabled := False; |
| 1325 | - g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\GER_COLS.EXE /'+p_acao+' /CacicPath='+g_oCacic.getCacicPath,false); | 1338 | + g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\GER_COLS.EXE /'+p_acao+' /CacicPath='+g_oCacic.getCacicPath,false,SW_HIDE); |
| 1326 | End | 1339 | End |
| 1327 | else | 1340 | else |
| 1328 | log_diario('Não foi possível invocar o Gerente de Coletas!'); | 1341 | log_diario('Não foi possível invocar o Gerente de Coletas!'); |
| @@ -1767,6 +1780,7 @@ var v_tripa_perfis, v_tripa_infos_coletadas,strAux : string; | @@ -1767,6 +1780,7 @@ var v_tripa_perfis, v_tripa_infos_coletadas,strAux : string; | ||
| 1767 | v_conta_perfis, v_conta_infos_coletadas, intAux : integer; | 1780 | v_conta_perfis, v_conta_infos_coletadas, intAux : integer; |
| 1768 | v_achei : boolean; | 1781 | v_achei : boolean; |
| 1769 | begin | 1782 | begin |
| 1783 | + Log_DEBUG('Montando Informações Gerais...'); | ||
| 1770 | FormularioGeral.Enabled := true; | 1784 | FormularioGeral.Enabled := true; |
| 1771 | FormularioGeral.Visible := true; | 1785 | FormularioGeral.Visible := true; |
| 1772 | 1786 | ||
| @@ -1794,6 +1808,7 @@ begin | @@ -1794,6 +1808,7 @@ begin | ||
| 1794 | begin | 1808 | begin |
| 1795 | 1809 | ||
| 1796 | v_tripa_perfis := getValorDatMemoria('Coletas.SIS' + trim(inttostr(v_conta_perfis)),v_tstrCipherOpened); | 1810 | v_tripa_perfis := getValorDatMemoria('Coletas.SIS' + trim(inttostr(v_conta_perfis)),v_tstrCipherOpened); |
| 1811 | + Log_DEBUG('Perfil => Coletas.SIS' + trim(inttostr(v_conta_perfis))+' => '+v_tripa_perfis); | ||
| 1797 | v_conta_perfis := v_conta_perfis + 1; | 1812 | v_conta_perfis := v_conta_perfis + 1; |
| 1798 | 1813 | ||
| 1799 | if (trim(v_tripa_perfis) <> '') then | 1814 | if (trim(v_tripa_perfis) <> '') then |
| @@ -1804,7 +1819,7 @@ begin | @@ -1804,7 +1819,7 @@ begin | ||
| 1804 | if (v_array_perfis.Count > 11) and (v_array_perfis[11]='S') then | 1819 | if (v_array_perfis.Count > 11) and (v_array_perfis[11]='S') then |
| 1805 | Begin | 1820 | Begin |
| 1806 | v_tripa_infos_coletadas := getValorDatMemoria('Coletas.Sistemas_Monitorados',v_tstrCipherOpened); | 1821 | v_tripa_infos_coletadas := getValorDatMemoria('Coletas.Sistemas_Monitorados',v_tstrCipherOpened); |
| 1807 | - | 1822 | + Log_DEBUG('Coletas de S.M. Efetuadas => ' + v_tripa_infos_coletadas); |
| 1808 | if (trim(v_tripa_infos_coletadas) <> '') then | 1823 | if (trim(v_tripa_infos_coletadas) <> '') then |
| 1809 | Begin | 1824 | Begin |
| 1810 | v_array_tripa_infos_coletadas := explode(v_tripa_infos_coletadas,'#'); | 1825 | v_array_tripa_infos_coletadas := explode(v_tripa_infos_coletadas,'#'); |
| @@ -1812,8 +1827,10 @@ begin | @@ -1812,8 +1827,10 @@ begin | ||
| 1812 | Begin | 1827 | Begin |
| 1813 | v_array_infos_coletadas := explode(v_array_tripa_infos_coletadas[intAux],','); | 1828 | v_array_infos_coletadas := explode(v_array_tripa_infos_coletadas[intAux],','); |
| 1814 | 1829 | ||
| 1830 | + Log_DEBUG('Verificando perfil[0]:' + v_array_perfis[0]); | ||
| 1815 | if (v_array_infos_coletadas[0]=v_array_perfis[0]) then | 1831 | if (v_array_infos_coletadas[0]=v_array_perfis[0]) then |
| 1816 | Begin | 1832 | Begin |
| 1833 | + Log_DEBUG('Verificando valores condicionais [1]:"'+trim(v_array_infos_coletadas[1])+'" e [3]:"'+trim(v_array_infos_coletadas[3])+'"'); | ||
| 1817 | if ((trim(v_array_infos_coletadas[1])<>'') and (trim(v_array_infos_coletadas[1])<>'?')) or | 1834 | if ((trim(v_array_infos_coletadas[1])<>'') and (trim(v_array_infos_coletadas[1])<>'?')) or |
| 1818 | ((trim(v_array_infos_coletadas[3])<>'') and (trim(v_array_infos_coletadas[3])<>'?')) then | 1835 | ((trim(v_array_infos_coletadas[3])<>'') and (trim(v_array_infos_coletadas[3])<>'?')) then |
| 1819 | Begin | 1836 | Begin |
| @@ -2170,17 +2187,20 @@ var boolAux : boolean; | @@ -2170,17 +2187,20 @@ var boolAux : boolean; | ||
| 2170 | v_strPalavraChave, | 2187 | v_strPalavraChave, |
| 2171 | v_strTeSO, | 2188 | v_strTeSO, |
| 2172 | v_strTeNodeAddress, | 2189 | v_strTeNodeAddress, |
| 2173 | - v_strNuPortaSR : String; | 2190 | + v_strNuPortaSR, |
| 2191 | + v_strNuTimeOutSR : String; | ||
| 2174 | fileAguarde : TextFile; | 2192 | fileAguarde : TextFile; |
| 2175 | begin | 2193 | begin |
| 2176 | if boolServerON then // Ordeno ao SrCACICsrv que auto-finalize | 2194 | if boolServerON then // Ordeno ao SrCACICsrv que auto-finalize |
| 2177 | Begin | 2195 | Begin |
| 2178 | Log_Diario('Desativando Suporte Remoto Seguro.'); | 2196 | Log_Diario('Desativando Suporte Remoto Seguro.'); |
| 2179 | - WinExec(PChar(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -kill'), SW_NORMAL); | 2197 | + |
| 2180 | { | 2198 | { |
| 2181 | - g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -kill',false); | 2199 | + WinExec(PChar(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -kill'), SW_NORMAL); |
| 2182 | } | 2200 | } |
| 2183 | 2201 | ||
| 2202 | + g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -kill',false,SW_HIDE); | ||
| 2203 | + | ||
| 2184 | boolServerON := false; | 2204 | boolServerON := false; |
| 2185 | End | 2205 | End |
| 2186 | else | 2206 | else |
| @@ -2207,6 +2227,7 @@ begin | @@ -2207,6 +2227,7 @@ begin | ||
| 2207 | v_strTeNodeAddress := StringReplace(v_strTeNodeAddress,'+','<MAIS>',[rfReplaceAll]); | 2227 | v_strTeNodeAddress := StringReplace(v_strTeNodeAddress,'+','<MAIS>',[rfReplaceAll]); |
| 2208 | 2228 | ||
| 2209 | v_strNuPortaSR := trim(FormularioGeral.getValorDatMemoria('Configs.NU_PORTA_SRCACIC' , v_tstrCipherOpened)); | 2229 | v_strNuPortaSR := trim(FormularioGeral.getValorDatMemoria('Configs.NU_PORTA_SRCACIC' , v_tstrCipherOpened)); |
| 2230 | + v_strNuTimeOutSR := trim(FormularioGeral.getValorDatMemoria('Configs.NU_TIMEOUT_SRCACIC' , v_tstrCipherOpened)); | ||
| 2210 | 2231 | ||
| 2211 | log_DEBUG('Invocando "'+g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' + | 2232 | log_DEBUG('Invocando "'+g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' + |
| 2212 | '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' + | 2233 | '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' + |
| @@ -2214,7 +2235,8 @@ begin | @@ -2214,7 +2235,8 @@ begin | ||
| 2214 | '[' + v_strTeNodeAddress + ']' + | 2235 | '[' + v_strTeNodeAddress + ']' + |
| 2215 | '[' + v_strPalavraChave + ']' + | 2236 | '[' + v_strPalavraChave + ']' + |
| 2216 | '[' + g_oCacic.getCacicPath + 'Temp\' + ']' + | 2237 | '[' + g_oCacic.getCacicPath + 'Temp\' + ']' + |
| 2217 | - '[' + v_strNuPortaSR + ']'); | 2238 | + '[' + v_strNuPortaSR + ']' + |
| 2239 | + '[' + v_strNuTimeOutSR + ']'); | ||
| 2218 | 2240 | ||
| 2219 | // Detectar versão do Windows antes de fazer a chamada seguinte... | 2241 | // Detectar versão do Windows antes de fazer a chamada seguinte... |
| 2220 | try | 2242 | try |
| @@ -2232,23 +2254,25 @@ begin | @@ -2232,23 +2254,25 @@ begin | ||
| 2232 | CloseFile(fileAguarde); | 2254 | CloseFile(fileAguarde); |
| 2233 | Finally | 2255 | Finally |
| 2234 | End; | 2256 | End; |
| 2235 | - WinExec(PChar(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' + | ||
| 2236 | - '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' + | ||
| 2237 | - '[' + v_strTeSO + ']' + | ||
| 2238 | - '[' + v_strTeNodeAddress + ']' + | ||
| 2239 | - '[' + v_strPalavraChave + ']' + | ||
| 2240 | - '[' + g_oCacic.getCacicPath + 'Temp\' + ']' + | ||
| 2241 | - '[' + v_strNuPortaSR + ']'),SW_NORMAL); | 2257 | + |
| 2242 | { | 2258 | { |
| 2259 | + WinExec(PChar(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' + | ||
| 2260 | + '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' + | ||
| 2261 | + '[' + v_strTeSO + ']' + | ||
| 2262 | + '[' + v_strTeNodeAddress + ']' + | ||
| 2263 | + '[' + v_strPalavraChave + ']' + | ||
| 2264 | + '[' + g_oCacic.getCacicPath + 'Temp\' + ']' + | ||
| 2265 | + '[' + v_strNuPortaSR + ']' + | ||
| 2266 | + '[' + v_strNuTimeOutSR + ']'),SW_NORMAL); | ||
| 2267 | + } | ||
| 2243 | g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' + | 2268 | g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' + |
| 2244 | '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' + | 2269 | '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' + |
| 2245 | '[' + v_strTeSO + ']' + | 2270 | '[' + v_strTeSO + ']' + |
| 2246 | '[' + v_strTeNodeAddress + ']' + | 2271 | '[' + v_strTeNodeAddress + ']' + |
| 2247 | '[' + v_strPalavraChave + ']' + | 2272 | '[' + v_strPalavraChave + ']' + |
| 2248 | '[' + g_oCacic.getCacicPath + 'Temp\' + ']' + | 2273 | '[' + g_oCacic.getCacicPath + 'Temp\' + ']' + |
| 2249 | - '[' + v_strNuPortaSR + ']',false); | ||
| 2250 | - } | ||
| 2251 | - | 2274 | + '[' + v_strNuPortaSR + ']' + |
| 2275 | + '[' + v_strNuTimeOutSR + ']',false,SW_NORMAL); | ||
| 2252 | 2276 | ||
| 2253 | BoolServerON := true; | 2277 | BoolServerON := true; |
| 2254 | End; | 2278 | End; |
mapa/main_mapa.pas
| @@ -51,6 +51,8 @@ var | @@ -51,6 +51,8 @@ var | ||
| 51 | var | 51 | var |
| 52 | intPausaPadrao : integer; | 52 | intPausaPadrao : integer; |
| 53 | 53 | ||
| 54 | +var v_Aguarde : TextFile; | ||
| 55 | + | ||
| 54 | var | 56 | var |
| 55 | boolDebugs : boolean; | 57 | boolDebugs : boolean; |
| 56 | 58 | ||
| @@ -1494,6 +1496,19 @@ begin | @@ -1494,6 +1496,19 @@ begin | ||
| 1494 | if not (v_strCacicPath = '') then | 1496 | if not (v_strCacicPath = '') then |
| 1495 | Begin | 1497 | Begin |
| 1496 | g_oCacic.setCacicPath(v_strCacicPath); | 1498 | g_oCacic.setCacicPath(v_strCacicPath); |
| 1499 | + | ||
| 1500 | + // A existência e bloqueio do arquivo abaixo evitará que o Cacic2.exe entre em ação | ||
| 1501 | + AssignFile(v_Aguarde,g_oCacic.getCacicPath + 'temp\aguarde_MAPACACIC.txt'); {Associa o arquivo a uma variável do tipo TextFile} | ||
| 1502 | + {$IOChecks off} | ||
| 1503 | + Reset(v_Aguarde); {Abre o arquivo texto} | ||
| 1504 | + {$IOChecks on} | ||
| 1505 | + if (IOResult <> 0) then // Arquivo não existe, será recriado. | ||
| 1506 | + Rewrite (v_Aguarde); | ||
| 1507 | + | ||
| 1508 | + Append(v_Aguarde); | ||
| 1509 | + Writeln(v_Aguarde,'Apenas um pseudo-cookie para o Cacic2 esperar o término de MapaCACIC'); | ||
| 1510 | + Append(v_Aguarde); | ||
| 1511 | + | ||
| 1497 | frmMapaCacic.tStringsCipherOpened := frmMapaCacic.CipherOpen(frmMapaCacic.g_oCacic.getCacicPath + frmMapaCacic.g_oCacic.getDatFileName); | 1512 | frmMapaCacic.tStringsCipherOpened := frmMapaCacic.CipherOpen(frmMapaCacic.g_oCacic.getCacicPath + frmMapaCacic.g_oCacic.getDatFileName); |
| 1498 | frmMapaCacic.lbNomeServidorWEB.Caption := 'Servidor: '+frmMapaCacic.GetValorDatMemoria('Configs.EnderecoServidor', frmMapaCacic.tStringsCipherOpened); | 1513 | frmMapaCacic.lbNomeServidorWEB.Caption := 'Servidor: '+frmMapaCacic.GetValorDatMemoria('Configs.EnderecoServidor', frmMapaCacic.tStringsCipherOpened); |
| 1499 | frmMapaCacic.lbMensagens.Caption := 'Entrada de Dados para Autenticação no Módulo Gerente WEB Cacic'; | 1514 | frmMapaCacic.lbMensagens.Caption := 'Entrada de Dados para Autenticação no Módulo Gerente WEB Cacic'; |
mapa/mapacacic.res
No preview for this file type
testacrypt/testacrypt.res
No preview for this file type