I write you for an little problem.
i use this bottom code and when i call SerialPageShow function , my .exe crash ! why ? please help me
#Include
!include LogicLib.nsh
!include "XPUI.nsh"
!include "Sections.nsh"
!include "WinMessages.nsh"
;-----------------------------------------
; General XPUI Settings
XPStyle off
#Splash screen bmp
!define IMG_NAME INST_Mobilegov_SERVER_.bmp
#Skin
!define XPUI_WANSIS_SKIN Bliss
!define XPUI_WANSIS_HEADERIMAGE
#Color Text (white)
!define XPUI_TEXT_COLOR FFFFFF
!define XPUI_TEXT_LIGHTCOLOR FFFFFF
#Color Licence text and BG
!define XPUI_LICENSEBKCOLOR "ffffff"
!define XPUI_BRANDINGTEXT_COLOR_FG "000000"
#define radio button use for license agreement
!define XPUI_LICENSEPAGE_RADIOBUTTONS
!define XPUI_ABORTWARNING
!define XPUI_DISABLEBG
!define UI "XPUI"
;-----------------------------------------
; Installer Page(s)
#page welcome 1
!insertmacro XPUI_PAGE_WELCOME
#license page
LicenseLangString myLicenseData 1033 "license_English.txt"
LicenseLangString myLicenseData 1036 "license_French.txt"
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ComponentsShow
!insertmacro XPUI_PAGE_LICENSE "$(myLicenseData)"
Page custom SerialPageShow SerialPageLeave
# install compoment page
!insertmacro XPUI_PAGE_COMPONENTS
#Directory installation
!insertmacro XPUI_PAGE_DIRECTORY
#Confirm install
!insertmacro XPUI_PAGE_INSTCONFIRM
#install files
!insertmacro XPUI_PAGE_INSTFILES
!insertmacro XPUI_PAGE_FINISH
!insertmacro XPUI_PAGE_ABORT
## Displays the serial dialog
Function SerialPageShow
!insertmacro MUI_HEADER_TEXT "Enter Serial Code" "Enter the software serial code to continue."
PassDialog::Dialog Serial \
/HEADINGTEXT 'Please enter the serial code located on the software CD case...' \
/CENTER \
/BOXDASH 12 70 4 '' \
/BOXDASH 92 70 4 '' \
/BOXDASH 172 70 4 '' \
/BOXDASH 252 70 4 '' \
/BOX 332 70 4 ''
Pop $R0 # success, back, cancel or error
FunctionEnd
Function SerialPageLeave
## Pop values from stack
Pop $R0
Pop $R1
Pop $R2
Pop $R3
Pop $R4
## A bit of validation
StrCpy '$5' '$R0-$R1-$R2-$R3-$R4$\r$\n'
StrCpy $6 0
Loop:
IntOp $6 $6 + 1
StrCmp $6 500 Bad ;1 more than the # serials in file
Push $6 ;line number to read from
File /oname=$PLUGINSDIR\serial.txt "Numbers.txt"
Push "$PLUGINSDIR\serial.txt" ;text file to read
Call ReadFileLine
Pop $0 ;output string (read from file.txt)
StrCmp $0 $5 Good
Goto Loop
Bad:
MessageBox MB_OK|MB_ICONEXCLAMATION "The entered username or password is incorrect!"
Delete "$PLUGINSDIR\serial.txt"
Abort
Good:
Delete "$PLUGINSDIR\serial.txt"
FunctionEnd
Function ReadFileLine
Exch $0 ;file
Exch
Exch $1 ;line number
Push $2
Push $3
FileOpen $2 $0 r
StrCpy $3 0
Loop:
IntOp $3 $3 + 1
ClearErrors
FileRead $2 $0
IfErrors +2
StrCmp $3 $1 0 loop
FileClose $2
Pop $3
Pop $2
Pop $1
Exch $0
FunctionEnd thx