Welcome,
I want attach updater application inside my exe file.
Using lazres i had created file called program.lrs.
Next i add that procedure.
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;
Next step was, on bottom Unit1.pas add
initialization
{$I program.lrs}
Next (for example) in on create form event add
procedure TForm1.FormCreate(Sender: TObject);
begin
SaveResourceAsFile('myexe','EXE','c:\test.exe');
end;
And that's header of program.lrs
LazarusResources.Add('myexe','EXE',[
Application compile but after load... i got error "myexe" resource not found...