Old 11th September 2014, 10:56   #1
Saadoune
Junior Member
 
Join Date: Sep 2014
Posts: 4
Nsis Modify the direcyory page

Hello,
I want to modify the default page directory to add a message box if the space required is insufficient.
I want to have a message box, or a specific message in the interface, even if the Next button is grayed.

Thks
Saadoune is offline   Reply With Quote
Old 11th September 2014, 12:19   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
When should this message appear?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 11th September 2014, 13:17   #3
Saadoune
Junior Member
 
Join Date: Sep 2014
Posts: 4
When the page appear if the default path is insufficient or after selecting the new path.
(When a path is insufficient I have the next button grayed)
Saadoune is offline   Reply With Quote
Old 11th September 2014, 13:28   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
There is .onVerifyInstDir but it is usually not recommended to put a MessageBox there...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 11th September 2014, 13:40   #5
Saadoune
Junior Member
 
Join Date: Sep 2014
Posts: 4
Yes I tried .onVerifyInstDir but it's not what I want.
When the space is not enought automaticly the Next button is grayed, can I add text inside the Directory page to tell the user that the space is not enought or color the text "Rquired space" in red ?
Thks
Saadoune is offline   Reply With Quote
Old 11th September 2014, 13:45   #6
Saadoune
Junior Member
 
Join Date: Sep 2014
Posts: 4
here is a printscreen of my interface
Saadoune is offline   Reply With Quote
Old 11th September 2014, 17:25   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
.onVerifyInstdir is not called for all invalid paths, this is the best you can do:

Quote:
!include WinMessages.nsh
InstallDir c:\foo

!include nsDialogs.nsh
!include LogicLib.nsh

Page Directory "" MyDirShow
Page InstFiles

Function MyDirShow
FindWindow $0 "#32770" "" $HWNDPARENT
System::Call 'user32::CreateWindowEx(i${__NSD_Label_EXSTYLE},t"STATIC",t"Hello world!?",i${__NSD_Label_STYLE},i20,i150,i300,i20,i$0,i0,i0,i0)i.r1'
SendMessage $0 ${WM_GETFONT} 0 0 $2
SendMessage $1 ${WM_SETFONT} $2 1
FunctionEnd

Function .onVerifyInstdir
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 0x400
System::Call kernel32::GetTickCount()i.r2
IntOp $2 $2 & 1 ; "Random", replace with code that checks if it is valid or not
${If} $2 <> 0
SetCtlColors $0 0xff0000 transparent
${Else}
SetCtlColors $0 0x000000 transparent
${EndIf}
ShowWindow $0 0 ; Redraw hack
ShowWindow $0 1
FunctionEnd

IntOp $PostCount $PostCount + 1
Anders 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