The Road to Delphi

Delphi – Free Pascal – Oxygene

VCL Styles for Inno Setup

49 Comments

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.

output_qkRcra

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 and installer is available on Github.

As always all your comments and feedback is welcome.

Author: Rodrigo

Just another Delphi guy.

49 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

  14. @Rodrigo

    I have inno setup script
    but I have problem for apply VCL :(

    help bor :)

  15. work fine in new script

    but I have a problem in my old script m any help bro?

  16. @Rodrigo

    how to skin in unstall? code please

  17. I don’t know this mean
    “Import the function LoadVCLStyleW for Unicode versions of Inno setup or the LoadVCLStyleA method for the Ansi version”
    success compile, but the skin does not change
    how to solve this?

  18. Missing dependency files for included binaries inside SetupVCLStylesInno.exe v1.5.1.0

    SHA-1 fd3e6a4452e28fbacf0e01d9d7e76091efa8fa5e

    BitmapStyleDesigner.exe v17.0.4625.53395

    SHA-1: 8625ad680d701b7f49d6afabbbcfae74a9435814

    designide170.bpl
    rtl170.bpl
    vcl170.bpl
    vclactnband170.bpl
    vclimg170.bpl
    vclx170.bpl
    xmlrtl170.bpl

    VclStyleViewer.exe v17.0.4625.53395

    SHA-1: 7937f70eed12ca70b23cc7cd778e40f68c71ab04

    rtl170.bpl
    vcl170.bpl
    vclactnband170.bpl
    vclx170.bpl

    just add if allowed the missing bpls aside binaries in updated installer and please create a noinstall zip version
    it is pretty annoying to unpack installer again and again manually when updated……

    TDWP

  19. Ok the installer SetupVCLStylesInno.exe has a style, when I create using the sample I dont see any style change. Currently using Windows 7 Pro SP 1, Inno Setup 5.5.6. Ideas?

  20. Really, we must download 3 GB of Delphi installation to compile the dll? I remember that time ago the installer was downloadable in this site, why you just don’t publish a release in your Github with the project COMPILED for those like me who don’t want to spent time (and residous) by intalling and unindtalling delphi IDE just to compile the project?.

    Thankyou anyways

  21. Hi Rodrigo,

    When I use the darker styles with InnoSetup the text is virtually unreadable. The font colour appears to be black when it should be white.

    Inno Script Studio 5.5.9 (u)
    VCL Styles Inno 1.5.4.1

    Here are two examples of the problem:

    Thanks,

    Steve

  22. Hey Rodrigo! thanks for your work! I tried using your dll in my project, but none of the skins are loaded. Even I tried compiling your samples and none of the skins are shown there either. I’m using Inno Setup 5.5.9 and Windows 10 64bit build 1703. What can I try?

  23. thank you very much, nice coder;

Leave a comment