Archive: HELP! Next a most complex control


HELP! Next a most complex control
Hello,

I am not sure, weather this is possible,
Please see the attached file for custom page.

I need to check the space availability on the user's PC and want to show the custom page.


Assume that you know how to deal with InstallOptions to create custom pages, for this you'd need to implement at least E.1.4 DriveSpace and E.1.5 GetDrives.


Hi Red Wine,
I know how to create the custom pages but do not know which control needs to be used with InstallOptions to get the functionality.
The control you see in the attached image in first post, is just a Photoshop imagination, I am open to any other control(s) too, but need to show drive space availability to users like most of the popular installers does. (For e.g. Visual Studio 2005)

We have around 12GB of movies and illustrations to be copied to user's PC.


Hi NBaua!

I think you should have a look at InstallOptionsEx. This plugin offers a ListView control. It might be a solution for you.

http://nsis.sourceforge.net/InstallOption****plug-in

Have a nice day!

Cheers

Bruno


thanks bholliger,
I will look in to it.


I hope the following minimal example would help you begin.
You may use the notify flag on the custom page leave function to get the selected drive.

The script:

outfile 'customtest.exe'

!define REQUIRED '60000'

!include 'FileFunc.nsh'
!Include 'MUI.nsh'

!insertmacro GetDrives
!insertmacro DriveSpace

!insertmacro MUI_PAGE_WELCOME
page custom CustomCreate
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"

Section -
#######
SectionEnd

Function CustomCreate
Push $1
InstallOptions::initDialog /NOUNLOAD '$PLUGINSDIR\custom.ini'
Pop $1
ReadINIStr $2 "$PLUGINSDIR\custom.ini" "Field 1" "HWND"
SetCtlColors $2 0x0000FF 0xFFFFFF
CreateFont $3 "Tahoma" 7 800
SendMessage $2 ${WM_SETFONT} $3 0
InstallOptions::show
Pop $1
FunctionEnd

Function GetDrivesCallBack
${DriveSpace} "$9" "/D=F /S=M" $R0
StrCpy $9 $9 1
IntCmp '$R0' '${REQUIRED}' +4 +4 0
StrCmp '$R2' 'state_ok' +3
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'State' 'Drive: $9 \
Required Space = ${REQUIRED} Mbytes Free Space = $R0 Mbytes'
StrCpy '$R2' 'state_ok'
ReadIniStr '$R1' '$PLUGINSDIR\custom.ini' 'Field 1' 'ListItems'
StrCmp '$R1' '' 0 addlist
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'ListItems' 'Drive: $9 \
Required Space = ${REQUIRED} Mbytes Free Space = $R0 Mbytes'
goto end
addlist:
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'ListItems' '$R1|Drive: $9 \
Required Space = ${REQUIRED} Mbytes Free Space = $R0 Mbytes'
end:
Push $0
FunctionEnd

Function .onInit
initpluginsdir
file /oname=$PLUGINSDIR\custom.ini custom.ini
${GetDrives} "HDD" GetDrivesCallBack
FunctionEnd

The custom.ini
[Settings]
NumFields=1

[Field 1]
Type=Listbox
State=
Left=12
Right=-11
Top=12
Bottom=36
Flags=


EDIT:
Added a defined required space and control colors.

Hello Red Wine,

Thanks a lot for such a gr8 HEADSTART for me.
I was looking almost this.
Thanks a milllllllllion.
:up:


You welcome :-)