I have a software package deployed using WIX. When I run the installer again after installing, it gives as option to repair, what does it exactly do?
Repair: If the question is what repair does, then it checks all component key-paths for the installed product and installs any components that may be missing - for some reason. In essence your product is just checked for being completely installed and then errors are fixed up.
There are some issues with repair resetting registry values unexpectedly that you should be aware of. This problem and a number of other, common problems with MSI are described here (very messy overview, but maybe have a skim if you see any relevant problems you recognize): How do I avoid common design flaws in my WiX / MSI deployment solution?
Self-Repair: You may also have triggered a Windows Installer self-repair because of a design error in your WiX source file / MSI output file.
This is a repair happening on its own without you running the installer again yourself - or kicking it off from Add/Remove programs
. Rather it is automatically invoked via certain "advertised entry points" that trigger a key-path check auto-magically. For example the act of launching an advertised shortcut or invoking a COM class and a few other types of actions (see linked content).
I have written about self-repair too many times, I will just link to existing answers. Please try the last one first (how to avoid it in your own package):
If the issue is not self-repair, then you should know that when you run your installer again it is normal to get a modify / repair dialog because the product is already installed. It is the correct behavior.
Links:
The links by @Stein Asmul explains the quite a lot of things in depth, to me in simple words this is what MSI repair/self healing does. If you have written the MSI you know that it consists of multiple features and each feature is made up of multiple components. Th repair option in simple words compares the ID/Primary Key for each component with that of the workstation in which it is running. If one of the component ID/Primary key is missing on the workstation it will re-install that component.
For example, if we have 2 components Component one to install abc.txt and Component two to install xyz.txt. The repair will go and check the ID/Primary key of Component 1 and Component 2 to make sure they exist of the workstation/server. If it's not present it will reinstall it. @Stein Asmul's links should have more details, this is a very simple short answer to it.