Old 16th December 2008, 20:01   #1
mstone42
Junior Member
 
Join Date: Dec 2008
Posts: 3
Displaying files

In my first foray into NSIS (and installers in general) I have almost finished my very first installer, but the last step is causing me some serious headaches. I would like to read in a file (e.g. Release Notes or Change Log) and display that as the last page of the installer. It's working (sorta), but the file is over 2K in size. Registers only hold 1K, so I'm filling registers as the file is read, but the control element on the screen also only holds 1K. I thought about using the License page, but it has that "I Agree" button on it. Any (better/alternate) ideas?

Thanks!
Mitch


Here's the code so far:
code:

; ---------------------------
; header stuff here...
; ---------------------------

Page instfiles
Page custom PageReleaseNotes "" ""

; ------------------------------------------------------------------
; Reads in the Release Notes and displays at end of installtion

Var Dialog
Function PageReleaseNotes
nsDialogs::Create /NOUNLOAD 1018
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}

StrCpy $R1 ""
StrCpy $R2 ""

ClearErrors
StrCpy $R0 "Release Notes$\r$\n"

StrCpy $9 0
FileOpen $1 "$INSTDIR\icw\release_notes.txt" r
IfErrors ReadErr

ReadLoop:
FileRead $1 $2
IfErrors LoopErr

StrLen $5 $R0
${If} $5 >= 1000 ;; we're about to exceed register capacity
StrLen $5 $R1
${If} $5 > 0
StrCpy $R2 $R0
${Else}
StrCpy $R1 $R0
${EndIf}
StrCpy $R0 ""
${EndIf}
StrCpy $4 $R0
StrCpy $R0 "$4 $\r$\n $2"
IntOp $9 $9 + 1

GoTo ReadLoop

LoopErr:
StrCpy $4 $R0 ; make sure we grab that last line read in
StrCpy $R0 "$4 $\r$\n $2"

FileClose $1
ReadErr:

nsDialogs::CreateControl /NOUNLOAD ${__NSD_Text_CLASS} \
${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_MULTILINE}|${WS_VSCROLL} \
${__NSD_Text_EXSTYLE} 0 0 100% 100% "$R1 $R2 $R3"
Pop $0

; Display the dialog
nsDialogs::Show
FunctionEnd

mstone42 is offline   Reply With Quote
Old 17th December 2008, 17:27   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You could use this:
http://nsis.sourceforge.net/CustomLicense_plug-in

Stu
Afrow UK is offline   Reply With Quote
Old 18th December 2008, 07:14   #3
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Also you may want to try this script...

http://nsis.sourceforge.net/Readme_P...I_License_Page

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 26th December 2008, 17:31   #4
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
Thanks for suggesting my plugin. Here is the other "half": http://nsis.sourceforge.net/External_License_file

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump