Skip to content
⌘ NSIS Forum Archive

determine license file on runtime?

14 posts

Yathosho#

determine license file on runtime?

is there a way to determine the text-file on runtime? i thought i could include a dummy-text which gets overwritten by a file the installer reads in the onGUIInit function, but i didn't manage to do so. where to does the license get extracted to? is it possible?
Yathosho#
i guess i just have to change this line

FindWindow $0 "#32770" "" $HWNDPARENT

what was that handy little tool that gives me handles (?) of windows?
JasonFriday13#
Try my CustomLicense plug-in. It is virtually a plugin version of the 'External License file' wiki page you found.
JasonFriday13#
You could use
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 1000
CustomLicense::LoadFile "$PLUGINSDIR\yourlicensefile.txt" $0
in the show function of the license page (if it works). The CustomLicense plugin is identical to the external license file wiki example, but in plugin form (thus removing the need for the system plugin).
Yathosho#
so i'm using this code snippet now..

Page License "" PreLicense

Function PreLicense
ReadINIStr $1 "$PLUGINSDIR\pimp.ini" "Installer" "LicenseType"
IfFileExists "$PLUGINSDIR\license.$1" 0 +2
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 1000
CustomLicense::LoadFile "$PLUGINSDIR\license.$1" $0
FunctionEnd
problem is that it doesn't display the whole license. any ideas?
Yathosho#
alright, i found the problem: the it only displays as many characters as my dummy license. could you fix your plugin?
Takhir#
External License Script

Attached is script for 'basic' GUI.