Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

find msi size


6 replies to this topic

haripanicker

haripanicker
  • Full Members
  • 14 posts

Posted 05 March 2009 - 00:29

Is there a way to find the required disk space to install a msi? basically the space required to install a particular msi?

is there any api to find it or do i need to manually go the file table and add up the sizes of all the files?

hari

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 05 March 2009 - 10:22

There are functions (e.g. MsiCostTree) provided by the WindowsInstaller.Installer object (and obviously in the API). As ever, MSDN provides most of what you'd need to know.

The complication, of course, comes with evaluating what features (and therefore what components) will be installed. I guess you'd pick a worst-case scenario and select all features, enumerate the components which comprise those features and then cost those.

EDIT:
I was browsing the registry a moment ago looking at something unrelated when I spotted 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\[ProductCode]\EstimatedSize'. Not all the entries in the 'Uninstall' branch have that value but it's a nice easy start.

Edited by VBScab, 05 March 2009 - 14:49.

- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 05 March 2009 - 20:49

I suppose you could also automate the extraction of all source files by running an admin image on the msi: msiexec /a Installer.msi and then get the size of the resulting, extracted folder. It should be a pretty good approximation of the max install size of the product (unless there are files included in the setup not being installed).
Regards
-Stein Åsmul

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 06 March 2009 - 09:50

QUOTE (Glytzhkof @ 2009-03-05 19:49)
I suppose you could also automate the extraction of all source files by running an admin image on the msi:

Hmmm....I thought of that and then I thought about apps with things like localised Help files: an admin image would contain every language instance for those files which, for a normal install, it wouldn't. Nowadays, of course, an MSI could contain binaries for XP and Vista, 32-bit and 64-bit. Again, not all of these would be installed normally.

It's not that straightforward a task, this one. Good luck and do return to let us know how you handled it.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

haripanicker

haripanicker
  • Full Members
  • 14 posts

Posted 09 March 2009 - 21:12

hmm ya tatz the problem... it contains files tat r not installed too...

i still havnt figured out the best way to do it...

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 12 March 2009 - 15:00

If you want to figure this out during an installation, wait until the Costing process is over, and the user has selected his features. Then enumerate all components, and check each install action. For every component being installed, add up all its file size.
You may want to check the destination folder of the component too - in case parts of the software are installed on other drives etc.

If you want to figure this out beforehand, or on behalf of another computer etc. this task is getting very hard. At least you need to predict the behavior of the target computer and the user installing the package.
For instance, if the MSI has a Merge Module that is also used in other MSIs, the components of that Merge Module may or may not be present on the target computer. Obviously this impacts the disk space needed.
You need to predict the user too, after all the user may change the feature selection.

Edited by Zweitze, 12 March 2009 - 15:37.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 12 March 2009 - 20:12

You may also want to look at these properties:

ARPSIZE - I think this is used to set the size information in the Add/Remove Program control panel, i.e. the registry entry that VBScab mentioned earlier.

PrimaryVolumeSpaceRequired - this is the required disk space but only on the primary volume.