Commit a91edf1c54be688899136cbe6805eb35c5aeb687

Authored by anderson.peterle@previdencia.gov.br
1 parent 58dcc587
Exists in master

Ajustes no agente principal (cacic2.exe) para tratamento da reexibicao do icone …

…no systray quando em logoff/logon, ajustes no chkCACIC para criacao de excecoes no firewall nativo do XP para o srCACICsrv, implementacao de indicador da condicao para Desativacao do Suporte Remoto pelo cliente.

git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/agente-windows@781 fecfc0c7-e812-0410-ae72-849f08638ee7
cacic2.res
No preview for this file type
cacicservice/CACICsvcMain.pas
@@ -110,10 +110,10 @@ procedure TCACICservice.logDEBUG(Msg : String); @@ -110,10 +110,10 @@ procedure TCACICservice.logDEBUG(Msg : String);
110 var fLog: textfile; 110 var fLog: textfile;
111 begin 111 begin
112 // Somente gravarei informações para debug se o arquivo "<HomeDrive>:\CACICsvc.log" existir 112 // Somente gravarei informações para debug se o arquivo "<HomeDrive>:\CACICsvc.log" existir
113 - if FileExists(g_oCacic.Windows.getHomeDrive + 'CACICsvc.log') then 113 + if FileExists(g_oCacic.Windows.getHomeDrive + g_oCacic.Windows.getWinDir + 'CACICsvc.log') then
114 Begin 114 Begin
115 - AssignFile(fLog, g_oCacic.Windows.getHomeDrive + 'CACICsvc.log');  
116 - if FileExists(g_oCacic.Windows.getHomeDrive + 'CACICsvc.log') then 115 + AssignFile(fLog, g_oCacic.Windows.getHomeDrive + g_oCacic.Windows.getWinDir + 'CACICsvc.log');
  116 + if FileExists(g_oCacic.Windows.getHomeDrive + g_oCacic.Windows.getWinDir + 'CACICsvc.log') then
117 Append(fLog) 117 Append(fLog)
118 else 118 else
119 Rewrite(fLog); 119 Rewrite(fLog);
@@ -148,6 +148,9 @@ procedure TCACICservice.ServiceStart(Sender: TService; var Started: Boolean); @@ -148,6 +148,9 @@ procedure TCACICservice.ServiceStart(Sender: TService; var Started: Boolean);
148 begin 148 begin
149 149
150 g_oCacic := TCACIC.Create; 150 g_oCacic := TCACIC.Create;
  151 + g_oCacic.setCacicPath(GetValorChaveRegIni('Cacic2', 'cacic_dir', g_oCacic.getWinDir + 'chksis.ini'));
  152 + CACICservice.logDEBUG('TCACICservice.ExecutaCACIC : setCacicPath => '+GetValorChaveRegIni('Cacic2', 'cacic_dir', g_oCacic.getWinDir + 'chksis.ini'));
  153 +
151 CACICservice.logDEBUG('TCACICservice.ServiceStart'); 154 CACICservice.logDEBUG('TCACICservice.ServiceStart');
152 Started := true; 155 Started := true;
153 156
@@ -162,9 +165,6 @@ end; @@ -162,9 +165,6 @@ end;
162 165
163 procedure TCACICservice.ExecutaCACIC; 166 procedure TCACICservice.ExecutaCACIC;
164 Begin 167 Begin
165 - CACICservice.logDEBUG('TCACICservice.ExecutaCACIC : setCacicPath => '+GetValorChaveRegIni('Cacic2', 'cacic_dir', g_oCacic.getWinDir + 'chksis.ini'));  
166 - g_oCacic.setCacicPath(GetValorChaveRegIni('Cacic2', 'cacic_dir', g_oCacic.getWinDir + 'chksis.ini'));  
167 -  
168 CACICservice.logDEBUG('TCACICservice.ExecutaCACIC : deleteFile => '+g_oCacic.getCacicPath + 'aguarde_CACIC.txt'); 168 CACICservice.logDEBUG('TCACICservice.ExecutaCACIC : deleteFile => '+g_oCacic.getCacicPath + 'aguarde_CACIC.txt');
169 DeleteFile(g_oCacic.getCacicPath + 'aguarde_CACIC.txt'); 169 DeleteFile(g_oCacic.getCacicPath + 'aguarde_CACIC.txt');
170 Sleep(3000); 170 Sleep(3000);
@@ -181,15 +181,14 @@ Begin @@ -181,15 +181,14 @@ Begin
181 181
182 While not (FileExists(g_oCacic.getCacicPath + 'cacic2.exe')) do 182 While not (FileExists(g_oCacic.getCacicPath + 'cacic2.exe')) do
183 Sleep(5000); // Espero 5 segundos... 183 Sleep(5000); // Espero 5 segundos...
184 - End;  
185 -  
186 184
187 - // Executo o Agente Principal do CACIC  
188 - Try  
189 - CACICservice.logDEBUG('TCACICservice.ExecutaCACIC : winExec => '+g_oCacic.getCacicPath + 'cacic2.exe');  
190 - g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'cacic2.exe',false);  
191 - Except  
192 - End; 185 + // Executo o Agente Principal do CACIC
  186 + Try
  187 + CACICservice.logDEBUG('TCACICservice.ExecutaCACIC : winExec => '+g_oCacic.getCacicPath + 'cacic2.exe');
  188 + g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'cacic2.exe',false);
  189 + Except
  190 + End;
  191 + End;
193 End; 192 End;
194 193
195 procedure TCACICservice.ServiceAfterInstall(Sender: TService); 194 procedure TCACICservice.ServiceAfterInstall(Sender: TService);
chkcacic/chkcacic.res
No preview for this file type
chkcacic/main.pas
@@ -901,14 +901,32 @@ begin @@ -901,14 +901,32 @@ begin
901 End 901 End
902 else 902 else
903 LogDebug('Exceção para "'+p_objeto+'" já existente.'); 903 LogDebug('Exceção para "'+p_objeto+'" já existente.');
  904 +
  905 + if (trim(GetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\'+StringReplace(p_objeto+'.exe','\','?\',[rfReplaceAll])))='') then
  906 + Begin
  907 + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\'+StringReplace(p_objeto+'.exe','\','?\',[rfReplaceAll]),p_objeto+'.exe:*:Enabled:'+p_objeto);
  908 + End
  909 + else
  910 + LogDebug('Exceção para "'+p_objeto+'" já existente.');
  911 +
904 End 912 End
905 else 913 else
906 - if (trim(GetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\'+StringReplace(p_objeto+'.exe','\','?\',[rfReplaceAll])))='') then  
907 - Begin  
908 - SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\'+StringReplace(p_objeto+'.exe','\','?\',[rfReplaceAll]),p_objeto+'.exe:*:Enabled:'+p_objeto);  
909 - End  
910 - else  
911 - LogDebug('Exceção para "'+p_objeto+'" já existente.'); 914 + Begin
  915 + if (trim(GetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\'+StringReplace(p_objeto+'.exe','\','?\',[rfReplaceAll])))='') then
  916 + Begin
  917 + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\'+StringReplace(p_objeto+'.exe','\','?\',[rfReplaceAll]),p_objeto+'.exe:*:Enabled:'+p_objeto);
  918 + End
  919 + else
  920 + LogDebug('Exceção para "'+p_objeto+'" já existente.');
  921 +
  922 + if (trim(GetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\'+StringReplace(p_objeto+'.exe','\','?\',[rfReplaceAll])))='') then
  923 + Begin
  924 + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\'+StringReplace(p_objeto+'.exe','\','?\',[rfReplaceAll]),p_objeto+'.exe:*:Enabled:'+p_objeto);
  925 + End
  926 + else
  927 + LogDebug('Exceção para "'+p_objeto+'" já existente.');
  928 +
  929 + End
912 Except 930 Except
913 LogDebug('Problema adicionando "'+p_objeto+'" à lista de exceções do FireWall!'); 931 LogDebug('Problema adicionando "'+p_objeto+'" à lista de exceções do FireWall!');
914 End; 932 End;
@@ -1249,22 +1267,33 @@ begin @@ -1249,22 +1267,33 @@ begin
1249 // Liberando as conexões de Saída para o FTP 1267 // Liberando as conexões de Saída para o FTP
1250 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\FTP-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+g_oCacic.getHomeDrive+'system32\\ftp.exe|Name=Programa de transferência de arquivos|Desc=Programa de transferência de arquivos|Edge=FALSE|'); 1268 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\FTP-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+g_oCacic.getHomeDrive+'system32\\ftp.exe|Name=Programa de transferência de arquivos|Desc=Programa de transferência de arquivos|Edge=FALSE|');
1251 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\FTP-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+g_oCacic.getHomeDrive+'system32\\ftp.exe|Name=Programa de transferência de arquivos|Desc=Programa de transferência de arquivos|Edge=FALSE|'); 1269 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\FTP-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+g_oCacic.getHomeDrive+'system32\\ftp.exe|Name=Programa de transferência de arquivos|Desc=Programa de transferência de arquivos|Edge=FALSE|');
  1270 + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\FTP-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+g_oCacic.getHomeDrive+'system32\\ftp.exe|Name=Programa de transferência de arquivos|Desc=Programa de transferência de arquivos|Edge=FALSE|');
  1271 + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\FTP-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+g_oCacic.getHomeDrive+'system32\\ftp.exe|Name=Programa de transferência de arquivos|Desc=Programa de transferência de arquivos|Edge=FALSE|');
1252 1272
1253 // Liberando as conexões de Saída para o Ger_Cols 1273 // Liberando as conexões de Saída para o Ger_Cols
1254 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-GERCOLS-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+g_oCacic.getCacicPath+'modulos\\ger_cols.exe|Name=Módulo Gerente de Coletas do Sistema CACIC|Desc=Módulo Gerente de Coletas do Sistema CACIC|Edge=FALSE|'); 1274 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-GERCOLS-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+g_oCacic.getCacicPath+'modulos\\ger_cols.exe|Name=Módulo Gerente de Coletas do Sistema CACIC|Desc=Módulo Gerente de Coletas do Sistema CACIC|Edge=FALSE|');
1255 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-GERCOLS-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+g_oCacic.getCacicPath+'modulos\\ger_cols.exe|Name=Módulo Gerente de Coletas do Sistema CACIC|Desc=Módulo Gerente de Coletas do Sistema CACIC|Edge=FALSE|'); 1275 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-GERCOLS-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+g_oCacic.getCacicPath+'modulos\\ger_cols.exe|Name=Módulo Gerente de Coletas do Sistema CACIC|Desc=Módulo Gerente de Coletas do Sistema CACIC|Edge=FALSE|');
  1276 + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-GERCOLS-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+g_oCacic.getCacicPath+'modulos\\ger_cols.exe|Name=Módulo Gerente de Coletas do Sistema CACIC|Desc=Módulo Gerente de Coletas do Sistema CACIC|Edge=FALSE|');
  1277 + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-GERCOLS-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+g_oCacic.getCacicPath+'modulos\\ger_cols.exe|Name=Módulo Gerente de Coletas do Sistema CACIC|Desc=Módulo Gerente de Coletas do Sistema CACIC|Edge=FALSE|');
1256 1278
1257 // Liberando as conexões de Saída para o SrCACICsrv 1279 // Liberando as conexões de Saída para o SrCACICsrv
1258 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-SRCACICSRV-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+g_oCacic.getCacicPath+'modulos\\srcacicsrv.exe|Name=Módulo Suporte Remoto Seguro do Sistema CACIC|Desc=Módulo Suporte Remoto Seguro do Sistema CACIC|Edge=FALSE|'); 1280 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-SRCACICSRV-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+g_oCacic.getCacicPath+'modulos\\srcacicsrv.exe|Name=Módulo Suporte Remoto Seguro do Sistema CACIC|Desc=Módulo Suporte Remoto Seguro do Sistema CACIC|Edge=FALSE|');
1259 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-SRCACICSRV-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+g_oCacic.getCacicPath+'modulos\\srcacicsrv.exe|Name=Módulo Suporte Remoto Seguro do Sistema CACIC|Desc=Módulo Suporte Remoto Seguro do Sistema CACIC|Edge=FALSE|'); 1281 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-SRCACICSRV-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+g_oCacic.getCacicPath+'modulos\\srcacicsrv.exe|Name=Módulo Suporte Remoto Seguro do Sistema CACIC|Desc=Módulo Suporte Remoto Seguro do Sistema CACIC|Edge=FALSE|');
  1282 + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-SRCACICSRV-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+g_oCacic.getCacicPath+'modulos\\srcacicsrv.exe|Name=Módulo Suporte Remoto Seguro do Sistema CACIC|Desc=Módulo Suporte Remoto Seguro do Sistema CACIC|Edge=FALSE|');
  1283 + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-SRCACICSRV-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+g_oCacic.getCacicPath+'modulos\\srcacicsrv.exe|Name=Módulo Suporte Remoto Seguro do Sistema CACIC|Desc=Módulo Suporte Remoto Seguro do Sistema CACIC|Edge=FALSE|');
1260 1284
1261 // Liberando as conexões de Saída para o ChkCacic 1285 // Liberando as conexões de Saída para o ChkCacic
1262 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-CHKCACIC-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+ExtractFilePath(Application.Exename) + '\chkcacic.exe|Name=chkcacic.exe|Desc=chkcacic.exe|Edge=FALSE|'); 1286 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-CHKCACIC-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+ExtractFilePath(Application.Exename) + '\chkcacic.exe|Name=chkcacic.exe|Desc=chkcacic.exe|Edge=FALSE|');
1263 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-CHKCACIC-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+ExtractFilePath(Application.Exename) + '\chkcacic.exe|Name=chkcacic.exe|Desc=chkcacic.exe|Edge=FALSE|'); 1287 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-CHKCACIC-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+ExtractFilePath(Application.Exename) + '\chkcacic.exe|Name=chkcacic.exe|Desc=chkcacic.exe|Edge=FALSE|');
  1288 + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-CHKCACIC-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+ExtractFilePath(Application.Exename) + '\chkcacic.exe|Name=chkcacic.exe|Desc=chkcacic.exe|Edge=FALSE|');
  1289 + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-CHKCACIC-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+ExtractFilePath(Application.Exename) + '\chkcacic.exe|Name=chkcacic.exe|Desc=chkcacic.exe|Edge=FALSE|');
1264 1290
1265 // Liberando as conexões de Saída para o ChkSis 1291 // Liberando as conexões de Saída para o ChkSis
1266 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-CHKSIS-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+g_oCacic.getWinDir + 'chksis.exe|Name=Módulo Verificador de Integridade do Sistema CACIC|Desc=Módulo Verificador de Integridade do Sistema CACIC|Edge=FALSE|'); 1292 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-CHKSIS-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+g_oCacic.getWinDir + 'chksis.exe|Name=Módulo Verificador de Integridade do Sistema CACIC|Desc=Módulo Verificador de Integridade do Sistema CACIC|Edge=FALSE|');
1267 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-CHKSIS-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+g_oCacic.getWinDir + 'chksis.exe|Name=Módulo Verificador de Integridade do Sistema CACIC|Desc=Módulo Verificador de Integridade do Sistema CACIC|Edge=FALSE|'); 1293 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-CHKSIS-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+g_oCacic.getWinDir + 'chksis.exe|Name=Módulo Verificador de Integridade do Sistema CACIC|Desc=Módulo Verificador de Integridade do Sistema CACIC|Edge=FALSE|');
  1294 + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-CHKSIS-Out-TCP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|Profile=Private|App='+g_oCacic.getWinDir + 'chksis.exe|Name=Módulo Verificador de Integridade do Sistema CACIC|Desc=Módulo Verificador de Integridade do Sistema CACIC|Edge=FALSE|');
  1295 + SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules\CACIC-CHKSIS-Out-UDP','v2.0|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|Profile=Private|App='+g_oCacic.getWinDir + 'chksis.exe|Name=Módulo Verificador de Integridade do Sistema CACIC|Desc=Módulo Verificador de Integridade do Sistema CACIC|Edge=FALSE|');
  1296 +
1268 End 1297 End
1269 Except 1298 Except
1270 LogDebug('Problema Liberando Policies de FireWall!'); 1299 LogDebug('Problema Liberando Policies de FireWall!');
@@ -1272,10 +1301,11 @@ begin @@ -1272,10 +1301,11 @@ begin
1272 End 1301 End
1273 else 1302 else
1274 Begin 1303 Begin
1275 - // Acrescento o ChkCacic às exceções do FireWall nativo... 1304 + // Acrescento o ChkCacic e srCACICsrv às exceções do FireWall nativo...
1276 {chkcacic} 1305 {chkcacic}
1277 LogDebug('Inserindo "'+ExtractFilePath(Application.Exename) + 'chkcacic" nas exceções do FireWall!'); 1306 LogDebug('Inserindo "'+ExtractFilePath(Application.Exename) + 'chkcacic" nas exceções do FireWall!');
1278 LiberaFireWall(ExtractFilePath(Application.Exename) + 'chkcacic'); 1307 LiberaFireWall(ExtractFilePath(Application.Exename) + 'chkcacic');
  1308 + LiberaFireWall(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe');
1279 End; 1309 End;
1280 Except 1310 Except
1281 End; 1311 End;
ger_cols/ger_cols.dpr
@@ -170,7 +170,7 @@ procedure log_DEBUG(p_msg:string); @@ -170,7 +170,7 @@ procedure log_DEBUG(p_msg:string);
170 Begin 170 Begin
171 if v_Debugs then log_diario('(v.'+getVersionInfo(ParamStr(0))+') DEBUG - '+p_msg); 171 if v_Debugs then log_diario('(v.'+getVersionInfo(ParamStr(0))+') DEBUG - '+p_msg);
172 End; 172 End;
173 - 173 +{
174 function Compress(p_strToCompress : string) : String; 174 function Compress(p_strToCompress : string) : String;
175 var v_tstrToCompress, v_tstrCompressed : TStringStream; 175 var v_tstrToCompress, v_tstrCompressed : TStringStream;
176 Zip : TZCompressionStream; 176 Zip : TZCompressionStream;
@@ -182,7 +182,7 @@ begin @@ -182,7 +182,7 @@ begin
182 Zip.Free; 182 Zip.Free;
183 183
184 Result := ZlibEx.ZCompressStrWeb(v_tstrCompressed.DataString); 184 Result := ZlibEx.ZCompressStrWeb(v_tstrCompressed.DataString);
185 -end; {Compress} 185 +end;
186 186
187 function DeCompress(p_ToDeCompress : String) : String; 187 function DeCompress(p_ToDeCompress : String) : String;
188 var v_tstrToDeCompress, v_tstrDeCompressed : TStringStream; 188 var v_tstrToDeCompress, v_tstrDeCompressed : TStringStream;
@@ -203,8 +203,8 @@ end; @@ -203,8 +203,8 @@ end;
203 203
204 DeZip.Free; 204 DeZip.Free;
205 Result := ZlibEx.ZDecompressStrEx(v_tstrDeCompressed.DataString); 205 Result := ZlibEx.ZDecompressStrEx(v_tstrDeCompressed.DataString);
206 -end; {DeCompress}  
207 - 206 +end;
  207 +}
208 Function RemoveCaracteresEspeciais(Texto, p_Fill : String; p_start, p_end:integer) : String; 208 Function RemoveCaracteresEspeciais(Texto, p_Fill : String; p_start, p_end:integer) : String;
209 var I : Integer; 209 var I : Integer;
210 Begin 210 Begin
@@ -2435,6 +2435,8 @@ Begin @@ -2435,6 +2435,8 @@ Begin
2435 SetValorDatMemoria('Configs.IN_EXIBE_BANDEJA' ,UpperCase(g_oCacic.deCrypt(XML_RetornaValor('in_exibe_bandeja' , strRetorno))), v_tstrCipherOpened); 2435 SetValorDatMemoria('Configs.IN_EXIBE_BANDEJA' ,UpperCase(g_oCacic.deCrypt(XML_RetornaValor('in_exibe_bandeja' , strRetorno))), v_tstrCipherOpened);
2436 SetValorDatMemoria('Configs.TE_JANELAS_EXCECAO' ,g_oCacic.deCrypt(XML_RetornaValor('te_janelas_excecao' , strRetorno)) , v_tstrCipherOpened); 2436 SetValorDatMemoria('Configs.TE_JANELAS_EXCECAO' ,g_oCacic.deCrypt(XML_RetornaValor('te_janelas_excecao' , strRetorno)) , v_tstrCipherOpened);
2437 SetValorDatMemoria('TcpIp.TE_ENDERECOS_MAC_INVALIDOS' ,g_oCacic.deCrypt(XML_RetornaValor('te_enderecos_mac_invalidos' , strRetorno)) , v_tstrCipherOpened); 2437 SetValorDatMemoria('TcpIp.TE_ENDERECOS_MAC_INVALIDOS' ,g_oCacic.deCrypt(XML_RetornaValor('te_enderecos_mac_invalidos' , strRetorno)) , v_tstrCipherOpened);
  2438 + SetValorDatMemoria('Configs.NU_PORTA_SRCACIC' ,g_oCacic.deCrypt(XML_RetornaValor('nu_porta_srcacic' , strRetorno)) , v_tstrCipherOpened);
  2439 + SetValorDatMemoria('Configs.CS_PERMITIR_DESATIVAR_SRCACIC' ,g_oCacic.deCrypt(XML_RetornaValor('cs_permitir_desativar_srcacic' , strRetorno)) , v_tstrCipherOpened);
2438 SetValorDatMemoria('Configs.DT_HR_COLETA_FORCADA' ,stringreplace(stringreplace(stringreplace(g_oCacic.deCrypt(XML_RetornaValor('dt_hr_coleta_forcada' , strRetorno)),'-','',[rfReplaceAll]),' ','',[rfReplaceAll]),':','',[rfReplaceAll]), v_tstrCipherOpened); 2440 SetValorDatMemoria('Configs.DT_HR_COLETA_FORCADA' ,stringreplace(stringreplace(stringreplace(g_oCacic.deCrypt(XML_RetornaValor('dt_hr_coleta_forcada' , strRetorno)),'-','',[rfReplaceAll]),' ','',[rfReplaceAll]),':','',[rfReplaceAll]), v_tstrCipherOpened);
2439 SetValorDatMemoria('Configs.DT_HR_COLETA_FORCADA_ANVI' ,stringreplace(stringreplace(stringreplace(g_oCacic.deCrypt(XML_RetornaValor('dt_hr_coleta_forcada_anvi', strRetorno)),'-','',[rfReplaceAll]),' ','',[rfReplaceAll]),':','',[rfReplaceAll]), v_tstrCipherOpened); 2441 SetValorDatMemoria('Configs.DT_HR_COLETA_FORCADA_ANVI' ,stringreplace(stringreplace(stringreplace(g_oCacic.deCrypt(XML_RetornaValor('dt_hr_coleta_forcada_anvi', strRetorno)),'-','',[rfReplaceAll]),' ','',[rfReplaceAll]),':','',[rfReplaceAll]), v_tstrCipherOpened);
2440 SetValorDatMemoria('Configs.DT_HR_COLETA_FORCADA_COMP' ,stringreplace(stringreplace(stringreplace(g_oCacic.deCrypt(XML_RetornaValor('dt_hr_coleta_forcada_comp', strRetorno)),'-','',[rfReplaceAll]),' ','',[rfReplaceAll]),':','',[rfReplaceAll]), v_tstrCipherOpened); 2442 SetValorDatMemoria('Configs.DT_HR_COLETA_FORCADA_COMP' ,stringreplace(stringreplace(stringreplace(g_oCacic.deCrypt(XML_RetornaValor('dt_hr_coleta_forcada_comp', strRetorno)),'-','',[rfReplaceAll]),' ','',[rfReplaceAll]),':','',[rfReplaceAll]), v_tstrCipherOpened);
ger_cols/ger_cols.res
No preview for this file type
@@ -62,6 +62,10 @@ var @@ -62,6 +62,10 @@ var
62 v_tstrCipherOpened : TStrings; 62 v_tstrCipherOpened : TStrings;
63 63
64 var 64 var
  65 + g_intTaskBarAtual,
  66 + g_intTaskBarAnterior : integer;
  67 +
  68 +var
65 boolDebugs : Boolean; 69 boolDebugs : Boolean;
66 70
67 var 71 var
@@ -1054,6 +1058,11 @@ var strAux, @@ -1054,6 +1058,11 @@ var strAux,
1054 v_Aguarde : TextFile; 1058 v_Aguarde : TextFile;
1055 v_SystemDrive : TStrings; 1059 v_SystemDrive : TStrings;
1056 begin 1060 begin
  1061 + // Essas variáveis ajudarão a controlar o redesenho do ícone no systray,
  1062 + // evitando o "roubo" do foco.
  1063 + g_intTaskBarAtual := 0;
  1064 + g_intTaskBarAnterior := 0;
  1065 +
1057 // Não mostrar o formulário... 1066 // Não mostrar o formulário...
1058 Application.ShowMainForm:=false; 1067 Application.ShowMainForm:=false;
1059 g_oCacic := TCACIC.Create; 1068 g_oCacic := TCACIC.Create;
@@ -2158,15 +2167,20 @@ end; @@ -2158,15 +2167,20 @@ end;
2158 } 2167 }
2159 procedure TFormularioGeral.Mnu_SuporteRemotoClick(Sender: TObject); 2168 procedure TFormularioGeral.Mnu_SuporteRemotoClick(Sender: TObject);
2160 var boolAux : boolean; 2169 var boolAux : boolean;
2161 - strPalavraChave,  
2162 - strTeSO,  
2163 - strTeNodeAddress : String; 2170 + v_strPalavraChave,
  2171 + v_strTeSO,
  2172 + v_strTeNodeAddress,
  2173 + v_strNuPortaSR : String;
2164 fileAguarde : TextFile; 2174 fileAguarde : TextFile;
2165 begin 2175 begin
2166 if boolServerON then // Ordeno ao SrCACICsrv que auto-finalize 2176 if boolServerON then // Ordeno ao SrCACICsrv que auto-finalize
2167 Begin 2177 Begin
2168 Log_Diario('Desativando Suporte Remoto Seguro.'); 2178 Log_Diario('Desativando Suporte Remoto Seguro.');
  2179 + WinExec(PChar(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -kill'), SW_NORMAL);
  2180 + {
2169 g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -kill',false); 2181 g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -kill',false);
  2182 + }
  2183 +
2170 boolServerON := false; 2184 boolServerON := false;
2171 End 2185 End
2172 else 2186 else
@@ -2176,28 +2190,31 @@ begin @@ -2176,28 +2190,31 @@ begin
2176 2190
2177 // Alguns cuidados necessários ao tráfego e recepção de valores pelo Gerente WEB 2191 // Alguns cuidados necessários ao tráfego e recepção de valores pelo Gerente WEB
2178 // Some cares about send and receive at Gerente WEB 2192 // Some cares about send and receive at Gerente WEB
2179 - strPalavraChave := FormularioGeral.getValorDatMemoria('Configs.te_palavra_chave', v_tstrCipherOpened);  
2180 - strPalavraChave := StringReplace(strPalavraChave,' ' ,'<ESPACE>' ,[rfReplaceAll]);  
2181 - strPalavraChave := StringReplace(strPalavraChave,'"' ,'<AD>' ,[rfReplaceAll]);  
2182 - strPalavraChave := StringReplace(strPalavraChave,'''' ,'<AS>' ,[rfReplaceAll]);  
2183 - strPalavraChave := StringReplace(strPalavraChave,'\' ,'<BarrInv>' ,[rfReplaceAll]);  
2184 - strPalavraChave := g_oCacic.enCrypt(strPalavraChave);  
2185 - strPalavraChave := StringReplace(strPalavraChave,'+','<MAIS>',[rfReplaceAll]);  
2186 -  
2187 - strTeSO := trim(StringReplace(FormularioGeral.getValorDatMemoria('Configs.TE_SO', v_tstrCipherOpened),' ','<ESPACE>',[rfReplaceAll]));  
2188 - strTeSO := g_oCacic.enCrypt(strTeSO);  
2189 - strTeSO := StringReplace(strTeSO,'+','<MAIS>',[rfReplaceAll]);  
2190 -  
2191 - strTeNodeAddress := trim(StringReplace(FormularioGeral.getValorDatMemoria('TcpIp.TE_NODE_ADDRESS' , v_tstrCipherOpened),' ','<ESPACE>' ,[rfReplaceAll]));  
2192 - strTeNodeAddress := g_oCacic.enCrypt(strTeNodeAddress);  
2193 - strTeNodeAddress := StringReplace(strTeNodeAddress,'+','<MAIS>',[rfReplaceAll]); 2193 + v_strPalavraChave := FormularioGeral.getValorDatMemoria('Configs.te_palavra_chave', v_tstrCipherOpened);
  2194 + v_strPalavraChave := StringReplace(v_strPalavraChave,' ' ,'<ESPACE>' ,[rfReplaceAll]);
  2195 + v_strPalavraChave := StringReplace(v_strPalavraChave,'"' ,'<AD>' ,[rfReplaceAll]);
  2196 + v_strPalavraChave := StringReplace(v_strPalavraChave,'''' ,'<AS>' ,[rfReplaceAll]);
  2197 + v_strPalavraChave := StringReplace(v_strPalavraChave,'\' ,'<BarrInv>' ,[rfReplaceAll]);
  2198 + v_strPalavraChave := g_oCacic.enCrypt(v_strPalavraChave);
  2199 + v_strPalavraChave := StringReplace(v_strPalavraChave,'+','<MAIS>',[rfReplaceAll]);
  2200 +
  2201 + v_strTeSO := trim(StringReplace(FormularioGeral.getValorDatMemoria('Configs.TE_SO', v_tstrCipherOpened),' ','<ESPACE>',[rfReplaceAll]));
  2202 + v_strTeSO := g_oCacic.enCrypt(v_strTeSO);
  2203 + v_strTeSO := StringReplace(v_strTeSO,'+','<MAIS>',[rfReplaceAll]);
  2204 +
  2205 + v_strTeNodeAddress := trim(StringReplace(FormularioGeral.getValorDatMemoria('TcpIp.TE_NODE_ADDRESS' , v_tstrCipherOpened),' ','<ESPACE>' ,[rfReplaceAll]));
  2206 + v_strTeNodeAddress := g_oCacic.enCrypt(v_strTeNodeAddress);
  2207 + v_strTeNodeAddress := StringReplace(v_strTeNodeAddress,'+','<MAIS>',[rfReplaceAll]);
  2208 +
  2209 + v_strNuPortaSR := trim(FormularioGeral.getValorDatMemoria('Configs.NU_PORTA_SRCACIC' , v_tstrCipherOpened));
2194 2210
2195 log_DEBUG('Invocando "'+g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' + 2211 log_DEBUG('Invocando "'+g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' +
2196 - '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' +  
2197 - '[' + strTeSO + ']' +  
2198 - '[' + strTeNodeAddress + ']' +  
2199 - '[' + strPalavraChave + ']' +  
2200 - '[' + g_oCacic.getCacicPath + 'Temp\aguarde_srCACIC.txt' + ']'); 2212 + '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' +
  2213 + '[' + v_strTeSO + ']' +
  2214 + '[' + v_strTeNodeAddress + ']' +
  2215 + '[' + v_strPalavraChave + ']' +
  2216 + '[' + g_oCacic.getCacicPath + 'Temp\' + ']' +
  2217 + '[' + v_strNuPortaSR + ']');
2201 2218
2202 // Detectar versão do Windows antes de fazer a chamada seguinte... 2219 // Detectar versão do Windows antes de fazer a chamada seguinte...
2203 try 2220 try
@@ -2215,12 +2232,23 @@ begin @@ -2215,12 +2232,23 @@ begin
2215 CloseFile(fileAguarde); 2232 CloseFile(fileAguarde);
2216 Finally 2233 Finally
2217 End; 2234 End;
2218 - g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' +  
2219 - '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' +  
2220 - '[' + strTeSO + ']' +  
2221 - '[' + strTeNodeAddress + ']' +  
2222 - '[' + strPalavraChave + ']' +  
2223 - '[' + g_oCacic.getCacicPath + 'Temp\' + ']',false); 2235 + WinExec(PChar(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' +
  2236 + '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' +
  2237 + '[' + v_strTeSO + ']' +
  2238 + '[' + v_strTeNodeAddress + ']' +
  2239 + '[' + v_strPalavraChave + ']' +
  2240 + '[' + g_oCacic.getCacicPath + 'Temp\' + ']' +
  2241 + '[' + v_strNuPortaSR + ']'),SW_NORMAL);
  2242 + {
  2243 + g_oCacic.createSampleProcess(g_oCacic.getCacicPath + 'modulos\srcacicsrv.exe -start [' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.EnderecoServidor', v_tstrCipherOpened)) + ']' +
  2244 + '[' + g_oCacic.enCrypt(FormularioGeral.getValorDatMemoria('Configs.Endereco_WS' , v_tstrCipherOpened)) + ']' +
  2245 + '[' + v_strTeSO + ']' +
  2246 + '[' + v_strTeNodeAddress + ']' +
  2247 + '[' + v_strPalavraChave + ']' +
  2248 + '[' + g_oCacic.getCacicPath + 'Temp\' + ']' +
  2249 + '[' + v_strNuPortaSR + ']',false);
  2250 + }
  2251 +
2224 2252
2225 BoolServerON := true; 2253 BoolServerON := true;
2226 End; 2254 End;
@@ -2240,8 +2268,17 @@ begin @@ -2240,8 +2268,17 @@ begin
2240 FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_SRCACIC.txt'); 2268 FormularioGeral.Matar(g_oCacic.getCacicPath+'temp\','aguarde_SRCACIC.txt');
2241 if FileExists(g_oCacic.getCacicPath + 'temp\aguarde_SRCACIC.txt') then 2269 if FileExists(g_oCacic.getCacicPath + 'temp\aguarde_SRCACIC.txt') then
2242 Begin 2270 Begin
2243 - Mnu_SuporteRemoto.Caption := 'Suporte Remoto Ativo!';  
2244 - Mnu_SuporteRemoto.Enabled := false; 2271 + if (getValorDatMemoria('Configs.CS_PERMITIR_DESATIVAR_SRCACIC',v_tstrCipherOpened) = 'S') then
  2272 + Begin
  2273 + Mnu_SuporteRemoto.Caption := 'Desativar Suporte Remoto';
  2274 + Mnu_SuporteRemoto.Enabled := true;
  2275 + End
  2276 + else
  2277 + Begin
  2278 + Mnu_SuporteRemoto.Caption := 'Suporte Remoto Ativo!';
  2279 + Mnu_SuporteRemoto.Enabled := false;
  2280 + End;
  2281 +
2245 boolServerON := true; 2282 boolServerON := true;
2246 End 2283 End
2247 else 2284 else
@@ -2254,9 +2291,18 @@ end; @@ -2254,9 +2291,18 @@ end;
2254 2291
2255 procedure TFormularioGeral.Timer_InicializaTrayTimer(Sender: TObject); 2292 procedure TFormularioGeral.Timer_InicializaTrayTimer(Sender: TObject);
2256 begin 2293 begin
2257 - Timer_InicializaTray.Enabled := false;  
2258 - InicializaTray;  
2259 - Timer_InicializaTray.Enabled := true; 2294 + Timer_InicializaTray.Enabled := false;
  2295 +
  2296 + g_intTaskBarAtual := FindWindow('Shell_TrayWnd', Nil);
  2297 + Log_DEBUG('g_intTaskBarAnterior: '+ intToStr(g_intTaskBarAnterior));
  2298 + Log_DEBUG('g_intTaskBarAtual: ' + intToStr(g_intTaskBarAtual));
  2299 +
  2300 + if (g_intTaskBarAnterior = 0) and (g_intTaskBarAtual > 0) then
  2301 + InicializaTray;
  2302 +
  2303 + g_intTaskBarAnterior := g_intTaskBarAtual;
  2304 +
  2305 + Timer_InicializaTray.Enabled := true;
2260 end; 2306 end;
2261 2307
2262 end. 2308 end.