How to cache msi files

Oct 8, 2010 at 2:38 PM

I would like to place msi files into a cache and install the msi from the cache, not from #CABPATH as is done when using an msi component with an embedded file .

This would make the msi source available when reparing the installation becomes necessary. Windows installer would not ask for the source of the msi (which is not available anyway because it is embedded into dotNetInstaller and the msi file amongst the temporary files gets deleted).

I have something like "%SYSTEMROOT%/Downloaded Installations" folder on my mind.

How can I do this?

Coordinator
Oct 9, 2010 at 4:11 PM

Doesn't Windows installer already do this automatically for you unless you explicitly tell it not to?

The esiest way I think is to define CABPATH as that special folder and make sure not to set the auto-delete option to True.

Oct 9, 2010 at 10:18 PM

As far as I can tell the situtation is this:

Windows Installer caches msi installation packages in a hidden folder at "%SYSTEMROOT%/Installer". The msi packages cached here are stripped from embedded cabinets, so the whole cache is only useful for doing the uninstallation. When Windows Installer is uninstalling a product it does not need the files themselves only the list files which it has to delete. So what Windows Installer does is logical and saves disk space, except for Windows Installer 5, which caches the whole msi package with all its embedded cabinates, thus eating up a lot of disk space and still using the cached package for uninstallation purposes only. 

When it comes to repairing an installation Windows Installer will not use its cache but will look for the original msi package at the location where it was installed from. Actually the user will be prompted for the location of the msi file if the msi is not found at the original location. But the user will not be able to provide such location because my msi is embedded into the bootstrapper!

CABPATH would not be a bad choice but it is inside TEMP which can get cleaned up easily, a more permanent folder would be a better choice.

Coordinator
Oct 9, 2010 at 11:56 PM

CABPATH is configurable at the configuration level, so just change it.