- As the windows installer technology is design in such a way it take cares of the important application phases such as installation,uninstallation and repair without worrying much.But in this post i would like to throw some light on windows installer file versioning rules and how you can have a fine grained control on those files used by the application using some methods,tweaks and properties.
- The windows installer operates on files using certain attributes such as Version,Date and Language.
- The REINSTALLMODE property contains a string made of a collection of letters indicating how files should be overwritten.It is used in conjunction with the REINSTALL property. The default value is “omus” (order-independent), where o indicates that older files should be overwritten with new files, m and u indicate that machine and user registry data should be reinstalled, and s indicates that shortcuts should be reinstalled.
- To modify file-overwrite behavior, you can replace the o in the REINSTALLMODE value with another letter indicating the desired behavior. Some of the possible values are e, to overwrite a file with an older or equal version, or a, to overwrite existing files without checking their version information.
- Example : msiexec /i app.msi REINSTALLMODE=amus REINSTALL=ALL
- when a MSI uninstallation takes place all the resources installed during the installed phase will be removed from the system.But there are cases when a corresponding file needs to be remained on the system after the uninstallation.The solution to this approach is to set the permanent attribute of the component to 16 .
- If the Never Overwrite component attribute is set (value:128), Windows Installer will skip installing the component if its key file is already present on the target system. If the component’s key file is not present on the target system, Windows Installer will follow the normal file-overwrite behavior.
- Companion file means the file whose installation logic depends on the versioning of its companion parent.
File | Version
- In the above case the installation state of File B depends upon the file versioning rules and the versioning information for File A.
- The MSI removes the files which are installed by it.but there are some files which are created after the launch of the application which are left behind after the uninstalltion.To overcome this a correponding entry in the RemoveFile table can be made.