Old 23rd March 2011, 16:16   #1
HandShake
Junior Member
 
Join Date: Oct 2007
Posts: 5
Custom License Page - big license file

Hello,

I am new in NSIS.

I have to add a "Save License File" button on (a custom) license page.

My problem is that if the license.txt is bigger than 1024 B, the file is displayed trimmed.

PHP Code:
        FileOpen $"$INSTDIR/License.txt" 
         StrCpy $file 
"" initialize
         
loop
              
FileRead $$
              IfErrors done 
              StrCpy $file 
"$file$2" 
              
Goto loop 
         done

              
FileClose $
    
!insertmacro CHANGETEXTFIELD "${DIALOG1}" "${CMD_FIELD_2}$file 
PHP Code:
  !macro CHANGETEXTFIELD FILE ELEMENT VALUE
  Push $R0 
holds value
  
!insertmacro MUI_INSTALLOPTIONS_WRITE ${VALUE"${FILE}" "${ELEMENT}" "State"
  
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "${FILE}" "${ELEMENT}" "HWND"
  
SendMessage $R0 ${WM_SETTEXT"STR:${VALUE}"
  
Pop $R0
  
!macroend 
I've tried to add a custom button on the a default License page. But if I add a custom button over the existing controls, the "old" controls disappears.

PHP Code:
!define MUI_PAGE_CUSTOMFUNCTION_PRE lic_pre
!insertmacro MUI_PAGE_LICENSE "License.txt" 
PHP Code:
Function lic_pre
  
!insertmacro MUI_HEADER_TEXT "Title" "Subtitle"  
   
nsDialogs::Create 1018 
         
${NSD_CreateCheckbox6090506"Show button below"
        
Pop $hwnd
        
${NSD_OnClick$hwnd EnDisableButton
    
${NSD_CreateButton25255050"Hello World"
        
Pop $button
        ShowWindow $button 
${SW_HIDE# start out hidden
   
nsDialogs::Show 
FunctionEnd 
Can you please give me a hint ...?
I must Add a new button...
10x.
Attached Files
File Type: zip ___Test.zip (2.8 KB, 118 views)
HandShake is offline   Reply With Quote
Old 24th March 2011, 08:05   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
Search the forum for EM_STREAMIN or something like that and you should find a thread about reading large license files

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
custom;license;big;file

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