The Road to Delphi – a Blog about programming

Delphi – Free Pascal – Oxygene

VCL Styles for Inno Setup

28 Comments

Important Update

The new location of this project is https://code.google.com/p/vcl-styles-plugins/

Introduction

As part of the VCL Styles Utils project, I made a plugin (dll) to skin the installers created by Inno setup. The current size of the plugin is about 1.6 mb, but when is included (and compressed) in the script only add ~490 Kb to the final installer.

Installation

The installer for the plugin includes 30+ VCL Styles, a set of wizard images and samples inno scripts. To install just follow the installer instructions.

149

2

3

4

5

Screenshots

1

2

3

4

5

6

7

How to use it

In order to use the plugin you must follow these steps

  1. Add the VclStylesinno.dll file to your inno setup script and the VCL Style file to use.
  2. Import the function LoadVCLStyleW for Unicode versions of Inno setup or the LoadVCLStyleA method for the Ansi version
  3. Import the function UnLoadVCLStyles
  4. In the InitializeSetup function extract the style to use and call the LoadVCLStyle method passing the name of the style file
  5. Finally in the DeinitializeSetup function call the UnLoadVCLStyles method.

Check the next sample script

[Files]
Source: ..\VclStylesinno.dll; DestDir: {app}; Flags: dontcopy
Source: ..\Styles\Amakrits.vsf; DestDir: {app}; Flags: dontcopy

[Code]
// Import the LoadVCLStyle function from VclStylesInno.DLL
procedure LoadVCLStyle(VClStyleFile: String); external 'LoadVCLStyleW@files:VclStylesInno.dll stdcall';
// Import the UnLoadVCLStyles function from VclStylesInno.DLL
procedure UnLoadVCLStyles; external 'UnLoadVCLStyles@files:VclStylesInno.dll stdcall';

function InitializeSetup(): Boolean;
begin
  ExtractTemporaryFile('Amakrits.vsf');
  LoadVCLStyle(ExpandConstant('{tmp}\Amakrits.vsf'));
  Result := True;
end;

procedure DeinitializeSetup();
begin
  UnLoadVCLStyles;
end;

TODO

  • Add support for TFolderTreeView and TStartMenuFolderTreeView components
  • Add support for themed controls in the TNewCheckBoxList component
  • Add support for the npbstMarquee style in the TNewProgressBar component

Source code and Installer

The source code is available in the Google code site of the project. You can download the installer from here

As always all your comments and feedback is welcome.

About these ads

Author: Rodrigo

Just another Delphi guy.

28 thoughts on “VCL Styles for Inno Setup

  1. Beautiful! I did not see in your article what minimum version of Delphi is required. (But I did see on the project home page.)

  2. Absolutely brilliant. Many thanks …

  3. Well done! Thanks alot!

  4. Do you sleep sometimes

  5. Pingback: VCL Styles for Inno Setup | Delphi Programming ...

  6. Nice! What is the minimum version number of Inno Setup required?

  7. Very nice addition to InnoSetup. Did find one small bug. Please feel free to email me for additional details. To replicate, just run the VCLStylesDemo project and cancel. The text in the Exit Setup dialog does not word wrap. You only see “Setup is not complete. If you exit now, the program will not be installed. You ma”.

  8. there is a serious access violation crash when rightclick the installer setup titlebar :)

  9. i have downloaded “SetupVCLStylesInno.exe” from your dropbox, started it, welcome page appeared

    went to the titlebar “Setup – VCL Styles for Innosetup” and did a right mouse button click on it and it crashes

  10. Hi there , i am having an issue with the code :( .. it compiles well , but when i try to run the installer it appears this error(image link)

  11. Thanks for sharing.

    But there’s one more thing. If you build multi-languages setup, the themes cannot apply on the first selection language.

  12. It’s a wonderfull idea to customize setup but I have an exception in InitializeSetup() function on LoadVCLStyle() line… With the message “External Exception EEDFADE… Could you help me ?

  13. how do i make the about button go black, done everything but still no luck, any help bro

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 708 other followers