CustomLicense plug-in

From NSIS Wiki

Author: JasonFriday13 (talk, contrib)


Links

The CustomLicense plug-in has been superseded by the nsRichEdit plug-in:

NsRichEdit.zip (28 KB) Forum thread


The original plug-in can still be downloaded from:

CustomLicense.zip (8 KB) Forum thread

Description

This plugin was born out of necessity. It was purely for the license page in the InstallSpiderUI (also written by me). Now I have released it as a plugin to the public. It loads a file into memory, then it sets the desired control with the same text. Supposed to be used with InstallOptions, but can be used for anything requiring a lot of text.

Sample Usage

;--------------------------------
;Include Modern UI
 
  !include "MUI.nsh"
 
;--------------------------------
;General
 
  ;Name and file
  Name "BigLicense-Test"
  OutFile "biglictest.exe"
 
  ; define name of the Licensepage
  !define LICENSEPAGE "license.txt"
 
ReserveFile "${NSISDIR}\${LICENSEPAGE}"
 
Function CustomLicensePagePre
  InitPluginsDir
 
  File /oname=$PLUGINSDIR\${LICENSEPAGE} "${LICENSEPAGE}"
 
  FindWindow $0 "#32770" "" $HWNDPARENT
  GetDlgItem $0 $0 1000
 
  CustomLicense::LoadFile "$PLUGINSDIR\${LICENSEPAGE}" $0
 
FunctionEnd
 
;--------------------------------
;Pages
 
  !define MUI_PAGE_CUSTOMFUNCTION_SHOW "CustomLicensePagePre"
  !insertmacro MUI_PAGE_LICENSE "dummy.txt"
 
  !insertmacro MUI_PAGE_INSTFILES
 
Section
 
  ;section ...
 
SectionEnd
 
;--------------------------------
;Languages
 
  !insertmacro MUI_LANGUAGE "English"
Personal tools
donate
ads