Commit f6856e6c927c5ab217b61bf73b3377a1113172e1

Authored by Eric Menezes Noronha
1 parent ed7f3d97
Exists in master

Update main.pas

Showing 1 changed file with 231 additions and 232 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
@@ -1316,7 +1316,7 @@ begin @@ -1316,7 +1316,7 @@ begin
1316 if (ActualActivity<>4) and (objCACIC.getValueFromFile('Configs', 'modulo_patr', strGerColsInfFileName) = 'S') then 1316 if (ActualActivity<>4) and (objCACIC.getValueFromFile('Configs', 'modulo_patr', strGerColsInfFileName) = 'S') then
1317 Invoca_MapaCacic 1317 Invoca_MapaCacic
1318 else 1318 else
1319 - MessageDlg(#13#13+'Módulo desabilitado!',mtInformation, [mbOK], 0); 1319 + MessageDlg(#13#13+'M�dulo desabilitado!',mtInformation, [mbOK], 0);
1320 end; 1320 end;
1321 1321
1322 //////////////////////////////////////////////////////////////////////////////// 1322 ////////////////////////////////////////////////////////////////////////////////
@@ -1329,19 +1329,18 @@ begin @@ -1329,19 +1329,18 @@ begin
1329 Begin 1329 Begin
1330 if ChecaMAPACACIC then 1330 if ChecaMAPACACIC then
1331 begin 1331 begin
1332 - // Caso exista o Mapa Cacic será verificada a versão e excluída caso antiga(Uma forma de ação pró-ativa) 1332 + // Caso exista o Mapa Cacic ser� verificada a vers�o e exclu�da caso antiga(Uma forma de a��o pr�-ativa)
1333 if FileExists(objCACIC.getLocalFolderName + 'Modules\mapacacic.exe') then 1333 if FileExists(objCACIC.getLocalFolderName + 'Modules\mapacacic.exe') then
1334 Begin 1334 Begin
1335 objCacic.writeDailyLog('Invoca_MapaCacic: Criando processo mapa.'); 1335 objCacic.writeDailyLog('Invoca_MapaCacic: Criando processo mapa.');
1336 objCACIC.writeDebugLog('Invoca_MapaCacic: Criando Processo Mapa => "'+objCACIC.getLocalFolderName + 'Modules\MapaCACIC.exe'); 1336 objCACIC.writeDebugLog('Invoca_MapaCacic: Criando Processo Mapa => "'+objCACIC.getLocalFolderName + 'Modules\MapaCACIC.exe');
1337 - sleep(10000); //Pausa para dar tempo de realizar o login na máquina, senão o usuário fica em branco.  
1338 if (objCACIC.createOneProcess(objCACIC.getLocalFolderName + 'Modules\mapacacic.exe',false,SW_SHOW)) then 1337 if (objCACIC.createOneProcess(objCACIC.getLocalFolderName + 'Modules\mapacacic.exe',false,SW_SHOW)) then
1339 objCacic.writeDailyLog('Invoca_MapaCacic: Processo criado.') 1338 objCacic.writeDailyLog('Invoca_MapaCacic: Processo criado.')
1340 else 1339 else
1341 objCacic.writeDailyLog('Invoca_MapaCacic: Falha ao criar processo.'); 1340 objCacic.writeDailyLog('Invoca_MapaCacic: Falha ao criar processo.');
1342 End 1341 End
1343 else 1342 else
1344 - objCACIC.writeDailyLog('Não foi possível invocar o Mapa Cacic!'); 1343 + objCACIC.writeDailyLog('N�o foi poss�vel invocar o Mapa Cacic!');
1345 End; 1344 End;
1346 End; 1345 End;
1347 end; 1346 end;
@@ -1389,8 +1388,8 @@ begin @@ -1389,8 +1388,8 @@ begin
1389 timerCheckNoMinuto.Enabled := false; 1388 timerCheckNoMinuto.Enabled := false;
1390 objCACIC.writeDebugLog('ExecutaCACIC: Preparando chamada ao Gerente de Coletas...'); 1389 objCACIC.writeDebugLog('ExecutaCACIC: Preparando chamada ao Gerente de Coletas...');
1391 1390
1392 - // Se foi gerado o arquivo ger_erro.txt o Log conterá a mensagem alí gravada como valor de chave  
1393 - // O Gerente de Coletas deverá ser eliminado para que seja baixado novamente por ChecaGERCOLS 1391 + // Se foi gerado o arquivo ger_erro.txt o Log conter� a mensagem al� gravada como valor de chave
  1392 + // O Gerente de Coletas dever� ser eliminado para que seja baixado novamente por ChecaGERCOLS
1394 if (FileExists(objCACIC.getLocalFolderName + 'gererro.txt')) then 1393 if (FileExists(objCACIC.getLocalFolderName + 'gererro.txt')) then
1395 Begin 1394 Begin
1396 objCACIC.writeDailyLog('Gerente de Coletas eliminado devido a falha:'); 1395 objCACIC.writeDailyLog('Gerente de Coletas eliminado devido a falha:');
@@ -1407,12 +1406,12 @@ begin @@ -1407,12 +1406,12 @@ begin
1407 SetaVariaveisGlobais; 1406 SetaVariaveisGlobais;
1408 End; 1407 End;
1409 1408
1410 - objCACIC.writeDailyLog('Iniciando execução de atividades.'); 1409 + objCACIC.writeDailyLog('Iniciando execu��o de atividades.');
1411 1410
1412 objCACIC.writeDebugLog('ExecutaCACIC: Primeira chamada ao Gerente de Coletas...'); 1411 objCACIC.writeDebugLog('ExecutaCACIC: Primeira chamada ao Gerente de Coletas...');
1413 Invoca_GerCols('getConfigs'); 1412 Invoca_GerCols('getConfigs');
1414 1413
1415 - sleep(3000); // Pausa para início do Gerente de Coletas e criação do arquivo temp\aguarde_GER.txt 1414 + sleep(3000); // Pausa para in�cio do Gerente de Coletas e cria��o do arquivo temp\aguarde_GER.txt
1416 1415
1417 Application.ProcessMessages; 1416 Application.ProcessMessages;
1418 InicializaTray; 1417 InicializaTray;
@@ -1430,9 +1429,9 @@ begin @@ -1430,9 +1429,9 @@ begin
1430 Invoca_MapaCacic; 1429 Invoca_MapaCacic;
1431 end; 1430 end;
1432 1431
1433 - // Pausas de 15 segundos para o caso de ser(em) baixada(s) nova(s) versão(ões) de GerCols e/ou Cacic280.  
1434 - // Serão 4 tentativas por minuto  
1435 - // Serão 30 minutos no máximo de tentativas, totalizando 120 1432 + // Pausas de 15 segundos para o caso de ser(em) baixada(s) nova(s) vers�o(�es) de GerCols e/ou Cacic280.
  1433 + // Ser�o 4 tentativas por minuto
  1434 + // Ser�o 30 minutos no m�ximo de tentativas, totalizando 120
1436 intTentativas := 0; 1435 intTentativas := 0;
1437 while (not Pode_Coletar and (intTentativas < 121)) do 1436 while (not Pode_Coletar and (intTentativas < 121)) do
1438 Begin 1437 Begin
@@ -1442,7 +1441,7 @@ begin @@ -1442,7 +1441,7 @@ begin
1442 inc(intTentativas); 1441 inc(intTentativas);
1443 End; 1442 End;
1444 1443
1445 - // Neste caso o Gerente de Coletas deverá fazer novo contato devido à permissão de criptografia ter sido colocada em espera pelo próximo contato. 1444 + // Neste caso o Gerente de Coletas dever� fazer novo contato devido � permiss�o de criptografia ter sido colocada em espera pelo pr�ximo contato.
1446 if (intTentativas > 120) or 1445 if (intTentativas > 120) or
1447 (objCACIC.GetValueFromFile('Configs','CsCipher', strGerColsInfFileName) = '2') then 1446 (objCACIC.GetValueFromFile('Configs','CsCipher', strGerColsInfFileName) = '2') then
1448 Begin 1447 Begin
@@ -1454,23 +1453,23 @@ begin @@ -1454,23 +1453,23 @@ begin
1454 End 1453 End
1455 else 1454 else
1456 Begin 1455 Begin
1457 - // Caso tenha sido baixada nova cópia do Gerente de Coletas, esta deverá ser movida para cima da atual 1456 + // Caso tenha sido baixada nova c�pia do Gerente de Coletas, esta dever� ser movida para cima da atual
1458 if (FileExists(objCACIC.getLocalFolderName + 'Temp\gercols.exe')) then 1457 if (FileExists(objCACIC.getLocalFolderName + 'Temp\gercols.exe')) then
1459 Begin 1458 Begin
1460 - objCACIC.writeDailyLog('Atualizando versão do Gerente de Coletas para '+objCACIC.getVersionInfo(objCACIC.getLocalFolderName + 'Temp\gercols.exe'));  
1461 - // O MoveFileEx não se deu bem no Win98! :| 1459 + objCACIC.writeDailyLog('Atualizando vers�o do Gerente de Coletas para '+objCACIC.getVersionInfo(objCACIC.getLocalFolderName + 'Temp\gercols.exe'));
  1460 + // O MoveFileEx n�o se deu bem no Win98! :|
1462 // MoveFileEx(PChar(objCACIC.getLocalFolderName + 'Temp\gercols.exe'),PChar(objCACIC.getLocalFolderName + 'Modulos\gercols.exe'),MOVEFILE_REPLACE_EXISTING); 1461 // MoveFileEx(PChar(objCACIC.getLocalFolderName + 'Temp\gercols.exe'),PChar(objCACIC.getLocalFolderName + 'Modulos\gercols.exe'),MOVEFILE_REPLACE_EXISTING);
1463 1462
1464 CopyFile(PChar(objCACIC.getLocalFolderName + 'Temp\gercols.exe'),PChar(objCACIC.getLocalFolderName + 'Modules\gercols.exe'),false); 1463 CopyFile(PChar(objCACIC.getLocalFolderName + 'Temp\gercols.exe'),PChar(objCACIC.getLocalFolderName + 'Modules\gercols.exe'),false);
1465 - sleep(2000); // 2 segundos de espera pela cópia! :) (Rwindows!) 1464 + sleep(2000); // 2 segundos de espera pela c�pia! :) (Rwindows!)
1466 1465
1467 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\gercols.exe'); 1466 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\gercols.exe');
1468 - sleep(2000); // 2 segundos de espera pela deleção! 1467 + sleep(2000); // 2 segundos de espera pela dele��o!
1469 1468
1470 - ExecutaCACIC(nil); // Forçará uma reexecução de GerCols... 1469 + ExecutaCACIC(nil); // For�ar� uma reexecu��o de GerCols...
1471 End; 1470 End;
1472 1471
1473 - // Verifico se foi gravada alguma mensagem pelo Gerente de Coletas e mostro caso a configuração permita 1472 + // Verifico se foi gravada alguma mensagem pelo Gerente de Coletas e mostro caso a configura��o permita
1474 v_mensagem := objCACIC.GetValueFromFile('Mensagens','TeMensagem', strGerColsInfFileName); 1473 v_mensagem := objCACIC.GetValueFromFile('Mensagens','TeMensagem', strGerColsInfFileName);
1475 if (v_mensagem <> '') and 1474 if (v_mensagem <> '') and
1476 (objCACIC.GetValueFromFile('Configs','InExibeErrosCriticos', strMainProgramInfFileName) = 'S') then 1475 (objCACIC.GetValueFromFile('Configs','InExibeErrosCriticos', strMainProgramInfFileName) = 'S') then
@@ -1483,37 +1482,37 @@ begin @@ -1483,37 +1482,37 @@ begin
1483 MessageDlg(v_mensagem,v_MsgDlgType, [mbOk], 0); 1482 MessageDlg(v_mensagem,v_MsgDlgType, [mbOk], 0);
1484 objCACIC.setValueToFile('Mensagens','TeMensagem', '', strGerColsInfFileName); 1483 objCACIC.setValueToFile('Mensagens','TeMensagem', '', strGerColsInfFileName);
1485 objCACIC.setValueToFile('Mensagens','CsTipo' , '', strGerColsInfFileName); 1484 objCACIC.setValueToFile('Mensagens','CsTipo' , '', strGerColsInfFileName);
1486 - // Para evitar uma reexecução de GerCols sem necessidade...  
1487 - intTentativas := 121; // Apenas para ajudar na condição seguinte 1485 + // Para evitar uma reexecu��o de GerCols sem necessidade...
  1486 + intTentativas := 121; // Apenas para ajudar na condi��o seguinte
1488 End; 1487 End;
1489 1488
1490 - // Verifico se TE_FILA_FTP foi setado (por GerCols) e obedeço ao intervalo para nova tentativa de coletas  
1491 - // Caso TE_FILA_FTP inicie com # é porque já passou nessa condição e deve iniciar nova tentativa de FTP... 1489 + // Verifico se TE_FILA_FTP foi setado (por GerCols) e obede�o ao intervalo para nova tentativa de coletas
  1490 + // Caso TE_FILA_FTP inicie com # � porque j� passou nessa condi��o e deve iniciar nova tentativa de FTP...
1492 v_TE_FILA_FTP := objCACIC.GetValueFromFile('Configs','TeFilaFTP', strGerColsInfFileName); 1491 v_TE_FILA_FTP := objCACIC.GetValueFromFile('Configs','TeFilaFTP', strGerColsInfFileName);
1493 if (intTentativas <> 121) and 1492 if (intTentativas <> 121) and
1494 (Copy(v_TE_FILA_FTP,1,1) <> '#') and 1493 (Copy(v_TE_FILA_FTP,1,1) <> '#') and
1495 (v_TE_FILA_FTP <> '0') and 1494 (v_TE_FILA_FTP <> '0') and
1496 (v_TE_FILA_FTP <> '') then 1495 (v_TE_FILA_FTP <> '') then
1497 Begin 1496 Begin
1498 - // Busquei o número de milisegundos setados em TeFilaFTP e o obedeço... 1497 + // Busquei o n�mero de milisegundos setados em TeFilaFTP e o obede�o...
1499 // 60.000 milisegundos correspondem a 60 segundos (1 minuto). 1498 // 60.000 milisegundos correspondem a 60 segundos (1 minuto).
1500 - // Acrescento 1, pois se for zero ele não executa. 1499 + // Acrescento 1, pois se for zero ele n�o executa.
1501 timerNuExecApos.Enabled := False; 1500 timerNuExecApos.Enabled := False;
1502 timerNuExecApos.Interval := strtoint(v_TE_FILA_FTP) * 60000; 1501 timerNuExecApos.Interval := strtoint(v_TE_FILA_FTP) * 60000;
1503 timerNuExecApos.Enabled := True; 1502 timerNuExecApos.Enabled := True;
1504 - objCACIC.writeDailyLog('FTP de coletores adiado pelo Módulo Gerente.'); 1503 + objCACIC.writeDailyLog('FTP de coletores adiado pelo M�dulo Gerente.');
1505 objCACIC.writeDailyLog('Nova tentativa em aproximadamente ' + v_TE_FILA_FTP+ ' minuto(s).'); 1504 objCACIC.writeDailyLog('Nova tentativa em aproximadamente ' + v_TE_FILA_FTP+ ' minuto(s).');
1506 objCACIC.setValueToFile('Configs','TeFilaFTP','#' + v_TE_FILA_FTP, strGerColsInfFileName); 1505 objCACIC.setValueToFile('Configs','TeFilaFTP','#' + v_TE_FILA_FTP, strGerColsInfFileName);
1507 End; 1506 End;
1508 1507
1509 - // Desabilita/Habilita a opção de Informações Gerais 1508 + // Desabilita/Habilita a op��o de Informa��es Gerais
1510 HabilitaInformacoesGerais; 1509 HabilitaInformacoesGerais;
1511 1510
1512 - // Desabilita/Habilita a opção de Suporte Remoto 1511 + // Desabilita/Habilita a op��o de Suporte Remoto
1513 HabilitaSuporteRemoto; 1512 HabilitaSuporteRemoto;
1514 1513
1515 - // O loop 1 foi dedicado a atualizações de versões e afins...  
1516 - // O loop 2 deverá invocar as coletas propriamente ditas... 1514 + // O loop 1 foi dedicado a atualiza��es de vers�es e afins...
  1515 + // O loop 2 dever� invocar as coletas propriamente ditas...
1517 if (intTentativas <> 121) then 1516 if (intTentativas <> 121) then
1518 Begin 1517 Begin
1519 objCACIC.writeDebugLog('ExecutaCACIC: Iniciando Chamada para Coletas...'); 1518 objCACIC.writeDebugLog('ExecutaCACIC: Iniciando Chamada para Coletas...');
@@ -1556,8 +1555,8 @@ end; @@ -1556,8 +1555,8 @@ end;
1556 1555
1557 procedure TFormularioGeral.ExibirConfiguracoes(Sender: TObject); 1556 procedure TFormularioGeral.ExibirConfiguracoes(Sender: TObject);
1558 begin 1557 begin
1559 - // SJI = Senha Já Informada...  
1560 - // Esse valor é inicializado com "N" 1558 + // SJI = Senha J� Informada...
  1559 + // Esse valor � inicializado com "N"
1561 if (objCACIC.deCrypt( objCACIC.GetValueFromFile('Configs','SJI',strMainProgramInfFileName))='') and 1560 if (objCACIC.deCrypt( objCACIC.GetValueFromFile('Configs','SJI',strMainProgramInfFileName))='') and
1562 (objCACIC.GetValueFromFile('Configs','WebManagerAddress',strChkSisInfFileName)<>'') then 1561 (objCACIC.GetValueFromFile('Configs','WebManagerAddress',strChkSisInfFileName)<>'') then
1563 begin 1562 begin
@@ -1575,13 +1574,13 @@ begin @@ -1575,13 +1574,13 @@ begin
1575 end; 1574 end;
1576 1575
1577 //======================================================================= 1576 //=======================================================================
1578 -// Todo o código deste ponto em diante está relacionado às rotinas de  
1579 -// de inclusão do ícone do programa na bandeja do sistema 1577 +// Todo o c�digo deste ponto em diante est� relacionado �s rotinas de
  1578 +// de inclus�o do �cone do programa na bandeja do sistema
1580 //======================================================================= 1579 //=======================================================================
1581 procedure TFormularioGeral.InicializaTray; 1580 procedure TFormularioGeral.InicializaTray;
1582 var v_strHint : String; 1581 var v_strHint : String;
1583 begin 1582 begin
1584 - // g_intStatus receberá 0 -> NORMAL ou 1 -> COLETAS ou 3 -> srCACIC 1583 + // g_intStatus receber� 0 -> NORMAL ou 1 -> COLETAS ou 3 -> srCACIC
1585 g_intStatus := ActualActivity; 1584 g_intStatus := ActualActivity;
1586 1585
1587 // Monto a frase a ser colocada no Hint 1586 // Monto a frase a ser colocada no Hint
@@ -1590,14 +1589,14 @@ begin @@ -1590,14 +1589,14 @@ begin
1590 if not (objCACIC.getValueFromTags('IPAddress',strWin32_NetworkAdapterConfiguration) = '') then 1589 if not (objCACIC.getValueFromTags('IPAddress',strWin32_NetworkAdapterConfiguration) = '') then
1591 v_strHint := v_strHint + chr(13) + chr(10) + 'IP: ' + objCACIC.getValueFromTags('IPAddress',strWin32_NetworkAdapterConfiguration); 1590 v_strHint := v_strHint + chr(13) + chr(10) + 'IP: ' + objCACIC.getValueFromTags('IPAddress',strWin32_NetworkAdapterConfiguration);
1592 1591
1593 - // Mostro a versão no painel de Informações Gerais 1592 + // Mostro a vers�o no painel de Informa��es Gerais
1594 1593
1595 1594
1596 if (g_intStatus = NORMAL) then 1595 if (g_intStatus = NORMAL) then
1597 Begin 1596 Begin
1598 if not (UpperCase(objCACIC.GetValueFromFile('Configs','ConexaoOK', strGerColsInfFileName)) = 'S') then 1597 if not (UpperCase(objCACIC.GetValueFromFile('Configs','ConexaoOK', strGerColsInfFileName)) = 'S') then
1599 Begin 1598 Begin
1600 - v_strHint := v_strHint + ' IDENTIFICAÇÃO LOCAL...'; 1599 + v_strHint := v_strHint + ' IDENTIFICA��O LOCAL...';
1601 g_intStatus := DESCONFIGURADO; 1600 g_intStatus := DESCONFIGURADO;
1602 End 1601 End
1603 else 1602 else
@@ -1609,7 +1608,7 @@ begin @@ -1609,7 +1608,7 @@ begin
1609 if g_intStatus = EM_SUPORTE then 1608 if g_intStatus = EM_SUPORTE then
1610 v_strHint := v_strHint + chr(13) + chr(10) + ' Em Suporte Remoto...' 1609 v_strHint := v_strHint + chr(13) + chr(10) + ' Em Suporte Remoto...'
1611 else if g_intStatus = COLETANDO then 1610 else if g_intStatus = COLETANDO then
1612 - v_strHint := v_strHint + chr(13) + chr(10) + ' Coletas em Execução...'; 1611 + v_strHint := v_strHint + chr(13) + chr(10) + ' Coletas em Execu��o...';
1613 objCACIC.writeDebugLog('InicializaTray: v_strHint Depois = "'+v_strHint+'"'); 1612 objCACIC.writeDebugLog('InicializaTray: v_strHint Depois = "'+v_strHint+'"');
1614 End; 1613 End;
1615 1614
@@ -1623,19 +1622,19 @@ begin @@ -1623,19 +1622,19 @@ begin
1623 imgIconList.GetIcon(g_intIconIndex,TrayIcon1.Icon); 1622 imgIconList.GetIcon(g_intIconIndex,TrayIcon1.Icon);
1624 g_intStatusAnterior := g_intStatus; 1623 g_intStatusAnterior := g_intStatus;
1625 timerCheckNoMinuto.Enabled := false; 1624 timerCheckNoMinuto.Enabled := false;
1626 - timerCheckNoMinuto.Interval := 5000; // Durante as coletas altero o timer verificador de ações para 5 segundos 1625 + timerCheckNoMinuto.Interval := 5000; // Durante as coletas altero o timer verificador de a��es para 5 segundos
1627 1626
1628 objCACIC.writeDebugLog('InicializaTray: Status alterado para ' + intToStr(g_intStatus)); 1627 objCACIC.writeDebugLog('InicializaTray: Status alterado para ' + intToStr(g_intStatus));
1629 if (g_intStatus = COLETANDO) then 1628 if (g_intStatus = COLETANDO) then
1630 Begin 1629 Begin
1631 Mnu_InformacoesGerais.Enabled := False; 1630 Mnu_InformacoesGerais.Enabled := False;
1632 Mnu_ExecutarAgora.Enabled := False; 1631 Mnu_ExecutarAgora.Enabled := False;
1633 - Mnu_InformacoesGerais.Caption := 'Aguarde, coletas em ação!'; 1632 + Mnu_InformacoesGerais.Caption := 'Aguarde, coletas em a��o!';
1634 Mnu_ExecutarAgora.Caption := Mnu_InformacoesGerais.Caption; 1633 Mnu_ExecutarAgora.Caption := Mnu_InformacoesGerais.Caption;
1635 End 1634 End
1636 else if (g_intStatus = DESCONFIGURADO) then 1635 else if (g_intStatus = DESCONFIGURADO) then
1637 Begin 1636 Begin
1638 - objCACIC.writeDebugLog('InicializaTray: Setando Ícones para "Interroga" (intStatus=' + IntToStr(g_intStatus) + ')...'); 1637 + objCACIC.writeDebugLog('InicializaTray: Setando �cones para "Interroga" (intStatus=' + IntToStr(g_intStatus) + ')...');
1639 End 1638 End
1640 else if (g_intStatus = EM_SUPORTE) then 1639 else if (g_intStatus = EM_SUPORTE) then
1641 Begin 1640 Begin
@@ -1646,14 +1645,14 @@ begin @@ -1646,14 +1645,14 @@ begin
1646 End 1645 End
1647 else 1646 else
1648 Begin 1647 Begin
1649 - timerCheckNoMinuto.Interval := 60000; // Restauro o timer verificador de ações para 1 minuto 1648 + timerCheckNoMinuto.Interval := 60000; // Restauro o timer verificador de a��es para 1 minuto
1650 1649
1651 Mnu_InformacoesGerais.Caption := strMenuCaptionINF; 1650 Mnu_InformacoesGerais.Caption := strMenuCaptionINF;
1652 Mnu_ExecutarAgora.Caption := strMenuCaptionEXE; 1651 Mnu_ExecutarAgora.Caption := strMenuCaptionEXE;
1653 Mnu_InformacoesGerais.Enabled := true; 1652 Mnu_InformacoesGerais.Enabled := true;
1654 Mnu_ExecutarAgora.Enabled := true; 1653 Mnu_ExecutarAgora.Enabled := true;
1655 1654
1656 - objCACIC.writeDebugLog('InicializaTray: Setando Ícones para "Normal" (intStatus=' + IntToStr(g_intStatus) + ')...'); 1655 + objCACIC.writeDebugLog('InicializaTray: Setando �cones para "Normal" (intStatus=' + IntToStr(g_intStatus) + ')...');
1657 End; 1656 End;
1658 1657
1659 objCACIC.writeDebugLog('InicializaTray: Setando o HINT do Systray para: "'+v_strHint+'"'); 1658 objCACIC.writeDebugLog('InicializaTray: Setando o HINT do Systray para: "'+v_strHint+'"');
@@ -1663,13 +1662,13 @@ begin @@ -1663,13 +1662,13 @@ begin
1663 1662
1664 if (objCACIC.GetValueFromFile('Configs','InExibeBandeja', strMainProgramInfFileName) <> 'N') Then 1663 if (objCACIC.GetValueFromFile('Configs','InExibeBandeja', strMainProgramInfFileName) <> 'N') Then
1665 Begin 1664 Begin
1666 - objCACIC.writeDebugLog('InicializaTray: Exibe/Renova Ícone do Systray...'); 1665 + objCACIC.writeDebugLog('InicializaTray: Exibe/Renova �cone do Systray...');
1667 imgIconList.GetIcon(g_intStatus,TrayIcon1.Icon); 1666 imgIconList.GetIcon(g_intStatus,TrayIcon1.Icon);
1668 TrayIcon1.Show; 1667 TrayIcon1.Show;
1669 End 1668 End
1670 else 1669 else
1671 Begin 1670 Begin
1672 - objCACIC.writeDebugLog('InicializaTray: Inibe Ícone do Systray...'); 1671 + objCACIC.writeDebugLog('InicializaTray: Inibe �cone do Systray...');
1673 TrayIcon1.Hide; 1672 TrayIcon1.Hide;
1674 End; 1673 End;
1675 End 1674 End
@@ -1695,22 +1694,22 @@ begin @@ -1695,22 +1694,22 @@ begin
1695 FormularioGeral.Visible:=false; 1694 FormularioGeral.Visible:=false;
1696 if (objCACIC.GetValueFromFile('Configs','InExibeBandeja', strMainProgramInfFileName) = 'N') Then 1695 if (objCACIC.GetValueFromFile('Configs','InExibeBandeja', strMainProgramInfFileName) = 'N') Then
1697 Begin 1696 Begin
1698 - objCACIC.writeDebugLog('MinimizaParaTrayArea: Escondendo o ícone'); 1697 + objCACIC.writeDebugLog('MinimizaParaTrayArea: Escondendo o �cone');
1699 TrayIcon1.Hide 1698 TrayIcon1.Hide
1700 End 1699 End
1701 else 1700 else
1702 Begin 1701 Begin
1703 - objCACIC.writeDebugLog('MinimizaParaTrayArea: Mostrando o ícone'); 1702 + objCACIC.writeDebugLog('MinimizaParaTrayArea: Mostrando o �cone');
1704 TrayIcon1.Show; 1703 TrayIcon1.Show;
1705 End; 1704 End;
1706 end; 1705 end;
1707 // ------------------------------------- 1706 // -------------------------------------
1708 -// Fim dos códigos da bandeja do sistema 1707 +// Fim dos c�digos da bandeja do sistema
1709 // ------------------------------------- 1708 // -------------------------------------
1710 1709
1711 procedure TFormularioGeral.FormCloseQuery(Sender: TObject; var CanClose: Boolean); 1710 procedure TFormularioGeral.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1712 begin 1711 begin
1713 - // Esse evento é colocado em Nil durante o shutdown do windows. 1712 + // Esse evento � colocado em Nil durante o shutdown do windows.
1714 // Ver o evento WMQueryEndSession. 1713 // Ver o evento WMQueryEndSession.
1715 CanClose := False; 1714 CanClose := False;
1716 MinimizaParaTrayArea(Nil); 1715 MinimizaParaTrayArea(Nil);
@@ -1718,8 +1717,8 @@ end; @@ -1718,8 +1717,8 @@ end;
1718 1717
1719 procedure TFormularioGeral.WMQueryEndSession(var Msg: TWMQueryEndSession); 1718 procedure TFormularioGeral.WMQueryEndSession(var Msg: TWMQueryEndSession);
1720 begin 1719 begin
1721 - objCACIC.writeDailyLog('Windows em processo de finalização!');  
1722 - // Quando há um shutdown do windows em execução, libera o close. 1720 + objCACIC.writeDailyLog('Windows em processo de finaliza��o!');
  1721 + // Quando h� um shutdown do windows em execu��o, libera o close.
1723 OnCloseQuery := Nil; 1722 OnCloseQuery := Nil;
1724 Msg.Result := 1; 1723 Msg.Result := 1;
1725 Finaliza(true); 1724 Finaliza(true);
@@ -1748,7 +1747,7 @@ begin @@ -1748,7 +1747,7 @@ begin
1748 ST_VL_WinsPrimario.Caption := objCACIC.getValueFromTags('WINSPrimaryServer' ,strWin32_NetworkAdapterConfiguration); 1747 ST_VL_WinsPrimario.Caption := objCACIC.getValueFromTags('WINSPrimaryServer' ,strWin32_NetworkAdapterConfiguration);
1749 ST_VL_WinsSecundario.Caption := objCACIC.getValueFromTags('WINSSecondaryServer' ,strWin32_NetworkAdapterConfiguration); 1748 ST_VL_WinsSecundario.Caption := objCACIC.getValueFromTags('WINSSecondaryServer' ,strWin32_NetworkAdapterConfiguration);
1750 1749
1751 - // Exibição das informações de Sistemas Monitorados... 1750 + // Exibi��o das informa��es de Sistemas Monitorados...
1752 v_conta_perfis := 1; 1751 v_conta_perfis := 1;
1753 v_conta_infos_coletadas := 0; 1752 v_conta_infos_coletadas := 0;
1754 v_tripa_perfis := '*'; 1753 v_tripa_perfis := '*';
@@ -1764,7 +1763,7 @@ begin @@ -1764,7 +1763,7 @@ begin
1764 Begin 1763 Begin
1765 v_array_perfis := objCACIC.explode(v_tripa_perfis,','); 1764 v_array_perfis := objCACIC.explode(v_tripa_perfis,',');
1766 1765
1767 - // ATENÇÃO!!! Antes da implementação de INFORMAÇÕES GERAIS o Count ia até 11, ok?! 1766 + // ATEN��O!!! Antes da implementa��o de INFORMA��ES GERAIS o Count ia at� 11, ok?!
1768 if (v_array_perfis.Count > 11) and (v_array_perfis[11]='S') then 1767 if (v_array_perfis.Count > 11) and (v_array_perfis[11]='S') then
1769 Begin 1768 Begin
1770 v_tripa_infos_coletadas := objCACIC.deCrypt( objCACIC.GetValueFromFile('Collects','ColMoni_Atual', strGerColsInfFileName)); 1769 v_tripa_infos_coletadas := objCACIC.deCrypt( objCACIC.GetValueFromFile('Collects','ColMoni_Atual', strGerColsInfFileName));
@@ -1806,7 +1805,7 @@ begin @@ -1806,7 +1805,7 @@ begin
1806 Begin 1805 Begin
1807 if (copy(strAux,0,8) = FormatDateTime('yyyymmdd', Date)) then 1806 if (copy(strAux,0,8) = FormatDateTime('yyyymmdd', Date)) then
1808 Begin 1807 Begin
1809 - // Vamos reaproveitar algumas variáveis!... 1808 + // Vamos reaproveitar algumas vari�veis!...
1810 1809
1811 v_array_perfis := objCACIC.explode(strAux,'#'); 1810 v_array_perfis := objCACIC.explode(strAux,'#');
1812 for intAux := 1 to v_array_perfis.Count-1 Do 1811 for intAux := 1 to v_array_perfis.Count-1 Do
@@ -1825,7 +1824,7 @@ begin @@ -1825,7 +1824,7 @@ begin
1825 v_array_infos_coletadas[3] := v_array_infos_coletadas[2]; 1824 v_array_infos_coletadas[3] := v_array_infos_coletadas[2];
1826 End; 1825 End;
1827 1826
1828 - // Códigos Possíveis: -1 : Problema no Envio da Coleta 1827 + // C�digos Poss�veis: -1 : Problema no Envio da Coleta
1829 // 1 : Coleta Enviada 1828 // 1 : Coleta Enviada
1830 // 0 : Sem Coleta para Envio 1829 // 0 : Sem Coleta para Envio
1831 strAux := IfThen(v_array_infos_coletadas[3]='1','Coleta Enviada ao Gerente WEB!', 1830 strAux := IfThen(v_array_infos_coletadas[3]='1','Coleta Enviada ao Gerente WEB!',
@@ -1841,7 +1840,7 @@ begin @@ -1841,7 +1840,7 @@ begin
1841 else 1840 else
1842 Begin 1841 Begin
1843 listSistemasMonitorados.Items.Add; 1842 listSistemasMonitorados.Items.Add;
1844 - listSistemasMonitorados.Items[0].Caption := 'Não Há Coletas Registradas Nesta Data'; 1843 + listSistemasMonitorados.Items[0].Caption := 'N�o H� Coletas Registradas Nesta Data';
1845 End; 1844 End;
1846 1845
1847 strConfigsPatrimonio := objCACIC.GetValueFromFile('Patrimonio','Configs', strMainProgramInfFileName); 1846 strConfigsPatrimonio := objCACIC.GetValueFromFile('Patrimonio','Configs', strMainProgramInfFileName);
@@ -1963,7 +1962,7 @@ procedure TFormularioGeral.Bt_Fechar_InfosGeraisClick(Sender: TObject); @@ -1963,7 +1962,7 @@ procedure TFormularioGeral.Bt_Fechar_InfosGeraisClick(Sender: TObject);
1963 end; 1962 end;
1964 1963
1965 1964
1966 -// Solução baixada de http://www.delphidabbler.com/codesnip.php?action=named&routines=URLDecode&showsrc=1 1965 +// Solu��o baixada de http://www.delphidabbler.com/codesnip.php?action=named&routines=URLDecode&showsrc=1
1967 function TFormularioGeral.URLDecode(const S: string): string; 1966 function TFormularioGeral.URLDecode(const S: string): string;
1968 var 1967 var
1969 Idx: Integer; // loops thru chars in string 1968 Idx: Integer; // loops thru chars in string
@@ -2021,15 +2020,15 @@ var strXML, @@ -2021,15 +2020,15 @@ var strXML,
2021 begin 2020 begin
2022 2021
2023 // ********************************************************************************************************** 2022 // **********************************************************************************************************
2024 - // Esta procedure tratará os comandos e suas ações, enviados em um pacote XML na requisição, conforme abaixo: 2023 + // Esta procedure tratar� os comandos e suas a��es, enviados em um pacote XML na requisi��o, conforme abaixo:
2025 // ********************************************************************************************************** 2024 // **********************************************************************************************************
2026 - // 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)  
2027 - // Requisição: Tag <Execute> 2025 + // 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)
  2026 + // Requisi��o: Tag <Execute>
2028 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK' 2027 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK'
2029 // 2028 //
2030 - // Ask -> Comando que perguntará sobre a existência de um determinado arquivo na estação.  
2031 - // Requisição: Tag <FileName>: Nome do arquivo a pesquisar no repositório local  
2032 - // Tag <FileHash>: Hash referente ao arquivo a ser pesquisado no repositório local 2029 + // Ask -> Comando que perguntar� sobre a exist�ncia de um determinado arquivo na esta��o.
  2030 + // Requisi��o: Tag <FileName>: Nome do arquivo a pesquisar no reposit�rio local
  2031 + // Tag <FileHash>: Hash referente ao arquivo a ser pesquisado no reposit�rio local
2033 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK'; 2032 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK';
2034 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'Tenho' ou 2033 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'Tenho' ou
2035 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'NaoTenho' ou 2034 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'NaoTenho' ou
@@ -2037,38 +2036,38 @@ begin @@ -2037,38 +2036,38 @@ begin
2037 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'Ocupado'. 2036 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'Ocupado'.
2038 // 2037 //
2039 // 2038 //
2040 - // Erase -> Comando que provocará a exclusão de determinado arquivo.  
2041 - // Deverá ser acompanhado das tags <FileName> e <FileHash>  
2042 - // Requisição: Tag <FileName>: Nome do arquivo a ser excluído do repositório local  
2043 - // Tag <FileHash>: Hash referente ao arquivo a ser excluído do repositório local 2039 + // Erase -> Comando que provocar� a exclus�o de determinado arquivo.
  2040 + // Dever� ser acompanhado das tags <FileName> e <FileHash>
  2041 + // Requisi��o: Tag <FileName>: Nome do arquivo a ser exclu�do do reposit�rio local
  2042 + // Tag <FileHash>: Hash referente ao arquivo a ser exclu�do do reposit�rio local
2044 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK'; 2043 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK';
2045 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'AcaoExecutada' ou 2044 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'AcaoExecutada' ou
2046 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'ArquivoNaoEncontrado' ou 2045 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'ArquivoNaoEncontrado' ou
2047 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'EscritaNaoPermitida'; 2046 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'EscritaNaoPermitida';
2048 // 2047 //
2049 - // Registry -> Comando que provocará ação no Registry de estações com MS-Windows.  
2050 - // Deverá ser acompanhado das tags <Path>, <Action>, <Condition> e <Value>  
2051 - // Requisição: Tag <Path> : Caminho no Registry  
2052 - // Tag <Action> : Ação para execução  
2053 - // SAVE => Salva o valor contido na tag <Value> de acordo com condição contida na tag <Condition>  
2054 - // ERASE => Apaga a chave de acordo com condição contida na tag <Condition>  
2055 - // Tag <Condition> : Condiçção para execução da ação 2048 + // Registry -> Comando que provocar� a��o no Registry de esta��es com MS-Windows.
  2049 + // Dever� ser acompanhado das tags <Path>, <Action>, <Condition> e <Value>
  2050 + // Requisi��o: Tag <Path> : Caminho no Registry
  2051 + // Tag <Action> : A��o para execu��o
  2052 + // SAVE => Salva o valor contido na tag <Value> de acordo com condi��o contida na tag <Condition>
  2053 + // ERASE => Apaga a chave de acordo com condi��o contida na tag <Condition>
  2054 + // Tag <Condition> : Condi���o para execu��o da a��o
2056 // EQUAL => Se o valor contido na tag <Value> for IGUAL ao valor encontrado na chave 2055 // EQUAL => Se o valor contido na tag <Value> for IGUAL ao valor encontrado na chave
2057 // DIFFER => Se o valor contido na tag <Value> for DIFERENTE ao valor encontrado na chave 2056 // DIFFER => Se o valor contido na tag <Value> for DIFERENTE ao valor encontrado na chave
2058 - // NONE => Nenhuma condição, permitindo a execução da ação de forma incondicional  
2059 - // Tag <Value> : Valor a ser utilizado na ação 2057 + // NONE => Nenhuma condi��o, permitindo a execu��o da a��o de forma incondicional
  2058 + // Tag <Value> : Valor a ser utilizado na a��o
2060 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK'; 2059 // Respostas: AResponseinfo.ContentText := AResponseinfo.ContentText + 'OK';
2061 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'AcaoExecutada' ou 2060 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'AcaoExecutada' ou
2062 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'ChaveNaoEncontrada' ou 2061 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'ChaveNaoEncontrada' ou
2063 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'EscritaNaoPermitida'; 2062 // AResponseinfo.ContentText := AResponseinfo.ContentText + 'EscritaNaoPermitida';
2064 // 2063 //
2065 - // Exit -> Comando para finalização do agente principal (bandeja) 2064 + // Exit -> Comando para finaliza��o do agente principal (bandeja)
2066 2065
2067 - // Palavra Chave definida por GerCols, enviada e armazenada no BD. A autenticação da comunicação é baseada na verificação deste valor.  
2068 - // A geração da palavra chave dar-se-á a cada contato do GerCols com o módulo Gerente WEB 2066 + // Palavra Chave definida por GerCols, enviada e armazenada no BD. A autentica��o da comunica��o � baseada na verifica��o deste valor.
  2067 + // A gera��o da palavra chave dar-se-� a cada contato do GerCols com o m�dulo Gerente WEB
2069 // te_palavra_chave -> <TE_PALAVRA_CHAVE> 2068 // te_palavra_chave -> <TE_PALAVRA_CHAVE>
2070 2069
2071 - // Tratamento da requisição http... 2070 + // Tratamento da requisi��o http...
2072 strXML := URLDecode(ARequestInfo.UnparsedParams); 2071 strXML := URLDecode(ARequestInfo.UnparsedParams);
2073 intAux := Pos('=',strXML); 2072 intAux := Pos('=',strXML);
2074 strXML := copy(strXML,(intAux+1),StrLen(PAnsiChar(strXML))-intAux); 2073 strXML := copy(strXML,(intAux+1),StrLen(PAnsiChar(strXML))-intAux);
@@ -2076,11 +2075,11 @@ begin @@ -2076,11 +2075,11 @@ begin
2076 2075
2077 2076
2078 2077
2079 - // Autenticação e tratamento da requisição 2078 + // Autentica��o e tratamento da requisi��o
2080 if (objCACIC.xmlGetValue('te_palavra_chave',strXML) = objCACIC.getValueMemoryData('Configs.te_palavra_chave',v_tstrCipherOpened)) then 2079 if (objCACIC.xmlGetValue('te_palavra_chave',strXML) = objCACIC.getValueMemoryData('Configs.te_palavra_chave',v_tstrCipherOpened)) then
2081 Begin 2080 Begin
2082 strCmd := objCACIC.xmlGetValue('cmd',strXML); 2081 strCmd := objCACIC.xmlGetValue('cmd',strXML);
2083 - // As ações terão seus valores 2082 + // As a��es ter�o seus valores
2084 2083
2085 if (strCmd = 'Execute') or 2084 if (strCmd = 'Execute') or
2086 (strCmd = 'Ask') or 2085 (strCmd = 'Ask') or
@@ -2089,10 +2088,10 @@ begin @@ -2089,10 +2088,10 @@ begin
2089 (strCmd = 'Exit') then 2088 (strCmd = 'Exit') then
2090 AResponseinfo.ContentText := 'OK' 2089 AResponseinfo.ContentText := 'OK'
2091 else 2090 else
2092 - AResponseinfo.ContentText := 'COMANDO NÃO RECONHECIDO!'; 2091 + AResponseinfo.ContentText := 'COMANDO N�O RECONHECIDO!';
2093 End 2092 End
2094 else 2093 else
2095 - AResponseinfo.ContentText := 'ACESSO NÃO PERMITIDO!'; 2094 + AResponseinfo.ContentText := 'ACESSO N�O PERMITIDO!';
2096 2095
2097 if (strCmd = 'Execute') then 2096 if (strCmd = 'Execute') then
2098 ExecutaCACIC(nil) 2097 ExecutaCACIC(nil)
@@ -2140,10 +2139,10 @@ if (pStrRCAction = &#39;&#39;) then @@ -2140,10 +2139,10 @@ if (pStrRCAction = &#39;&#39;) then
2140 else 2139 else
2141 Begin 2140 Begin
2142 tstrActions := objCACIC.explode(pStrRCAction,'[FIELD]'); 2141 tstrActions := objCACIC.explode(pStrRCAction,'[FIELD]');
2143 - 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)  
2144 - (AnsiPos('ck_conexao.' ,tstrActions[1]) = 0) and // Não informo sobre as ações com o arquivo de controle de conexao do srCACICsrv  
2145 - (AnsiPos(objCACIC.getLocalFolderName,tstrActions[1]) = 0) and // Não informo sobre as ações de rotina na pasta do CACIC  
2146 - (trim(tstrActions[1]) <> '') then // Não informo caso o parâmetro 1 (origem) esteja vazio 2142 + 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)
  2143 + (AnsiPos('ck_conexao.' ,tstrActions[1]) = 0) and // N�o informo sobre as a��es com o arquivo de controle de conexao do srCACICsrv
  2144 + (AnsiPos(objCACIC.getLocalFolderName,tstrActions[1]) = 0) and // N�o informo sobre as a��es de rotina na pasta do CACIC
  2145 + (trim(tstrActions[1]) <> '') then // N�o informo caso o par�metro 1 (origem) esteja vazio
2147 Begin 2146 Begin
2148 objCACIC.writeDebugLog('CheckRCActions: ' + pStrRCAction); 2147 objCACIC.writeDebugLog('CheckRCActions: ' + pStrRCAction);
2149 strRCActionsAux2 := objCACIC.getValueFromFile('srCACICcli','m_idConexao',objCACIC.getLocalFolderName + 'Temp\ck_conexao.ini'); 2148 strRCActionsAux2 := objCACIC.getValueFromFile('srCACICcli','m_idConexao',objCACIC.getLocalFolderName + 'Temp\ck_conexao.ini');
@@ -2169,17 +2168,17 @@ var v_strTeSO, @@ -2169,17 +2168,17 @@ var v_strTeSO,
2169 begin 2168 begin
2170 if boolServerON then // Ordeno ao SrCACICsrv que auto-finalize 2169 if boolServerON then // Ordeno ao SrCACICsrv que auto-finalize
2171 Begin 2170 Begin
2172 - // Desligando a captura de ações 2171 + // Desligando a captura de a��es
2173 CN.Stop; 2172 CN.Stop;
2174 2173
2175 - objCACIC.writeDailyLog('Desativando o Módulo de Suporte Remoto Seguro.'); 2174 + objCACIC.writeDailyLog('Desativando o M�dulo de Suporte Remoto Seguro.');
2176 2175
2177 objCACIC.createOneProcess(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe -kill',false,SW_HIDE); 2176 objCACIC.createOneProcess(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe -kill',false,SW_HIDE);
2178 objCacic.setBoolCipher(not objCacic.isInDebugMode); 2177 objCacic.setBoolCipher(not objCacic.isInDebugMode);
2179 - // Bloqueio o módulo de suporte remoto seguro na FireWall nativa. 2178 + // Bloqueio o m�dulo de suporte remoto seguro na FireWall nativa.
2180 objCACIC.addApplicationToFirewall('srCACIC - Suporte Remoto Seguro do Sistema CACIC',objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe', false); 2179 objCACIC.addApplicationToFirewall('srCACIC - Suporte Remoto Seguro do Sistema CACIC',objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe', false);
2181 2180
2182 - Sleep(3000); // Pausa para liberação do aguarde_srCACIC.txt 2181 + Sleep(3000); // Pausa para libera��o do aguarde_srCACIC.txt
2183 2182
2184 CheckRCActions; 2183 CheckRCActions;
2185 2184
@@ -2211,13 +2210,13 @@ begin @@ -2211,13 +2210,13 @@ begin
2211 v_strNuPortaSR := trim(objCACIC.deCrypt( objCACIC.GetValueFromFile('Configs','NuPortaSrCacic' , strMainProgramInfFileName))); 2210 v_strNuPortaSR := trim(objCACIC.deCrypt( objCACIC.GetValueFromFile('Configs','NuPortaSrCacic' , strMainProgramInfFileName)));
2212 v_strNuTimeOutSR := trim(objCACIC.GetValueFromFile('Configs','NuTimeOutSrCacic' , strMainProgramInfFileName)); 2211 v_strNuTimeOutSR := trim(objCACIC.GetValueFromFile('Configs','NuTimeOutSrCacic' , strMainProgramInfFileName));
2213 2212
2214 - // Detectar versão do Windows antes de fazer a chamada seguinte... 2213 + // Detectar vers�o do Windows antes de fazer a chamada seguinte...
2215 try 2214 try
2216 AssignFile(fileAguarde,objCACIC.getLocalFolderName + 'Temp\aguarde_srCACIC.txt'); 2215 AssignFile(fileAguarde,objCACIC.getLocalFolderName + 'Temp\aguarde_srCACIC.txt');
2217 {$IOChecks off} 2216 {$IOChecks off}
2218 Reset(fileAguarde); {Abre o arquivo texto} 2217 Reset(fileAguarde); {Abre o arquivo texto}
2219 {$IOChecks on} 2218 {$IOChecks on}
2220 - if (IOResult <> 0) then // Arquivo não existe, será recriado. 2219 + if (IOResult <> 0) then // Arquivo n�o existe, ser� recriado.
2221 begin 2220 begin
2222 Rewrite (fileAguarde); 2221 Rewrite (fileAguarde);
2223 Append(fileAguarde); 2222 Append(fileAguarde);
@@ -2228,11 +2227,11 @@ begin @@ -2228,11 +2227,11 @@ begin
2228 Finally 2227 Finally
2229 End; 2228 End;
2230 2229
2231 - objCACIC.writeDebugLog('Mnu_SuporteRemotoClick: Verificando validade do módulo srCACICsrv para chamada!'); 2230 + objCACIC.writeDebugLog('Mnu_SuporteRemotoClick: Verificando validade do m�dulo srCACICsrv para chamada!');
2232 2231
2233 objCACIC.writeDebugLog('Mnu_SuporteRemotoClick: objCACIC.getFileHash('+objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe'+') = "'+objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe'+'"')); 2232 objCACIC.writeDebugLog('Mnu_SuporteRemotoClick: objCACIC.getFileHash('+objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe'+') = "'+objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe'+'"'));
2234 2233
2235 - // Executarei o srCACICsrv após batimento do HASHCode 2234 + // Executarei o srCACICsrv ap�s batimento do HASHCode
2236 if (objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe') = objCACIC.deCrypt( objCACIC.GetValueFromFile('Hash-Codes','SRCACICSRV.EXE', strChkSisInfFileName),false,true)) then 2235 if (objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe') = objCACIC.deCrypt( objCACIC.GetValueFromFile('Hash-Codes','SRCACICSRV.EXE', strChkSisInfFileName),false,true)) then
2237 Begin 2236 Begin
2238 objCACIC.writeDebugLog('Mnu_SuporteRemotoClick: Invocando (Criptografado)"'+objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe -start [' + objCACIC.getWebManagerAddress + ']' + 2237 objCACIC.writeDebugLog('Mnu_SuporteRemotoClick: Invocando (Criptografado)"'+objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe -start [' + objCACIC.getWebManagerAddress + ']' +
@@ -2251,7 +2250,7 @@ begin @@ -2251,7 +2250,7 @@ begin
2251 '[' + v_strNuPortaSR + ']' + 2250 '[' + v_strNuPortaSR + ']' +
2252 '[' + v_strNuTimeOutSR + ']'); 2251 '[' + v_strNuTimeOutSR + ']');
2253 2252
2254 - // Libero o módulo de suporte remoto seguro na FireWall nativa. 2253 + // Libero o m�dulo de suporte remoto seguro na FireWall nativa.
2255 objCACIC.addApplicationToFirewall('srCACIC - Suporte Remoto Seguro do Sistema CACIC',objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe', true); 2254 objCACIC.addApplicationToFirewall('srCACIC - Suporte Remoto Seguro do Sistema CACIC',objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe', true);
2256 2255
2257 objCACIC.createOneProcess(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe -start [' + objCACIC.getWebManagerAddress + ']' + 2256 objCACIC.createOneProcess(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe -start [' + objCACIC.getWebManagerAddress + ']' +
@@ -2262,19 +2261,19 @@ begin @@ -2262,19 +2261,19 @@ begin
2262 '[' + v_strNuPortaSR + ']' + 2261 '[' + v_strNuPortaSR + ']' +
2263 '[' + v_strNuTimeOutSR + ']',false,SW_NORMAL); 2262 '[' + v_strNuTimeOutSR + ']',false,SW_NORMAL);
2264 tstrAux.Free; 2263 tstrAux.Free;
2265 - Sleep(3000); // Pausa para criação do aguarde_srCACIC.txt 2264 + Sleep(3000); // Pausa para cria��o do aguarde_srCACIC.txt
2266 objCACIC.setBoolCipher(not objCACIC.isInDebugMode); 2265 objCACIC.setBoolCipher(not objCACIC.isInDebugMode);
2267 InicializaTray; 2266 InicializaTray;
2268 2267
2269 - // Ligando a captura de ações 2268 + // Ligando a captura de a��es
2270 CN.Execute; 2269 CN.Execute;
2271 2270
2272 BoolServerON := true; 2271 BoolServerON := true;
2273 End 2272 End
2274 else 2273 else
2275 Begin 2274 Begin
2276 - objCACIC.writeDailyLog('Execução de srCACICsrv impedida por falta de integridade!');  
2277 - objCACIC.writeDailyLog('Providenciando nova cópia.'); 2275 + objCACIC.writeDailyLog('Execu��o de srCACICsrv impedida por falta de integridade!');
  2276 + objCACIC.writeDailyLog('Providenciando nova c�pia.');
2278 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe'); 2277 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Modules\srcacicsrv.exe');
2279 Invoca_GerCols('recuperaSR'); 2278 Invoca_GerCols('recuperaSR');
2280 intPausaRecupera := 0; 2279 intPausaRecupera := 0;
@@ -2333,26 +2332,26 @@ end; @@ -2333,26 +2332,26 @@ end;
2333 2332
2334 procedure TFormularioGeral.CheckIfDownloadedVersion; 2333 procedure TFormularioGeral.CheckIfDownloadedVersion;
2335 Begin 2334 Begin
2336 - objCACIC.writeDebugLog('CheckIfDownloadedVersion: Verificando existência de nova versão baixada do Agente Principal...'); 2335 + objCACIC.writeDebugLog('CheckIfDownloadedVersion: Verificando exist�ncia de nova vers�o baixada do Agente Principal...');
2337 2336
2338 - // Caso tenha sido baixada nova cópia do Agente Principal, esta deverá ser movida para cima da atual pelo Gerente de Coletas... 2337 + // Caso tenha sido baixada nova c�pia do Agente Principal, esta dever� ser movida para cima da atual pelo Gerente de Coletas...
2339 if (FileExists(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName)) then 2338 if (FileExists(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName)) then
2340 Begin 2339 Begin
2341 - objCACIC.writeDebugLog('CheckIfDownloadedVersion: Hash Code de Executável("'+objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName+'") = "' + objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName) + '"');  
2342 - objCACIC.writeDebugLog('CheckIfDownloadedVersion: Hash Code Desejável = "' + objCACIC.deCrypt( objCACIC.GetValueFromFile('Hash-Codes', objCACIC.getMainProgramName,strChkSisInfFileName),false,true) + '"'); 2340 + objCACIC.writeDebugLog('CheckIfDownloadedVersion: Hash Code de Execut�vel("'+objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName+'") = "' + objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName) + '"');
  2341 + objCACIC.writeDebugLog('CheckIfDownloadedVersion: Hash Code Desej�vel = "' + objCACIC.deCrypt( objCACIC.GetValueFromFile('Hash-Codes', objCACIC.getMainProgramName,strChkSisInfFileName),false,true) + '"');
2343 if (objCACIC.deCrypt( objCACIC.GetValueFromFile('Hash-Codes',objCACIC.getMainProgramName, strChkSisInfFileName),false,true) = objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName)) then //AutoUpdate! 2342 if (objCACIC.deCrypt( objCACIC.GetValueFromFile('Hash-Codes',objCACIC.getMainProgramName, strChkSisInfFileName),false,true) = objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName)) then //AutoUpdate!
2344 Begin 2343 Begin
2345 - objCACIC.writeDebugLog('CheckIfDownloadedVersion: Encontrei a nova versão em '+objCACIC.getLocalFolderName + 'Temp); 2344 + objCACIC.writeDebugLog('CheckIfDownloadedVersion: Encontrei a nova vers�o em '+objCACIC.getLocalFolderName + 'Temp);
2346 if (objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName) = objCACIC.getFileHash(objCACIC.getLocalFolderName + objCACIC.getMainProgramName)) then 2345 if (objCACIC.getFileHash(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName) = objCACIC.getFileHash(objCACIC.getLocalFolderName + objCACIC.getMainProgramName)) then
2347 Begin 2346 Begin
2348 - objCACIC.writeDebugLog('CheckIfDownloadedVersion: Os hashs codes entre '+objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName + ' e ' + objCACIC.getLocalFolderName + objCACIC.getMainProgramName + ' são iguais!'); 2347 + objCACIC.writeDebugLog('CheckIfDownloadedVersion: Os hashs codes entre '+objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName + ' e ' + objCACIC.getLocalFolderName + objCACIC.getMainProgramName + ' s�o iguais!');
2349 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName) 2348 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName)
2350 End 2349 End
2351 else 2350 else
2352 Begin 2351 Begin
2353 - objCACIC.writeDebugLog('CheckIfDownloadedVersion: Os hashs codes entre '+objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName + ' e ' + objCACIC.getLocalFolderName + objCACIC.getMainProgramName + ' são diferentes!');  
2354 - objCACIC.writeDailyLog('Versão Nova de '+objCACIC.getMainProgramName+' Encontrada. ('+objCACIC.GetVersionInfo(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName)+')');  
2355 - objCACIC.writeDailyLog('Finalizando para Auto-Atualização.'); 2352 + objCACIC.writeDebugLog('CheckIfDownloadedVersion: Os hashs codes entre '+objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName + ' e ' + objCACIC.getLocalFolderName + objCACIC.getMainProgramName + ' s�o diferentes!');
  2353 + objCACIC.writeDailyLog('Vers�o Nova de '+objCACIC.getMainProgramName+' Encontrada. ('+objCACIC.GetVersionInfo(objCACIC.getLocalFolderName + 'Temp\' + objCACIC.getMainProgramName)+')');
  2354 + objCACIC.writeDailyLog('Finalizando para Auto-Atualiza��o.');
2356 CopyFile(PChar(objCACIC.getLocalFolderName + 'aguarde_CACIC.txt'),PChar(objCACIC.getLocalFolderName + 'Temp\atualiza_CACIC.txt'),false); 2355 CopyFile(PChar(objCACIC.getLocalFolderName + 'aguarde_CACIC.txt'),PChar(objCACIC.getLocalFolderName + 'Temp\atualiza_CACIC.txt'),false);
2357 Finaliza(false); 2356 Finaliza(false);
2358 End; 2357 End;
@@ -2566,8 +2565,8 @@ begin @@ -2566,8 +2565,8 @@ begin
2566 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\ck_conexao.ini'); 2565 objCACIC.deleteFileOrFolder(objCACIC.getLocalFolderName + 'Temp\ck_conexao.ini');
2567 FormularioGeral.ExecutaCACIC(nil); 2566 FormularioGeral.ExecutaCACIC(nil);
2568 End; 2567 End;
2569 - objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Verificando existência de nova versão de CACICservice para atualização');  
2570 - // Verificação de existência de nova versão do CACICservice para substituição e execução 2568 + objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Verificando exist�ncia de nova vers�o de CACICservice para atualiza��o');
  2569 + // Verifica��o de exist�ncia de nova vers�o do CACICservice para substitui��o e execu��o
2571 if FileExists(objCACIC.getLocalFolderName + 'Temp\cacicservice.exe') then 2570 if FileExists(objCACIC.getLocalFolderName + 'Temp\cacicservice.exe') then
2572 Begin 2571 Begin
2573 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Eliminando "'+objCACIC.getWinDir + 'cacicservice.exe"'); 2572 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Eliminando "'+objCACIC.getWinDir + 'cacicservice.exe"');
@@ -2577,21 +2576,21 @@ begin @@ -2577,21 +2576,21 @@ begin
2577 2576
2578 if not FileExists(objCACIC.getWinDir + 'cacicservice.exe') then 2577 if not FileExists(objCACIC.getWinDir + 'cacicservice.exe') then
2579 Begin 2578 Begin
2580 - objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Eliminação OK! Movendo "'+objCACIC.getLocalFolderName + 'Temp\cacicservice.exe" para "'+objCACIC.getWinDir + 'cacicservice.exe"'); 2579 + objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Elimina��o OK! Movendo "'+objCACIC.getLocalFolderName + 'Temp\cacicservice.exe" para "'+objCACIC.getWinDir + 'cacicservice.exe"');
2581 MoveFile(PChar(objCACIC.getLocalFolderName + 'Temp\cacicservice.exe'),PChar(objCACIC.getWinDir + 'cacicservice.exe')); 2580 MoveFile(PChar(objCACIC.getLocalFolderName + 'Temp\cacicservice.exe'),PChar(objCACIC.getWinDir + 'cacicservice.exe'));
2582 sleep(2000); 2581 sleep(2000);
2583 2582
2584 FormularioGeral.ServiceStart('','CacicSustainService'); 2583 FormularioGeral.ServiceStart('','CacicSustainService');
2585 End 2584 End
2586 else 2585 else
2587 - objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Impossível Eliminar "'+objCACIC.getWinDir + 'cacicservice.exe"'); 2586 + objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Imposs�vel Eliminar "'+objCACIC.getWinDir + 'cacicservice.exe"');
2588 End; 2587 End;
2589 End; 2588 End;
2590 Finally 2589 Finally
2591 g_intTaskBarAtual := FindWindow('Shell_TrayWnd', Nil); 2590 g_intTaskBarAtual := FindWindow('Shell_TrayWnd', Nil);
2592 g_intDesktopWindow := FormularioGeral.getDesktopWindowHandle; 2591 g_intDesktopWindow := FormularioGeral.getDesktopWindowHandle;
2593 2592
2594 - objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Valores para Condição de Redesenho do ícone no SysTRAY...'); 2593 + objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Valores para Condi��o de Redesenho do �cone no SysTRAY...');
2595 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: g_intTaskBarAnterior : ' + IntToStr(g_intTaskBarAnterior)); 2594 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: g_intTaskBarAnterior : ' + IntToStr(g_intTaskBarAnterior));
2596 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: g_intTaskBarAtual : ' + IntToStr(g_intTaskBarAtual)); 2595 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: g_intTaskBarAtual : ' + IntToStr(g_intTaskBarAtual));
2597 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: g_intDesktopWindow : ' + IntToStr(g_intDesktopWindow)); 2596 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: g_intDesktopWindow : ' + IntToStr(g_intDesktopWindow));
@@ -2604,7 +2603,7 @@ begin @@ -2604,7 +2603,7 @@ begin
2604 Begin 2603 Begin
2605 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Invocando InicializaTray...'); 2604 objCACIC.writeDebugLog('timerCheckNoMinutoTimer: Invocando InicializaTray...');
2606 if ((g_intTaskBarAnterior = 0) and (g_intTaskBarAtual > 0)) then 2605 if ((g_intTaskBarAnterior = 0) and (g_intTaskBarAtual > 0)) then
2607 - g_intStatusAnterior := -1; // Para forçar o redesenho no systray 2606 + g_intStatusAnterior := -1; // Para for�ar o redesenho no systray
2608 2607
2609 FormularioGeral.InicializaTray; 2608 FormularioGeral.InicializaTray;
2610 End; 2609 End;
@@ -2647,7 +2646,7 @@ begin @@ -2647,7 +2646,7 @@ begin
2647 ARect.Left := LEFT_MENU_ITEM; 2646 ARect.Left := LEFT_MENU_ITEM;
2648 ACanvas.FillRect(ARect); 2647 ACanvas.FillRect(ARect);
2649 2648
2650 - DrawText(ACanvas.Handle, PChar('Configurações'), -1, ARect, DT_LEFT or DT_VCENTER or DT_SINGLELINE{ or DT_NOCLIP}); 2649 + DrawText(ACanvas.Handle, PChar('Configura��es'), -1, ARect, DT_LEFT or DT_VCENTER or DT_SINGLELINE{ or DT_NOCLIP});
2651 end; 2650 end;
2652 2651
2653 procedure TFormularioGeral.Mnu_ExecutarAgoraDrawItem(Sender: TObject; 2652 procedure TFormularioGeral.Mnu_ExecutarAgoraDrawItem(Sender: TObject;
@@ -2675,7 +2674,7 @@ begin @@ -2675,7 +2674,7 @@ begin
2675 ARect.Left := LEFT_MENU_ITEM; 2674 ARect.Left := LEFT_MENU_ITEM;
2676 ACanvas.FillRect(ARect); 2675 ACanvas.FillRect(ARect);
2677 2676
2678 - DrawText(ACanvas.Handle, PChar('Informações Gerais'), -1, ARect, DT_LEFT or DT_VCENTER or DT_SINGLELINE{ or DT_NOCLIP}); 2677 + DrawText(ACanvas.Handle, PChar('Informa��es Gerais'), -1, ARect, DT_LEFT or DT_VCENTER or DT_SINGLELINE{ or DT_NOCLIP});
2679 end; 2678 end;
2680 2679
2681 procedure TFormularioGeral.Mnu_SuporteRemotoDrawItem(Sender: TObject; 2680 procedure TFormularioGeral.Mnu_SuporteRemotoDrawItem(Sender: TObject;
@@ -2734,7 +2733,7 @@ begin @@ -2734,7 +2733,7 @@ begin
2734 // it will fail because it no longer exists when the explorer restarts. 2733 // it will fail because it no longer exists when the explorer restarts.
2735 on E:Exception do 2734 on E:Exception do
2736 Begin 2735 Begin
2737 - objCACIC.writeExceptionLog(E.Message,e.ClassName,'ApplicationEvents1Message - Liberando Systray Icon para recriação'); 2736 + objCACIC.writeExceptionLog(E.Message,e.ClassName,'ApplicationEvents1Message - Liberando Systray Icon para recria��o');
2738 End; 2737 End;
2739 end; 2738 end;
2740 TrayIcon1 := TTrayIcon.Create(self); 2739 TrayIcon1 := TTrayIcon.Create(self);