Inno Setup

Rodrigo Ruz edited this page Aug 18, 2017 · 9 revisions

Mix

Introduction

VCL Styles for Inno Setup is a Free and Open Source plugin (dll) that allows you to add skins to the installers created by Inno setup.

Features

The plugin supports all the Inno controls

  • TNewEdit
  • TPasswordEdit
  • TNewMemo
  • TNewComboBox
  • TNewListBox
  • TNewButton
  • TNewCheckBox
  • TNewRadioButton
  • TSelectFolderForm
  • TFolderTreeView
  • TStartMenuFolderTreeView
  • TRichEditViewer
  • TNewStaticText
  • TNewNotebook
  • TNewNotebookPage

Support for ANSI and Unicode versions of Inno setup.

Support for menus.

Support for shell dialogs (open/save file, select folder).

Includes 30+ VCL Styles (skins), a set of wizard images and samples inno scripts.

https://theroadtodelphi.files.wordpress.com/2014/12/output_1n5chq.gif

The current size of the plugin is about 1.6 mb, but when is included (and compressed) in the script only add ~500 Kb to the final installer.

Screenshots

https://theroadtodelphi.files.wordpress.com/2014/12/2014-12-06-05_39_10-setup-my-program.png

https://theroadtodelphi.files.wordpress.com/2014/12/2014-12-06-05_30_10-greenshot.png

https://theroadtodelphi.files.wordpress.com/2014/12/2014-12-06-05_23_45-setup-my-program.png

https://theroadtodelphi.files.wordpress.com/2014/12/2014-12-06-05_20_50-browse-for-folder.png

https://theroadtodelphi.files.wordpress.com/2014/12/opendialog.png

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 (skin) 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.

Note : To avoid a delay in the startup of the setup list the VclStylesinno.dll and the skin file at the top of the Files section.

This is documented in the Inno Setup Help.

...If you use a 'files:' prefix and solid compression is enabled, be sure to list your DLLs at (or near) the top of the Files section. In order to extract an arbitrary file in a solid-compressed installation, Setup must first decompress all prior files (to a temporary buffer in memory). This can result in a substantial delay if a number of other files are listed above the specified file in the Files section.

Installer 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;

Uninstaller sample script

#define VCLStylesSkinPath "{localappdata}\VCLStylesSkin"
[Files]
Source: ..\VclStylesinno.dll; DestDir: {#VCLStylesSkinPath}; Flags: uninsneveruninstall
Source: ..\Styles\Amakrits.vsf; DestDir: {#VCLStylesSkinPath}; Flags: uninsneveruninstall


[Code]
// Import the LoadVCLStyle function from VclStylesInno.DLL
procedure LoadVCLStyle(VClStyleFile: String); external 'LoadVCLStyleW@files:VclStylesInno.dll stdcall setuponly';
procedure LoadVCLStyle_UnInstall(VClStyleFile: String); external 'LoadVCLStyleW@{#VCLStylesSkinPath}\VclStylesInno.dll stdcall uninstallonly';
// Import the UnLoadVCLStyles function from VclStylesInno.DLL
procedure UnLoadVCLStyles; external 'UnLoadVCLStyles@files:VclStylesInno.dll stdcall setuponly';
procedure UnLoadVCLStyles_UnInstall; external 'UnLoadVCLStyles@{#VCLStylesSkinPath}\VclStylesInno.dll stdcall uninstallonly';

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

procedure DeinitializeSetup();
begin
	UnLoadVCLStyles;
end;

function InitializeUninstall: Boolean;
begin
  Result := True;
  LoadVCLStyle_UnInstall(ExpandConstant('{#VCLStylesSkinPath}\Amakrits.vsf'));
end;

procedure DeinitializeUninstall();
begin
  UnLoadVCLStyles_UnInstall;
end;

Looking for the installer? Check the Release Area

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.