Prasad
Posts: 25
Joined: Fri May 25, 2012 12:55 pm

Enable/disable Next button depending upon available space

Hello Support Team,

I have an issue regarding the disk space.

my senerio is as follows:-

I have 2 dialogs,
1) Drive Selection Dialog : Here I choose the drive to install my software. To select the drive, I use the control 'Volume Select Combo' . After selecting the drive, when I click on "Next" button, the second diloag (Disk Space Reuirement Dialog ) is launched
2) Disk Space Reuirement Dialog : This dialog has the control 'Volume Cost List', which shows available space on each drive on computer. If the drive selected on previous dialog does not have enough empty space, in 'Volume Cost List' it is mentioned under 'Insufficient Space' section. In such scenario I want to disable "Next" button on this Disk Space Reuirement Dialog (currrently it is enabled and user is allowed to go to next dialog even if enough space is not available on selected drive)

How to achieve this ?
Daniel
Posts: 8239
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Enable/disable Next button depending upon available spac

Hello,

In order to obtain what you want you should use the OutOfDiskSpace property. On your Disk Space Reuirement Dialog select the [Next >] button and add the following control condition:
  • Condition: OutOfDiskSpace = 1
    Action: Disable
Please keep in mind that a SetTargetPath published event should be added after you set your application installation path from UI.

Here's attached a sample which implements your scenario.
SAMPLE.aip
(24.14 KiB) Downloaded 408 times

Also, please keep in mind that we have added this functionality on "VerifyReadyDlg" dialog. If any computer disk volume that is a target of the current installation doesn't have enough disk space to allow the installation, then when [Install] button is pushed a spawn dialog is launched and it warning you there is not enough disk space.

If you have any question let me know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Prasad
Posts: 25
Joined: Fri May 25, 2012 12:55 pm

Re: Enable/disable Next button depending upon available spac

Hi Daniel,

I faced problem when I used conditions on Next button
[ OutOfDiskSpace = 1, Action: Disable ]
but still when first time Disk Space Reuirement Dialog is displayed 'Next' button is still enabled. If I click on 'Next' button and go to next dialog and by clicking 'Back' button, again come to this dialog Disk Space Reuirement Dialog, then onwards this 'Next' button gets disabled correctly.

Also, I am using Advanced Installer version 9.1 build 44617. So could not check the sample sent by you, since have attached sample version of 9.2.
Could you please resend the sample on Advanced Installer version 9.1 ?
Daniel
Posts: 8239
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Enable/disable Next button depending upon available spac

Hello,

You are encountering this behavior because you are using our "Enhanced User Interface" feature. In order to obtain what you want you should add one more step to solution from my previous post:
- Go to "Custom Actions" page and add a "Set installer property" custom action with sequence under "Wizard Dialogs Stage -> Begin" standard action like this:
  • Property: AiEarlyValidate
    Formatted: 1
    Condition: NOT Installed
Here's attached a sample, created using version 9.1 Of Advanced Installer, which implements your scenario.
SAMPLE.aip
(18.95 KiB) Downloaded 371 times
Let us know if this helps, otherwise please give us more details about your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Prasad
Posts: 25
Joined: Fri May 25, 2012 12:55 pm

Re: Enable/disable Next button depending upon available spac

Thanks Daniel. Your suggestion is working.
Just a question out of curiosity, How does this property work exactly for 'Next' button on Disk Space Reuirement Dialog?
because the property name 'AiEarlyValidate' does not suggest validation of any particlular control.


Also, can I use this property for validation of other controls also ?
Daniel
Posts: 8239
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Enable/disable Next button depending upon available spac

Hello,

The "AiEarlyValidate" property is not related with the [Next >] control button. This is an internal Advanced Installer property whose role is to force costing operation to be completed before "WelcomeDlg" appears, when Enhanced UI is enabled. So, when you are using costing operation with Enhanced UI activated, this internal property needs to be set for the Enhanced UI to work properly.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Prasad
Posts: 25
Joined: Fri May 25, 2012 12:55 pm

Re: Enable/disable Next button depending upon available spac

Thanks a lot Daniel for your support
Prasad
Posts: 25
Joined: Fri May 25, 2012 12:55 pm

Re: Enable/disable Next button depending upon available spac

Hi,

I have one more query related to this.
On the same Disk Space Reuirement Dialog, I am displaying Installation Path also (as a static text). If the required space is not available, then I also want to change color of Installation Path Text.
Is it possible to change Text Style (Font / Color etc) at runtime, based on condition ?
If yes, how can this be achieved ?
Daniel
Posts: 8239
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Enable/disable Next button depending upon available spac

Hello,

In order to achieve what you want you can perform like this:
- Go to "Themes" -> "Text Styles" tab and create 3 new text styles using [New...] button:
  • Identifier: MyTextStyle
    Property name: TEXT_STYLE
  • Identifier: TextStyleRed
    Property name:
  • Identifier: TextStyleBlack
    Property name:
- Choose the red color (or your desired color) for "TextStyleRed" and the black color for "TextStyleBlack".
- Edit "MyTextStyle" using "Set Fallbacks" option. In the "Edit Conditional Text Styles" dialog add two new conditional text styles:
  • Condition: OutOfDiskSpace = 1
    Text Style: TextStyleRed
  • Condition: OutOfDiskSpace = 0
    Text Style: TextStyleBlack
- Go to "Dialogs" page and select your static text control (i.e INSTALL_PATH). From "Properties" right pane set the following attributes:
  • Use Indirection: True
    Indirect Property: TEXT_STYLE
- Select the previous dialog and on the [Next >] button add a dummy new control event:
  • Name: DoAction
    Argument: DUMMY
- Go to "Table Editor" page and select "ControlEvent" table. Search the corresponding DUMMY control event row and update its "Argument" field to:
  • AI_ChooseTextStyles
- Build and run your project.

Here's attached a sample, created using version 9.1 Of Advanced Installer, which implements your scenario.
SAMPLE.aip
(20.35 KiB) Downloaded 363 times

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Prasad
Posts: 25
Joined: Fri May 25, 2012 12:55 pm

Re: Enable/disable Next button depending upon available spac

Thanks a ton Daniel.
Your suggestion is really helpful.

Return to “Common Problems”