tags:

views:

560

answers:

2

As most of you probably noticed, when uninstalling an MSI package Windows will ask for the original .msi file...

Why is that ?

I can only see disadvantages to that:

  • not resilient to network changes.
  • not resilient to local disk changes.
  • unexpected by users.
  • typically requires users to leave their desk and start a crusade to get the correct CD.
  • kind of proves installations are not self-contained.
  • promotes the use of unsafe tools such as msizap.
  • which in turn promotes the "next time I'll just use a zip file" mentality.

Could someone shed some light on this ?

+1  A: 

There are a few reasons for keeping the original msi:

  • The uninstaller uses it to know what files and registry keys were installed and make sure they are all cleaned up.
  • The msi may contain code for special uninstall actions that need to be performed.
  • It allows you do to a 'repair' operation from the Add/Remove Programs menu, regardless of whether or not you saved the install file yourself.

The normal way of things is for Windows to keep the file cached for you, so you don't have to think about it. See your %WINDIR%\Installer\ folder. The only reason it would ask your for the original msi is if something is wrong with the saved file. This addresses most of your concerns, though it does raise a new one (disk-space).

Joel Coehoorn
and what about using the registry itself to store the actions and keys added to enable uninstalls? That'd make more sense than storing the whole file. Repair dying when there's no msi is totally expected, but no uninstall is a no-no in my books.
Vinko Vrsalovic
I don't work for MS: take it up with them ;) But storing that much info in the registry probably isn't a good idea, either. It's bloated enough as it is.
Joel Coehoorn
Oh: but I agree that the system should be smart enough to still do some kind of 'basic' uninstall if the original file goes missing. But again, I don't work for MS.
Joel Coehoorn
I believe the system should really store everything needed for #1 and #2. From a user point of view, #3 could require the original install, nobody will ever be surprised by that.And you're right for the installer folder... I guess I must reinstall my box now...Thanks.
bltxd
MSI files in %WINDIR%\Installer\ are "stripped out" versions of original installations so they don't take much of disk space.
Pavel Chuchuva
Sorry, but this is not a correct answer. 1) file and Registry changes are stored in a dedicated MSI database section of the Registry. The original MSI file is not needed for this purpose. 2) At install-time, the MSI file is cached minus the CAB payload. Therefore, any kind of special uninstall custom actions will still be possible using the cached MSI file; CAB payload not necessary.
William Leara
+7  A: 

The original MSI is not needed for uninstall unless the MSI itself is badly designed. As stated above all MSI files are cached in %WINDIR%\Installer*.* using a random name. This MSI is stripped of all cabs, and hence contains the installer structure only, and no files.

This "stripped" MSI file is used for any maintenance and uninstall operations - and it is sufficient for uninstall in the vast majority of cases. The original source is only needed if files need to be copied to disk (for a maintenance install), or the MSI does an explicit request to resolve the original source via the standard action ResolveSource or via a custom action (which shouldn't be done in a properly authored package).

I hear rumours that Microsoft may be changing this in newer versions of MSI and instead cache the entire MSI file instead of a stripped file.

Glytzhkof
This is actually a much better answer than the accepted answer. The accepted answer from Oct 16 is filled with inaccurrancies.
William Leara

related questions