{*******************************************************} { } { GlobalOutAddInDefine } { } { Copyright (C) 2023 kku } { } {*******************************************************} unit GlobalOutAddInDefine; interface uses Winapi.Windows, GlobalDefine; const // 1.0 : 최초 // 1.1 : 제목, 본문 두곳에서 컨텐츠 필터 검출 옵션 추가, 새로운 패턴 적용 추가 23_1130 17:22:31 kku VER_OUTLOOK_ADDIN = '1.1'; REG_BS1OutlookAddInKey = 'TypeLib\{8B449B0A-A530-4D5B-898E-AE28EB10C48E}'; OAI_MAILSECU_POLICY = 10; OAI_MAILITEM_SEND_DATA = 11; OAI_MAILITEM_RCV_DATA = 12; DLL_ADDIN = 'Bs1out.dll'; DLL_ADDIN64 = 'Bs1out64.dll'; type POutlookAddInPo = ^TOutlookAddInPo; TMailCttSchProc = (mcspUnknown, mcspClear, mcspMask); TMailCttSchPos = (mcsoBody, mcsoSubject, mcsoBoth); TOutlookAddInPo = record bCollectRcvMail, bCollectSendMail, bBlockAttSize, bMailCttSch: Boolean; MailCttSchProc: TMailCttSchProc; MailCttSchPos: TMailCttSchPos; nHitLimit: Integer; sPatterns, sRunDir, sCttSchPtrnPath, sCollectAttachPath: String; // 첨부파일 별도 처리 AttachAB: TAttachBlockPolicy; end; procedure InstallOutlookAddin(sMdDir: String); implementation uses Tocsg.Path, System.SysUtils, Tocsg.Process, Tocsg.Shell, Tocsg.Registry; // 64환경에서만 사용하도록 작성됨, 32환경, APP에서 하려면 프로그램파일즈 설치 경로를 주의해야함 23_0504 14:41:55 kku procedure InstallOutlookAddin(sMdDir: String); var sTemp: String; begin if sMdDir = '' then sMdDir := GetRunExePathDir; if DirectoryExists(sMdDir) and not ExistsKey(HKEY_CLASSES_ROOT, REG_BS1OutlookAddInKey) then begin sTemp := GetProgramFilesDir; if DirectoryExists(sTemp) then begin if DirectoryExists(sTemp[1] + ':\Program Files\Microsoft Office') then sTemp := sMdDir + DLL_ADDIN64 else if DirectoryExists(sTemp[1] + ':\Program Files (x86)\Microsoft Office') then sTemp := sMdDir + DLL_ADDIN else sTemp := ''; if FileExists(sTemp) and (GetProcessPidByName('outlook.exe') = 0) then ExecutePath_hide('regsvr32.exe', Format('/i /s "%s"', [sTemp])); end; end; end; end.