Sorry for the delay, but I was not able to follow the speech as the installer.
So I did some tests, but I do not work. The code that I wrote to embed an executable file within an executable file does not work. Who knows why? Thanks for your help.
Errore: The name of the executable file that must contain the other executable not found
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
procedure SaveResourceAsFile(const ResName: string; ResType: pchar; const FileName: string);
begin
with TResourceStream.Create(hInstance, ResName, ResType) do
try
SaveToFile(FileName);
finally
Free;
end;
end;
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var
val: string;
begin
val:=Edit1.Text;
val:= ExtractFilePath (Application.ExeName) + val;
SaveResourceAsFile(Application.ExeName,'exe', val);
end;
end.
initialization
{$I program.lrs}