@@ -43,6 +43,7 @@ procedure Register;
4343 rsCopyTrue = ' Copy successful' ;
4444 rsCopyFalse = ' Copy error' ;
4545 rsDownloadFFmpeg = ' Download the necessary ffmpeg libraries' ;
46+ rsSSL = ' Copy OpenSSL to Lazarus directory' ;
4647
4748implementation
4849uses HttpDownloader;
@@ -67,11 +68,14 @@ function RayUsed: boolean;
6768
6869procedure RayFunction (Sender: TObject);
6970var Editor: TSourceEditorInterface;
70-
71+ Pos: TPoint;
7172 procedure insertXY (Text:String);
7273 begin
7374 Editor.CutToClipboard;
7475 Editor.ReplaceText(editor.CursorTextXY,editor.CursorTextXY,Text);
76+ Pos := editor.CursorTextXY;
77+ Pos.X := Pos.x-1 ;
78+ Editor.CursorTextXY := Pos;
7579 end ;
7680
7781 begin
@@ -146,6 +150,14 @@ function GetRay4lazDir: string;
146150 if Pkg <> nil then result := ExtractFilePath(ExcludeTrailingPathDelimiter(Pkg.DirectoryExpanded));
147151end ;
148152
153+
154+ function GetLazdir : string;
155+ begin
156+ Result:=' $(LazarusDir)' ;
157+ if not IDEMacros.SubstituteMacros(Result) then
158+ raise Exception.Create(' unable to retrieve target file of project' );
159+ end ;
160+
149161procedure CopyByName (dllFile: String);
150162var Src, Dst: string;
151163begin
@@ -184,6 +196,24 @@ procedure CopyMediaToProject(Sender: Tobject);
184196 CopyByName(dllFile);
185197end ;
186198
199+ procedure CopySSl (dllFile: string);
200+ var Src, Dst : string;
201+ begin
202+ Src := GetRay4lazDir + ' package' + PathDelim + ' openssl' + PathDelim + GetOslibFolder + PathDelim + dllFile;
203+ Dst := GetLazdir + dllFile;
204+
205+ if CopyFile(Src, Dst) then
206+ IDEMessagesWindow.AddCustomMessage(mluHint, rsCopyTrue, dllFile, 0 ,0 ) else
207+ IDEMessagesWindow.AddCustomMessage(mluError, rsCopyFalse);
208+ end ;
209+
210+
211+ procedure CopySSlAll (Sender: TObject);
212+ begin
213+ CopySSl(' ssleay32.dll' );
214+ CopySSl(' libeay32.dll' );
215+ end ;
216+
187217procedure CompileRay4laz (Sender: TObject);
188218var Pkg: TIDEPackage;
189219begin
@@ -283,6 +313,7 @@ procedure Register;
283313 RegisterIDEMenuCommand(SectionTool, ' Sep2' ,' -' ,nil ,nil );
284314 RegisterIDEMenuCommand(SectionTool, ' CopyDll4' , rsCopyDll4, nil , @CopyMediaToProject,nil , ' pkg_lrs' );
285315 RegisterIDEMenuCommand(SectionTool, ' DownloadLibs' , rsDownloadFFmpeg , nil , @DownloadFFmpeg,nil , ' menu_exporthtml' );
316+ RegisterIDEMenuCommand(SectionTool, ' DownloadLibs1' , rsSSL , nil , @CopySSlAll,nil , ' pkg_lrs' );
286317
287318 RegisterIDEMenuCommand(SectionToolMenu, ' Sep3' ,' -' ,nil ,nil );
288319 RegisterIDEMenuCommand(SectionToolMenu, ' ShowCheatsheet' , rsHelpCheat , nil , @RayFunction, nil , ' ce_interface' );
@@ -321,7 +352,6 @@ procedure TEventClass.DoSomething(Sender: TObject);
321352 end else SectionTool.Visible := false;
322353end ;
323354
324-
325355initialization
326356 EventCode := TEventClass.Create;
327357finalization
0 commit comments