Skip to content
⌘ NSIS Forum Archive

Nsis Modify the direcyory page

7 posts

Saadoune#

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#
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#
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
Anders#
.onVerifyInstdir is not called for all invalid paths, this is the best you can do:

!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