View Full Version : Session.FeatureCost and VBScript

Tim Mayert
06-10-2004, 01:10 PM
I would like to try and use VBScript to get the total space required to install my application and to display this value on one of my dialog boxes for the user to see.

I found the Session.FeatureCost function so thought this might work to get the value, that is if it will work and I get the syntax correct.

Since I have not created any VBScript custom actions what would the syntax of this look like and how do I set it up so that it places this total value into a property that I can then display on one of my dialog boxes?

Is there any other object method that may work better?


06-15-2004, 05:09 PM
Are you using installscript to display your dialog boxes?

Tim Mayert
06-16-2004, 07:24 AM
No, I would like to avoid using any InstallScript in my Basic MSI project.

06-16-2004, 09:42 AM
If that doesn't work you can always just use a SetProperty type custom action and access it from the Session.Property("PropName") property.

Tim Mayert
08-23-2004, 11:59 AM
I am able to get the Session.FeatureCost function to work in VBScript, but the size does not seem correct.

Here is my code for one a couple of my features:

iRequestState = Session.FeatureRequestState("Arts")
If (iRequestState > 0) And (iRequestState <> 2) then
nvReturn = Session.FeatureCost("Arts", 0, 3 )
nvTotal = nvTotal + nvReturn
MsgBox ("Arts Disk Space Required: " & nvReturn )
End If

iRequestState = Session.FeatureRequestState("Corp")
If (iRequestState > 0) And (iRequestState <> 2) then
nvReturn = Session.FeatureCost("Corp", 0, 3 )
nvTotal = nvTotal + nvReturn
MsgBox ("Corp Disk Space Required: " & nvReturn )
End If

Now the actual sizes of these features are:
Arts = 1.66 MB
Corp = 200 KB

But when I run the functions the message box will return the following:
Arts = 3416
Corp = 400

Does anyone know why the sizes are doubled? Is there any conversions/formatting that I am suppose to do before getting the correct size?

Any Help would be appreciated.

08-23-2004, 12:22 PM
As described in the MSI Help Library page "Session.FeatureCost", the size is reported "in units of 512 bytes"...