Page 1 of 1

A destination dialog for a single component

Posted: Thu Oct 25, 2007 7:14 pm
by ken rentz
One of our installers has to install a fairly large component (200 meg to 4 gig). Because of it's size, we would like to let the user select it's install location separately from the main application. We would also like to use the space required/available/remaining functionality, since this component's size is so large. The problem I'm encountering is trying to get this dialog to display the component's size for the space required. How does one go about setting this value manually?

Posted: Fri Oct 26, 2007 2:26 pm
by Alex_Ronquillo
You don't need to set this manually. You can set it as a separate feature, or you can also leave it in the general feature and create a custom dialog to ask the user where to install it, and install it to the user's selected folder. There is no need for you to manipulate the RequireDiskSpace. However, if you still want to manipulate it, you can use the Set Component Space command.

Posted: Fri Oct 26, 2007 3:32 pm
by ken rentz
I'm afraid that for a number of marketing and upgrade reasons, we can not put this component's drive selection on the same page as the main program's.

the problem that I'm encountering is that I can not figure out how to set the TotalRequiredSpace variable for this single item. I'm fine with having to shuffle around some variable inside the script in order to make it work, but I can not figure out what to set in order to have two dialogs display different disk space requirements.

Posted: Fri Oct 26, 2007 4:31 pm
by Alex_Ronquillo
Hoooooo, now I understand. Let me suggest you this:

Create two separate features, one for the big component, and the other for the rest of the installation. Let's call these features "Big component" and "Rest". Now follow the following steps:

1.- Before the first destination dialog, (the one for the Rest feature), add the following lines of code. (Just an example, use the variables you want):

Code: Select all

Set Variable TestVar to
Get Required Space by Component "Big Component" into variable TestVar
Set Component Big Component space requirements to 0 bytes
2.- After the dialog returns, and before the second destination dialog, add:

Code: Select all

Set Component Big Component space requirements to $TestVar$ bytes
Get Required Space by Component "Rest" into variable TestVar
Set Component Rest space requirements to 0 bytes
3.- After the second destination dialog returns, add:

Code: Select all

Set Component Rest space requirements to $TestVar$
That should do the job. I hope I explained it clearly. Note: You need to take into account the user may press back at any dialog, you need to manage that. The code I gave you works if the user doesn't press back.