Commit c9d7fbbb04df5db2bbc545b5d9633175e659abc9

Authored by Eric Menezes Noronha
2 parents 54442317 f6856e6c
Exists in master

Merge branch 'master' of https://github.com/lightbase/agente-windows

Conflicts:
	main.pas
Showing 1 changed file with 235 additions and 234 deletions   Show diff stats
1 (** 1 (**
2 --------------------------------------------------------------------------------------------------------------------------------------------------------------- 2 ---------------------------------------------------------------------------------------------------------------------------------------------------------------
3 -Copyright 2000, 2001, 2002, 2003, 2004, 2005 Dataprev - Empresa de Tecnologia e Informações da Previdência Social, Brasil 3 +Copyright 2000, 2001, 2002, 2003, 2004, 2005 Dataprev - Empresa de Tecnologia e Informa��es da Previd�ncia Social, Brasil
4 4
5 -Este arquivo é parte do programa CACIC - Configurador Automático e Coletor de Informações Computacionais 5 +Este arquivo � parte do programa CACIC - Configurador Autom�tico e Coletor de Informa��es Computacionais
6 6
7 -O CACIC é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como  
8 -publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença, ou (na sua opinião) qualquer versão. 7 +O CACIC � um software livre; voc� pode redistribui-lo e/ou modifica-lo dentro dos termos da Licen�a P�blica Geral GNU como
  8 +publicada pela Funda��o do Software Livre (FSF); na vers�o 2 da Licen�a, ou (na sua opini�o) qualquer vers�o.
9 9
10 -Este programa é distribuido na esperança que possa ser util, mas SEM NENHUMA GARANTIA; sem uma garantia implicita de ADEQUAÇÂO a qualquer  
11 -MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes. 10 +Este programa � distribuido na esperan�a que possa ser util, mas SEM NENHUMA GARANTIA; sem uma garantia implicita de ADEQUA��O a qualquer
  11 +MERCADO ou APLICA��O EM PARTICULAR. Veja a Licen�a P�blica Geral GNU para maiores detalhes.
12 12
13 -Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título "LICENCA.txt", junto com este programa, se não, escreva para a Fundação do Software 13 +Voc� deve ter recebido uma c�pia da Licen�a P�blica Geral GNU, sob o t�tulo "LICENCA.txt", junto com este programa, se n�o, escreva para a Funda��o do Software
14 Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15 --------------------------------------------------------------------------------------------------------------------------------------------------------------- 15 ---------------------------------------------------------------------------------------------------------------------------------------------------------------
16 *) 16 *)
@@ -53,13 +53,13 @@ const @@ -53,13 +53,13 @@ const
53 GBYTE = MBYTE shl 10; 53 GBYTE = MBYTE shl 10;
54 NORMAL = 0; // Normal 54 NORMAL = 0; // Normal
55 COLETANDO = 1; // Raio - Coletando 55 COLETANDO = 1; // Raio - Coletando
56 - DESCONFIGURADO = 2; // Interrogação - Identificando Host 56 + DESCONFIGURADO = 2; // Interroga��o - Identificando Host
57 EM_SUPORTE = 3; // Telefone - Em Suporte Remoto 57 EM_SUPORTE = 3; // Telefone - Em Suporte Remoto
58 - LEFT_MENU_ITEM = 13; // Coordenada X para escrita das opções do menu de contexto 58 + LEFT_MENU_ITEM = 13; // Coordenada X para escrita das op��es do menu de contexto
59 59
60 60
61 61
62 -// Declaração das variáveis globais. 62 +// Declara��o das vari�veis globais.
63 var strConfigsPatrimonio, 63 var strConfigsPatrimonio,
64 strMenuCaptionLAT, 64 strMenuCaptionLAT,
65 strMenuCaptionCON, 65 strMenuCaptionCON,
@@ -280,7 +280,7 @@ type @@ -280,7 +280,7 @@ type
280 procedure Invoca_MapaCacic; 280 procedure Invoca_MapaCacic;
281 procedure CheckIfDownloadedVersion; 281 procedure CheckIfDownloadedVersion;
282 procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND; 282 procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND;
283 - // A procedure WMQueryEndSession é usada para detectar o 283 + // A procedure WMQueryEndSession � usada para detectar o
284 // Shutdown do Windows e "derrubar" o Cacic. 284 // Shutdown do Windows e "derrubar" o Cacic.
285 procedure WMQueryEndSession(var Msg : TWMQueryEndSession); Message WM_QUERYENDSESSION; 285 procedure WMQueryEndSession(var Msg : TWMQueryEndSession); Message WM_QUERYENDSESSION;
286 procedure WMMENUSELECT(var msg: TWMMENUSELECT); message WM_MENUSELECT; 286 procedure WMMENUSELECT(var msg: TWMMENUSELECT); message WM_MENUSELECT;
@@ -490,15 +490,15 @@ begin @@ -490,15 +490,15 @@ begin
490 if Result then 490 if Result then
491 objCACIC.writeDebugLog('ServiceStart: ' + sService + ' - OK!') 491 objCACIC.writeDebugLog('ServiceStart: ' + sService + ' - OK!')
492 else 492 else
493 - objCACIC.writeDebugLog('ServiceStart: ' + sService + ' - Não Foi Possível Iniciar!'); 493 + objCACIC.writeDebugLog('ServiceStart: ' + sService + ' - N�o Foi Poss�vel Iniciar!');
494 end; 494 end;
495 495
496 -// Início de Procedimentos para monitoramento de dispositivos USB - Anderson Peterle - 02/2010 496 +// In�cio de Procedimentos para monitoramento de dispositivos USB - Anderson Peterle - 02/2010
497 procedure TFormularioGeral.UsbIN(ASender : TObject; const ADevType,AVendorID,ADeviceID : string); 497 procedure TFormularioGeral.UsbIN(ASender : TObject; const ADevType,AVendorID,ADeviceID : string);
498 begin 498 begin
499 // Envio de valores ao Gerente WEB 499 // Envio de valores ao Gerente WEB
500 // Formato: USBinfo=I_ddmmyyyyhhnnss_ADeviceID 500 // Formato: USBinfo=I_ddmmyyyyhhnnss_ADeviceID
501 - // Os valores serão armazenados localmente (cacic280.inf) se for impossível o envio. 501 + // Os valores ser�o armazenados localmente (cacic280.inf) se for imposs�vel o envio.
502 objCACIC.writeDebugLog('UsbIN: << USB INSERIDO .:. Vendor ID => ' + AVendorID + ' .:. Device ID = ' + ADeviceID); 502 objCACIC.writeDebugLog('UsbIN: << USB INSERIDO .:. Vendor ID => ' + AVendorID + ' .:. Device ID = ' + ADeviceID);
503 Invoca_GerCols('USBinfo=I_'+FormatDateTime('yyyymmddhhnnss', now) + '_' + AVendorID + '_' + ADeviceID, false, false); 503 Invoca_GerCols('USBinfo=I_'+FormatDateTime('yyyymmddhhnnss', now) + '_' + AVendorID + '_' + ADeviceID, false, false);
504 end; 504 end;
@@ -508,7 +508,7 @@ procedure TFormularioGeral.UsbOUT(ASender : TObject; const ADevType,AVendorID,AD @@ -508,7 +508,7 @@ procedure TFormularioGeral.UsbOUT(ASender : TObject; const ADevType,AVendorID,AD
508 begin 508 begin
509 // Envio de valores ao Gerente WEB 509 // Envio de valores ao Gerente WEB
510 // Formato: USBinfo=O_ddmmyyyyhhnnss_ADeviceID 510 // Formato: USBinfo=O_ddmmyyyyhhnnss_ADeviceID
511 - // Os valores serão armazenados localmente (cacic280.inf) se for impossível o envio. 511 + // Os valores ser�o armazenados localmente (cacic280.inf) se for imposs�vel o envio.
512 objCACIC.writeDebugLog('UsbOUT: >> USB REMOVIDO .:. Vendor ID => ' + AVendorID + ' .:. Device ID = ' + ADeviceID); 512 objCACIC.writeDebugLog('UsbOUT: >> USB REMOVIDO .:. Vendor ID => ' + AVendorID + ' .:. Device ID = ' + ADeviceID);
513 Invoca_GerCols('USBinfo=O_'+FormatDateTime('yyyymmddhhnnss', now) + '_' + AVendorID + '_' + ADeviceID, false, false); 513 Invoca_GerCols('USBinfo=O_'+FormatDateTime('yyyymmddhhnnss', now) + '_' + AVendorID + '_' + ADeviceID, false, false);
514 end; 514 end;
@@ -529,7 +529,7 @@ begin @@ -529,7 +529,7 @@ begin
529 Parser.LoadFromBuffer(PAnsiChar(p_strConfigs)); 529 Parser.LoadFromBuffer(PAnsiChar(p_strConfigs));
530 objCACIC.writeDebugLog('MontaVetoresPatrimonio: p_strConfigs: '+p_strConfigs); 530 objCACIC.writeDebugLog('MontaVetoresPatrimonio: p_strConfigs: '+p_strConfigs);
531 531
532 - // Código para montar o vetor UON1 532 + // C�digo para montar o vetor UON1
533 Parser.StartScan; 533 Parser.StartScan;
534 i := -1; 534 i := -1;
535 strItemName := ''; 535 strItemName := '';
@@ -540,7 +540,7 @@ begin @@ -540,7 +540,7 @@ begin
540 if (Parser.CurPartType = ptStartTag) and (strItemName = 'IT1') Then 540 if (Parser.CurPartType = ptStartTag) and (strItemName = 'IT1') Then
541 Begin 541 Begin
542 i := i + 1; 542 i := i + 1;
543 - SetLength(VetorUON1, i + 1); // Aumento o tamanho da matriz dinamicamente de acordo com o número de itens recebidos. 543 + SetLength(VetorUON1, i + 1); // Aumento o tamanho da matriz dinamicamente de acordo com o n�mero de itens recebidos.
544 strTagName := 'IT1'; 544 strTagName := 'IT1';
545 end 545 end
546 else if (Parser.CurPartType = ptEndTag) and (strItemName = 'IT1') then 546 else if (Parser.CurPartType = ptEndTag) and (strItemName = 'IT1') then
@@ -561,7 +561,7 @@ begin @@ -561,7 +561,7 @@ begin
561 End; 561 End;
562 End; 562 End;
563 563
564 - // Código para montar o vetor UON1a 564 + // C�digo para montar o vetor UON1a
565 Parser.StartScan; 565 Parser.StartScan;
566 strTagName := ''; 566 strTagName := '';
567 strAux1 := ''; 567 strAux1 := '';
@@ -572,7 +572,7 @@ begin @@ -572,7 +572,7 @@ begin
572 if (Parser.CurPartType = ptStartTag) and (strItemName = 'IT1A') Then 572 if (Parser.CurPartType = ptStartTag) and (strItemName = 'IT1A') Then
573 Begin 573 Begin
574 i := i + 1; 574 i := i + 1;
575 - SetLength(VetorUON1a, i + 1); // Aumento o tamanho da matriz dinamicamente de acordo com o número de itens recebidos. 575 + SetLength(VetorUON1a, i + 1); // Aumento o tamanho da matriz dinamicamente de acordo com o n�mero de itens recebidos.
576 strTagName := 'IT1A'; 576 strTagName := 'IT1A';
577 end 577 end
578 else if (Parser.CurPartType = ptEndTag) and (strItemName = 'IT1A') then 578 else if (Parser.CurPartType = ptEndTag) and (strItemName = 'IT1A') then
@@ -608,7 +608,7 @@ begin @@ -608,7 +608,7 @@ begin
608 End; 608 End;
609 end; 609 end;
610 610
611 - // Código para montar o vetor UON2 611 + // C�digo para montar o vetor UON2
612 Parser.StartScan; 612 Parser.StartScan;
613 strTagName := ''; 613 strTagName := '';
614 i := -1; 614 i := -1;
@@ -618,7 +618,7 @@ begin @@ -618,7 +618,7 @@ begin
618 if (Parser.CurPartType = ptStartTag) and (strItemName = 'IT2') Then 618 if (Parser.CurPartType = ptStartTag) and (strItemName = 'IT2') Then
619 Begin 619 Begin
620 i := i + 1; 620 i := i + 1;
621 - SetLength(VetorUON2, i + 1); // Aumento o tamanho da matriz dinamicamente de acordo com o número de itens recebidos. 621 + SetLength(VetorUON2, i + 1); // Aumento o tamanho da matriz dinamicamente de acordo com o n�mero de itens recebidos.
622 strTagName := 'IT2'; 622 strTagName := 'IT2';
623 end 623 end
624 else if (Parser.CurPartType = ptEndTag) and (strItemName = 'IT2') then 624 else if (Parser.CurPartType = ptEndTag) and (strItemName = 'IT2') then
@@ -654,7 +654,7 @@ end; @@ -654,7 +654,7 @@ end;
654 } 654 }
655 function TFormularioGeral.ActualActivity : integer; 655 function TFormularioGeral.ActualActivity : integer;
656 Begin 656 Begin
657 - // Se eu conseguir matar os arquivos abaixo é porque srCACICsrv, GerCols e mapaCACIC já finalizaram suas atividades... 657 + // Se eu conseguir matar os arquivos abaixo � porque srCACICsrv, GerCols e mapaCACIC j� finalizaram suas atividades...
658 objCACIC.writeDebugLog('ActualActivity: BEGIN'); 658 objCACIC.writeDebugLog('ActualActivity: BEGIN');
659 659
660 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\aguarde_GER.txt'); 660 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\aguarde_GER.txt');
@@ -689,10 +689,10 @@ Begin @@ -689,10 +689,10 @@ Begin
689 689
690 if (FormularioGeral.ActualActivity = 0) then 690 if (FormularioGeral.ActualActivity = 0) then
691 Begin 691 Begin
692 - // Verificação das janelas abertas para que não aconteça coletas caso haja aplicações pesadas rodando (configurado no Módulo Gerente) 692 + // Verifica��o das janelas abertas para que n�o aconte�a coletas caso haja aplica��es pesadas rodando (configurado no M�dulo Gerente)
693 v_JANELAS_EXCECAO := objCACIC.GetValueFromFile('Configs','TeJanelasExcecao', FormularioGeral.strMainProgramInfFileName); 693 v_JANELAS_EXCECAO := objCACIC.GetValueFromFile('Configs','TeJanelasExcecao', FormularioGeral.strMainProgramInfFileName);
694 694
695 - objCACIC.writeDebugLog('Pode_Coletar: Verificando Janelas para Exceção...'); 695 + objCACIC.writeDebugLog('Pode_Coletar: Verificando Janelas para Exce��o...');
696 tstrJANELAS := TStrings.Create; 696 tstrJANELAS := TStrings.Create;
697 if (v_JANELAS_EXCECAO <> '') then 697 if (v_JANELAS_EXCECAO <> '') then
698 Begin 698 Begin
@@ -707,28 +707,28 @@ Begin @@ -707,28 +707,28 @@ Begin
707 End; 707 End;
708 End; 708 End;
709 709
710 - // Caso alguma janela tenha algum nome de aplicação cadastrada como "crítica" ou "pesada"... 710 + // Caso alguma janela tenha algum nome de aplica��o cadastrada como "cr�tica" ou "pesada"...
711 if (intContaJANELAS > 0) then 711 if (intContaJANELAS > 0) then
712 Begin 712 Begin
713 - objCACIC.writeDailyLog('EXECUÇÃO DE ATIVIDADES ADIADA!'); 713 + objCACIC.writeDailyLog('EXECU��O DE ATIVIDADES ADIADA!');
714 v_contador := 0; 714 v_contador := 0;
715 v_plural1 := ''; 715 v_plural1 := '';
716 - v_plural2 := 'ÃO'; 716 + v_plural2 := '�O';
717 for intAux := 0 to tstrJANELAS.Count-1 Do 717 for intAux := 0 to tstrJANELAS.Count-1 Do
718 Begin 718 Begin
719 h := FormularioGeral.FindWindowByTitle(tstrJANELAS[intAux]); 719 h := FormularioGeral.FindWindowByTitle(tstrJANELAS[intAux]);
720 if h <> 0 then 720 if h <> 0 then
721 Begin 721 Begin
722 v_contador := v_contador + 1; 722 v_contador := v_contador + 1;
723 - objCACIC.writeDailyLog('Aplicação/Janela ' + inttostr(v_contador) + ': ' + tstrJANELAS[intAux]); 723 + objCACIC.writeDailyLog('Aplica��o/Janela ' + inttostr(v_contador) + ': ' + tstrJANELAS[intAux]);
724 End; 724 End;
725 End; 725 End;
726 if (v_contador > 1) then 726 if (v_contador > 1) then
727 Begin 727 Begin
728 v_plural1 := 'S'; 728 v_plural1 := 'S';
729 - v_plural2 := 'ÕES'; 729 + v_plural2 := '�ES';
730 End; 730 End;
731 - objCACIC.writeDailyLog('-> PARA PROCEDER, FINALIZE A' + v_plural1 + ' APLICAÇ' + v_plural2 + ' LISTADA' + v_plural1 + ' ACIMA.'); 731 + objCACIC.writeDailyLog('-> PARA PROCEDER, FINALIZE A' + v_plural1 + ' APLICA�' + v_plural2 + ' LISTADA' + v_plural1 + ' ACIMA.');
732 End; 732 End;
733 End; 733 End;
734 734
@@ -736,7 +736,7 @@ Begin @@ -736,7 +736,7 @@ Begin
736 Result := true 736 Result := true
737 else 737 else
738 Begin 738 Begin
739 - objCACIC.writeDebugLog('Pode_Coletar: A Ação foi NEGADA!'); 739 + objCACIC.writeDebugLog('Pode_Coletar: A A��o foi NEGADA!');
740 if (intContaJANELAS=0) then 740 if (intContaJANELAS=0) then
741 Begin 741 Begin
742 if (FileExists(objCACIC.getLocalFolderName + 'Temp\aguarde_GER.txt')) then 742 if (FileExists(objCACIC.getLocalFolderName + 'Temp\aguarde_GER.txt')) then
@@ -746,7 +746,7 @@ Begin @@ -746,7 +746,7 @@ Begin
746 objCACIC.writeDebugLog('Pode_Coletar: Suporte Remoto em atividade.'); 746 objCACIC.writeDebugLog('Pode_Coletar: Suporte Remoto em atividade.');
747 747
748 if (FileExists(objCACIC.getLocalFolderName + 'Temp\aguarde_MAPACACIC.txt')) then 748 if (FileExists(objCACIC.getLocalFolderName + 'Temp\aguarde_MAPACACIC.txt')) then
749 - objCACIC.writeDebugLog('Pode_Coletar: Módulo Avulso para Coleta de Patrimônio em atividade.'); 749 + objCACIC.writeDebugLog('Pode_Coletar: M�dulo Avulso para Coleta de Patrim�nio em atividade.');
750 End; 750 End;
751 //else 751 //else
752 // objCACIC.cipherClose(objCACIC.getLocalFolderName + objCACIC.getDatFileName,v_tstrCipherOpened); 752 // objCACIC.cipherClose(objCACIC.getLocalFolderName + objCACIC.getDatFileName,v_tstrCipherOpened);
@@ -798,13 +798,13 @@ begin @@ -798,13 +798,13 @@ begin
798 IsMenuOpen := not ((msg.MenuFlag and $FFFF > 0) and (msg.Menu = 0)); 798 IsMenuOpen := not ((msg.MenuFlag and $FFFF > 0) and (msg.Menu = 0));
799 end; 799 end;
800 800
801 -// Verifico a existência do Gerente de Coletas, caso não exista, o chksis.exe fará download! 801 +// Verifico a exist�ncia do Gerente de Coletas, caso n�o exista, o chksis.exe far� download!
802 function TFormularioGeral.ChecaMAPACACIC : boolean; 802 function TFormularioGeral.ChecaMAPACACIC : boolean;
803 var strFileSize : String; 803 var strFileSize : String;
804 Begin 804 Begin
805 Result := true; 805 Result := true;
806 806
807 - objCACIC.writeDebugLog('ChecaMAPA: Verificando existência e tamanho do Gerente de Coletas...'); 807 + objCACIC.writeDebugLog('ChecaMAPA: Verificando exist�ncia e tamanho do Gerente de Coletas...');
808 808
809 strFileSize := objCACIC.getFileSize(objCACIC.getLocalFolderName + 'Modules\mapacacic.exe',true); 809 strFileSize := objCACIC.getFileSize(objCACIC.getLocalFolderName + 'Modules\mapacacic.exe',true);
810 810
@@ -818,7 +818,7 @@ Begin @@ -818,7 +818,7 @@ Begin
818 InicializaTray; 818 InicializaTray;
819 819
820 objCACIC.writeDailyLog('Acionando Recuperador de Mapa Cacic.'); 820 objCACIC.writeDailyLog('Acionando Recuperador de Mapa Cacic.');
821 - objCACIC.writeDebugLog('ChecaMAPACACIC: Acionando Recuperador de Módulo Gerente de Coletas: '+objCACIC.getWinDir + 'chksis.exe'); 821 + objCACIC.writeDebugLog('ChecaMAPACACIC: Acionando Recuperador de M�dulo Gerente de Coletas: '+objCACIC.getWinDir + 'chksis.exe');
822 objCACIC.createOneProcess(objCACIC.getWinDir + 'chksis.exe',false,SW_HIDE); 822 objCACIC.createOneProcess(objCACIC.getWinDir + 'chksis.exe',false,SW_HIDE);
823 823
824 sleep(30000); // 30 segundos de espera para download do gercols.exe 824 sleep(30000); // 30 segundos de espera para download do gercols.exe
@@ -826,27 +826,27 @@ Begin @@ -826,27 +826,27 @@ Begin
826 strFileSize := objCACIC.getFileSize(objCACIC.getLocalFolderName + '\Modules\mapacacic.exe',true); 826 strFileSize := objCACIC.getFileSize(objCACIC.getLocalFolderName + '\Modules\mapacacic.exe',true);
827 if not(strFileSize = '0') and not(strFileSize = '-1') then 827 if not(strFileSize = '0') and not(strFileSize = '-1') then
828 Begin 828 Begin
829 - objCACIC.writeDailyLog('Módulo Mapa Cacic RECUPERADO COM SUCESSO!');  
830 - objCACIC.writeDebugLog('ChecaMAPACACIC: Módulo Gerente de Coletas RECUPERADO COM SUCESSO!'); 829 + objCACIC.writeDailyLog('M�dulo Mapa Cacic RECUPERADO COM SUCESSO!');
  830 + objCACIC.writeDebugLog('ChecaMAPACACIC: M�dulo Gerente de Coletas RECUPERADO COM SUCESSO!');
831 InicializaTray; 831 InicializaTray;
832 Result := True; 832 Result := True;
833 End 833 End
834 else 834 else
835 Begin 835 Begin
836 - objCACIC.writeDailyLog('Módulo Mapa Cacic NÃO RECUPERADO!');  
837 - objCACIC.writeDebugLog('ChecaMAPACACIC: Módulo Gerente de Coletas NÃO RECUPERADO!'); 836 + objCACIC.writeDailyLog('M�dulo Mapa Cacic N�O RECUPERADO!');
  837 + objCACIC.writeDebugLog('ChecaMAPACACIC: M�dulo Gerente de Coletas N�O RECUPERADO!');
838 End; 838 End;
839 objCACIC.writeDebugLog('ChecaMAPACACIC: ' + DupeString('=',100)); 839 objCACIC.writeDebugLog('ChecaMAPACACIC: ' + DupeString('=',100));
840 end; 840 end;
841 End; 841 End;
842 842
843 -// Verifico a existência do Gerente de Coletas, caso não exista, o chksis.exe fará download! 843 +// Verifico a exist�ncia do Gerente de Coletas, caso n�o exista, o chksis.exe far� download!
844 function TFormularioGeral.ChecaGERCOLS : boolean; 844 function TFormularioGeral.ChecaGERCOLS : boolean;
845 var strFileSize : String; 845 var strFileSize : String;
846 Begin 846 Begin
847 Result := true; 847 Result := true;
848 848
849 - objCACIC.writeDebugLog('ChecaGERCOLS: Verificando existência e tamanho do Gerente de Coletas...'); 849 + objCACIC.writeDebugLog('ChecaGERCOLS: Verificando exist�ncia e tamanho do Gerente de Coletas...');
850 850
851 strFileSize := objCACIC.getFileSize(objCACIC.getLocalFolderName + 'Modules\gercols.exe',true); 851 strFileSize := objCACIC.getFileSize(objCACIC.getLocalFolderName + 'Modules\gercols.exe',true);
852 852
@@ -858,8 +858,8 @@ Begin @@ -858,8 +858,8 @@ Begin
858 858
859 InicializaTray; 859 InicializaTray;
860 860
861 - objCACIC.writeDailyLog('Acionando Recuperador de Módulo Gerente de Coletas.');  
862 - objCACIC.writeDebugLog('ChecaGERCOLS: Acionando Recuperador de Módulo Gerente de Coletas: '+objCACIC.getWinDir + 'chksis.exe'); 861 + objCACIC.writeDailyLog('Acionando Recuperador de M�dulo Gerente de Coletas.');
  862 + objCACIC.writeDebugLog('ChecaGERCOLS: Acionando Recuperador de M�dulo Gerente de Coletas: '+objCACIC.getWinDir + 'chksis.exe');
863 objCACIC.createOneProcess(objCACIC.getWinDir + 'chksis.exe',false,SW_HIDE); 863 objCACIC.createOneProcess(objCACIC.getWinDir + 'chksis.exe',false,SW_HIDE);
864 864
865 sleep(30000); // 30 segundos de espera para download do gercols.exe 865 sleep(30000); // 30 segundos de espera para download do gercols.exe
@@ -867,15 +867,15 @@ Begin @@ -867,15 +867,15 @@ Begin
867 strFileSize := objCACIC.getFileSize(objCACIC.getLocalFolderName + '\Modules\gercols.exe',true); 867 strFileSize := objCACIC.getFileSize(objCACIC.getLocalFolderName + '\Modules\gercols.exe',true);
868 if not(strFileSize = '0') and not(strFileSize = '-1') then 868 if not(strFileSize = '0') and not(strFileSize = '-1') then
869 Begin 869 Begin
870 - objCACIC.writeDailyLog('Módulo Gerente de Coletas RECUPERADO COM SUCESSO!');  
871 - objCACIC.writeDebugLog('ChecaGERCOLS: Módulo Gerente de Coletas RECUPERADO COM SUCESSO!'); 870 + objCACIC.writeDailyLog('M�dulo Gerente de Coletas RECUPERADO COM SUCESSO!');
  871 + objCACIC.writeDebugLog('ChecaGERCOLS: M�dulo Gerente de Coletas RECUPERADO COM SUCESSO!');
872 InicializaTray; 872 InicializaTray;
873 Result := True; 873 Result := True;
874 End 874 End
875 else 875 else
876 Begin 876 Begin
877 - objCACIC.writeDailyLog('Módulo Gerente de Coletas NÃO RECUPERADO!');  
878 - objCACIC.writeDebugLog('ChecaGERCOLS: Módulo Gerente de Coletas NÃO RECUPERADO!'); 877 + objCACIC.writeDailyLog('M�dulo Gerente de Coletas N�O RECUPERADO!');
  878 + objCACIC.writeDebugLog('ChecaGERCOLS: M�dulo Gerente de Coletas N�O RECUPERADO!');
879 End; 879 End;
880 End; 880 End;
881 objCACIC.writeDebugLog('ChecaGERCOLS: ' + DupeString('=',100)); 881 objCACIC.writeDebugLog('ChecaGERCOLS: ' + DupeString('=',100));
@@ -884,8 +884,8 @@ End; @@ -884,8 +884,8 @@ End;
884 884
885 procedure ExibirConfiguracoes(Sender: TObject); 885 procedure ExibirConfiguracoes(Sender: TObject);
886 begin 886 begin
887 - // SJI = Senha Já Informada...  
888 - // Esse valor é inicializado com "N" 887 + // SJI = Senha J� Informada...
  888 + // Esse valor � inicializado com "N"
889 if (objCACIC.deCrypt( objCACIC.GetValueFromFile('Configs','SJI',FormularioGeral.strMainProgramInfFileName)) = '') and 889 if (objCACIC.deCrypt( objCACIC.GetValueFromFile('Configs','SJI',FormularioGeral.strMainProgramInfFileName)) = '') and
890 (objCACIC.GetValueFromFile('Configs','WebManagerAddress',FormularioGeral.strChkSisInfFileName) <> '') then 890 (objCACIC.GetValueFromFile('Configs','WebManagerAddress',FormularioGeral.strChkSisInfFileName) <> '') then
891 begin 891 begin
@@ -903,7 +903,7 @@ end; @@ -903,7 +903,7 @@ end;
903 903
904 procedure TFormularioGeral.CriaFormSenha(Sender: TObject); 904 procedure TFormularioGeral.CriaFormSenha(Sender: TObject);
905 begin 905 begin
906 - // Caso ainda não exista senha para administração do CACIC, define ADMINCACIC como inicial. 906 + // Caso ainda n�o exista senha para administra��o do CACIC, define ADMINCACIC como inicial.
907 if (objCACIC.deCrypt( objCACIC.GetValueFromFile('Configs','TeSenhaAdmAgente',FormularioGeral.strMainProgramInfFileName),false,true) = '') Then 907 if (objCACIC.deCrypt( objCACIC.GetValueFromFile('Configs','TeSenhaAdmAgente',FormularioGeral.strMainProgramInfFileName),false,true) = '') Then
908 objCACIC.setValueToFile('Configs','TeSenhaAdmAgente', objCACIC.enCrypt('ADMINCACIC'), FormularioGeral.strMainProgramInfFileName); 908 objCACIC.setValueToFile('Configs','TeSenhaAdmAgente', objCACIC.enCrypt('ADMINCACIC'), FormularioGeral.strMainProgramInfFileName);
909 909
@@ -914,17 +914,17 @@ procedure TFormularioGeral.ChecaCONFIGS; @@ -914,17 +914,17 @@ procedure TFormularioGeral.ChecaCONFIGS;
914 var strAux : string; 914 var strAux : string;
915 Begin 915 Begin
916 916
917 - // Verifico se o endereço do servidor do cacic foi configurado. 917 + // Verifico se o endere�o do servidor do cacic foi configurado.
918 if (objCACIC.GetValueFromFile('Configs','WebManagerAddress',strChkSisInfFileName) = '') then 918 if (objCACIC.GetValueFromFile('Configs','WebManagerAddress',strChkSisInfFileName) = '') then
919 Begin 919 Begin
920 strAux := objCACIC.fixWebAddress(objCACIC.GetValueFromFile('Configs','WebManagerAddress', strChkSisInfFileName)); 920 strAux := objCACIC.fixWebAddress(objCACIC.GetValueFromFile('Configs','WebManagerAddress', strChkSisInfFileName));
921 921
922 if (strAux = '') then 922 if (strAux = '') then
923 begin 923 begin
924 - strAux := 'ATENÇÃO: Endereço do servidor do CACIC ainda não foi configurado.'; 924 + strAux := 'ATEN��O: Endere�o do servidor do CACIC ainda n�o foi configurado.';
925 objCACIC.writeDailyLog(strAux); 925 objCACIC.writeDailyLog(strAux);
926 - objCACIC.writeDailyLog('Ativando módulo de configuração de endereço de servidor.');  
927 - MessageDlg(strAux + chr(13) + 'Por favor, informe o endereço do servidor do CACIC na tela que será exibida a seguir.', mtWarning, [mbOk], 0); 926 + objCACIC.writeDailyLog('Ativando m�dulo de configura��o de endere�o de servidor.');
  927 + MessageDlg(strAux + chr(13) + 'Por favor, informe o endere�o do servidor do CACIC na tela que ser� exibida a seguir.', mtWarning, [mbOk], 0);
928 ExibirConfiguracoes(Nil); 928 ExibirConfiguracoes(Nil);
929 end; 929 end;
930 End; 930 End;
@@ -932,7 +932,7 @@ end; @@ -932,7 +932,7 @@ end;
932 932
933 procedure TFormularioGeral.HabilitaInformacoesGerais; 933 procedure TFormularioGeral.HabilitaInformacoesGerais;
934 Begin 934 Begin
935 - // Desabilita/Habilita a opção de Informações Gerais 935 + // Desabilita/Habilita a op��o de Informa��es Gerais
936 Mnu_InformacoesGerais.Enabled := (objCACIC.getValueFromTags('Caption' ,strWin32_ComputerSystem) + 936 Mnu_InformacoesGerais.Enabled := (objCACIC.getValueFromTags('Caption' ,strWin32_ComputerSystem) +
937 objCACIC.getValueFromTags('IPAddress' ,strWin32_NetworkAdapterConfiguration) + 937 objCACIC.getValueFromTags('IPAddress' ,strWin32_NetworkAdapterConfiguration) +
938 objCACIC.getValueFromTags('DNSDomain' ,strWin32_NetworkAdapterConfiguration) + 938 objCACIC.getValueFromTags('DNSDomain' ,strWin32_NetworkAdapterConfiguration) +
@@ -947,7 +947,7 @@ End; @@ -947,7 +947,7 @@ End;
947 947
948 procedure TFormularioGeral.HabilitaSuporteRemoto; 948 procedure TFormularioGeral.HabilitaSuporteRemoto;
949 Begin 949 Begin
950 - // Desabilita/Habilita a opção de Suporte Remoto 950 + // Desabilita/Habilita a op��o de Suporte Remoto
951 Mnu_SuporteRemoto.Enabled := (objCACIC.GetValueFromFile('Configs','CsSuporteRemoto',strMainProgramInfFileName) = 'S') and (FileExists(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe')); 951 Mnu_SuporteRemoto.Enabled := (objCACIC.GetValueFromFile('Configs','CsSuporteRemoto',strMainProgramInfFileName) = 'S') and (FileExists(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe'));
952 End; 952 End;
953 953
@@ -955,8 +955,8 @@ function TFormularioGeral.Posso_Rodar : boolean; @@ -955,8 +955,8 @@ function TFormularioGeral.Posso_Rodar : boolean;
955 Begin 955 Begin
956 result := false; 956 result := false;
957 957
958 - objCACIC.writeDebugLog('Posso_Rodar: Verificando concomitância de sessões');  
959 - // Se eu conseguir matar o arquivo abaixo é porque não há outra sessão deste agente aberta... (POG? Nããão! :) ) 958 + objCACIC.writeDebugLog('Posso_Rodar: Verificando concomit�ncia de sess�es');
  959 + // Se eu conseguir matar o arquivo abaixo � porque n�o h� outra sess�o deste agente aberta... (POG? N���o! :) )
960 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'aguarde_CACIC.txt'); 960 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'aguarde_CACIC.txt');
961 961
962 Result := not (FileExists(objCACIC.getLocalFolderName + 'aguarde_CACIC.txt')); 962 Result := not (FileExists(objCACIC.getLocalFolderName + 'aguarde_CACIC.txt'));
@@ -979,7 +979,7 @@ begin @@ -979,7 +979,7 @@ begin
979 979
980 bl_primeira_execucao := true; 980 bl_primeira_execucao := true;
981 981
982 - // A verificação dupla é uma solução de contorno para o caso de o boolCipher ter sido setado após criptografia/deCriptografia do dado gravado 982 + // A verifica��o dupla � uma solu��o de contorno para o caso de o boolCipher ter sido setado ap�s criptografia/deCriptografia do dado gravado
983 if (objCACIC.deCrypt( objCACIC.getValueFromFile('Hash-Codes',objCACIC.getMainProgramName,strChkSisInfFileName),false,true) = objCACIC.getFileHash(ParamStr(0))) then 983 if (objCACIC.deCrypt( objCACIC.getValueFromFile('Hash-Codes',objCACIC.getMainProgramName,strChkSisInfFileName),false,true) = objCACIC.getFileHash(ParamStr(0))) then
984 Begin 984 Begin
985 objCACIC.setMainProgramHash(objCACIC.getFileHash(ParamStr(0))); 985 objCACIC.setMainProgramHash(objCACIC.getFileHash(ParamStr(0)));
@@ -995,8 +995,8 @@ begin @@ -995,8 +995,8 @@ begin
995 strWin32_NetworkAdapterConfiguration := fetchWMIvalues('Win32_NetworkAdapterConfiguration', objCACIC.getLocalFolderName); 995 strWin32_NetworkAdapterConfiguration := fetchWMIvalues('Win32_NetworkAdapterConfiguration', objCACIC.getLocalFolderName);
996 strWin32_ComputerSystem := fetchWMIvalues('Win32_ComputerSystem', objCACIC.getLocalFolderName); 996 strWin32_ComputerSystem := fetchWMIvalues('Win32_ComputerSystem', objCACIC.getLocalFolderName);
997 997
998 - //Correção do bug do script net logon da pgfn;  
999 - //O script estava instalando o cacic sem interação com desktop, 998 + //Corre��o do bug do script net logon da pgfn;
  999 + //O script estava instalando o cacic sem intera��o com desktop,
1000 //bugando o mapa e o trayicon. 1000 //bugando o mapa e o trayicon.
1001 1001
1002 {*** 1 = SERVICE_STOPPED ***} 1002 {*** 1 = SERVICE_STOPPED ***}
@@ -1007,21 +1007,21 @@ begin @@ -1007,21 +1007,21 @@ begin
1007 {*** 6 = SERVICE_PAUSE_PENDING ***} 1007 {*** 6 = SERVICE_PAUSE_PENDING ***}
1008 {*** 7 = SERVICE_PAUSED ***} 1008 {*** 7 = SERVICE_PAUSED ***}
1009 1009
1010 - // Verifico se o serviço está instalado/rodando,etc. 1010 + // Verifico se o servi�o est� instalado/rodando,etc.
1011 wordServiceStatus := objCacic.ServiceGetStatus(nil,'CacicSustainService'); 1011 wordServiceStatus := objCacic.ServiceGetStatus(nil,'CacicSustainService');
1012 1012
1013 - //Verifico o serviço para correção de bug  
1014 - // Verifico se o serviço está instalado/rodando,etc. 1013 + //Verifico o servi�o para corre��o de bug
  1014 + // Verifico se o servi�o est� instalado/rodando,etc.
1015 1015
1016 if wordServiceStatus <> 0 then 1016 if wordServiceStatus <> 0 then
1017 begin 1017 begin
1018 - //verifica o status, se não estiver correto altera 1018 + //verifica o status, se n�o estiver correto altera
1019 serviceType := objCacic.serviceGetType('', 'CacicSustainService'); 1019 serviceType := objCacic.serviceGetType('', 'CacicSustainService');
1020 end; 1020 end;
1021 1021
1022 if (wordServiceStatus = 0) then 1022 if (wordServiceStatus = 0) then
1023 Begin 1023 Begin
1024 - // Instalo e Habilito o serviço 1024 + // Instalo e Habilito o servi�o
1025 objCacic.createOneProcess(objCacic.getWinDir + 'cacicservice.exe /install /silent',true); 1025 objCacic.createOneProcess(objCacic.getWinDir + 'cacicservice.exe /install /silent',true);
1026 End 1026 End
1027 else if (wordServiceStatus < 4) then 1027 else if (wordServiceStatus < 4) then
@@ -1042,22 +1042,22 @@ begin @@ -1042,22 +1042,22 @@ begin
1042 imgIconList.GetIcon(0,TrayIcon1.Icon); 1042 imgIconList.GetIcon(0,TrayIcon1.Icon);
1043 TrayIcon1.Show; 1043 TrayIcon1.Show;
1044 1044
1045 - // Criação do objeto para monitoramento de dispositivos USB 1045 + // Cria��o do objeto para monitoramento de dispositivos USB
1046 FUsb := TUsbClass.Create; 1046 FUsb := TUsbClass.Create;
1047 FUsb.OnUsbInsertion := UsbIN; 1047 FUsb.OnUsbInsertion := UsbIN;
1048 FUsb.OnUsbRemoval := UsbOUT; 1048 FUsb.OnUsbRemoval := UsbOUT;
1049 1049
1050 - // Essas variáveis ajudarão a controlar o redesenho do ícone no systray, 1050 + // Essas vari�veis ajudar�o a controlar o redesenho do �cone no systray,
1051 // evitando o "roubo" do foco. 1051 // evitando o "roubo" do foco.
1052 g_intTaskBarAtual := 0; 1052 g_intTaskBarAtual := 0;
1053 g_intTaskBarAnterior := 0; 1053 g_intTaskBarAnterior := 0;
1054 g_intDesktopWindow := 0; 1054 g_intDesktopWindow := 0;
1055 1055
1056 - // Não mostrar o formulário... 1056 + // N�o mostrar o formul�rio...
1057 Application.ShowMainForm := false; 1057 Application.ShowMainForm := false;
1058 g_intStatusAnterior := -1; 1058 g_intStatusAnterior := -1;
1059 1059
1060 - // Aplicar traduções GetText,etc... 1060 + // Aplicar tradu��es GetText,etc...
1061 1061
1062 strMenuCaptionLAT := Mnu_LogAtividades.Caption; 1062 strMenuCaptionLAT := Mnu_LogAtividades.Caption;
1063 strMenuCaptionCON := Mnu_Configuracoes.Caption; 1063 strMenuCaptionCON := Mnu_Configuracoes.Caption;
@@ -1069,7 +1069,7 @@ begin @@ -1069,7 +1069,7 @@ begin
1069 1069
1070 Try 1070 Try
1071 1071
1072 - // Apago o indicador de finalização normal 1072 + // Apago o indicador de finaliza��o normal
1073 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'normal_CACIC.txt'); 1073 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'normal_CACIC.txt');
1074 1074
1075 if not DirectoryExists(objCACIC.getLocalFolderName + 'Temp') then 1075 if not DirectoryExists(objCACIC.getLocalFolderName + 'Temp') then
@@ -1090,21 +1090,21 @@ begin @@ -1090,21 +1090,21 @@ begin
1090 1090
1091 if Posso_Rodar then 1091 if Posso_Rodar then
1092 Begin 1092 Begin
1093 - // Uma forma fácil de evitar que outra sessão deste agente seja iniciada! (POG? Nããããooo!) :))))  
1094 - AssignFile(textFileAguarde,objCACIC.getLocalFolderName + 'aguarde_CACIC.txt'); {Associa o arquivo a uma variável do tipo TextFile} 1093 + // Uma forma f�cil de evitar que outra sess�o deste agente seja iniciada! (POG? N����ooo!) :))))
  1094 + AssignFile(textFileAguarde,objCACIC.getLocalFolderName + 'aguarde_CACIC.txt'); {Associa o arquivo a uma vari�vel do tipo TextFile}
1095 {$IOChecks off} 1095 {$IOChecks off}
1096 Reset(textFileAguarde); {Abre o arquivo texto} 1096 Reset(textFileAguarde); {Abre o arquivo texto}
1097 {$IOChecks on} 1097 {$IOChecks on}
1098 - if (IOResult <> 0) then // Arquivo não existe, será recriado. 1098 + if (IOResult <> 0) then // Arquivo n�o existe, ser� recriado.
1099 Rewrite (textFileAguarde); 1099 Rewrite (textFileAguarde);
1100 1100
1101 Append(textFileAguarde); 1101 Append(textFileAguarde);
1102 - Writeln(textFileAguarde,'Apenas um pseudo-cookie para evitar sessões concomitantes...'); 1102 + Writeln(textFileAguarde,'Apenas um pseudo-cookie para evitar sess�es concomitantes...');
1103 Append(textFileAguarde); 1103 Append(textFileAguarde);
1104 - Writeln(textFileAguarde,'Futuramente penso em colocar aqui o pID, para possibilitar finalização via software externo...'); 1104 + Writeln(textFileAguarde,'Futuramente penso em colocar aqui o pID, para possibilitar finaliza��o via software externo...');
1105 Append(textFileAguarde); 1105 Append(textFileAguarde);
1106 1106
1107 - // Inicializo bloqueando o módulo de suporte remoto seguro na FireWall nativa. 1107 + // Inicializo bloqueando o m�dulo de suporte remoto seguro na FireWall nativa.
1108 if FileExists(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe') then 1108 if FileExists(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe') then
1109 objCACIC.addApplicationToFirewall('srCACIC - Suporte Remoto Seguro do Sistema CACIC',objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe', false); 1109 objCACIC.addApplicationToFirewall('srCACIC - Suporte Remoto Seguro do Sistema CACIC',objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe', false);
1110 1110
@@ -1116,25 +1116,25 @@ begin @@ -1116,25 +1116,25 @@ begin
1116 begin 1116 begin
1117 if FindCmdLineSwitch('atualizacao', True) then 1117 if FindCmdLineSwitch('atualizacao', True) then
1118 begin 1118 begin
1119 - objCACIC.writeDebugLog('FormCreate: Opção /atualizacao recebida...');  
1120 - objCACIC.writeDailyLog('Reinicializando com versão '+ objCACIC.GetVersionInfo(ParamStr(0))); 1119 + objCACIC.writeDebugLog('FormCreate: Op��o /atualizacao recebida...');
  1120 + objCACIC.writeDailyLog('Reinicializando com vers�o '+ objCACIC.GetVersionInfo(ParamStr(0)));
1121 end 1121 end
1122 else 1122 else
1123 begin 1123 begin
1124 - objCACIC.writeDebugLog('FormCreate: Opção /execute recebida...');  
1125 - objCACIC.writeDailyLog('Opção para execução imediata encontrada...'); 1124 + objCACIC.writeDebugLog('FormCreate: Op��o /execute recebida...');
  1125 + objCACIC.writeDailyLog('Op��o para execu��o imediata encontrada...');
1126 end; 1126 end;
1127 ExecutaCACIC(nil); 1127 ExecutaCACIC(nil);
1128 end; 1128 end;
1129 1129
1130 - // Os timers iniciam-se desabilitados... Mais à frente receberão parâmetros de tempo para execução. 1130 + // Os timers iniciam-se desabilitados... Mais � frente receber�o par�metros de tempo para execu��o.
1131 timerNuExecApos.Enabled := False; 1131 timerNuExecApos.Enabled := False;
1132 timerNuIntervalo.Enabled := False; 1132 timerNuIntervalo.Enabled := False;
1133 1133
1134 // Derruba o cacic durante o shutdown do windows. 1134 // Derruba o cacic durante o shutdown do windows.
1135 ShutdownEmExecucao := False; 1135 ShutdownEmExecucao := False;
1136 1136
1137 - // Não mostrar o formulário... 1137 + // N�o mostrar o formul�rio...
1138 //Application.ShowMainForm:=false; 1138 //Application.ShowMainForm:=false;
1139 1139
1140 Try 1140 Try
@@ -1142,32 +1142,32 @@ begin @@ -1142,32 +1142,32 @@ begin
1142 SetaVariaveisGlobais; 1142 SetaVariaveisGlobais;
1143 Except 1143 Except
1144 on E : Exception do 1144 on E : Exception do
1145 - objCACIC.writeExceptionLog(E.Message,E.ClassName,'SETANDO VARIÁVEIS GLOBAIS!'); 1145 + objCACIC.writeExceptionLog(E.Message,E.ClassName,'SETANDO VARI�VEIS GLOBAIS!');
1146 End; 1146 End;
1147 1147
1148 timerNuExecApos.Enabled := True; 1148 timerNuExecApos.Enabled := True;
1149 1149
1150 InicializaTray; 1150 InicializaTray;
1151 1151
1152 - // String list e objeto para captura de ações durante suporte remoto 1152 + // String list e objeto para captura de a��es durante suporte remoto
1153 tstrListRCActions := TStringList.Create; 1153 tstrListRCActions := TStringList.Create;
1154 End 1154 End
1155 else 1155 else
1156 Begin 1156 Begin
1157 - objCACIC.writeDebugLog('FormCreate: Agente finalizado devido a concomitância de sessões...'); 1157 + objCACIC.writeDebugLog('FormCreate: Agente finalizado devido a concomit�ncia de sess�es...');
1158 Finaliza; 1158 Finaliza;
1159 End; 1159 End;
1160 Except 1160 Except
1161 on E:Exception do 1161 on E:Exception do
1162 Begin 1162 Begin
1163 - objCACIC.writeExceptionLog(E.Message,e.ClassName,'PROBLEMAS NA INICIALIZAÇÃO (2)'); 1163 + objCACIC.writeExceptionLog(E.Message,e.ClassName,'PROBLEMAS NA INICIALIZA��O (2)');
1164 Finaliza(false); 1164 Finaliza(false);
1165 End; 1165 End;
1166 End 1166 End
1167 End 1167 End
1168 else 1168 else
1169 Begin 1169 Begin
1170 - objCACIC.writeDailyLog('Execução Impedida por Falta de Integridade do Agente Principal!'); 1170 + objCACIC.writeDailyLog('Execu��o Impedida por Falta de Integridade do Agente Principal!');
1171 Finaliza(false); 1171 Finaliza(false);
1172 End; 1172 End;
1173 end; 1173 end;
@@ -1176,7 +1176,7 @@ procedure TFormularioGeral.SetaVariaveisGlobais; @@ -1176,7 +1176,7 @@ procedure TFormularioGeral.SetaVariaveisGlobais;
1176 var v_aux : string; 1176 var v_aux : string;
1177 Begin 1177 Begin
1178 Try 1178 Try
1179 - // Inicialização do indicador de SENHA JÁ INFORMADA 1179 + // Inicializa��o do indicador de SENHA J� INFORMADA
1180 objCACIC.setValueToFile('Configs','SJI',objCACIC.enCrypt(''),strMainProgramInfFileName); 1180 objCACIC.setValueToFile('Configs','SJI',objCACIC.enCrypt(''),strMainProgramInfFileName);
1181 1181
1182 if (Trim(objCACIC.GetValueFromFile('Configs','InExibeBandeja' ,strMainProgramInfFileName)) = '') or 1182 if (Trim(objCACIC.GetValueFromFile('Configs','InExibeBandeja' ,strMainProgramInfFileName)) = '') or
@@ -1189,19 +1189,19 @@ Begin @@ -1189,19 +1189,19 @@ Begin
1189 if (Trim(objCACIC.GetValueFromFile('Configs','NuIntervaloExec',strMainProgramInfFileName)) = '') then 1189 if (Trim(objCACIC.GetValueFromFile('Configs','NuIntervaloExec',strMainProgramInfFileName)) = '') then
1190 objCACIC.setValueToFile('Configs','NuIntervaloExec', '4' ,strMainProgramInfFileName); 1190 objCACIC.setValueToFile('Configs','NuIntervaloExec', '4' ,strMainProgramInfFileName);
1191 1191
1192 - // IN_EXIBE_BANDEJA O valor padrão é mostrar o ícone na bandeja.  
1193 - // NU_EXEC_APOS Assumirá o padrão de 0 minutos para execução imediata em caso de primeira execução (instalação).  
1194 - // NU_INTERVALO_EXEC Assumirá o padrão de 4 horas para o intervalo, no caso de problemas. 1192 + // IN_EXIBE_BANDEJA O valor padr�o � mostrar o �cone na bandeja.
  1193 + // NU_EXEC_APOS Assumir� o padr�o de 0 minutos para execu��o imediata em caso de primeira execu��o (instala��o).
  1194 + // NU_INTERVALO_EXEC Assumir� o padr�o de 4 horas para o intervalo, no caso de problemas.
1195 1195
1196 - // Número de horas do intervalo (3.600.000 milisegundos correspondem a 1 hora). 1196 + // N�mero de horas do intervalo (3.600.000 milisegundos correspondem a 1 hora).
1197 timerNuIntervalo.Interval := strtoint(objCACIC.GetValueFromFile('Configs','NuIntervaloExec',strMainProgramInfFileName)) * 3600000; 1197 timerNuIntervalo.Interval := strtoint(objCACIC.GetValueFromFile('Configs','NuIntervaloExec',strMainProgramInfFileName)) * 3600000;
1198 1198
1199 - // Número de minutos para iniciar a execução (60.000 milisegundos correspondem a 1 minuto). Acrescento 1, pois se for zero ele não executa. 1199 + // N�mero de minutos para iniciar a execu��o (60.000 milisegundos correspondem a 1 minuto). Acrescento 1, pois se for zero ele n�o executa.
1200 timerNuExecApos.Interval := (strtoint(objCACIC.GetValueFromFile('Configs','NuExecApos',strMainProgramInfFileName)) * 60000) + 1000; 1200 timerNuExecApos.Interval := (strtoint(objCACIC.GetValueFromFile('Configs','NuExecApos',strMainProgramInfFileName)) * 60000) + 1000;
1201 1201
1202 - // Se for a primeiríssima execução do agente naquela máquina (após sua instalação) já faz todas as coletas configuradas, sem esperar os minutos definidos pelo administrador.  
1203 - // Também armazena os Hash-Codes dos módulos principais, evitando novo download...  
1204 - If (objCACIC.GetValueFromFile('Configs','NuExecApos',strMainProgramInfFileName) = '12345') then // Flag usada na inicialização. Só entra nesse if se for a primeira execução do cacic após carregado. 1202 + // Se for a primeir�ssima execu��o do agente naquela m�quina (ap�s sua instala��o) j� faz todas as coletas configuradas, sem esperar os minutos definidos pelo administrador.
  1203 + // Tamb�m armazena os Hash-Codes dos m�dulos principais, evitando novo download...
  1204 + If (objCACIC.GetValueFromFile('Configs','NuExecApos',strMainProgramInfFileName) = '12345') then // Flag usada na inicializa��o. S� entra nesse if se for a primeira execu��o do cacic ap�s carregado.
1205 begin 1205 begin
1206 timerNuExecApos.Interval := 1000; // 1 minuto para chamar GerCols /coletas 1206 timerNuExecApos.Interval := 1000; // 1 minuto para chamar GerCols /coletas
1207 objCACIC.setValueToFile('Configs','NuExecApos', '1',strMainProgramInfFileName); 1207 objCACIC.setValueToFile('Configs','NuExecApos', '1',strMainProgramInfFileName);
@@ -1210,29 +1210,29 @@ Begin @@ -1210,29 +1210,29 @@ Begin
1210 Begin 1210 Begin
1211 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\atualiza_CACIC.txt'); 1211 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\atualiza_CACIC.txt');
1212 timerNuExecApos.Interval := 1000; // 1 minuto para chamar GerCols /coletas 1212 timerNuExecApos.Interval := 1000; // 1 minuto para chamar GerCols /coletas
1213 - objCACIC.writeDailyLog('Reinicializando com versão '+ objCACIC.GetVersionInfo(ParamStr(0))); 1213 + objCACIC.writeDailyLog('Reinicializando com vers�o '+ objCACIC.GetVersionInfo(ParamStr(0)));
1214 End 1214 End
1215 else 1215 else
1216 Begin 1216 Begin
1217 - objCACIC.writeDailyLog('Inicio automático de coletas programado para ' + objCACIC.GetValueFromFile('Configs','NuExecApos',strMainProgramInfFileName) + ' minutos.');  
1218 - objCACIC.writeDailyLog('Executar as ações de coletas automaticamente a cada ' + objCACIC.GetValueFromFile('Configs','NuIntervaloExec',strMainProgramInfFileName) + ' horas.'); 1217 + objCACIC.writeDailyLog('Inicio autom�tico de coletas programado para ' + objCACIC.GetValueFromFile('Configs','NuExecApos',strMainProgramInfFileName) + ' minutos.');
  1218 + objCACIC.writeDailyLog('Executar as a��es de coletas automaticamente a cada ' + objCACIC.GetValueFromFile('Configs','NuIntervaloExec',strMainProgramInfFileName) + ' horas.');
1219 objCACIC.writeDailyLog(DupeString('=',100)); 1219 objCACIC.writeDailyLog(DupeString('=',100));
1220 End; 1220 End;
1221 1221
1222 v_aux := Trim(objCACIC.GetValueFromFile('Configs','DtHrUltimaColeta',strGerColsInfFileName)); 1222 v_aux := Trim(objCACIC.GetValueFromFile('Configs','DtHrUltimaColeta',strGerColsInfFileName));
1223 if (v_aux <> '') and (Copy(v_aux, 1, 8) <> FormatDateTime('YYYYmmdd', Now)) then timerNuExecApos.Enabled := True; 1223 if (v_aux <> '') and (Copy(v_aux, 1, 8) <> FormatDateTime('YYYYmmdd', Now)) then timerNuExecApos.Enabled := True;
1224 1224
1225 - // Desabilita/Habilita a opção de Informações Gerais 1225 + // Desabilita/Habilita a op��o de Informa��es Gerais
1226 HabilitaInformacoesGerais; 1226 HabilitaInformacoesGerais;
1227 1227
1228 - // Desabilita/Habilita a opção de Suporte Remoto 1228 + // Desabilita/Habilita a op��o de Suporte Remoto
1229 HabilitaSuporteRemoto; 1229 HabilitaSuporteRemoto;
1230 1230
1231 InicializaTray; 1231 InicializaTray;
1232 Except 1232 Except
1233 on E : Exception do 1233 on E : Exception do
1234 Begin 1234 Begin
1235 - objCACIC.writeExceptionLog(E.Message,E.ClassName,'PROBLEMAS NA INICIALIZAÇÃO (1)'); 1235 + objCACIC.writeExceptionLog(E.Message,E.ClassName,'PROBLEMAS NA INICIALIZA��O (1)');
1236 Finaliza; 1236 Finaliza;
1237 End; 1237 End;
1238 End; 1238 End;
@@ -1249,13 +1249,13 @@ Begin @@ -1249,13 +1249,13 @@ Begin
1249 1249
1250 if (boolNormal) then 1250 if (boolNormal) then
1251 Begin 1251 Begin
1252 - // Criando um indicador de finalização normal da aplicação,  
1253 - // evitando que o chkSIS.exe baixe outra cópia do Agente Principal ao "achar" que o agente encontra-se com problema.  
1254 - AssignFile(txtFileNormal,objCACIC.getLocalFolderName + 'normal_CACIC.txt'); {Associa o arquivo a uma variável do tipo TextFile} 1252 + // Criando um indicador de finaliza��o normal da aplica��o,
  1253 + // evitando que o chkSIS.exe baixe outra c�pia do Agente Principal ao "achar" que o agente encontra-se com problema.
  1254 + AssignFile(txtFileNormal,objCACIC.getLocalFolderName + 'normal_CACIC.txt'); {Associa o arquivo a uma vari�vel do tipo TextFile}
1255 {$IOChecks off} 1255 {$IOChecks off}
1256 Reset(txtFileNormal); {Abre o arquivo texto} 1256 Reset(txtFileNormal); {Abre o arquivo texto}
1257 {$IOChecks on} 1257 {$IOChecks on}
1258 - if (IOResult <> 0) then // Arquivo não existe, será recriado. 1258 + if (IOResult <> 0) then // Arquivo n�o existe, ser� recriado.
1259 Rewrite (txtFileNormal); 1259 Rewrite (txtFileNormal);
1260 1260
1261 Append(txtFileNormal); 1261 Append(txtFileNormal);
@@ -1268,7 +1268,7 @@ Begin @@ -1268,7 +1268,7 @@ Begin
1268 End; 1268 End;
1269 Except 1269 Except
1270 on E : Exception do 1270 on E : Exception do
1271 - objCACIC.writeExceptionLog(E.Message,E.ClassName,'PROBLEMAS NA FINALIZAÇÃO'); 1271 + objCACIC.writeExceptionLog(E.Message,E.ClassName,'PROBLEMAS NA FINALIZA��O');
1272 End; 1272 End;
1273 objCACIC.Free; 1273 objCACIC.Free;
1274 Halt(0); 1274 Halt(0);
@@ -1287,19 +1287,19 @@ begin @@ -1287,19 +1287,19 @@ begin
1287 (boolCheckExecution and 1287 (boolCheckExecution and
1288 (ActualActivity = 0) ) then 1288 (ActualActivity = 0) ) then
1289 Begin 1289 Begin
1290 - // Caso exista o Gerente de Coletas será verificada a versão e excluída caso antiga(Uma forma de ação pró-ativa) 1290 + // Caso exista o Gerente de Coletas ser� verificada a vers�o e exclu�da caso antiga(Uma forma de a��o pr�-ativa)
1291 if ChecaGERCOLS then 1291 if ChecaGERCOLS then
1292 Begin 1292 Begin
1293 ChecaCONFIGS; 1293 ChecaCONFIGS;
1294 1294
1295 - objCACIC.writeDebugLog('Invoca_GerCols: Invocando Gerente de Coletas com ação: "'+p_acao+'"'); 1295 + objCACIC.writeDebugLog('Invoca_GerCols: Invocando Gerente de Coletas com a��o: "'+p_acao+'"');
1296 1296
1297 if boolShowInfo and not (p_acao = 'getTest') then 1297 if boolShowInfo and not (p_acao = 'getTest') then
1298 - objCACIC.writeDebugLog('Invocando Gerente de Coletas com ação: "'+p_acao+'"'); 1298 + objCACIC.writeDebugLog('Invocando Gerente de Coletas com a��o: "'+p_acao+'"');
1299 1299
1300 timerNuExecApos.Enabled := False; 1300 timerNuExecApos.Enabled := False;
1301 objCACIC.writeDebugLog('Invoca_GerCols: Criando Processo GerCols => "'+objCACIC.getLocalFolderName + 'Modules\gercols.exe /'+p_acao+' /WebServicesFolderName='+objCACIC.getWebServicesFolderName +' /LocalFolderName='+objCACIC.getLocalFolderName + ' /WebManagerAddress=' + objCACIC.getWebManagerAddress + '"'); 1301 objCACIC.writeDebugLog('Invoca_GerCols: Criando Processo GerCols => "'+objCACIC.getLocalFolderName + 'Modules\gercols.exe /'+p_acao+' /WebServicesFolderName='+objCACIC.getWebServicesFolderName +' /LocalFolderName='+objCACIC.getLocalFolderName + ' /WebManagerAddress=' + objCACIC.getWebManagerAddress + '"');
1302 - if ((p_acao = 'getTest') or (p_acao = 'getConfigs')) then //se for getTest, esperar a aplicação finalizar. 1302 + if ((p_acao = 'getTest') or (p_acao = 'getConfigs')) then //se for getTest, esperar a aplica��o finalizar.
1303 objCACIC.createOneProcess(objCACIC.getLocalFolderName + 'Modules\gercols.exe /'+p_acao+' /WebServicesFolderName='+objCACIC.getWebServicesFolderName +' /LocalFolderName='+objCACIC.getLocalFolderName + ' /WebManagerAddress=' + objCACIC.getWebManagerAddress + ' /MainProgramName=' + objCACIC.getMainProgramName + ' /MainProgramHash=' + objCACIC.getMainProgramHash,true,SW_HIDE) 1303 objCACIC.createOneProcess(objCACIC.getLocalFolderName + 'Modules\gercols.exe /'+p_acao+' /WebServicesFolderName='+objCACIC.getWebServicesFolderName +' /LocalFolderName='+objCACIC.getLocalFolderName + ' /WebManagerAddress=' + objCACIC.getWebManagerAddress + ' /MainProgramName=' + objCACIC.getMainProgramName + ' /MainProgramHash=' + objCACIC.getMainProgramHash,true,SW_HIDE)
1304 else 1304 else
1305 objCACIC.createOneProcess(objCACIC.getLocalFolderName + 'Modules\gercols.exe /'+p_acao+' /WebServicesFolderName='+objCACIC.getWebServicesFolderName +' /LocalFolderName='+objCACIC.getLocalFolderName + ' /WebManagerAddress=' + objCACIC.getWebManagerAddress + ' /MainProgramName=' + objCACIC.getMainProgramName + ' /MainProgramHash=' + objCACIC.getMainProgramHash,true,SW_HIDE); 1305 objCACIC.createOneProcess(objCACIC.getLocalFolderName + 'Modules\gercols.exe /'+p_acao+' /WebServicesFolderName='+objCACIC.getWebServicesFolderName +' /LocalFolderName='+objCACIC.getLocalFolderName + ' /WebManagerAddress=' + objCACIC.getWebManagerAddress + ' /MainProgramName=' + objCACIC.getMainProgramName + ' /MainProgramHash=' + objCACIC.getMainProgramHash,true,SW_HIDE);
@@ -1307,7 +1307,7 @@ begin @@ -1307,7 +1307,7 @@ begin
1307 objCacic.setBoolCipher(not objCacic.isInDebugMode); 1307 objCacic.setBoolCipher(not objCacic.isInDebugMode);
1308 End 1308 End
1309 else 1309 else
1310 - objCACIC.writeDailyLog('Não foi possível invocar o Gerente de Coletas!'); 1310 + objCACIC.writeDailyLog('N�o foi poss�vel invocar o Gerente de Coletas!');
1311 End; 1311 End;
1312 end; 1312 end;
1313 1313
@@ -1318,14 +1318,14 @@ begin @@ -1318,14 +1318,14 @@ begin
1318 else if(ActualActivity <> 0) then 1318 else if(ActualActivity <> 0) then
1319 begin 1319 begin
1320 if ActualActivity = 1 then 1320 if ActualActivity = 1 then
1321 - MessageDlg(#13#13+'Coleta em execução!',mtInformation, [mbOK], 0); 1321 + MessageDlg(#13#13+'Coleta em execução!',mtInformation, [mbOK], 0);
1322 if ActualActivity = 3 then 1322 if ActualActivity = 3 then
1323 MessageDlg(#13#13+'Cacic sendo executado em suporte remoto!',mtInformation, [mbOK], 0); 1323 MessageDlg(#13#13+'Cacic sendo executado em suporte remoto!',mtInformation, [mbOK], 0);
1324 if ActualActivity = 4 then 1324 if ActualActivity = 4 then
1325 - MessageDlg(#13#13+'Mapa já está em execução!',mtInformation, [mbOK], 0); 1325 + MessageDlg(#13#13+'Mapa já está em execução!',mtInformation, [mbOK], 0);
1326 end 1326 end
1327 else 1327 else
1328 - MessageDlg(#13#13+'Módulo desabilitado!',mtInformation, [mbOK], 0); 1328 + MessageDlg(#13#13+'M�dulo desabilitado!',mtInformation, [mbOK], 0);
1329 end; 1329 end;
1330 1330
1331 //////////////////////////////////////////////////////////////////////////////// 1331 ////////////////////////////////////////////////////////////////////////////////
@@ -1338,7 +1338,7 @@ begin @@ -1338,7 +1338,7 @@ begin
1338 Begin 1338 Begin
1339 if ChecaMAPACACIC then 1339 if ChecaMAPACACIC then
1340 begin 1340 begin
1341 - // Caso exista o Mapa Cacic será verificada a versão e excluída caso antiga(Uma forma de ação pró-ativa) 1341 + // Caso exista o Mapa Cacic ser� verificada a vers�o e exclu�da caso antiga(Uma forma de a��o pr�-ativa)
1342 if FileExists(objCACIC.getLocalFolderName + 'Modules\mapacacic.exe') then 1342 if FileExists(objCACIC.getLocalFolderName + 'Modules\mapacacic.exe') then
1343 Begin 1343 Begin
1344 objCacic.writeDailyLog('Invoca_MapaCacic: Criando processo mapa.'); 1344 objCacic.writeDailyLog('Invoca_MapaCacic: Criando processo mapa.');
@@ -1348,8 +1348,9 @@ begin @@ -1348,8 +1348,9 @@ begin
1348 else 1348 else
1349 objCacic.writeDailyLog('Invoca_MapaCacic: Falha ao criar processo.'); 1349 objCacic.writeDailyLog('Invoca_MapaCacic: Falha ao criar processo.');
1350 End 1350 End
1351 - else  
1352 - objCACIC.writeDailyLog('Não foi possível invocar o Mapa Cacic!'); 1351 + else
  1352 + objCACIC.writeDailyLog('Não foi possível invocar o Mapa Cacic!');
  1353 + End;
1353 End; 1354 End;
1354 End; 1355 End;
1355 end; 1356 end;
@@ -1397,8 +1398,8 @@ begin @@ -1397,8 +1398,8 @@ begin
1397 timerCheckNoMinuto.Enabled := false; 1398 timerCheckNoMinuto.Enabled := false;
1398 objCACIC.writeDebugLog('ExecutaCACIC: Preparando chamada ao Gerente de Coletas...'); 1399 objCACIC.writeDebugLog('ExecutaCACIC: Preparando chamada ao Gerente de Coletas...');
1399 1400
1400 - // Se foi gerado o arquivo ger_erro.txt o Log conterá a mensagem alí gravada como valor de chave  
1401 - // O Gerente de Coletas deverá ser eliminado para que seja baixado novamente por ChecaGERCOLS 1401 + // Se foi gerado o arquivo ger_erro.txt o Log conter� a mensagem al� gravada como valor de chave
  1402 + // O Gerente de Coletas dever� ser eliminado para que seja baixado novamente por ChecaGERCOLS
1402 if (FileExists(objCACIC.getLocalFolderName + 'gererro.txt')) then 1403 if (FileExists(objCACIC.getLocalFolderName + 'gererro.txt')) then
1403 Begin 1404 Begin
1404 objCACIC.writeDailyLog('Gerente de Coletas eliminado devido a falha:'); 1405 objCACIC.writeDailyLog('Gerente de Coletas eliminado devido a falha:');
@@ -1415,12 +1416,12 @@ begin @@ -1415,12 +1416,12 @@ begin
1415 SetaVariaveisGlobais; 1416 SetaVariaveisGlobais;
1416 End; 1417 End;
1417 1418
1418 - objCACIC.writeDailyLog('Iniciando execução de atividades.'); 1419 + objCACIC.writeDailyLog('Iniciando execu��o de atividades.');
1419 1420
1420 objCACIC.writeDebugLog('ExecutaCACIC: Primeira chamada ao Gerente de Coletas...'); 1421 objCACIC.writeDebugLog('ExecutaCACIC: Primeira chamada ao Gerente de Coletas...');
1421 Invoca_GerCols('getConfigs'); 1422 Invoca_GerCols('getConfigs');
1422 1423
1423 - sleep(3000); // Pausa para início do Gerente de Coletas e criação do arquivo temp\aguarde_GER.txt 1424 + sleep(3000); // Pausa para in�cio do Gerente de Coletas e cria��o do arquivo temp\aguarde_GER.txt
1424 1425
1425 Application.ProcessMessages; 1426 Application.ProcessMessages;
1426 InicializaTray; 1427 InicializaTray;
@@ -1438,9 +1439,9 @@ begin @@ -1438,9 +1439,9 @@ begin
1438 Invoca_MapaCacic; 1439 Invoca_MapaCacic;
1439 end; 1440 end;
1440 1441
1441 - // Pausas de 15 segundos para o caso de ser(em) baixada(s) nova(s) versão(ões) de GerCols e/ou Cacic280.  
1442 - // Serão 4 tentativas por minuto  
1443 - // Serão 30 minutos no máximo de tentativas, totalizando 120 1442 + // Pausas de 15 segundos para o caso de ser(em) baixada(s) nova(s) vers�o(�es) de GerCols e/ou Cacic280.
  1443 + // Ser�o 4 tentativas por minuto
  1444 + // Ser�o 30 minutos no m�ximo de tentativas, totalizando 120
1444 intTentativas := 0; 1445 intTentativas := 0;
1445 while (not Pode_Coletar and (intTentativas < 121)) do 1446 while (not Pode_Coletar and (intTentativas < 121)) do
1446 Begin 1447 Begin
@@ -1450,7 +1451,7 @@ begin @@ -1450,7 +1451,7 @@ begin
1450 inc(intTentativas); 1451 inc(intTentativas);
1451 End; 1452 End;
1452 1453
1453 - // Neste caso o Gerente de Coletas deverá fazer novo contato devido à permissão de criptografia ter sido colocada em espera pelo próximo contato. 1454 + // Neste caso o Gerente de Coletas dever� fazer novo contato devido � permiss�o de criptografia ter sido colocada em espera pelo pr�ximo contato.
1454 if (intTentativas > 120) or 1455 if (intTentativas > 120) or
1455 (objCACIC.GetValueFromFile('Configs','CsCipher', strGerColsInfFileName) = '2') then 1456 (objCACIC.GetValueFromFile('Configs','CsCipher', strGerColsInfFileName) = '2') then
1456 Begin 1457 Begin
@@ -1462,23 +1463,23 @@ begin @@ -1462,23 +1463,23 @@ begin
1462 End 1463 End
1463 else 1464 else
1464 Begin 1465 Begin
1465 - // Caso tenha sido baixada nova cópia do Gerente de Coletas, esta deverá ser movida para cima da atual 1466 + // Caso tenha sido baixada nova c�pia do Gerente de Coletas, esta dever� ser movida para cima da atual
1466 if (FileExists(objCACIC.getLocalFolderName + 'Temp\gercols.exe')) then 1467 if (FileExists(objCACIC.getLocalFolderName + 'Temp\gercols.exe')) then
1467 Begin 1468 Begin
1468 - objCACIC.writeDailyLog('Atualizando versão do Gerente de Coletas para '+objCACIC.getVersionInfo(objCACIC.getLocalFolderName + 'Temp\gercols.exe'));  
1469 - // O MoveFileEx não se deu bem no Win98! :| 1469 + objCACIC.writeDailyLog('Atualizando vers�o do Gerente de Coletas para '+objCACIC.getVersionInfo(objCACIC.getLocalFolderName + 'Temp\gercols.exe'));
  1470 + // O MoveFileEx n�o se deu bem no Win98! :|
1470 // MoveFileEx(PChar(objCACIC.getLocalFolderName + 'Temp\gercols.exe'),PChar(objCACIC.getLocalFolderName + 'Modulos\gercols.exe'),MOVEFILE_REPLACE_EXISTING); 1471 // MoveFileEx(PChar(objCACIC.getLocalFolderName + 'Temp\gercols.exe'),PChar(objCACIC.getLocalFolderName + 'Modulos\gercols.exe'),MOVEFILE_REPLACE_EXISTING);
1471 1472
1472 CopyFile(PChar(objCACIC.getLocalFolderName + 'Temp\gercols.exe'),PChar(objCACIC.getLocalFolderName + 'Modules\gercols.exe'),false); 1473 CopyFile(PChar(objCACIC.getLocalFolderName + 'Temp\gercols.exe'),PChar(objCACIC.getLocalFolderName + 'Modules\gercols.exe'),false);
1473 - sleep(2000); // 2 segundos de espera pela cópia! :) (Rwindows!) 1474 + sleep(2000); // 2 segundos de espera pela c�pia! :) (Rwindows!)
1474 1475
1475 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\gercols.exe'); 1476 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\gercols.exe');
1476 - sleep(2000); // 2 segundos de espera pela deleção! 1477 + sleep(2000); // 2 segundos de espera pela dele��o!
1477 1478
1478 - ExecutaCACIC(nil); // Forçará uma reexecução de GerCols... 1479 + ExecutaCACIC(nil); // For�ar� uma reexecu��o de GerCols...
1479 End; 1480 End;
1480 1481
1481 - // Verifico se foi gravada alguma mensagem pelo Gerente de Coletas e mostro caso a configuração permita 1482 + // Verifico se foi gravada alguma mensagem pelo Gerente de Coletas e mostro caso a configura��o permita
1482 v_mensagem := objCACIC.GetValueFromFile('Mensagens','TeMensagem', strGerColsInfFileName); 1483 v_mensagem := objCACIC.GetValueFromFile('Mensagens','TeMensagem', strGerColsInfFileName);
1483 if (v_mensagem <> '') and 1484 if (v_mensagem <> '') and
1484 (objCACIC.GetValueFromFile('Configs','InExibeErrosCriticos', strMainProgramInfFileName) = 'S') then 1485 (objCACIC.GetValueFromFile('Configs','InExibeErrosCriticos', strMainProgramInfFileName) = 'S') then
@@ -1491,37 +1492,37 @@ begin @@ -1491,37 +1492,37 @@ begin
1491 MessageDlg(v_mensagem,v_MsgDlgType, [mbOk], 0); 1492 MessageDlg(v_mensagem,v_MsgDlgType, [mbOk], 0);
1492 objCACIC.setValueToFile('Mensagens','TeMensagem', '', strGerColsInfFileName); 1493 objCACIC.setValueToFile('Mensagens','TeMensagem', '', strGerColsInfFileName);
1493 objCACIC.setValueToFile('Mensagens','CsTipo' , '', strGerColsInfFileName); 1494 objCACIC.setValueToFile('Mensagens','CsTipo' , '', strGerColsInfFileName);
1494 - // Para evitar uma reexecução de GerCols sem necessidade...  
1495 - intTentativas := 121; // Apenas para ajudar na condição seguinte 1495 + // Para evitar uma reexecu��o de GerCols sem necessidade...
  1496 + intTentativas := 121; // Apenas para ajudar na condi��o seguinte
1496 End; 1497 End;
1497 1498
1498 - // Verifico se TE_FILA_FTP foi setado (por GerCols) e obedeço ao intervalo para nova tentativa de coletas  
1499 - // Caso TE_FILA_FTP inicie com # é porque já passou nessa condição e deve iniciar nova tentativa de FTP... 1499 + // Verifico se TE_FILA_FTP foi setado (por GerCols) e obede�o ao intervalo para nova tentativa de coletas
  1500 + // Caso TE_FILA_FTP inicie com # � porque j� passou nessa condi��o e deve iniciar nova tentativa de FTP...
1500 v_TE_FILA_FTP := objCACIC.GetValueFromFile('Configs','TeFilaFTP', strGerColsInfFileName); 1501 v_TE_FILA_FTP := objCACIC.GetValueFromFile('Configs','TeFilaFTP', strGerColsInfFileName);
1501 if (intTentativas <> 121) and 1502 if (intTentativas <> 121) and
1502 (Copy(v_TE_FILA_FTP,1,1) <> '#') and 1503 (Copy(v_TE_FILA_FTP,1,1) <> '#') and
1503 (v_TE_FILA_FTP <> '0') and 1504 (v_TE_FILA_FTP <> '0') and
1504 (v_TE_FILA_FTP <> '') then 1505 (v_TE_FILA_FTP <> '') then
1505 Begin 1506 Begin
1506 - // Busquei o número de milisegundos setados em TeFilaFTP e o obedeço... 1507 + // Busquei o n�mero de milisegundos setados em TeFilaFTP e o obede�o...
1507 // 60.000 milisegundos correspondem a 60 segundos (1 minuto). 1508 // 60.000 milisegundos correspondem a 60 segundos (1 minuto).
1508 - // Acrescento 1, pois se for zero ele não executa. 1509 + // Acrescento 1, pois se for zero ele n�o executa.
1509 timerNuExecApos.Enabled := False; 1510 timerNuExecApos.Enabled := False;
1510 timerNuExecApos.Interval := strtoint(v_TE_FILA_FTP) * 60000; 1511 timerNuExecApos.Interval := strtoint(v_TE_FILA_FTP) * 60000;
1511 timerNuExecApos.Enabled := True; 1512 timerNuExecApos.Enabled := True;
1512 - objCACIC.writeDailyLog('FTP de coletores adiado pelo Módulo Gerente.'); 1513 + objCACIC.writeDailyLog('FTP de coletores adiado pelo M�dulo Gerente.');
1513 objCACIC.writeDailyLog('Nova tentativa em aproximadamente ' + v_TE_FILA_FTP+ ' minuto(s).'); 1514 objCACIC.writeDailyLog('Nova tentativa em aproximadamente ' + v_TE_FILA_FTP+ ' minuto(s).');
1514 objCACIC.setValueToFile('Configs','TeFilaFTP','#' + v_TE_FILA_FTP, strGerColsInfFileName); 1515 objCACIC.setValueToFile('Configs','TeFilaFTP','#' + v_TE_FILA_FTP, strGerColsInfFileName);
1515 End; 1516 End;
1516 1517
1517 - // Desabilita/Habilita a opção de Informações Gerais 1518 + // Desabilita/Habilita a op��o de Informa��es Gerais
1518 HabilitaInformacoesGerais; 1519 HabilitaInformacoesGerais;
1519 1520
1520 - // Desabilita/Habilita a opção de Suporte Remoto 1521 + // Desabilita/Habilita a op��o de Suporte Remoto
1521 HabilitaSuporteRemoto; 1522 HabilitaSuporteRemoto;
1522 1523
1523 - // O loop 1 foi dedicado a atualizações de versões e afins...  
1524 - // O loop 2 deverá invocar as coletas propriamente ditas... 1524 + // O loop 1 foi dedicado a atualiza��es de vers�es e afins...
  1525 + // O loop 2 dever� invocar as coletas propriamente ditas...
1525 if (intTentativas <> 121) then 1526 if (intTentativas <> 121) then
1526 Begin 1527 Begin
1527 objCACIC.writeDebugLog('ExecutaCACIC: Iniciando Chamada para Coletas...'); 1528 objCACIC.writeDebugLog('ExecutaCACIC: Iniciando Chamada para Coletas...');
@@ -1564,8 +1565,8 @@ end; @@ -1564,8 +1565,8 @@ end;
1564 1565
1565 procedure TFormularioGeral.ExibirConfiguracoes(Sender: TObject); 1566 procedure TFormularioGeral.ExibirConfiguracoes(Sender: TObject);
1566 begin 1567 begin
1567 - // SJI = Senha Já Informada...  
1568 - // Esse valor é inicializado com "N" 1568 + // SJI = Senha J� Informada...
  1569 + // Esse valor � inicializado com "N"
1569 if (objCACIC.deCrypt( objCACIC.GetValueFromFile('Configs','SJI',strMainProgramInfFileName))='') and 1570 if (objCACIC.deCrypt( objCACIC.GetValueFromFile('Configs','SJI',strMainProgramInfFileName))='') and
1570 (objCACIC.GetValueFromFile('Configs','WebManagerAddress',strChkSisInfFileName)<>'') then 1571 (objCACIC.GetValueFromFile('Configs','WebManagerAddress',strChkSisInfFileName)<>'') then
1571 begin 1572 begin
@@ -1583,13 +1584,13 @@ begin @@ -1583,13 +1584,13 @@ begin
1583 end; 1584 end;
1584 1585
1585 //======================================================================= 1586 //=======================================================================
1586 -// Todo o código deste ponto em diante está relacionado às rotinas de  
1587 -// de inclusão do ícone do programa na bandeja do sistema 1587 +// Todo o c�digo deste ponto em diante est� relacionado �s rotinas de
  1588 +// de inclus�o do �cone do programa na bandeja do sistema
1588 //======================================================================= 1589 //=======================================================================
1589 procedure TFormularioGeral.InicializaTray; 1590 procedure TFormularioGeral.InicializaTray;
1590 var v_strHint : String; 1591 var v_strHint : String;
1591 begin 1592 begin
1592 - // g_intStatus receberá 0 -> NORMAL ou 1 -> COLETAS ou 3 -> srCACIC 1593 + // g_intStatus receber� 0 -> NORMAL ou 1 -> COLETAS ou 3 -> srCACIC
1593 g_intStatus := ActualActivity; 1594 g_intStatus := ActualActivity;
1594 1595
1595 // Monto a frase a ser colocada no Hint 1596 // Monto a frase a ser colocada no Hint
@@ -1598,14 +1599,14 @@ begin @@ -1598,14 +1599,14 @@ begin
1598 if not (objCACIC.getValueFromTags('IPAddress',strWin32_NetworkAdapterConfiguration) = '') then 1599 if not (objCACIC.getValueFromTags('IPAddress',strWin32_NetworkAdapterConfiguration) = '') then
1599 v_strHint := v_strHint + chr(13) + chr(10) + 'IP: ' + objCACIC.getValueFromTags('IPAddress',strWin32_NetworkAdapterConfiguration); 1600 v_strHint := v_strHint + chr(13) + chr(10) + 'IP: ' + objCACIC.getValueFromTags('IPAddress',strWin32_NetworkAdapterConfiguration);
1600 1601
1601 - // Mostro a versão no painel de Informações Gerais 1602 + // Mostro a vers�o no painel de Informa��es Gerais
1602 1603
1603 1604
1604 if (g_intStatus = NORMAL) then 1605 if (g_intStatus = NORMAL) then
1605 Begin 1606 Begin
1606 if not (UpperCase(objCACIC.GetValueFromFile('Configs','ConexaoOK', strGerColsInfFileName)) = 'S') then 1607 if not (UpperCase(objCACIC.GetValueFromFile('Configs','ConexaoOK', strGerColsInfFileName)) = 'S') then
1607 Begin 1608 Begin
1608 - v_strHint := v_strHint + ' IDENTIFICAÇÃO LOCAL...'; 1609 + v_strHint := v_strHint + ' IDENTIFICA��O LOCAL...';
1609 g_intStatus := DESCONFIGURADO; 1610 g_intStatus := DESCONFIGURADO;
1610 End 1611 End
1611 else 1612 else
@@ -1617,7 +1618,7 @@ begin @@ -1617,7 +1618,7 @@ begin
1617 if g_intStatus = EM_SUPORTE then 1618 if g_intStatus = EM_SUPORTE then
1618 v_strHint := v_strHint + chr(13) + chr(10) + ' Em Suporte Remoto...' 1619 v_strHint := v_strHint + chr(13) + chr(10) + ' Em Suporte Remoto...'
1619 else if g_intStatus = COLETANDO then 1620 else if g_intStatus = COLETANDO then
1620 - v_strHint := v_strHint + chr(13) + chr(10) + ' Coletas em Execução...'; 1621 + v_strHint := v_strHint + chr(13) + chr(10) + ' Coletas em Execu��o...';
1621 objCACIC.writeDebugLog('InicializaTray: v_strHint Depois = "'+v_strHint+'"'); 1622 objCACIC.writeDebugLog('InicializaTray: v_strHint Depois = "'+v_strHint+'"');
1622 End; 1623 End;
1623 1624
@@ -1631,19 +1632,19 @@ begin @@ -1631,19 +1632,19 @@ begin
1631 imgIconList.GetIcon(g_intIconIndex,TrayIcon1.Icon); 1632 imgIconList.GetIcon(g_intIconIndex,TrayIcon1.Icon);
1632 g_intStatusAnterior := g_intStatus; 1633 g_intStatusAnterior := g_intStatus;
1633 timerCheckNoMinuto.Enabled := false; 1634 timerCheckNoMinuto.Enabled := false;
1634 - timerCheckNoMinuto.Interval := 5000; // Durante as coletas altero o timer verificador de ações para 5 segundos 1635 + timerCheckNoMinuto.Interval := 5000; // Durante as coletas altero o timer verificador de a��es para 5 segundos
1635 1636
1636 objCACIC.writeDebugLog('InicializaTray: Status alterado para ' + intToStr(g_intStatus)); 1637 objCACIC.writeDebugLog('InicializaTray: Status alterado para ' + intToStr(g_intStatus));
1637 if (g_intStatus = COLETANDO) then 1638 if (g_intStatus = COLETANDO) then
1638 Begin 1639 Begin
1639 Mnu_InformacoesGerais.Enabled := False; 1640 Mnu_InformacoesGerais.Enabled := False;
1640 Mnu_ExecutarAgora.Enabled := False; 1641 Mnu_ExecutarAgora.Enabled := False;
1641 - Mnu_InformacoesGerais.Caption := 'Aguarde, coletas em ação!'; 1642 + Mnu_InformacoesGerais.Caption := 'Aguarde, coletas em a��o!';
1642 Mnu_ExecutarAgora.Caption := Mnu_InformacoesGerais.Caption; 1643 Mnu_ExecutarAgora.Caption := Mnu_InformacoesGerais.Caption;
1643 End 1644 End
1644 else if (g_intStatus = DESCONFIGURADO) then 1645 else if (g_intStatus = DESCONFIGURADO) then
1645 Begin 1646 Begin
1646 - objCACIC.writeDebugLog('InicializaTray: Setando Ícones para "Interroga" (intStatus=' + IntToStr(g_intStatus) + ')...'); 1647 + objCACIC.writeDebugLog('InicializaTray: Setando �cones para "Interroga" (intStatus=' + IntToStr(g_intStatus) + ')...');
1647 End 1648 End
1648 else if (g_intStatus = EM_SUPORTE) then 1649 else if (g_intStatus = EM_SUPORTE) then
1649 Begin 1650 Begin
@@ -1654,14 +1655,14 @@ begin @@ -1654,14 +1655,14 @@ begin
1654 End 1655 End
1655 else 1656 else
1656 Begin 1657 Begin
1657 - timerCheckNoMinuto.Interval := 60000; // Restauro o timer verificador de ações para 1 minuto 1658 + timerCheckNoMinuto.Interval := 60000; // Restauro o timer verificador de a��es para 1 minuto
1658 1659
1659 Mnu_InformacoesGerais.Caption := strMenuCaptionINF; 1660 Mnu_InformacoesGerais.Caption := strMenuCaptionINF;
1660 Mnu_ExecutarAgora.Caption := strMenuCaptionEXE; 1661 Mnu_ExecutarAgora.Caption := strMenuCaptionEXE;
1661 Mnu_InformacoesGerais.Enabled := true; 1662 Mnu_InformacoesGerais.Enabled := true;
1662 Mnu_ExecutarAgora.Enabled := true; 1663 Mnu_ExecutarAgora.Enabled := true;
1663 1664
1664 - objCACIC.writeDebugLog('InicializaTray: Setando Ícones para "Normal" (intStatus=' + IntToStr(g_intStatus) + ')...'); 1665 + objCACIC.writeDebugLog('InicializaTray: Setando �cones para "Normal" (intStatus=' + IntToStr(g_intStatus) + ')...');
1665 End; 1666 End;
1666 1667
1667 objCACIC.writeDebugLog('InicializaTray: Setando o HINT do Systray para: "'+v_strHint+'"'); 1668 objCACIC.writeDebugLog('InicializaTray: Setando o HINT do Systray para: "'+v_strHint+'"');
@@ -1671,13 +1672,13 @@ begin @@ -1671,13 +1672,13 @@ begin
1671 1672
1672 if (objCACIC.GetValueFromFile('Configs','InExibeBandeja', strMainProgramInfFileName) <> 'N') Then 1673 if (objCACIC.GetValueFromFile('Configs','InExibeBandeja', strMainProgramInfFileName) <> 'N') Then
1673 Begin 1674 Begin
1674 - objCACIC.writeDebugLog('InicializaTray: Exibe/Renova Ícone do Systray...'); 1675 + objCACIC.writeDebugLog('InicializaTray: Exibe/Renova �cone do Systray...');
1675 imgIconList.GetIcon(g_intStatus,TrayIcon1.Icon); 1676 imgIconList.GetIcon(g_intStatus,TrayIcon1.Icon);
1676 TrayIcon1.Show; 1677 TrayIcon1.Show;
1677 End 1678 End
1678 else 1679 else
1679 Begin 1680 Begin
1680 - objCACIC.writeDebugLog('InicializaTray: Inibe Ícone do Systray...'); 1681 + objCACIC.writeDebugLog('InicializaTray: Inibe �cone do Systray...');
1681 TrayIcon1.Hide; 1682 TrayIcon1.Hide;
1682 End; 1683 End;
1683 End 1684 End
@@ -1703,22 +1704,22 @@ begin @@ -1703,22 +1704,22 @@ begin
1703 FormularioGeral.Visible:=false; 1704 FormularioGeral.Visible:=false;
1704 if (objCACIC.GetValueFromFile('Configs','InExibeBandeja', strMainProgramInfFileName) = 'N') Then 1705 if (objCACIC.GetValueFromFile('Configs','InExibeBandeja', strMainProgramInfFileName) = 'N') Then
1705 Begin 1706 Begin
1706 - objCACIC.writeDebugLog('MinimizaParaTrayArea: Escondendo o ícone'); 1707 + objCACIC.writeDebugLog('MinimizaParaTrayArea: Escondendo o �cone');
1707 TrayIcon1.Hide 1708 TrayIcon1.Hide
1708 End 1709 End
1709 else 1710 else
1710 Begin 1711 Begin
1711 - objCACIC.writeDebugLog('MinimizaParaTrayArea: Mostrando o ícone'); 1712 + objCACIC.writeDebugLog('MinimizaParaTrayArea: Mostrando o �cone');
1712 TrayIcon1.Show; 1713 TrayIcon1.Show;
1713 End; 1714 End;
1714 end; 1715 end;
1715 // ------------------------------------- 1716 // -------------------------------------
1716 -// Fim dos códigos da bandeja do sistema 1717 +// Fim dos c�digos da bandeja do sistema
1717 // ------------------------------------- 1718 // -------------------------------------
1718 1719
1719 procedure TFormularioGeral.FormCloseQuery(Sender: TObject; var CanClose: Boolean); 1720 procedure TFormularioGeral.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1720 begin 1721 begin
1721 - // Esse evento é colocado em Nil durante o shutdown do windows. 1722 + // Esse evento � colocado em Nil durante o shutdown do windows.
1722 // Ver o evento WMQueryEndSession. 1723 // Ver o evento WMQueryEndSession.
1723 CanClose := False; 1724 CanClose := False;
1724 MinimizaParaTrayArea(Nil); 1725 MinimizaParaTrayArea(Nil);
@@ -1726,8 +1727,8 @@ end; @@ -1726,8 +1727,8 @@ end;
1726 1727
1727 procedure TFormularioGeral.WMQueryEndSession(var Msg: TWMQueryEndSession); 1728 procedure TFormularioGeral.WMQueryEndSession(var Msg: TWMQueryEndSession);
1728 begin 1729 begin
1729 - objCACIC.writeDailyLog('Windows em processo de finalização!');  
1730 - // Quando há um shutdown do windows em execução, libera o close. 1730 + objCACIC.writeDailyLog('Windows em processo de finaliza��o!');
  1731 + // Quando h� um shutdown do windows em execu��o, libera o close.
1731 OnCloseQuery := Nil; 1732 OnCloseQuery := Nil;
1732 Msg.Result := 1; 1733 Msg.Result := 1;
1733 Finaliza(true); 1734 Finaliza(true);
@@ -1756,7 +1757,7 @@ begin @@ -1756,7 +1757,7 @@ begin
1756 ST_VL_WinsPrimario.Caption := objCACIC.getValueFromTags('WINSPrimaryServer' ,strWin32_NetworkAdapterConfiguration); 1757 ST_VL_WinsPrimario.Caption := objCACIC.getValueFromTags('WINSPrimaryServer' ,strWin32_NetworkAdapterConfiguration);
1757 ST_VL_WinsSecundario.Caption := objCACIC.getValueFromTags('WINSSecondaryServer' ,strWin32_NetworkAdapterConfiguration); 1758 ST_VL_WinsSecundario.Caption := objCACIC.getValueFromTags('WINSSecondaryServer' ,strWin32_NetworkAdapterConfiguration);
1758 1759
1759 - // Exibição das informações de Sistemas Monitorados... 1760 + // Exibi��o das informa��es de Sistemas Monitorados...
1760 v_conta_perfis := 1; 1761 v_conta_perfis := 1;
1761 v_conta_infos_coletadas := 0; 1762 v_conta_infos_coletadas := 0;
1762 v_tripa_perfis := '*'; 1763 v_tripa_perfis := '*';
@@ -1772,7 +1773,7 @@ begin @@ -1772,7 +1773,7 @@ begin
1772 Begin 1773 Begin
1773 v_array_perfis := objCACIC.explode(v_tripa_perfis,','); 1774 v_array_perfis := objCACIC.explode(v_tripa_perfis,',');
1774 1775
1775 - // ATENÇÃO!!! Antes da implementação de INFORMAÇÕES GERAIS o Count ia até 11, ok?! 1776 + // ATEN��O!!! Antes da implementa��o de INFORMA��ES GERAIS o Count ia at� 11, ok?!
1776 if (v_array_perfis.Count > 11) and (v_array_perfis[11]='S') then 1777 if (v_array_perfis.Count > 11) and (v_array_perfis[11]='S') then
1777 Begin 1778 Begin
1778 v_tripa_infos_coletadas := objCACIC.deCrypt( objCACIC.GetValueFromFile('Collects','ColMoni_Atual', strGerColsInfFileName)); 1779 v_tripa_infos_coletadas := objCACIC.deCrypt( objCACIC.GetValueFromFile('Collects','ColMoni_Atual', strGerColsInfFileName));
@@ -1814,7 +1815,7 @@ begin @@ -1814,7 +1815,7 @@ begin
1814 Begin 1815 Begin
1815 if (copy(strAux,0,8) = FormatDateTime('yyyymmdd', Date)) then 1816 if (copy(strAux,0,8) = FormatDateTime('yyyymmdd', Date)) then
1816 Begin 1817 Begin
1817 - // Vamos reaproveitar algumas variáveis!... 1818 + // Vamos reaproveitar algumas vari�veis!...
1818 1819
1819 v_array_perfis := objCACIC.explode(strAux,'#'); 1820 v_array_perfis := objCACIC.explode(strAux,'#');
1820 for intAux := 1 to v_array_perfis.Count-1 Do 1821 for intAux := 1 to v_array_perfis.Count-1 Do
@@ -1833,7 +1834,7 @@ begin @@ -1833,7 +1834,7 @@ begin
1833 v_array_infos_coletadas[3] := v_array_infos_coletadas[2]; 1834 v_array_infos_coletadas[3] := v_array_infos_coletadas[2];
1834 End; 1835 End;
1835 1836
1836 - // Códigos Possíveis: -1 : Problema no Envio da Coleta 1837 + // C�digos Poss�veis: -1 : Problema no Envio da Coleta
1837 // 1 : Coleta Enviada 1838 // 1 : Coleta Enviada
1838 // 0 : Sem Coleta para Envio 1839 // 0 : Sem Coleta para Envio
1839 strAux := IfThen(v_array_infos_coletadas[3]='1','Coleta Enviada ao Gerente WEB!', 1840 strAux := IfThen(v_array_infos_coletadas[3]='1','Coleta Enviada ao Gerente WEB!',
@@ -1849,7 +1850,7 @@ begin @@ -1849,7 +1850,7 @@ begin
1849 else 1850 else
1850 Begin 1851 Begin
1851 listSistemasMonitorados.Items.Add; 1852 listSistemasMonitorados.Items.Add;
1852 - listSistemasMonitorados.Items[0].Caption := 'Não Há Coletas Registradas Nesta Data'; 1853 + listSistemasMonitorados.Items[0].Caption := 'N�o H� Coletas Registradas Nesta Data';
1853 End; 1854 End;
1854 1855
1855 strConfigsPatrimonio := objCACIC.GetValueFromFile('Patrimonio','Configs', strMainProgramInfFileName); 1856 strConfigsPatrimonio := objCACIC.GetValueFromFile('Patrimonio','Configs', strMainProgramInfFileName);
@@ -1971,7 +1972,7 @@ procedure TFormularioGeral.Bt_Fechar_InfosGeraisClick(Sender: TObject); @@ -1971,7 +1972,7 @@ procedure TFormularioGeral.Bt_Fechar_InfosGeraisClick(Sender: TObject);
1971 end; 1972 end;
1972 1973
1973 1974
1974 -// Solução baixada de http://www.delphidabbler.com/codesnip.php?action=named&routines=URLDecode&showsrc=1 1975 +// Solu��o baixada de http://www.delphidabbler.com/codesnip.php?action=named&routines=URLDecode&showsrc=1
1975 function TFormularioGeral.URLDecode(const S: string): string; 1976 function TFormularioGeral.URLDecode(const S: string): string;
1976 var 1977 var
1977 Idx: Integer; // loops thru chars in string 1978 Idx: Integer; // loops thru chars in string
@@ -2029,15 +2030,15 @@ var strXML, @@ -2029,15 +2030,15 @@ var strXML,
2029 begin 2030 begin
2030 2031
2031 // ********************************************************************************************************** 2032 // **********************************************************************************************************
2032 - // Esta procedure tratará os comandos e suas ações, enviados em um pacote XML na requisição, conforme abaixo: 2033 + // Esta procedure tratar� os comandos e suas a��es, enviados em um pacote XML na requisi��o, conforme abaixo:
2033 // ********************************************************************************************************** 2034 // **********************************************************************************************************
2034 - // Execute -> Comando que forçará a execução do Gerente de Coletas (Sugestão: Configurar coletas forçadas no Gerente WEB e executar esse comando)  
2035 - // Requisição: Tag <Execute> 2035 + // Execute -> Comando que for�ar� a execu��o do Gerente de Coletas (Sugest�o: Configurar coletas for�adas no Gerente WEB e executar esse comando)
  2036 + // Requisi��o: Tag <Execute>
2036 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK' 2037 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK'
2037 // 2038 //
2038 - // Ask -> Comando que perguntará sobre a existência de um determinado arquivo na estação.  
2039 - // Requisição: Tag <FileName>: Nome do arquivo a pesquisar no repositório local  
2040 - // Tag <FileHash>: Hash referente ao arquivo a ser pesquisado no repositório local 2039 + // Ask -> Comando que perguntar� sobre a exist�ncia de um determinado arquivo na esta��o.
  2040 + // Requisi��o: Tag <FileName>: Nome do arquivo a pesquisar no reposit�rio local
  2041 + // Tag <FileHash>: Hash referente ao arquivo a ser pesquisado no reposit�rio local
2041 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK'; 2042 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK';
2042 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'Tenho' ou 2043 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'Tenho' ou
2043 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'NaoTenho' ou 2044 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'NaoTenho' ou
@@ -2045,38 +2046,38 @@ begin @@ -2045,38 +2046,38 @@ begin
2045 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'Ocupado'. 2046 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'Ocupado'.
2046 // 2047 //
2047 // 2048 //
2048 - // Erase -> Comando que provocará a exclusão de determinado arquivo.  
2049 - // Deverá ser acompanhado das tags <FileName> e <FileHash>  
2050 - // Requisição: Tag <FileName>: Nome do arquivo a ser excluído do repositório local  
2051 - // Tag <FileHash>: Hash referente ao arquivo a ser excluído do repositório local 2049 + // Erase -> Comando que provocar� a exclus�o de determinado arquivo.
  2050 + // Dever� ser acompanhado das tags <FileName> e <FileHash>
  2051 + // Requisi��o: Tag <FileName>: Nome do arquivo a ser exclu�do do reposit�rio local
  2052 + // Tag <FileHash>: Hash referente ao arquivo a ser exclu�do do reposit�rio local
2052 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK'; 2053 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK';
2053 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'AcaoExecutada' ou 2054 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'AcaoExecutada' ou
2054 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'ArquivoNaoEncontrado' ou 2055 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'ArquivoNaoEncontrado' ou
2055 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'EscritaNaoPermitida'; 2056 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'EscritaNaoPermitida';
2056 // 2057 //
2057 - // Registry -> Comando que provocará ação no Registry de estações com MS-Windows.  
2058 - // Deverá ser acompanhado das tags <Path>, <Action>, <Condition> e <Value>  
2059 - // Requisição: Tag <Path> : Caminho no Registry  
2060 - // Tag <Action> : Ação para execução  
2061 - // SAVE => Salva o valor contido na tag <Value> de acordo com condição contida na tag <Condition>  
2062 - // ERASE => Apaga a chave de acordo com condição contida na tag <Condition>  
2063 - // Tag <Condition> : Condiçção para execução da ação 2058 + // Registry -> Comando que provocar� a��o no Registry de esta��es com MS-Windows.
  2059 + // Dever� ser acompanhado das tags <Path>, <Action>, <Condition> e <Value>
  2060 + // Requisi��o: Tag <Path> : Caminho no Registry
  2061 + // Tag <Action> : A��o para execu��o
  2062 + // SAVE => Salva o valor contido na tag <Value> de acordo com condi��o contida na tag <Condition>
  2063 + // ERASE => Apaga a chave de acordo com condi��o contida na tag <Condition>
  2064 + // Tag <Condition> : Condi���o para execu��o da a��o
2064 // EQUAL => Se o valor contido na tag <Value> for IGUAL ao valor encontrado na chave 2065 // EQUAL => Se o valor contido na tag <Value> for IGUAL ao valor encontrado na chave
2065 // DIFFER => Se o valor contido na tag <Value> for DIFERENTE ao valor encontrado na chave 2066 // DIFFER => Se o valor contido na tag <Value> for DIFERENTE ao valor encontrado na chave
2066 - // NONE => Nenhuma condição, permitindo a execução da ação de forma incondicional  
2067 - // Tag <Value> : Valor a ser utilizado na ação 2067 + // NONE => Nenhuma condi��o, permitindo a execu��o da a��o de forma incondicional
  2068 + // Tag <Value> : Valor a ser utilizado na a��o
2068 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK'; 2069 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK';
2069 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'AcaoExecutada' ou 2070 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'AcaoExecutada' ou
2070 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'ChaveNaoEncontrada' ou 2071 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'ChaveNaoEncontrada' ou
2071 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'EscritaNaoPermitida'; 2072 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'EscritaNaoPermitida';
2072 // 2073 //
2073 - // Exit -> Comando para finalização do agente principal (bandeja) 2074 + // Exit -> Comando para finaliza��o do agente principal (bandeja)
2074 2075
2075 - // Palavra Chave definida por GerCols, enviada e armazenada no BD. A autenticação da comunicação é baseada na verificação deste valor.  
2076 - // A geração da palavra chave dar-se-á a cada contato do GerCols com o módulo Gerente WEB 2076 + // Palavra Chave definida por GerCols, enviada e armazenada no BD. A autentica��o da comunica��o � baseada na verifica��o deste valor.
  2077 + // A gera��o da palavra chave dar-se-� a cada contato do GerCols com o m�dulo Gerente WEB
2077 // te_palavra_chave -> <TE_PALAVRA_CHAVE> 2078 // te_palavra_chave -> <TE_PALAVRA_CHAVE>
2078 2079
2079 - // Tratamento da requisição http... 2080 + // Tratamento da requisi��o http...
2080 strXML := URLDecode(ARequestInfo.UnparsedParams); 2081 strXML := URLDecode(ARequestInfo.UnparsedParams);
2081 intAux := Pos('=',strXML); 2082 intAux := Pos('=',strXML);
2082 strXML := copy(strXML,(intAux+1),StrLen(PAnsiChar(strXML))-intAux); 2083 strXML := copy(strXML,(intAux+1),StrLen(PAnsiChar(strXML))-intAux);
@@ -2084,11 +2085,11 @@ begin @@ -2084,11 +2085,11 @@ begin
2084 2085
2085 2086
2086 2087
2087 - // Autenticação e tratamento da requisição 2088 + // Autentica��o e tratamento da requisi��o
2088 if (objCACIC.xmlGetValue('te_palavra_chave',strXML) = objCACIC.getValueMemoryData('Configs.te_palavra_chave',v_tstrCipherOpened)) then 2089 if (objCACIC.xmlGetValue('te_palavra_chave',strXML) = objCACIC.getValueMemoryData('Configs.te_palavra_chave',v_tstrCipherOpened)) then
2089 Begin 2090 Begin
2090 strCmd := objCACIC.xmlGetValue('cmd',strXML); 2091 strCmd := objCACIC.xmlGetValue('cmd',strXML);
2091 - // As ações terão seus valores 2092 + // As a��es ter�o seus valores
2092 2093
2093 if (strCmd = 'Execute') or 2094 if (strCmd = 'Execute') or
2094 (strCmd = 'Ask') or 2095 (strCmd = 'Ask') or
@@ -2097,10 +2098,10 @@ begin @@ -2097,10 +2098,10 @@ begin
2097 (strCmd = 'Exit') then 2098 (strCmd = 'Exit') then
2098 AResponseinfo.ContentText := 'OK' 2099 AResponseinfo.ContentText := 'OK'
2099 else 2100 else
2100 - AResponseinfo.ContentText := 'COMANDO NÃO RECONHECIDO!'; 2101 + AResponseinfo.ContentText := 'COMANDO N�O RECONHECIDO!';
2101 End 2102 End
2102 else 2103 else
2103 - AResponseinfo.ContentText := 'ACESSO NÃO PERMITIDO!'; 2104 + AResponseinfo.ContentText := 'ACESSO N�O PERMITIDO!';
2104 2105
2105 if (strCmd = 'Execute') then 2106 if (strCmd = 'Execute') then
2106 ExecutaCACIC(nil) 2107 ExecutaCACIC(nil)
@@ -2148,10 +2149,10 @@ if (pStrRCAction = &#39;&#39;) then @@ -2148,10 +2149,10 @@ if (pStrRCAction = &#39;&#39;) then
2148 else 2149 else
2149 Begin 2150 Begin
2150 tstrActions := objCACIC.explode(pStrRCAction,'[FIELD]'); 2151 tstrActions := objCACIC.explode(pStrRCAction,'[FIELD]');
2151 - if (AnsiPos('OSCE_DEBUG' ,tstrActions[1]) = 0) and // Não informo sobre as ações temporárias do OfficeScan (vide docs.trendmicro.com -> HotFix 1197)  
2152 - (AnsiPos('ck_conexao.' ,tstrActions[1]) = 0) and // Não informo sobre as ações com o arquivo de controle de conexao do srCACICsrv  
2153 - (AnsiPos(objCACIC.getLocalFolderName,tstrActions[1]) = 0) and // Não informo sobre as ações de rotina na pasta do CACIC  
2154 - (trim(tstrActions[1]) <> '') then // Não informo caso o parâmetro 1 (origem) esteja vazio 2152 + if (AnsiPos('OSCE_DEBUG' ,tstrActions[1]) = 0) and // N�o informo sobre as a��es tempor�rias do OfficeScan (vide docs.trendmicro.com -> HotFix 1197)
  2153 + (AnsiPos('ck_conexao.' ,tstrActions[1]) = 0) and // N�o informo sobre as a��es com o arquivo de controle de conexao do srCACICsrv
  2154 + (AnsiPos(objCACIC.getLocalFolderName,tstrActions[1]) = 0) and // N�o informo sobre as a��es de rotina na pasta do CACIC
  2155 + (trim(tstrActions[1]) <> '') then // N�o informo caso o par�metro 1 (origem) esteja vazio
2155 Begin 2156 Begin
2156 objCACIC.writeDebugLog('CheckRCActions: ' + pStrRCAction); 2157 objCACIC.writeDebugLog('CheckRCActions: ' + pStrRCAction);
2157 strRCActionsAux2 := objCACIC.getValueFromFile('srCACICcli','m_idConexao',objCACIC.getLocalFolderName + 'Temp\ck_conexao.ini'); 2158 strRCActionsAux2 := objCACIC.getValueFromFile('srCACICcli','m_idConexao',objCACIC.getLocalFolderName + 'Temp\ck_conexao.ini');
@@ -2177,17 +2178,17 @@ var v_strTeSO, @@ -2177,17 +2178,17 @@ var v_strTeSO,
2177 begin 2178 begin
2178 if boolServerON then // Ordeno ao SrCACICsrv que auto-finalize 2179 if boolServerON then // Ordeno ao SrCACICsrv que auto-finalize
2179 Begin 2180 Begin
2180 - // Desligando a captura de ações 2181 + // Desligando a captura de a��es
2181 CN.Stop; 2182 CN.Stop;
2182 2183
2183 - objCACIC.writeDailyLog('Desativando o Módulo de Suporte Remoto Seguro.'); 2184 + objCACIC.writeDailyLog('Desativando o M�dulo de Suporte Remoto Seguro.');
2184 2185
2185 objCACIC.createOneProcess(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe -kill',false,SW_HIDE); 2186 objCACIC.createOneProcess(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe -kill',false,SW_HIDE);
2186 objCacic.setBoolCipher(not objCacic.isInDebugMode); 2187 objCacic.setBoolCipher(not objCacic.isInDebugMode);
2187 - // Bloqueio o módulo de suporte remoto seguro na FireWall nativa. 2188 + // Bloqueio o m�dulo de suporte remoto seguro na FireWall nativa.
2188 objCACIC.addApplicationToFirewall('srCACIC - Suporte Remoto Seguro do Sistema CACIC',objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe', false); 2189 objCACIC.addApplicationToFirewall('srCACIC - Suporte Remoto Seguro do Sistema CACIC',objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe', false);
2189 2190
2190 - Sleep(3000); // Pausa para liberação do aguarde_srCACIC.txt 2191 + Sleep(3000); // Pausa para libera��o do aguarde_srCACIC.txt
2191 2192
2192 CheckRCActions; 2193 CheckRCActions;
2193 2194
@@ -2219,13 +2220,13 @@ begin @@ -2219,13 +2220,13 @@ begin
2219 v_strNuPortaSR := trim(objCACIC.deCrypt( objCACIC.GetValueFromFile('Configs','NuPortaSrCacic' , strMainProgramInfFileName))); 2220 v_strNuPortaSR := trim(objCACIC.deCrypt( objCACIC.GetValueFromFile('Configs','NuPortaSrCacic' , strMainProgramInfFileName)));
2220 v_strNuTimeOutSR := trim(objCACIC.GetValueFromFile('Configs','NuTimeOutSrCacic' , strMainProgramInfFileName)); 2221 v_strNuTimeOutSR := trim(objCACIC.GetValueFromFile('Configs','NuTimeOutSrCacic' , strMainProgramInfFileName));
2221 2222
2222 - // Detectar versão do Windows antes de fazer a chamada seguinte... 2223 + // Detectar vers�o do Windows antes de fazer a chamada seguinte...
2223 try 2224 try
2224 AssignFile(fileAguarde,objCACIC.getLocalFolderName + 'Temp\aguarde_srCACIC.txt'); 2225 AssignFile(fileAguarde,objCACIC.getLocalFolderName + 'Temp\aguarde_srCACIC.txt');
2225 {$IOChecks off} 2226 {$IOChecks off}
2226 Reset(fileAguarde); {Abre o arquivo texto} 2227 Reset(fileAguarde); {Abre o arquivo texto}
2227 {$IOChecks on} 2228 {$IOChecks on}
2228 - if (IOResult <> 0) then // Arquivo não existe, será recriado. 2229 + if (IOResult <> 0) then // Arquivo n�o existe, ser� recriado.
2229 begin 2230 begin
2230 Rewrite (fileAguarde); 2231 Rewrite (fileAguarde);
2231 Append(fileAguarde); 2232 Append(fileAguarde);
@@ -2236,11 +2237,11 @@ begin @@ -2236,11 +2237,11 @@ begin
2236 Finally 2237 Finally
2237 End; 2238 End;
2238 2239
2239 - objCACIC.writeDebugLog('Mnu_SuporteRemotoClick: Verificando validade do módulo srCACICsrv para chamada!'); 2240 + objCACIC.writeDebugLog('Mnu_SuporteRemotoClick: Verificando validade do m�dulo srCACICsrv para chamada!');
2240 2241
2241 objCACIC.writeDebugLog('Mnu_SuporteRemotoClick: objCACIC.getFileHash('+objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe'+') = "'+objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe'+'"')); 2242 objCACIC.writeDebugLog('Mnu_SuporteRemotoClick: objCACIC.getFileHash('+objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe'+') = "'+objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe'+'"'));
2242 2243
2243 - // Executarei o srCACICsrv após batimento do HASHCode 2244 + // Executarei o srCACICsrv ap�s batimento do HASHCode
2244 if (objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe') = objCACIC.deCrypt( objCACIC.GetValueFromFile('Hash-Codes','SRCACICSRV.EXE', strChkSisInfFileName),false,true)) then 2245 if (objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe') = objCACIC.deCrypt( objCACIC.GetValueFromFile('Hash-Codes','SRCACICSRV.EXE', strChkSisInfFileName),false,true)) then
2245 Begin 2246 Begin
2246 objCACIC.writeDebugLog('Mnu_SuporteRemotoClick: Invocando (Criptografado)"'+objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe -start [' + objCACIC.getWebManagerAddress + ']' + 2247 objCACIC.writeDebugLog('Mnu_SuporteRemotoClick: Invocando (Criptografado)"'+objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe -start [' + objCACIC.getWebManagerAddress + ']' +
@@ -2259,7 +2260,7 @@ begin @@ -2259,7 +2260,7 @@ begin
2259 '[' + v_strNuPortaSR + ']' + 2260 '[' + v_strNuPortaSR + ']' +
2260 '[' + v_strNuTimeOutSR + ']'); 2261 '[' + v_strNuTimeOutSR + ']');
2261 2262
2262 - // Libero o módulo de suporte remoto seguro na FireWall nativa. 2263 + // Libero o m�dulo de suporte remoto seguro na FireWall nativa.
2263 objCACIC.addApplicationToFirewall('srCACIC - Suporte Remoto Seguro do Sistema CACIC',objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe', true); 2264 objCACIC.addApplicationToFirewall('srCACIC - Suporte Remoto Seguro do Sistema CACIC',objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe', true);
2264 2265
2265 objCACIC.createOneProcess(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe -start [' + objCACIC.getWebManagerAddress + ']' + 2266 objCACIC.createOneProcess(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe -start [' + objCACIC.getWebManagerAddress + ']' +
@@ -2270,19 +2271,19 @@ begin @@ -2270,19 +2271,19 @@ begin
2270 '[' + v_strNuPortaSR + ']' + 2271 '[' + v_strNuPortaSR + ']' +
2271 '[' + v_strNuTimeOutSR + ']',false,SW_NORMAL); 2272 '[' + v_strNuTimeOutSR + ']',false,SW_NORMAL);
2272 tstrAux.Free; 2273 tstrAux.Free;
2273 - Sleep(3000); // Pausa para criação do aguarde_srCACIC.txt 2274 + Sleep(3000); // Pausa para cria��o do aguarde_srCACIC.txt
2274 objCACIC.setBoolCipher(not objCACIC.isInDebugMode); 2275 objCACIC.setBoolCipher(not objCACIC.isInDebugMode);
2275 InicializaTray; 2276 InicializaTray;
2276 2277
2277 - // Ligando a captura de ações 2278 + // Ligando a captura de a��es
2278 CN.Execute; 2279 CN.Execute;
2279 2280
2280 BoolServerON := true; 2281 BoolServerON := true;
2281 End 2282 End
2282 else 2283 else
2283 Begin 2284 Begin
2284 - objCACIC.writeDailyLog('Execução de srCACICsrv impedida por falta de integridade!');  
2285 - objCACIC.writeDailyLog('Providenciando nova cópia.'); 2285 + objCACIC.writeDailyLog('Execu��o de srCACICsrv impedida por falta de integridade!');
  2286 + objCACIC.writeDailyLog('Providenciando nova c�pia.');
2286 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe'); 2287 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe');
2287 Invoca_GerCols('recuperaSR'); 2288 Invoca_GerCols('recuperaSR');
2288 intPausaRecupera := 0; 2289 intPausaRecupera := 0;
@@ -2341,26 +2342,26 @@ end; @@ -2341,26 +2342,26 @@ end;
2341 2342
2342 procedure TFormularioGeral.CheckIfDownloadedVersion; 2343 procedure TFormularioGeral.CheckIfDownloadedVersion;
2343 Begin 2344 Begin
2344 - objCACIC.writeDebugLog('CheckIfDownloadedVersion: Verificando existência de nova versão baixada do Agente Principal...'); 2345 + objCACIC.writeDebugLog('CheckIfDownloadedVersion: Verificando exist�ncia de nova vers�o baixada do Agente Principal...');
2345 2346
2346 - // Caso tenha sido baixada nova cópia do Agente Principal, esta deverá ser movida para cima da atual pelo Gerente de Coletas... 2347 + // Caso tenha sido baixada nova c�pia do Agente Principal, esta dever� ser movida para cima da atual pelo Gerente de Coletas...
2347 if (FileExists(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName)) then 2348 if (FileExists(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName)) then
2348 Begin 2349 Begin
2349 - objCACIC.writeDebugLog('CheckIfDownloadedVersion: Hash Code de Executável("'+objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName+'") = "' + objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName) + '"');  
2350 - objCACIC.writeDebugLog('CheckIfDownloadedVersion: Hash Code Desejável = "' + objCACIC.deCrypt( objCACIC.GetValueFromFile('Hash-Codes', objCACIC.getMainProgramName,strChkSisInfFileName),false,true) + '"'); 2350 + objCACIC.writeDebugLog('CheckIfDownloadedVersion: Hash Code de Execut�vel("'+objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName+'") = "' + objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName) + '"');
  2351 + objCACIC.writeDebugLog('CheckIfDownloadedVersion: Hash Code Desej�vel = "' + objCACIC.deCrypt( objCACIC.GetValueFromFile('Hash-Codes', objCACIC.getMainProgramName,strChkSisInfFileName),false,true) + '"');
2351 if (objCACIC.deCrypt( objCACIC.GetValueFromFile('Hash-Codes',objCACIC.getMainProgramName, strChkSisInfFileName),false,true) = objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName)) then //AutoUpdate! 2352 if (objCACIC.deCrypt( objCACIC.GetValueFromFile('Hash-Codes',objCACIC.getMainProgramName, strChkSisInfFileName),false,true) = objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName)) then //AutoUpdate!
2352 Begin 2353 Begin
2353 - objCACIC.writeDebugLog('CheckIfDownloadedVersion: Encontrei a nova versão em '+objCACIC.getLocalFolderName + 'Temp); 2354 + objCACIC.writeDebugLog('CheckIfDownloadedVersion: Encontrei a nova vers�o em '+objCACIC.getLocalFolderName + 'Temp);
2354 if (objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName) = objCACIC.getFileHash(objCACIC.getLocalFolderName + objCACIC.getMainProgramName)) then 2355 if (objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName) = objCACIC.getFileHash(objCACIC.getLocalFolderName + objCACIC.getMainProgramName)) then
2355 Begin 2356 Begin
2356 - objCACIC.writeDebugLog('CheckIfDownloadedVersion: Os hashs codes entre '+objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName + ' e ' + objCACIC.getLocalFolderName + objCACIC.getMainProgramName + ' são iguais!'); 2357 + objCACIC.writeDebugLog('CheckIfDownloadedVersion: Os hashs codes entre '+objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName + ' e ' + objCACIC.getLocalFolderName + objCACIC.getMainProgramName + ' s�o iguais!');
2357 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName) 2358 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName)
2358 End 2359 End
2359 else 2360 else
2360 Begin 2361 Begin
2361 - objCACIC.writeDebugLog('CheckIfDownloadedVersion: Os hashs codes entre '+objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName + ' e ' + objCACIC.getLocalFolderName + objCACIC.getMainProgramName + ' são diferentes!');  
2362 - objCACIC.writeDailyLog('Versão Nova de '+objCACIC.getMainProgramName+' Encontrada. ('+objCACIC.GetVersionInfo(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName)+')');  
2363 - objCACIC.writeDailyLog('Finalizando para Auto-Atualização.'); 2362 + objCACIC.writeDebugLog('CheckIfDownloadedVersion: Os hashs codes entre '+objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName + ' e ' + objCACIC.getLocalFolderName + objCACIC.getMainProgramName + ' s�o diferentes!');
  2363 + objCACIC.writeDailyLog('Vers�o Nova de '+objCACIC.getMainProgramName+' Encontrada. ('+objCACIC.GetVersionInfo(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName)+')');
  2364 + objCACIC.writeDailyLog('Finalizando para Auto-Atualiza��o.');
2364 CopyFile(PChar(objCACIC.getLocalFolderName + 'aguarde_CACIC.txt'),PChar(objCACIC.getLocalFolderName + 'Temp\atualiza_CACIC.txt'),false); 2365 CopyFile(PChar(objCACIC.getLocalFolderName + 'aguarde_CACIC.txt'),PChar(objCACIC.getLocalFolderName + 'Temp\atualiza_CACIC.txt'),false);
2365 Finaliza(false); 2366 Finaliza(false);
2366 End; 2367 End;
@@ -2574,8 +2575,8 @@ begin @@ -2574,8 +2575,8 @@ begin
2574 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\ck_conexao.ini'); 2575 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\ck_conexao.ini');
2575 FormularioGeral.ExecutaCACIC(nil); 2576 FormularioGeral.ExecutaCACIC(nil);
2576 End; 2577 End;
2577 - objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Verificando existência de nova versão de CACICservice para atualização');  
2578 - // Verificação de existência de nova versão do CACICservice para substituição e execução 2578 + objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Verificando exist�ncia de nova vers�o de CACICservice para atualiza��o');
  2579 + // Verifica��o de exist�ncia de nova vers�o do CACICservice para substitui��o e execu��o
2579 if FileExists(objCACIC.getLocalFolderName + 'Temp\cacicservice.exe') then 2580 if FileExists(objCACIC.getLocalFolderName + 'Temp\cacicservice.exe') then
2580 Begin 2581 Begin
2581 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Eliminando "'+objCACIC.getWinDir + 'cacicservice.exe"'); 2582 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Eliminando "'+objCACIC.getWinDir + 'cacicservice.exe"');
@@ -2585,21 +2586,21 @@ begin @@ -2585,21 +2586,21 @@ begin
2585 2586
2586 if not FileExists(objCACIC.getWinDir + 'cacicservice.exe') then 2587 if not FileExists(objCACIC.getWinDir + 'cacicservice.exe') then
2587 Begin 2588 Begin
2588 - objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Eliminação OK! Movendo "'+objCACIC.getLocalFolderName + 'Temp\cacicservice.exe" para "'+objCACIC.getWinDir + 'cacicservice.exe"'); 2589 + objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Elimina��o OK! Movendo "'+objCACIC.getLocalFolderName + 'Temp\cacicservice.exe" para "'+objCACIC.getWinDir + 'cacicservice.exe"');
2589 MoveFile(PChar(objCACIC.getLocalFolderName + 'Temp\cacicservice.exe'),PChar(objCACIC.getWinDir + 'cacicservice.exe')); 2590 MoveFile(PChar(objCACIC.getLocalFolderName + 'Temp\cacicservice.exe'),PChar(objCACIC.getWinDir + 'cacicservice.exe'));
2590 sleep(2000); 2591 sleep(2000);
2591 2592
2592 FormularioGeral.ServiceStart('','CacicSustainService'); 2593 FormularioGeral.ServiceStart('','CacicSustainService');
2593 End 2594 End
2594 else 2595 else
2595 - objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Impossível Eliminar "'+objCACIC.getWinDir + 'cacicservice.exe"'); 2596 + objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Imposs�vel Eliminar "'+objCACIC.getWinDir + 'cacicservice.exe"');
2596 End; 2597 End;
2597 End; 2598 End;
2598 Finally 2599 Finally
2599 g_intTaskBarAtual := FindWindow('Shell_TrayWnd', Nil); 2600 g_intTaskBarAtual := FindWindow('Shell_TrayWnd', Nil);
2600 g_intDesktopWindow := FormularioGeral.getDesktopWindowHandle; 2601 g_intDesktopWindow := FormularioGeral.getDesktopWindowHandle;
2601 2602
2602 - objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Valores para Condição de Redesenho do ícone no SysTRAY...'); 2603 + objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Valores para Condi��o de Redesenho do �cone no SysTRAY...');
2603 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: g_intTaskBarAnterior : ' + IntToStr(g_intTaskBarAnterior)); 2604 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: g_intTaskBarAnterior : ' + IntToStr(g_intTaskBarAnterior));
2604 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: g_intTaskBarAtual : ' + IntToStr(g_intTaskBarAtual)); 2605 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: g_intTaskBarAtual : ' + IntToStr(g_intTaskBarAtual));
2605 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: g_intDesktopWindow : ' + IntToStr(g_intDesktopWindow)); 2606 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: g_intDesktopWindow : ' + IntToStr(g_intDesktopWindow));
@@ -2612,7 +2613,7 @@ begin @@ -2612,7 +2613,7 @@ begin
2612 Begin 2613 Begin
2613 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Invocando InicializaTray...'); 2614 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Invocando InicializaTray...');
2614 if ((g_intTaskBarAnterior = 0) and (g_intTaskBarAtual > 0)) then 2615 if ((g_intTaskBarAnterior = 0) and (g_intTaskBarAtual > 0)) then
2615 - g_intStatusAnterior := -1; // Para forçar o redesenho no systray 2616 + g_intStatusAnterior := -1; // Para for�ar o redesenho no systray
2616 2617
2617 FormularioGeral.InicializaTray; 2618 FormularioGeral.InicializaTray;
2618 End; 2619 End;
@@ -2655,7 +2656,7 @@ begin @@ -2655,7 +2656,7 @@ begin
2655 ARect.Left := LEFT_MENU_ITEM; 2656 ARect.Left := LEFT_MENU_ITEM;
2656 ACanvas.FillRect(ARect); 2657 ACanvas.FillRect(ARect);
2657 2658
2658 - DrawText(ACanvas.Handle, PChar('Configurações'), -1, ARect, DT_LEFT or DT_VCENTER or DT_SINGLELINE{ or DT_NOCLIP}); 2659 + DrawText(ACanvas.Handle, PChar('Configura��es'), -1, ARect, DT_LEFT or DT_VCENTER or DT_SINGLELINE{ or DT_NOCLIP});
2659 end; 2660 end;
2660 2661
2661 procedure TFormularioGeral.Mnu_ExecutarAgoraDrawItem(Sender: TObject; 2662 procedure TFormularioGeral.Mnu_ExecutarAgoraDrawItem(Sender: TObject;
@@ -2683,7 +2684,7 @@ begin @@ -2683,7 +2684,7 @@ begin
2683 ARect.Left := LEFT_MENU_ITEM; 2684 ARect.Left := LEFT_MENU_ITEM;
2684 ACanvas.FillRect(ARect); 2685 ACanvas.FillRect(ARect);
2685 2686
2686 - DrawText(ACanvas.Handle, PChar('Informações Gerais'), -1, ARect, DT_LEFT or DT_VCENTER or DT_SINGLELINE{ or DT_NOCLIP}); 2687 + DrawText(ACanvas.Handle, PChar('Informa��es Gerais'), -1, ARect, DT_LEFT or DT_VCENTER or DT_SINGLELINE{ or DT_NOCLIP});
2687 end; 2688 end;
2688 2689
2689 procedure TFormularioGeral.Mnu_SuporteRemotoDrawItem(Sender: TObject; 2690 procedure TFormularioGeral.Mnu_SuporteRemotoDrawItem(Sender: TObject;
@@ -2742,7 +2743,7 @@ begin @@ -2742,7 +2743,7 @@ begin
2742 // it will fail because it no longer exists when the explorer restarts. 2743 // it will fail because it no longer exists when the explorer restarts.
2743 on E:Exception do 2744 on E:Exception do
2744 Begin 2745 Begin
2745 - objCACIC.writeExceptionLog(E.Message,e.ClassName,'ApplicationEvents1Message - Liberando Systray Icon para recriação'); 2746 + objCACIC.writeExceptionLog(E.Message,e.ClassName,'ApplicationEvents1Message - Liberando Systray Icon para recria��o');
2746 End; 2747 End;
2747 end; 2748 end;
2748 TrayIcon1 := TTrayIcon.Create(self); 2749 TrayIcon1 := TTrayIcon.Create(self);