Old 28th August 2013, 06:18   #1
ilaiyaraja
Member
 
Join Date: Sep 2012
Posts: 81
How to create conditional Directory page?

I have installed my app in this path,

$PROGRAMFILES\myapp.

After that i want to check the free space for this drive.In my app wants at least 2GB free space. so i have used following command for checking,
Function MyFuncDir
${DriveSpace} "C:\" "/D=F /S=G" $R0
;$Ro
${If} $R0 >=2
MessageBox MB_OK "required free space is not available.select some other directory"
--Here I want to call page directory function--
${End}
FunctionEnd

In the first time install dont need Directory page.Because by default install location is C:\$PROGRAMFILES\myapp this path.
After free space if required is not available then only display directory page for selecting some other directory.
After selecting some other directory again wants check required free space is there,if available proceed to next page else again display directory page.

How to achieve this?
ilaiyaraja is offline   Reply With Quote
Old 2nd September 2013, 07:54   #2
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 564
Send a message via ICQ to T.Slappy
Use Directory page but in it's 'Pre' function do your calculations.

Use Abort command to skip the page (page will not be visible) and move to next page.

Cool looking installers with custom design: www.graphical-installer.com
Create Setup Pages easily: www.install-designer.com
Build installers in Visual Studio 2005-2022: www.visual-installer.com
or RAD Studio 2009 - 11 Alexandria: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Old 2nd September 2013, 10:16   #3
ilaiyaraja
Member
 
Join Date: Sep 2012
Posts: 81
Thanks slappy.

Checking condition in pre function and either call directory page or not is not possible in my case.
Because Assume a case system contains 5 drives{C,D,E,F,G].In the fifth G drive only possible to install my app.How can i check ?
Based on your solution Insert page directory macro in 5 times.
!define MUI_PAGE_CUSTOMFUNCTION_PRE MyFuncDir
!insertmacro MUI_PAGE_DIRECTORY
!define MUI_PAGE_CUSTOMFUNCTION_PRE MyFuncDir
!insertmacro MUI_PAGE_DIRECTORY
!define MUI_PAGE_CUSTOMFUNCTION_PRE MyFuncDir
!insertmacro MUI_PAGE_DIRECTORY
!define MUI_PAGE_CUSTOMFUNCTION_PRE MyFuncDir
!insertmacro MUI_PAGE_DIRECTORY
------
------
This is not good for writing script.I think some looping concept needed here.So i have tried some while loop for calling page directory macro.But I cant do well.
ilaiyaraja is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
java, nsis

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