2

I'm using Inno Setup (Unicode) with a set of DLL's that I'm writing in Delphi XE2. The DLL's have VCL forms which are shown during the installation wizard/progress.

I've tried out implementing VCL Styles in my Inno Setup installer. All is well, except for the forms which are created within these DLL's. Some of the form is skinned, but not all of it...

Partial Skin

As you can see, the form's background color, the list view background color, and the font color have changed. However, the list view headers, the progress bars, and the form's border are still the old style.

How can I make the forms in these DLL's show proper styles?

Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
  • I'm actually guessing that I have to load this style file into each DLL by passing the style filename into it, using for example an exported procedure like `ApplyVclStyle(const Filename: WideString);` – Jerry Dodge Feb 16 '14 at 01:27
  • The plugin only can skin the forms and controls created by inno setup. For the forms of your dll you must load the VCL Style your self as you said in your comment. – RRUZ Feb 16 '14 at 14:16

1 Answers1

4

The VCL Styles plugin for Inno Setup is only designed to draw styles on the forms and controls in Inno Setup. In order to get the forms in these DLL's to be skinned, you need to export a function from the DLL that Inno Setup can pass in the filename...

Inno Setup

[Code]
#define public VclStyleFile "Carbon (2).vsf"

procedure DllLoadStyle(const StyleFilename: WideString);
  external 'DllLoadStyle@MyDLL.dll stdcall';

function InitializeSetup: Boolean;
begin
  ExtractTemporaryFile('{#VclStyleFile}');
  LoadVCLStyleW(ExpandConstant('{tmp}\{#VclStyleFile}'));
  DllInit; //Presumed your DLL needs to initialize / instantiate the form
  DllLoadStyle(ExpandConstant('{tmp}\{#VclStyleFile}'));
  ...
end;

Delphi DLL

uses
  Vcl.Themes,

procedure DllLoadStyle(const StyleFilename: WideString); stdcall;
begin
  TStyleManager.SetStyle(TStyleManager.LoadFromFile(StyleFilename))
end;

exports
  DllLoadStyle;
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
  • OT: you don't need to expand your preprocessor variables unless they contain in their values some of the Inno Setup constants (whose you need to expand). The preprocessor simply emits the values of your variables to the script. So the `ExpandConstant` function in your `ExtractTemporaryFile` function call does exactly nothing at all. – TLama Feb 16 '14 at 21:22