1

I was reading about Windows Installer REINSTALLMODE property and I have a question about code v.

The documentations says: "Use to run from the source package and re-cache the local package. Do not use the v reinstall option code for the first installation of an application or feature."

Can anyone provide a better explanation?

rharrison33
  • 1,252
  • 4
  • 18
  • 34

2 Answers2

2

There is a cached version of the MSI (\Windows\installer often) with a hex name that is used for repair, uninstall, general servicing operations like that. You probably know that. It gets put there at first install, which is why you wouldn't use it at first install, but then there is no good reason I know of to use REINSTALLMODE at first install anyway. I mean it's re-install, the product is already there.

PhilDW
  • 20,260
  • 1
  • 18
  • 28
  • 1
    I sometimes suggest REINSTALLMODE="emus" (replace same or higher version) as command line for people who don't increment their assembly file versions - see [**this answer**](http://stackoverflow.com/a/1080386/129130). It is slightly better than amus, but I think it might trigger the same file protection errors on newer Windows versions if you have a protected file in the MSI - never seen it happen though. I suppose I should suggest the real solution: fix the release process and increment the versions or use [**a companion file**](http://stackoverflow.com/a/1434514/129130) if you have to. – Stein Åsmul Oct 02 '14 at 21:36
  • 1
    An absurdity with REINSTALLMODE="emus" and non-incremented assembly versions is that there will be version identical and binary different files in the wild. I can't picture any benefits from this. I would just set 1.0.0.* to always auto-increment the build version. – Stein Åsmul Oct 03 '14 at 15:34
2

The v code for REINSTALLMODE is useful for small updates and minor upgrades, scenarios that are re-cache and repair operations. In these scenarios (as opposed to patch scenarios) you are trying to replace the existing package with a new one, and the cached copy needs to be similarly replaced. The cache allows repairs and removals to work without necessarily requiring the original media, and it must be kept up to date.

It's unclear to me why Windows Installer is smart enough to cache the .msi on a first-time install, but doesn't automatically do so for a small update or minor upgrade.

Michael Urman
  • 15,737
  • 2
  • 28
  • 44
  • The last comment is what really gets me with MSI - it suffers a number of absurdities that make life unnecessarily complicated. The sloppy handling of transforms and their caching (not sure if this has been fixed in recent MSI versions) is another. SDK-level complexity for a basic operation. – Stein Åsmul Oct 03 '14 at 15:32