shazia.parveen
30th January 2010 07:51 UTC
icon change
Hi ,
!define MUI_ABORTWARNING
On writing this code in the NSIS scripting , the action of this code line when you will click the Cancel button of the setup is that it will ask you weather you want to perform this action 'Yes' or 'No' , my question is that i want to change the icon i have shown in the attached file for your help, how to do that..Help me
MSG
30th January 2010 09:53 UTC
You can probably change the MessageBox command somewhere in the MUI/MUI2 header files. Check your NSIS\contrib\Modern UI(2) folder.
(Or even better, copy how MUI/MUI2 do it into your own installer, and don't define the MUI_ABORTWARNING.)
shazia.parveen
30th January 2010 10:10 UTC
I am pasting the full code below please see that
Name "Serial"
OutFile "Serial.exe"
## Include headers
!include MUI.nsh
!include LogicLib.nsh
!define MUI_ABORTWARNING
## Pages
ShowInstDetails show
ShowUnInstDetails show
!insertmacro MUI_PAGE_WELCOME
Page custom SerialPageShow SerialPageLeave
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
## Languages
!insertmacro MUI_LANGUAGE English
## 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
## Validate serial numbers
Function SerialPageLeave
## Pop values from stack
Pop $R0
Pop $R1
Pop $R2
Pop $R3
Pop $R4
Banner::show "Please wait ...Your Serial Number is Validating..."
## A bit of validation
;StrCpy '$5' '$R0-$R1-$R2-$R3-$R4'
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=$PLUGINSDIRserial.txt "Numbers.txt"
Push "$PLUGINSDIRserial.txt" ;text file to read
Call ReadFileLine
Pop $0 ;output string (read from file.txt)
StrCmp $0 $5 Good
Goto Loop
Bad:
Banner::destroy
MessageBox MB_OK|MB_ICONEXCLAMATION "The entered username or password is incorrect!"
Delete "$PLUGINSDIRserial.txt"
Abort
Good:
Banner::destroy
Delete "$PLUGINSDIRserial.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
## Just a dummy section
Section 'A section'
SectionEnd
MSG
30th January 2010 10:52 UTC
shazia.parveen, I just gave you the solution to your problem. But I'm not going to rewrite your installer script for you. You're going to have to do a *little* bit of work by yourself.
shazia.parveen
1st February 2010 10:56 UTC
Hey MSG,
i got what you want to say and i got the solution..thanks for replying