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 | 102 | function getWinDir() : string; |
| 103 | 103 | function getHomeDrive() : string; |
| 104 | 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 | 106 | procedure showTrayIcon(p_visible:boolean); |
| 107 | 107 | end; |
| 108 | 108 | |
| ... | ... | @@ -641,10 +641,12 @@ end; |
| 641 | 641 | Executa commandos, substitui o WinExec |
| 642 | 642 | |
| 643 | 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 | 650 | var |
| 649 | 651 | SUInfo: TStartupInfo; |
| 650 | 652 | ProcInfo: TProcessInformation; |
| ... | ... | @@ -652,7 +654,7 @@ begin |
| 652 | 654 | FillChar(SUInfo, SizeOf(SUInfo), #0); |
| 653 | 655 | SUInfo.cb := SizeOf(SUInfo); |
| 654 | 656 | SUInfo.dwFlags := STARTF_USESHOWWINDOW; |
| 655 | - SUInfo.wShowWindow := SW_HIDE; | |
| 657 | + SUInfo.wShowWindow := p_showWindow; | |
| 656 | 658 | |
| 657 | 659 | Result := CreateProcess(nil, |
| 658 | 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 | 175 | // Executo o CHKsis, verificando a estrutura do sistema |
| 176 | 176 | Try |
| 177 | 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 | 179 | Except |
| 180 | 180 | End; |
| 181 | 181 | |
| ... | ... | @@ -185,7 +185,7 @@ Begin |
| 185 | 185 | // Executo o Agente Principal do CACIC |
| 186 | 186 | Try |
| 187 | 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 | 189 | Except |
| 190 | 190 | End; |
| 191 | 191 | End; | ... | ... |
chkcacic/FormConfig.dfm
| ... | ... | @@ -32,9 +32,9 @@ object Configs: TConfigs |
| 32 | 32 | object lbMensagemNaoAplicavel: TLabel |
| 33 | 33 | Left = 265 |
| 34 | 34 | Top = 25 |
| 35 | - Width = 200 | |
| 35 | + Width = 192 | |
| 36 | 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 | 38 | Font.Charset = DEFAULT_CHARSET |
| 39 | 39 | Font.Color = clRed |
| 40 | 40 | Font.Height = -11 |
| ... | ... | @@ -155,7 +155,7 @@ object Configs: TConfigs |
| 155 | 155 | end |
| 156 | 156 | object Button_Gravar: TButton |
| 157 | 157 | Left = 48 |
| 158 | - Top = 325 | |
| 158 | + Top = 314 | |
| 159 | 159 | Width = 214 |
| 160 | 160 | Height = 35 |
| 161 | 161 | Caption = 'Concluir Instala'#231#227'o/Atualiza'#231#227'o' |
| ... | ... | @@ -170,7 +170,7 @@ object Configs: TConfigs |
| 170 | 170 | end |
| 171 | 171 | object btSair: TButton |
| 172 | 172 | Left = 291 |
| 173 | - Top = 325 | |
| 173 | + Top = 314 | |
| 174 | 174 | Width = 150 |
| 175 | 175 | Height = 35 |
| 176 | 176 | Caption = 'Sair' |
| ... | ... | @@ -185,7 +185,7 @@ object Configs: TConfigs |
| 185 | 185 | end |
| 186 | 186 | object pnVersao: TPanel |
| 187 | 187 | Left = 426 |
| 188 | - Top = 302 | |
| 188 | + Top = 354 | |
| 189 | 189 | Width = 58 |
| 190 | 190 | Height = 14 |
| 191 | 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 | 2436 | SetValorDatMemoria('Configs.TE_JANELAS_EXCECAO' ,g_oCacic.deCrypt(XML_RetornaValor('te_janelas_excecao' , strRetorno)) , v_tstrCipherOpened); |
| 2437 | 2437 | SetValorDatMemoria('TcpIp.TE_ENDERECOS_MAC_INVALIDOS' ,g_oCacic.deCrypt(XML_RetornaValor('te_enderecos_mac_invalidos' , strRetorno)) , v_tstrCipherOpened); |
| 2438 | 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 | 2440 | SetValorDatMemoria('Configs.CS_PERMITIR_DESATIVAR_SRCACIC' ,g_oCacic.deCrypt(XML_RetornaValor('cs_permitir_desativar_srcacic' , strRetorno)) , v_tstrCipherOpened); |
| 2440 | 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 | 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 | 1374 | Top = 86 |
| 1375 | 1375 | object Mnu_LogAtividades: TMenuItem |
| 1376 | 1376 | Caption = 'Log de Atividades' |
| 1377 | + Hint = | |
| 1378 | + 'Exibe as atividades desempenhadas pelos agentes do CACIC nesta d' + | |
| 1379 | + 'ata.' | |
| 1377 | 1380 | OnClick = ExibirLogAtividades |
| 1378 | 1381 | end |
| 1379 | 1382 | object Mnu_Configuracoes: TMenuItem |
| 1380 | 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 | 1387 | OnClick = ExibirConfiguracoes |
| 1382 | 1388 | end |
| 1383 | 1389 | object Mnu_ExecutarAgora: TMenuItem |
| 1384 | 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 | 1394 | OnClick = ExecutaCacic |
| 1386 | 1395 | end |
| 1387 | 1396 | object Mnu_InfosTCP: TMenuItem |
| 1388 | 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 | 1401 | OnClick = Mnu_InfosTCPClick |
| 1390 | 1402 | end |
| 1391 | 1403 | object Mnu_InfosPatrimoniais: TMenuItem |
| 1392 | 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 | 1409 | OnClick = Mnu_InfosPatrimoniaisClick |
| 1394 | 1410 | end |
| 1395 | 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 | 1417 | OnClick = Mnu_SuporteRemotoClick |
| 1398 | 1418 | end |
| 1399 | 1419 | object Mnu_FinalizarCacic: TMenuItem |
| 1400 | 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 | 1424 | OnClick = Sair |
| 1402 | 1425 | end |
| 1403 | 1426 | end | ... | ... |
main.pas
| ... | ... | @@ -441,21 +441,25 @@ end; |
| 441 | 441 | |
| 442 | 442 | |
| 443 | 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 | 447 | tstrJANELAS : TStrings; |
| 446 | 448 | h : hwnd; |
| 447 | 449 | v_contador, intContaJANELAS, intAux : integer; |
| 448 | 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 | 452 | FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_SRCACIC.txt'); |
| 451 | 453 | FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_GER.txt'); |
| 452 | 454 | FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_INI.txt'); |
| 455 | + FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_MAPACACIC.txt'); | |
| 453 | 456 | intContaJANELAS := 0; |
| 454 | 457 | h := 0; |
| 455 | 458 | |
| 456 | 459 | if (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_GER.txt') and |
| 457 | 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 | 463 | Begin |
| 460 | 464 | FormularioGeral.CipherOpen; |
| 461 | 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 | 513 | (h = 0) and |
| 510 | 514 | (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_GER.txt')) and |
| 511 | 515 | (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_SRCACIC.txt')) and |
| 516 | + (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_MAPACACIC.txt')) and | |
| 512 | 517 | (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_INI.txt')) then |
| 513 | 518 | Result := true |
| 514 | 519 | else |
| 515 | 520 | Begin |
| 516 | 521 | FormularioGeral.log_DEBUG('Ação NEGADA!'); |
| 517 | 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 | 538 | Result := false; |
| 526 | 539 | End; |
| 527 | 540 | |
| ... | ... | @@ -822,7 +835,7 @@ Begin |
| 822 | 835 | |
| 823 | 836 | log_diario('Acionando recuperador de Módulo Gerente de Coletas.'); |
| 824 | 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 | 840 | sleep(30000); // 30 segundos de espera para download do ger_cols.exe |
| 828 | 841 | v_Tamanho_Arquivo := Get_File_Size(g_oCacic.getCacicPath + 'modulos\ger_cols.exe',true); |
| ... | ... | @@ -1322,7 +1335,7 @@ begin |
| 1322 | 1335 | CipherClose; |
| 1323 | 1336 | log_diario('Invocando Gerente de Coletas com ação: "'+p_acao+'"'); |
| 1324 | 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 | 1339 | End |
| 1327 | 1340 | else |
| 1328 | 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 | 1780 | v_conta_perfis, v_conta_infos_coletadas, intAux : integer; |
| 1768 | 1781 | v_achei : boolean; |
| 1769 | 1782 | begin |
| 1783 | + Log_DEBUG('Montando Informações Gerais...'); | |
| 1770 | 1784 | FormularioGeral.Enabled := true; |
| 1771 | 1785 | FormularioGeral.Visible := true; |
| 1772 | 1786 | |
| ... | ... | @@ -1794,6 +1808,7 @@ begin |
| 1794 | 1808 | begin |
| 1795 | 1809 | |
| 1796 | 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 | 1812 | v_conta_perfis := v_conta_perfis + 1; |
| 1798 | 1813 | |
| 1799 | 1814 | if (trim(v_tripa_perfis) <> '') then |
| ... | ... | @@ -1804,7 +1819,7 @@ begin |
| 1804 | 1819 | if (v_array_perfis.Count > 11) and (v_array_perfis[11]='S') then |
| 1805 | 1820 | Begin |
| 1806 | 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 | 1823 | if (trim(v_tripa_infos_coletadas) <> '') then |
| 1809 | 1824 | Begin |
| 1810 | 1825 | v_array_tripa_infos_coletadas := explode(v_tripa_infos_coletadas,'#'); |
| ... | ... | @@ -1812,8 +1827,10 @@ begin |
| 1812 | 1827 | Begin |
| 1813 | 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 | 1831 | if (v_array_infos_coletadas[0]=v_array_perfis[0]) then |
| 1816 | 1832 | Begin |
| 1833 | + Log_DEBUG('Verificando valores condicionais [1]:"'+trim(v_array_infos_coletadas[1])+'" e [3]:"'+trim(v_array_infos_coletadas[3])+'"'); | |
| 1817 | 1834 | if ((trim(v_array_infos_coletadas[1])<>'') and (trim(v_array_infos_coletadas[1])<>'?')) or |
| 1818 | 1835 | ((trim(v_array_infos_coletadas[3])<>'') and (trim(v_array_infos_coletadas[3])<>'?')) then |
| 1819 | 1836 | Begin |
| ... | ... | @@ -2170,17 +2187,20 @@ var boolAux : boolean; |
| 2170 | 2187 | v_strPalavraChave, |
| 2171 | 2188 | v_strTeSO, |
| 2172 | 2189 | v_strTeNodeAddress, |
| 2173 | - v_strNuPortaSR : String; | |
| 2190 | + v_strNuPortaSR, | |
| 2191 | + v_strNuTimeOutSR : String; | |
| 2174 | 2192 | fileAguarde : TextFile; |
| 2175 | 2193 | begin |
| 2176 | 2194 | if boolServerON then // Ordeno ao SrCACICsrv que auto-finalize |
| 2177 | 2195 | Begin |
| 2178 | 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 | 2204 | boolServerON := false; |
| 2185 | 2205 | End |
| 2186 | 2206 | else |
| ... | ... | @@ -2207,6 +2227,7 @@ begin |
| 2207 | 2227 | v_strTeNodeAddress := StringReplace(v_strTeNodeAddress,'+','<MAIS>',[rfReplaceAll]); |
| 2208 | 2228 | |
| 2209 | 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 | 2232 | log_DEBUG('Invocando "'+g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' + |
| 2212 | 2233 | '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' + |
| ... | ... | @@ -2214,7 +2235,8 @@ begin |
| 2214 | 2235 | '[' + v_strTeNodeAddress + ']' + |
| 2215 | 2236 | '[' + v_strPalavraChave + ']' + |
| 2216 | 2237 | '[' + g_oCacic.getCacicPath + 'Temp\' + ']' + |
| 2217 | - '[' + v_strNuPortaSR + ']'); | |
| 2238 | + '[' + v_strNuPortaSR + ']' + | |
| 2239 | + '[' + v_strNuTimeOutSR + ']'); | |
| 2218 | 2240 | |
| 2219 | 2241 | // Detectar versão do Windows antes de fazer a chamada seguinte... |
| 2220 | 2242 | try |
| ... | ... | @@ -2232,23 +2254,25 @@ begin |
| 2232 | 2254 | CloseFile(fileAguarde); |
| 2233 | 2255 | Finally |
| 2234 | 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 | 2268 | g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' + |
| 2244 | 2269 | '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' + |
| 2245 | 2270 | '[' + v_strTeSO + ']' + |
| 2246 | 2271 | '[' + v_strTeNodeAddress + ']' + |
| 2247 | 2272 | '[' + v_strPalavraChave + ']' + |
| 2248 | 2273 | '[' + g_oCacic.getCacicPath + 'Temp\' + ']' + |
| 2249 | - '[' + v_strNuPortaSR + ']',false); | |
| 2250 | - } | |
| 2251 | - | |
| 2274 | + '[' + v_strNuPortaSR + ']' + | |
| 2275 | + '[' + v_strNuTimeOutSR + ']',false,SW_NORMAL); | |
| 2252 | 2276 | |
| 2253 | 2277 | BoolServerON := true; |
| 2254 | 2278 | End; | ... | ... |
mapa/main_mapa.pas
| ... | ... | @@ -51,6 +51,8 @@ var |
| 51 | 51 | var |
| 52 | 52 | intPausaPadrao : integer; |
| 53 | 53 | |
| 54 | +var v_Aguarde : TextFile; | |
| 55 | + | |
| 54 | 56 | var |
| 55 | 57 | boolDebugs : boolean; |
| 56 | 58 | |
| ... | ... | @@ -1494,6 +1496,19 @@ begin |
| 1494 | 1496 | if not (v_strCacicPath = '') then |
| 1495 | 1497 | Begin |
| 1496 | 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 | 1512 | frmMapaCacic.tStringsCipherOpened := frmMapaCacic.CipherOpen(frmMapaCacic.g_oCacic.getCacicPath + frmMapaCacic.g_oCacic.getDatFileName); |
| 1498 | 1513 | frmMapaCacic.lbNomeServidorWEB.Caption := 'Servidor: '+frmMapaCacic.GetValorDatMemoria('Configs.EnderecoServidor', frmMapaCacic.tStringsCipherOpened); |
| 1499 | 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