Old 11th December 2006, 13:38   #1
n_baua
Member
 
Join Date: Aug 2006
Posts: 86
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.
Attached Images
File Type: gif screen.gif (40.6 KB, 812 views)
n_baua is offline   Reply With Quote
Old 11th December 2006, 13:53   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
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.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 12th December 2006, 04:09   #3
n_baua
Member
 
Join Date: Aug 2006
Posts: 86
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.
n_baua is offline   Reply With Quote
Old 12th December 2006, 05:21   #4
bholliger
Senior Member
 
Join Date: Jul 2004
Location: Switzerland
Posts: 223
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
bholliger is offline   Reply With Quote
Old 12th December 2006, 07:17   #5
n_baua
Member
 
Join Date: Aug 2006
Posts: 86
thanks bholliger,
I will look in to it.
n_baua is offline   Reply With Quote
Old 12th December 2006, 09:21   #6
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
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:
code:
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
code:
[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.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS

Last edited by Red Wine; 12th December 2006 at 12:07.
Red Wine is offline   Reply With Quote
Old 13th December 2006, 02:01   #7
n_baua
Member
 
Join Date: Aug 2006
Posts: 86
Hello Red Wine,

Thanks a lot for such a gr8 HEADSTART for me.
I was looking almost this.
Thanks a milllllllllion.
n_baua is offline   Reply With Quote
Old 13th December 2006, 08:51   #8
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
You welcome :-)

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine 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