From 2964646d0cdb2e8d778bd684ed938685bb4b5c37 Mon Sep 17 00:00:00 2001 From: anderson.peterle@previdencia.gov.br Date: Wed, 29 Jul 2009 14:11:44 +0000 Subject: [PATCH] Agente-Windows: Adaptacao em CreateSampleProcess parametrizando o tipo de exibicao 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. --- CACIC_Library.pas | 12 +++++++----- cacic2.res | Bin 4916 -> 0 bytes cacicservice/CACICsvc.res | Bin 5332 -> 0 bytes cacicservice/CACICsvcMain.pas | 4 ++-- chkcacic/FormConfig.dfm | 10 +++++----- chkcacic/chkcacic.res | Bin 5192 -> 0 bytes chksis/chksis.res | Bin 5152 -> 0 bytes col_anvi/col_anvi.res | Bin 16328 -> 0 bytes col_comp/col_comp.res | Bin 16340 -> 0 bytes col_hard/col_hard.res | Bin 16324 -> 0 bytes col_moni/col_moni.res | Bin 16344 -> 0 bytes col_patr/col_patr.res | Bin 16328 -> 0 bytes col_soft/col_soft.res | Bin 16344 -> 0 bytes col_undi/col_undi.res | Bin 16344 -> 0 bytes ger_cols/ger_cols.dpr | 1 + ger_cols/ger_cols.res | Bin 4816 -> 0 bytes ini_cols/ini_cols.res | Bin 6744 -> 0 bytes main.dfm | 25 ++++++++++++++++++++++++- main.pas | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------- mapa/main_mapa.pas | 15 +++++++++++++++ mapa/mapacacic.res | Bin 5220 -> 0 bytes testacrypt/testacrypt.res | Bin 1664 -> 0 bytes 22 files changed, 105 insertions(+), 40 deletions(-) diff --git a/CACIC_Library.pas b/CACIC_Library.pas index 0617077..c9d9f52 100644 --- a/CACIC_Library.pas +++ b/CACIC_Library.pas @@ -102,7 +102,7 @@ type function getWinDir() : string; function getHomeDrive() : string; function isWindowsAdmin() : boolean; - function createSampleProcess(p_cmd: string; p_wait: boolean ) : boolean; + function createSampleProcess(p_cmd: string; p_wait: boolean; p_showWindow : word): boolean; procedure showTrayIcon(p_visible:boolean); end; @@ -641,10 +641,12 @@ end; Executa commandos, substitui o WinExec @autor: Marcos Dell Antonio - @param p_cmd Comando a ser executado - @param p_wait TRUE se deve aguardar término da excução, FALSE caso contrário + @adaptações: Anderson Peterle + @param p_cmd Comando a ser executado + @param p_wait TRUE se deve aguardar término da excução, FALSE caso contrário + @param p_showWindow Constante que define o tipo de exibição da janela do aplicativo -------------------------------------------------------------------------------} -function TCACIC_Windows.createSampleProcess(p_cmd: string; p_wait: boolean ): boolean; +function TCACIC_Windows.createSampleProcess(p_cmd: string; p_wait: boolean; p_showWindow : word): boolean; var SUInfo: TStartupInfo; ProcInfo: TProcessInformation; @@ -652,7 +654,7 @@ begin FillChar(SUInfo, SizeOf(SUInfo), #0); SUInfo.cb := SizeOf(SUInfo); SUInfo.dwFlags := STARTF_USESHOWWINDOW; - SUInfo.wShowWindow := SW_HIDE; + SUInfo.wShowWindow := p_showWindow; Result := CreateProcess(nil, PChar(p_cmd), diff --git a/cacic2.res b/cacic2.res index d06e924..225dea6 100755 Binary files a/cacic2.res and b/cacic2.res differ diff --git a/cacicservice/CACICsvc.res b/cacicservice/CACICsvc.res index 7bb0cee..d7c9b8f 100755 Binary files a/cacicservice/CACICsvc.res and b/cacicservice/CACICsvc.res differ diff --git a/cacicservice/CACICsvcMain.pas b/cacicservice/CACICsvcMain.pas index f6bc318..c3217b5 100755 --- a/cacicservice/CACICsvcMain.pas +++ b/cacicservice/CACICsvcMain.pas @@ -175,7 +175,7 @@ Begin // Executo o CHKsis, verificando a estrutura do sistema Try CACICservice.logDEBUG('TCACICservice.ExecutaCACIC : winExec => '+g_oCacic.getWinDir + 'chksis.exe'); - g_oCacic.createSampleProcess(g_oCacic.getWinDir + 'chksis.exe',false); + g_oCacic.createSampleProcess(g_oCacic.getWinDir + 'chksis.exe',false,SW_HIDE); Except End; @@ -185,7 +185,7 @@ Begin // Executo o Agente Principal do CACIC Try CACICservice.logDEBUG('TCACICservice.ExecutaCACIC : winExec => '+g_oCacic.getCacicPath + 'cacic2.exe'); - g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'cacic2.exe',false); + g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'cacic2.exe',false,SW_NORMAL); Except End; End; diff --git a/chkcacic/FormConfig.dfm b/chkcacic/FormConfig.dfm index b5e306e..5572756 100755 --- a/chkcacic/FormConfig.dfm +++ b/chkcacic/FormConfig.dfm @@ -32,9 +32,9 @@ object Configs: TConfigs object lbMensagemNaoAplicavel: TLabel Left = 265 Top = 25 - Width = 200 + Width = 192 Height = 13 - Caption = '(N'#227'o aplic'#225'vel ao ChkCacic do NetLogon)' + Caption = '(N'#227'o aplicar ao chkCACIC do NetLogon)' Font.Charset = DEFAULT_CHARSET Font.Color = clRed Font.Height = -11 @@ -155,7 +155,7 @@ object Configs: TConfigs end object Button_Gravar: TButton Left = 48 - Top = 325 + Top = 314 Width = 214 Height = 35 Caption = 'Concluir Instala'#231#227'o/Atualiza'#231#227'o' @@ -170,7 +170,7 @@ object Configs: TConfigs end object btSair: TButton Left = 291 - Top = 325 + Top = 314 Width = 150 Height = 35 Caption = 'Sair' @@ -185,7 +185,7 @@ object Configs: TConfigs end object pnVersao: TPanel Left = 426 - Top = 302 + Top = 354 Width = 58 Height = 14 BevelOuter = bvLowered diff --git a/chkcacic/chkcacic.res b/chkcacic/chkcacic.res index 6a6aed2..2f6ee43 100755 Binary files a/chkcacic/chkcacic.res and b/chkcacic/chkcacic.res differ diff --git a/chksis/chksis.res b/chksis/chksis.res index cc567c1..e937fa2 100755 Binary files a/chksis/chksis.res and b/chksis/chksis.res differ diff --git a/col_anvi/col_anvi.res b/col_anvi/col_anvi.res index 204a2bf..f226127 100755 Binary files a/col_anvi/col_anvi.res and b/col_anvi/col_anvi.res differ diff --git a/col_comp/col_comp.res b/col_comp/col_comp.res index 5929be9..72908f6 100755 Binary files a/col_comp/col_comp.res and b/col_comp/col_comp.res differ diff --git a/col_hard/col_hard.res b/col_hard/col_hard.res index bf6555b..012fc27 100755 Binary files a/col_hard/col_hard.res and b/col_hard/col_hard.res differ diff --git a/col_moni/col_moni.res b/col_moni/col_moni.res index 9ed1cdb..5583f54 100755 Binary files a/col_moni/col_moni.res and b/col_moni/col_moni.res differ diff --git a/col_patr/col_patr.res b/col_patr/col_patr.res index 517d043..e9b05ff 100755 Binary files a/col_patr/col_patr.res and b/col_patr/col_patr.res differ diff --git a/col_soft/col_soft.res b/col_soft/col_soft.res index 2eb9ba9..af7d70c 100755 Binary files a/col_soft/col_soft.res and b/col_soft/col_soft.res differ diff --git a/col_undi/col_undi.res b/col_undi/col_undi.res index e939358..a22b40a 100755 Binary files a/col_undi/col_undi.res and b/col_undi/col_undi.res differ diff --git a/ger_cols/ger_cols.dpr b/ger_cols/ger_cols.dpr index c332cc9..5ae8ca6 100755 --- a/ger_cols/ger_cols.dpr +++ b/ger_cols/ger_cols.dpr @@ -2436,6 +2436,7 @@ Begin SetValorDatMemoria('Configs.TE_JANELAS_EXCECAO' ,g_oCacic.deCrypt(XML_RetornaValor('te_janelas_excecao' , strRetorno)) , v_tstrCipherOpened); SetValorDatMemoria('TcpIp.TE_ENDERECOS_MAC_INVALIDOS' ,g_oCacic.deCrypt(XML_RetornaValor('te_enderecos_mac_invalidos' , strRetorno)) , v_tstrCipherOpened); SetValorDatMemoria('Configs.NU_PORTA_SRCACIC' ,g_oCacic.deCrypt(XML_RetornaValor('nu_porta_srcacic' , strRetorno)) , v_tstrCipherOpened); + SetValorDatMemoria('Configs.NU_TIMEOUT_SRCACIC' ,g_oCacic.deCrypt(XML_RetornaValor('nu_timeout_srcacic' , strRetorno)) , v_tstrCipherOpened); SetValorDatMemoria('Configs.CS_PERMITIR_DESATIVAR_SRCACIC' ,g_oCacic.deCrypt(XML_RetornaValor('cs_permitir_desativar_srcacic' , strRetorno)) , v_tstrCipherOpened); SetValorDatMemoria('Configs.DT_HR_COLETA_FORCADA' ,stringreplace(stringreplace(stringreplace(g_oCacic.deCrypt(XML_RetornaValor('dt_hr_coleta_forcada' , strRetorno)),'-','',[rfReplaceAll]),' ','',[rfReplaceAll]),':','',[rfReplaceAll]), v_tstrCipherOpened); 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); diff --git a/ger_cols/ger_cols.res b/ger_cols/ger_cols.res index 1392858..cf7fc05 100755 Binary files a/ger_cols/ger_cols.res and b/ger_cols/ger_cols.res differ diff --git a/ini_cols/ini_cols.res b/ini_cols/ini_cols.res index 4398f76..60e2ac0 100755 Binary files a/ini_cols/ini_cols.res and b/ini_cols/ini_cols.res differ diff --git a/main.dfm b/main.dfm index d7bf291..5f6f0d8 100755 --- a/main.dfm +++ b/main.dfm @@ -1374,30 +1374,53 @@ object FormularioGeral: TFormularioGeral Top = 86 object Mnu_LogAtividades: TMenuItem Caption = 'Log de Atividades' + Hint = + 'Exibe as atividades desempenhadas pelos agentes do CACIC nesta d' + + 'ata.' OnClick = ExibirLogAtividades end object Mnu_Configuracoes: TMenuItem Caption = 'Configura'#231#245'es' + Hint = + 'Permite a reconfigura'#231#227'o de endere'#231'o do Servidor de Aplica'#231#227'o e ' + + 'Servidor de Atualiza'#231#245'es' OnClick = ExibirConfiguracoes end object Mnu_ExecutarAgora: TMenuItem Caption = 'Executar Agora' + Hint = + 'Ordena ao Agente Principal que inicie as a'#231#245'es fora do intervalo' + + ' previamente configurado no m'#243'dulo Gerente WEB' OnClick = ExecutaCacic end object Mnu_InfosTCP: TMenuItem Caption = 'Informa'#231#245'es Gerais' + Hint = + 'Exibe um resumo de informa'#231#245'es relevantes coletadas neste comput' + + 'ador' OnClick = Mnu_InfosTCPClick end object Mnu_InfosPatrimoniais: TMenuItem Caption = 'Informa'#231#245'es &Patrimoniais' + Hint = + 'Caso a op'#231#227'o de coleta autom'#225'tica esteja ativa no m'#243'dulo Gerente' + + ' WEB, esta op'#231#227'o executar'#225' o M'#243'dulo Coletor de Informa'#231#245'es Patri' + + 'moniais' OnClick = Mnu_InfosPatrimoniaisClick end object Mnu_SuporteRemoto: TMenuItem - Caption = 'Ativar Suporte Remoto' + Caption = 'Ativar Suporte Remoto Seguro' + Hint = + 'Caso a op'#231#227'o de Suporte Remoto Seguro esteja ativa no m'#243'dulo Ger' + + 'ente WEB para esta subrede, esta op'#231#227'o executar'#225' o M'#243'dulo Servid' + + 'or de Suporte Remoto Seguro' OnClick = Mnu_SuporteRemotoClick end object Mnu_FinalizarCacic: TMenuItem Caption = 'Finalizar o CACIC' + Hint = + 'Ordenar'#225' ao Agente Principal que auto-finalize-se. '#201' necess'#225'rio ' + + 'conhecer a senha configurada previamente no m'#243'dulo Gerente WEB.' OnClick = Sair end end diff --git a/main.pas b/main.pas index af5fb3c..7ebca3f 100755 --- a/main.pas +++ b/main.pas @@ -441,21 +441,25 @@ end; function Pode_Coletar : boolean; -var v_JANELAS_EXCECAO, v_plural1, v_plural2 : string; +var v_JANELAS_EXCECAO, + v_plural1, + v_plural2 : string; tstrJANELAS : TStrings; h : hwnd; v_contador, intContaJANELAS, intAux : integer; Begin - // Se eu conseguir matar o arquivo abaixo é porque Ger_Cols e Ini_Cols já finalizaram suas atividades... + // Se eu conseguir matar os arquivos abaixo é porque srCACICsrv, Ger_Cols, Ini_Cols e mapaCACIC já finalizaram suas atividades... FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_SRCACIC.txt'); FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_GER.txt'); FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_INI.txt'); + FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_MAPACACIC.txt'); intContaJANELAS := 0; h := 0; if (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_GER.txt') and not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_SRCACIC.txt') and - not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_INI.txt')) then + not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_INI.txt') and + not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_MAPACACIC.txt')) then Begin FormularioGeral.CipherOpen; // 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 (h = 0) and (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_GER.txt')) and (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_SRCACIC.txt')) and + (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_MAPACACIC.txt')) and (not FileExists(g_oCacic.getCacicPath + 'temp\aguarde_INI.txt')) then Result := true else Begin FormularioGeral.log_DEBUG('Ação NEGADA!'); if (intContaJANELAS=0) then - if (FileExists(g_oCacic.getCacicPath + 'temp\aguarde_SRCACIC.txt')) then - FormularioGeral.log_DEBUG('Suporte Remoto em atividade.') - else if (FileExists(g_oCacic.getCacicPath + 'temp\aguarde_GER.txt')) then - FormularioGeral.log_DEBUG('Gerente de Coletas em atividade.') - else if (FileExists(g_oCacic.getCacicPath + 'temp\aguarde_INI.txt')) then - FormularioGeral.log_DEBUG('Inicializador de Coletas em atividade.') - else FormularioGeral.CipherClose; + Begin + if (FileExists(g_oCacic.getCacicPath + 'temp\aguarde_SRCACIC.txt')) then + FormularioGeral.log_DEBUG('Suporte Remoto em atividade.'); + + if (FileExists(g_oCacic.getCacicPath + 'temp\aguarde_GER.txt')) then + FormularioGeral.log_DEBUG('Gerente de Coletas em atividade.'); + + if (FileExists(g_oCacic.getCacicPath + 'temp\aguarde_INI.txt')) then + FormularioGeral.log_DEBUG('Inicializador de Coletas em atividade.'); + + if (FileExists(g_oCacic.getCacicPath + 'temp\aguarde_MAPACACIC.txt')) then + FormularioGeral.log_DEBUG('Módulo Avulso para Coleta de Patrimônio em atividade.'); + End + else + FormularioGeral.CipherClose; Result := false; End; @@ -822,7 +835,7 @@ Begin log_diario('Acionando recuperador de Módulo Gerente de Coletas.'); log_DEBUG('Recuperador de Módulo Gerente de Coletas: '+g_oCacic.getWinDir + 'chksis.exe'); - g_oCacic.createSampleProcess(g_oCacic.getWinDir + 'chksis.exe',false); + g_oCacic.createSampleProcess(g_oCacic.getWinDir + 'chksis.exe',false,SW_HIDE); sleep(30000); // 30 segundos de espera para download do ger_cols.exe v_Tamanho_Arquivo := Get_File_Size(g_oCacic.getCacicPath + 'modulos\ger_cols.exe',true); @@ -1322,7 +1335,7 @@ begin CipherClose; log_diario('Invocando Gerente de Coletas com ação: "'+p_acao+'"'); Timer_Nu_Exec_Apos.Enabled := False; - g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\GER_COLS.EXE /'+p_acao+' /CacicPath='+g_oCacic.getCacicPath,false); + g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\GER_COLS.EXE /'+p_acao+' /CacicPath='+g_oCacic.getCacicPath,false,SW_HIDE); End else 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; v_conta_perfis, v_conta_infos_coletadas, intAux : integer; v_achei : boolean; begin + Log_DEBUG('Montando Informações Gerais...'); FormularioGeral.Enabled := true; FormularioGeral.Visible := true; @@ -1794,6 +1808,7 @@ begin begin v_tripa_perfis := getValorDatMemoria('Coletas.SIS' + trim(inttostr(v_conta_perfis)),v_tstrCipherOpened); + Log_DEBUG('Perfil => Coletas.SIS' + trim(inttostr(v_conta_perfis))+' => '+v_tripa_perfis); v_conta_perfis := v_conta_perfis + 1; if (trim(v_tripa_perfis) <> '') then @@ -1804,7 +1819,7 @@ begin if (v_array_perfis.Count > 11) and (v_array_perfis[11]='S') then Begin v_tripa_infos_coletadas := getValorDatMemoria('Coletas.Sistemas_Monitorados',v_tstrCipherOpened); - + Log_DEBUG('Coletas de S.M. Efetuadas => ' + v_tripa_infos_coletadas); if (trim(v_tripa_infos_coletadas) <> '') then Begin v_array_tripa_infos_coletadas := explode(v_tripa_infos_coletadas,'#'); @@ -1812,8 +1827,10 @@ begin Begin v_array_infos_coletadas := explode(v_array_tripa_infos_coletadas[intAux],','); + Log_DEBUG('Verificando perfil[0]:' + v_array_perfis[0]); if (v_array_infos_coletadas[0]=v_array_perfis[0]) then Begin + Log_DEBUG('Verificando valores condicionais [1]:"'+trim(v_array_infos_coletadas[1])+'" e [3]:"'+trim(v_array_infos_coletadas[3])+'"'); if ((trim(v_array_infos_coletadas[1])<>'') and (trim(v_array_infos_coletadas[1])<>'?')) or ((trim(v_array_infos_coletadas[3])<>'') and (trim(v_array_infos_coletadas[3])<>'?')) then Begin @@ -2170,17 +2187,20 @@ var boolAux : boolean; v_strPalavraChave, v_strTeSO, v_strTeNodeAddress, - v_strNuPortaSR : String; + v_strNuPortaSR, + v_strNuTimeOutSR : String; fileAguarde : TextFile; begin if boolServerON then // Ordeno ao SrCACICsrv que auto-finalize Begin Log_Diario('Desativando Suporte Remoto Seguro.'); - WinExec(PChar(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -kill'), SW_NORMAL); + { - g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -kill',false); + WinExec(PChar(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -kill'), SW_NORMAL); } + g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -kill',false,SW_HIDE); + boolServerON := false; End else @@ -2207,6 +2227,7 @@ begin v_strTeNodeAddress := StringReplace(v_strTeNodeAddress,'+','',[rfReplaceAll]); v_strNuPortaSR := trim(FormularioGeral.getValorDatMemoria('Configs.NU_PORTA_SRCACIC' , v_tstrCipherOpened)); + v_strNuTimeOutSR := trim(FormularioGeral.getValorDatMemoria('Configs.NU_TIMEOUT_SRCACIC' , v_tstrCipherOpened)); log_DEBUG('Invocando "'+g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' + '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' + @@ -2214,7 +2235,8 @@ begin '[' + v_strTeNodeAddress + ']' + '[' + v_strPalavraChave + ']' + '[' + g_oCacic.getCacicPath + 'Temp\' + ']' + - '[' + v_strNuPortaSR + ']'); + '[' + v_strNuPortaSR + ']' + + '[' + v_strNuTimeOutSR + ']'); // Detectar versão do Windows antes de fazer a chamada seguinte... try @@ -2232,23 +2254,25 @@ begin CloseFile(fileAguarde); Finally End; - WinExec(PChar(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' + - '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' + - '[' + v_strTeSO + ']' + - '[' + v_strTeNodeAddress + ']' + - '[' + v_strPalavraChave + ']' + - '[' + g_oCacic.getCacicPath + 'Temp\' + ']' + - '[' + v_strNuPortaSR + ']'),SW_NORMAL); + { + WinExec(PChar(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' + + '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' + + '[' + v_strTeSO + ']' + + '[' + v_strTeNodeAddress + ']' + + '[' + v_strPalavraChave + ']' + + '[' + g_oCacic.getCacicPath + 'Temp\' + ']' + + '[' + v_strNuPortaSR + ']' + + '[' + v_strNuTimeOutSR + ']'),SW_NORMAL); + } g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' + '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' + '[' + v_strTeSO + ']' + '[' + v_strTeNodeAddress + ']' + '[' + v_strPalavraChave + ']' + '[' + g_oCacic.getCacicPath + 'Temp\' + ']' + - '[' + v_strNuPortaSR + ']',false); - } - + '[' + v_strNuPortaSR + ']' + + '[' + v_strNuTimeOutSR + ']',false,SW_NORMAL); BoolServerON := true; End; diff --git a/mapa/main_mapa.pas b/mapa/main_mapa.pas index 0d391f0..5af412b 100755 --- a/mapa/main_mapa.pas +++ b/mapa/main_mapa.pas @@ -51,6 +51,8 @@ var var intPausaPadrao : integer; +var v_Aguarde : TextFile; + var boolDebugs : boolean; @@ -1494,6 +1496,19 @@ begin if not (v_strCacicPath = '') then Begin g_oCacic.setCacicPath(v_strCacicPath); + + // A existência e bloqueio do arquivo abaixo evitará que o Cacic2.exe entre em ação + AssignFile(v_Aguarde,g_oCacic.getCacicPath + 'temp\aguarde_MAPACACIC.txt'); {Associa o arquivo a uma variável do tipo TextFile} + {$IOChecks off} + Reset(v_Aguarde); {Abre o arquivo texto} + {$IOChecks on} + if (IOResult <> 0) then // Arquivo não existe, será recriado. + Rewrite (v_Aguarde); + + Append(v_Aguarde); + Writeln(v_Aguarde,'Apenas um pseudo-cookie para o Cacic2 esperar o término de MapaCACIC'); + Append(v_Aguarde); + frmMapaCacic.tStringsCipherOpened := frmMapaCacic.CipherOpen(frmMapaCacic.g_oCacic.getCacicPath + frmMapaCacic.g_oCacic.getDatFileName); frmMapaCacic.lbNomeServidorWEB.Caption := 'Servidor: '+frmMapaCacic.GetValorDatMemoria('Configs.EnderecoServidor', frmMapaCacic.tStringsCipherOpened); frmMapaCacic.lbMensagens.Caption := 'Entrada de Dados para Autenticação no Módulo Gerente WEB Cacic'; diff --git a/mapa/mapacacic.res b/mapa/mapacacic.res index f04f7cf..cfd4ff1 100755 Binary files a/mapa/mapacacic.res and b/mapa/mapacacic.res differ diff --git a/testacrypt/testacrypt.res b/testacrypt/testacrypt.res index 20a6172..605a6a1 100755 Binary files a/testacrypt/testacrypt.res and b/testacrypt/testacrypt.res differ -- libgit2 0.21.2