From 16c9dc7cfb47928fc8c5565ab797a47227e970df Mon Sep 17 00:00:00 2001 From: harpiain@gmail.com Date: Sat, 4 Apr 2009 21:59:52 +0000 Subject: [PATCH] - Exclusão de arquivos desnecessários no repositório --- cacicservice/CACICsvc.~dpr | 29 ----------------------------- cacicservice/CACICsvcMain.dcu | Bin 8566 -> 0 bytes cacicservice/CACICsvcMain.~ddp | Bin 51 -> 0 bytes cacicservice/CACICsvcMain.~dfm | 20 -------------------- cacicservice/CACICsvcMain.~pas | 234 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ cacicservice/CACICsvcThread.dcu | Bin 1456 -> 0 bytes cacicservice/CACICsvcThread.~pas | 202 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 7 files changed, 0 insertions(+), 485 deletions(-) delete mode 100755 cacicservice/CACICsvc.~dpr delete mode 100755 cacicservice/CACICsvcMain.dcu delete mode 100755 cacicservice/CACICsvcMain.~ddp delete mode 100755 cacicservice/CACICsvcMain.~dfm delete mode 100755 cacicservice/CACICsvcMain.~pas delete mode 100755 cacicservice/CACICsvcThread.dcu delete mode 100755 cacicservice/CACICsvcThread.~pas diff --git a/cacicservice/CACICsvc.~dpr b/cacicservice/CACICsvc.~dpr deleted file mode 100755 index 7849787..0000000 --- a/cacicservice/CACICsvc.~dpr +++ /dev/null @@ -1,29 +0,0 @@ -(** ---------------------------------------------------------------------------------------------------------------------------------------------------------------- -Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Dataprev - Empresa de Tecnologia e Informações da Previdência Social, Brasil - -Este arquivo é parte do programa CACIC - Configurador Automático e Coletor de Informações Computacionais - -O CACIC é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como -publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença, ou (na sua opinião) qualquer versão. - -Este programa é distribuido na esperança que possa ser util, mas SEM NENHUMA GARANTIA; sem uma garantia implicita de ADEQUAÇÂO a qualquer -MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes. - -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 -Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ---------------------------------------------------------------------------------------------------------------------------------------------------------------- -*) -program CACICsvc; - -uses - SvcMgr, - CACICsvcMain in 'CACICsvcMain.pas' {CACICservice: TService}; - -{$R *.RES} - -begin - Application.Initialize; - Application.CreateForm(TCACICservice, CACICservice); - Application.Run; -end. diff --git a/cacicservice/CACICsvcMain.dcu b/cacicservice/CACICsvcMain.dcu deleted file mode 100755 index c2e0dba..0000000 Binary files a/cacicservice/CACICsvcMain.dcu and /dev/null differ diff --git a/cacicservice/CACICsvcMain.~ddp b/cacicservice/CACICsvcMain.~ddp deleted file mode 100755 index 4370276..0000000 Binary files a/cacicservice/CACICsvcMain.~ddp and /dev/null differ diff --git a/cacicservice/CACICsvcMain.~dfm b/cacicservice/CACICsvcMain.~dfm deleted file mode 100755 index 3470366..0000000 --- a/cacicservice/CACICsvcMain.~dfm +++ /dev/null @@ -1,20 +0,0 @@ -object CACICservice: TCACICservice - OldCreateOrder = False - DisplayName = 'CACICservice' - Interactive = True - AfterInstall = ServiceAfterInstall - OnExecute = ServiceExecute - OnStart = ServiceStart - OnStop = ServiceStop - Left = 192 - Top = 107 - Height = 375 - Width = 544 - object Timer_CHKsis: TTimer - Enabled = False - Interval = 60000 - OnTimer = Timer_CHKsisTimer - Left = 464 - Top = 16 - end -end diff --git a/cacicservice/CACICsvcMain.~pas b/cacicservice/CACICsvcMain.~pas deleted file mode 100755 index 41f9224..0000000 --- a/cacicservice/CACICsvcMain.~pas +++ /dev/null @@ -1,234 +0,0 @@ -(** ---------------------------------------------------------------------------------------------------------------------------------------------------------------- -Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Dataprev - Empresa de Tecnologia e Informações da Previdência Social, Brasil - -Este arquivo é parte do programa CACIC - Configurador Automático e Coletor de Informações Computacionais - -O CACIC é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como -publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença, ou (na sua opinião) qualquer versão. - -Este programa é distribuido na esperança que possa ser util, mas SEM NENHUMA GARANTIA; sem uma garantia implicita de ADEQUAÇÂO a qualquer -MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes. - -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 -Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ---------------------------------------------------------------------------------------------------------------------------------------------------------------- -*) -unit CACICsvcMain; - -interface - -uses - Windows, Messages, SysUtils, Classes, SvcMgr,strutils, ExtCtrls; - -var strHomeDrive, - strCacicDir : String; - boolStarted : boolean; - -type - TCACICservice = class(TService) - Timer_CHKsis: TTimer; - procedure ServiceExecute(Sender: TService); - procedure ServiceStart(Sender: TService; var Started: Boolean); - procedure ServiceAfterInstall(Sender: TService); - procedure Timer_CHKsisTimer(Sender: TObject); - procedure ServiceStop(Sender: TService; var Stopped: Boolean); - private - - { Internal Start & Stop methods } - function HomeDrive : string; - function GetValorChaveRegIni(p_Secao, p_Chave, p_File : String): String; - function GetAppPath: String; - procedure doSaveLog(Msg : String); - Procedure WMEndSession(var Msg : TWMEndSession) ; message WM_ENDSESSION; - procedure ExecutaCACIC; - public - { Public declarations } - - function GetServiceController: TServiceController; override; - end; - -var - CACICservice: TCACICservice; - -implementation - -{$R *.DFM} -procedure TCACICservice.WMEndSession(var Msg : TWMEndSession) ; -begin - if Msg.EndSession = TRUE then - doSaveLog('Windows finalizado em ' + FormatDateTime('c', Now)) ; - inherited; - Application.Free; -end; -// Funções Auxiliares -function TCACICservice.GetValorChaveRegIni(p_Secao, p_Chave, p_File : String): String; -//Para buscar do Arquivo INI... -// Marreta devido a limitações do KERNEL w9x no tratamento de arquivos texto e suas seções -//function GetValorChaveRegIni(p_SectionName, p_KeyName, p_IniFileName : String) : String; -var - FileText : TStringList; - i, j, v_Size_Section, v_Size_Key : integer; - v_SectionName, v_KeyName : string; - begin -//doSaveLog('GetVCRini: Secao: '+p_Secao+' Chave: '+p_Chave+' File: '+p_File); - Result := ''; - v_SectionName := '[' + p_Secao + ']'; - v_Size_Section := strLen(PChar(v_SectionName)); - v_KeyName := p_Chave + '='; - v_Size_Key := strLen(PChar(v_KeyName)); - FileText := TStringList.Create; - try - FileText.LoadFromFile(p_File); - For i := 0 To FileText.Count - 1 Do - Begin - if (LowerCase(Trim(PChar(Copy(FileText[i],1,v_Size_Section)))) = LowerCase(Trim(PChar(v_SectionName)))) then - Begin - For j := i to FileText.Count - 1 Do - Begin - if (LowerCase(Trim(PChar(Copy(FileText[j],1,v_Size_Key)))) = LowerCase(Trim(PChar(v_KeyName)))) then - Begin - Result := PChar(Copy(FileText[j],v_Size_Key + 1,strLen(PChar(FileText[j]))-v_Size_Key)); - Break; - End; - End; - End; - if (Result <> '') then break; - End; - finally - FileText.Free; - end; - end; - -function TCACICservice.GetAppPath: String; -Var - Test : String; - Res : Longint; - CurSize : Longint; -begin - CurSize := 1024; - SetLength(Test, CurSize); - Res := GetModuleFilename(GetModuleHandle(nil), PChar(test), CurSize); - If (res > curSize) then - begin - CurSize := res + 10; - SetLength(Test, CurSize); - Res := GetModuleFilename(GetModuleHandle(nil), PChar(test), CurSize); - end; - Setlength(Test, Res); - test := ExtractFileDir(Test); - if (test[Length(test)] = '\') or (test[Length(test)]='/') then - SetLength(Test, Length(test) - 1); - Result := test; -end; - -function TCACICservice.HomeDrive : string; -var WinDir : array [0..144] of char; -begin - GetWindowsDirectory (WinDir, 144); - Result := StrPas (WinDir); -end; - -procedure TCACICservice.doSaveLog(Msg : String); -var fLog: textfile; -begin - AssignFile(fLog, HomeDrive + '\CACICsvc.log'); - if FileExists(HomeDrive + '\CACICsvc.log') then - Append(fLog) - else - Rewrite(fLog); - Writeln(fLog,FormatDateTime('dd/mm hh:nn:ss ', Now) + '[CACICsvc] : ' +msg); - CloseFile(fLog); -End; - -procedure ServiceController(CtrlCode: DWord); stdcall; -begin - CACICservice.Controller(CtrlCode); -end; - -function TCACICservice.GetServiceController: TServiceController; -begin - Result := ServiceController; -end; - -procedure TCACICservice.ServiceExecute(Sender: TService); -begin - doSaveLog('TCACICservice.ServiceExecute'); - - { Loop while service is active in SCM } - While NOT Terminated do - Begin - { Process Service Requests } - ServiceThread.ProcessRequests( False ); - { Allow system some time } - Sleep(1); - End; -end; - -procedure TCACICservice.ServiceStart(Sender: TService; var Started: Boolean); -begin - - Started := true; - - ExecutaCACIC; - - Timer_CHKsis.Interval := 60000; - Timer_CHKsis.Enabled := true; - - While not Terminated do - Sleep(250); - - -end; - -procedure TCACICservice.ExecutaCACIC; -Begin - - strHomeDrive := MidStr(HomeDrive,1,3); //x:\ - strCacicDir := strHomeDrive + GetValorChaveRegIni('Cacic2', 'cacic_dir', GetAppPath + '\chksis.ini'); - - DeleteFile(strCacicDir + '\aguarde_CACIC.txt'); - Sleep(3000); - - // Se o arquivo indicador de execução não existir... - if not (FileExists(strCacicDir + '\aguarde_CACIC.txt')) then - Begin - // Executo o CHKsis, verificando a estrutura do sistema - Try - WinEXEC(PChar(HomeDrive + '\chksis.exe'),sw_HIDE); - Except - End; - - While not (FileExists(strCacicDir + '\cacic2.exe')) do - Sleep(5000); // Espero 5 segundos... - End; - - - // Executo o Agente Principal do CACIC - Try - WinEXEC(PChar(strCacicDir + '\cacic2.exe'),sw_hide); - Except - End; -End; - -procedure TCACICservice.ServiceAfterInstall(Sender: TService); - -begin - ServiceStart(nil,boolStarted); -end; - -procedure TCACICservice.Timer_CHKsisTimer(Sender: TObject); -begin - ExecutaCACIC; - - // Verificações diversas - -end; - -procedure TCACICservice.ServiceStop(Sender: TService; - var Stopped: Boolean); -begin - Stopped := true; -end; - -end. diff --git a/cacicservice/CACICsvcThread.dcu b/cacicservice/CACICsvcThread.dcu deleted file mode 100755 index 24c928d..0000000 Binary files a/cacicservice/CACICsvcThread.dcu and /dev/null differ diff --git a/cacicservice/CACICsvcThread.~pas b/cacicservice/CACICsvcThread.~pas deleted file mode 100755 index a504db9..0000000 --- a/cacicservice/CACICsvcThread.~pas +++ /dev/null @@ -1,202 +0,0 @@ -(* - A Windows NT Service Thread - =========================== - - Author Kim Sandell - Email: kim.sandell@nsftele.com -*) -unit CACICsvcThread; - -interface - -uses - Windows, Messages, SysUtils, Classes, StrUtils; - -var strHomeDrive, - strCacicDir : String; - -type - TNTServiceThread = Class(TThread) - private - { Private declarations } - function HomeDrive : string; - function GetValorChaveRegIni(p_Secao, p_Chave, p_File : String): String; - function GetAppPath: String; - procedure doSaveLog(Msg : String); - function CreateProcessSimple(sExecutableFilePath : string ) : String; - Public - { Public declarations } - Interval : Integer; - - Procedure Execute; Override; - Published - { Published declarations } - End; - -implementation - -{ TNTServiceThread } -// Funções Auxiliares -function TNTServiceThread.GetValorChaveRegIni(p_Secao, p_Chave, p_File : String): String; -//Para buscar do Arquivo INI... -// Marreta devido a limitações do KERNEL w9x no tratamento de arquivos texto e suas seções -//function GetValorChaveRegIni(p_SectionName, p_KeyName, p_IniFileName : String) : String; -var - FileText : TStringList; - i, j, v_Size_Section, v_Size_Key : integer; - v_SectionName, v_KeyName : string; - begin -//doSaveLog('GetVCRini: Secao: '+p_Secao+' Chave: '+p_Chave+' File: '+p_File); - Result := ''; - v_SectionName := '[' + p_Secao + ']'; - v_Size_Section := strLen(PChar(v_SectionName)); - v_KeyName := p_Chave + '='; - v_Size_Key := strLen(PChar(v_KeyName)); - FileText := TStringList.Create; - try - FileText.LoadFromFile(p_File); - For i := 0 To FileText.Count - 1 Do - Begin - if (LowerCase(Trim(PChar(Copy(FileText[i],1,v_Size_Section)))) = LowerCase(Trim(PChar(v_SectionName)))) then - Begin - For j := i to FileText.Count - 1 Do - Begin - if (LowerCase(Trim(PChar(Copy(FileText[j],1,v_Size_Key)))) = LowerCase(Trim(PChar(v_KeyName)))) then - Begin - Result := PChar(Copy(FileText[j],v_Size_Key + 1,strLen(PChar(FileText[j]))-v_Size_Key)); - Break; - End; - End; - End; - if (Result <> '') then break; - End; - finally - FileText.Free; - end; - end; - -function TNTServiceThread.GetAppPath: String; -Var - Test : String; - Res : Longint; - CurSize : Longint; -begin - CurSize := 1024; - SetLength(Test, CurSize); - Res := GetModuleFilename(GetModuleHandle(nil), PChar(test), CurSize); - If (res > curSize) then - begin - CurSize := res + 10; - SetLength(Test, CurSize); - Res := GetModuleFilename(GetModuleHandle(nil), PChar(test), CurSize); - end; - Setlength(Test, Res); - test := ExtractFileDir(Test); - if (test[Length(test)] = '\') or (test[Length(test)]='/') then - SetLength(Test, Length(test) - 1); - Result := test; -end; - -function TNTServiceThread.HomeDrive : string; -var WinDir : array [0..144] of char; -begin - GetWindowsDirectory (WinDir, 144); - Result := StrPas (WinDir); -end; - -procedure TNTServiceThread.doSaveLog(Msg : String); -var fLog: textfile; -begin - AssignFile(fLog, strHomeDrive + 'CACICsvc.log'); - if FileExists(strHomeDrive + 'CACICsvc.log') then - Append(fLog) - else - Rewrite(fLog); - Writeln(fLog,FormatDateTime('dd/mm hh:nn:ss ', Now) + '[CACICsvc] : ' +msg); - CloseFile(fLog); -End; - -function TNTServiceThread.CreateProcessSimple(sExecutableFilePath : string ) : string; -var - pi: TProcessInformation; - si: TStartupInfo; -begin - FillMemory( @si, sizeof( si ), 0 ); - si.cb := sizeof( si ); - - CreateProcess( - Nil, - PChar( sExecutableFilePath ), - Nil, Nil, False, - NORMAL_PRIORITY_CLASS, Nil, Nil, - si, pi ); - - // "after calling code" such as - // the code to wait until the - // process is done should go here - - CloseHandle( pi.hProcess ); - CloseHandle( pi.hThread ); -end; - -procedure TNTServiceThread.Execute; -begin - strHomeDrive := MidStr(HomeDrive,1,3); //x:\ - doSaveLog('strHomeDrive: '+strHomeDrive); - - strCacicDir := strHomeDrive + GetValorChaveRegIni('Cacic2', 'cacic_dir', GetAppPath + '\chksis.ini'); - doSaveLog('strCacicDir: '+strCacicDir); - - // Executo o CHKsis, verificando a estrutura do sistema - Try - CreateProcessSimple(PChar(HomeDrive + '\chksis.exe')); - Except - End; - - While not (FileExists(strCacicDir + '\cacic2.exe')) do - Sleep(5000); // Espero 5 segundos... - - // Executo o Agente Principal do CACIC - Try - doSaveLog('Executarei "'+strCacicDir + '\cacic2.exe"'); - CreateProcessSimple(PChar(strCacicDir + '\cacic2.exe')); - Except - End; - - While not Terminated do - Sleep(250); - - { - // Do NOT free on termination - The Serivce frees the Thread - FreeOnTerminate := False; - - // Set Interval - TimeOut := Interval * 4; - - // Main Loop - Try - While Not Terminated do - Begin - // Decrement timeout - Dec( TimeOut ); - - If (TimeOut=0) then - Begin - // Reset timer - TimeOut := Interval * 4; - - // Beep once per x seconds - Beep; - End; - // Wait 1/4th of a second - Sleep(250); - End; - Except - On E:Exception do ; // TODO: Exception logging... - End; - // Terminate the Thread - This signals Terminated=True - Terminate; - } -end; - -end. -- libgit2 0.21.2