Skip to content
Rodrigo Ruz edited this page Oct 30, 2015 · 6 revisions

Introduction

https://theroadtodelphi.files.wordpress.com/2014/07/output_a6nofn.gif

The NSISVCLStyles plugin (dll) allow you skin the installers created by NSIS (2.46 and 3.0). The size of the plugin is about 1.6 mb, but when is included (and compressed) in the script only add ~550 Kb to the final installer.

Installation

The installer for the plugin includes 30+ skins (VCL Styles) and a set of samples NSIS scripts. To install just follow the installer instructions.

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

https://theroadtodelphi.files.wordpress.com/2014/07/23.png

How apply a style to the installer

To use the plugin in a NSIS script you must call the LoadVCLStyle function, passing the skin name in the .onInit function.

Function .onInit
  InitPluginsDir
  ;Get the skin file to use
  File /oname=$PLUGINSDIR\Amakrits.vsf "..\Styles\Amakrits.vsf"
  ;Load the skin using the LoadVCLStyle function 
  NSISVCLStyles::LoadVCLStyle $PLUGINSDIR\Amakrits.vsf
FunctionEnd

How apply a style to the Uninstaller

To use the plugin in a NSIS Uninstaller you must call the LoadVCLStyle function, passing the skin name in the un.onInit function.

Function un.onInit
  InitPluginsDir
  File /oname=$PLUGINSDIR\Amakrits.vsf "..\Styles\Amakrits.vsf"
  ;Load the skin using the LoadVCLStyle function 
  NSISVCLStyles::LoadVCLStyle $PLUGINSDIR\Amakrits.vsf
FunctionEnd

How disable the style in the Non Client Area

To disable the style in the nonclient area of the main Window of the wizard you must use the RemoveStyleNCArea function.

Function .onInit
  InitPluginsDir
  ;Get the skin file to use
  File /oname=$PLUGINSDIR\Amakrits.vsf "..\Styles\Amakrits.vsf"
  ;Load the skin using the LoadVCLStyle function 
  NSISVCLStyles::LoadVCLStyle $PLUGINSDIR\Amakrits.vsf
  ;Disable the style in the non client area
  NSISVCLStyles::RemoveStyleNCArea
FunctionEnd

https://theroadtodelphi.files.wordpress.com/2014/07/2014_02_05_20_39_27_nsdialogs_welcome_setup.png

https://theroadtodelphi.files.wordpress.com/2014/07/2014_02_05_17_17_06_nsdialogs_welcome_setup.png

How disable the style in a control

These images show a installer using some label with custom colors

https://theroadtodelphi.files.wordpress.com/2014/07/2014_02_05_18_21_50_nsdialogs_welcome_setup.png

https://theroadtodelphi.files.wordpress.com/2014/07/2014_02_05_20_43_01_nsdialogs_welcome_setup.png

If you apply a style the custom colors are not used

https://theroadtodelphi.files.wordpress.com/2014/07/2014-02-05-20_43_49-nsdialogs-welcome-setup.png

https://theroadtodelphi.files.wordpress.com/2014/07/2014-02-05-20_44_19-nsdialogs-welcome-setup.png

The plugin allow disable the style in any control, only passing the handle to the RemoveStyleControl function.

Try this sample

	nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 10u -130u 20u "Welcome to nsDialogs!"
	Pop $HEADLINE
        ;Remove the style from the control    
	NSISVCLStyles::RemoveStyleControl $HEADLINE

	nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 32u -130u -32u "nsDialogs is the next generation of user interfaces in NSIS. It gives the developer full control over custom pages. Some of the features include control text containing variables, callbacks directly into script functions and creation of any type of control. Create boring old edit boxes or load some external library and create custom controls with no need of creating your own plug-in.$\r$\n$\r$\nUnlike InstallOptions, nsDialogs doesn't use INI files to communicate with the script. By interacting directly with the script, nsDialogs can perform much faster without the need of costly, old and inefficient INI operations. Direct interaction also allows direct calls to functions defined in the script and removes the need of conversion functions like Io2Nsis.$\r$\n$\r$\nHit the Next button to see how it all fits into a mock directory page."
	Pop $TEXT
        ;Remove the style from the control    
	NSISVCLStyles::RemoveStyleControl $TEXT

https://theroadtodelphi.files.wordpress.com/2014/07/2014-02-05-20_45_41-nsdialogs-welcome-setup.png

https://theroadtodelphi.files.wordpress.com/2014/07/2014-02-05-20_45_56-nsdialogs-welcome-setup.png

Downloads

The current version of the plugin is 1.0.4.5 release Date 20151030

Clone this wiki locally