CustomLicense plug-in: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
No edit summary
 
(Added Sample Usage)
Line 16: Line 16:
Supposed to be used with InstallOptions, but can be used for
Supposed to be used with InstallOptions, but can be used for
anything requiring a lot of text.
anything requiring a lot of text.
== Sample Usage ==
<highlight-nsis>
;--------------------------------
;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"
</highlight-nsis>


[[Category:Plugins]]
[[Category:Plugins]]

Revision as of 09:43, 7 November 2006

Author: JasonFriday13 (talk, contrib)


Links

Plugin package:
CustomLicense.zip (8 KB)

Forum thread

Description

This plugin was born out of necessity. It was purly 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"