SUMMARY
The Microsoft Setup Toolkit for Windows GetCopyListCost() function can
be used to compute the cost needed to install the files in the copy
list to the target. The syntax for GetCopyListCost() is:
Long&=GetCopyListCost(szExtras$,szCosts$,szNeededs$)
szExtras$ is an input parameter to GetCopyListCost(), and szCosts$ and
szNeededs$ are output parameters. All three parameters are symbols
whose values are lists of up to 26 integers. The nth integer in the
list will have the information about the nth alphabetic drive, where
the drives are A-Z.
If there will be extra costs beyond the cost of copying and
decompressing the files in the copy list, these costs should be
included in szExtras$. For example, to specify an extra cost of 5000
bytes on the Windows drive, the code might resemble the following:
WinDrive$ = MID$(GetWindowsDir, 1, 1)
ndrive% = ASC (ucase$(WinDrive$)) - ASC ("A")
for i% = 1 to ndrive% step 1
AddListItem "ExtraCosts", "0"
next i%
AddListItem "ExtraCosts", "5000"
need& = GetCopyListCost ("ExtraCosts", "costs", "needs")
If there are no extra costs, "" can be passed for szExtras$.
On return, the value of szCosts$ will be a list of 26 integers, which
are the total costs for drives A-Z of copying the files in the copy
list and of the costs in szExtras$. The value of szNeededs$ will be a
list of 26 integers, which are the total costs for each drive--the
amount of free space on the drive. For any drive that will not be
affected by the extra costs or by copying the copy list, szNeededs$
will report 0.