In a Basic MSI installation, it sometimes appears to a person that an auto-repair is being triggered during an installation, when there is no reason for one to take place. In this case, the first thing you must do is to enable logging, then run the installation and see what the log reveals to you. If the log file does not show that any files were reinstalled, is it really a repair that is taking place?
The Windows Installer can repair, replace, and verify files in an application. A partial or complete application reinstallation would be warranted if any files or registry entries associated with a particular feature are missing or corrupt. When a feature or applicaiton is reinstalled, all the services, environment variables, and custom actions belonging to the feature or application are reinstalled. Changes that were made to environment variables between the original installation and the reinstallation are then lost.
Back to the original example. If your installation log shows that no files were reinstalled, what exactly is happening?
Features can be advertised instead of immediately installed. You do this by setting the feature's Advertisement property to Allow Advertise. Now, just because you set it to allow advertisement, that doesn't mean that it will be the default option when the installation is run. In the custom setup dialog, the user has to indicate that he wants to install the feature when it is required, rather than during the installation. So, the installation takes place on the user's system, but the feature is not yet installed.
During the use of the application, when the user desires to use the functionality that is provided by the advertised feature, the feature is then installed. This is install-on-demand and is the point where installation developers can become confused during the testing of their installations. They mistake install-on-demand for auto-repair, when it is not.
When you encounter this scenario in your testing, always check your installation log to determine what is happening. It may be that sometime during development, you inadvertently advertised a feature, and that was not your intention. It happens to all of us, so don't fret, just recognize it for what it is, and correct it.
A Reader Question about Using Code-Signing Certificates in InstallShield