-
Notifications
You must be signed in to change notification settings - Fork 46
NSIS
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.
The installer for the plugin includes 30+ skins (VCL Styles) and a set of samples NSIS scripts. To install just follow the installer instructions.
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
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
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
These images show a installer using some label with custom colors
If you apply a style the custom colors are not used
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
Looking for the installer? Check the Release Area
The current version of the plugin is 1.0.5.2 release Date 20160713