Showing FMX or VCL Form Created with Delphi in Inno Setup through DLL?

  

I am trying to show a FMX form in Inno Setup using an dll. i created a DLL and added the form to the DLL.dll.
here is the code from the dll:

library DLL;

uses
System.SysUtils,
System.Classes,
Winapi.Windows, Winapi.Messages, System.Variants,
DLLForm in ‘DLLForm.pas’ {Form2};

{$R *.res}
procedure ShowForm; stdcall;
begin
Form2:=TForm2.Create(nil);
Form2.ShowModal;
Form2.Free; //Added this line.
end;

Exports ShowForm;
end.

and here it is the code for inno:

[Setup]
AppName=Windows
AppPublisher=Stack
AppVersion=1.0.0.0
DefaultDirName={pf}\FMXForm

[Files]
Source: Include\DLL.dll; DestDir: {tmp} Flags: dontcopy;

[code]
procedure Show;
external ‘ShowForm@Files:DLL.dll stdcall delayload’;

procedure InitializeWizard();
begin
Show;
end;

Setup Compiles but did not showing the form and exits without showing any errors.

It is working fine with cmd,vcl apps but with inno it is not.
I used following code to show the form from dll in cmd,vcl apps :

procedure ShowForm; stdcall; external ‘DLL.dll’;

procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.Free;
ShowForm;
end;

Comments are closed.