Reputation: 1821
i am having a msi setup file which installs a windows service on the system. Now everytime i install a newer version of the setup, i want that it should first completely uninstall the previously installed version and then install the current version. I am pretty new to these configuration so not having any idea on this.
Any help would be much appreciated.
Thanks in Advance!
Upvotes: 1
Views: 120
Reputation: 691
You will have to ensure that when you run uninstall on the first version of your application that it really does leave your system in the original state you expect. Unfortunately, depending upon your setup and application, a clean uninstall is not automatically guaranteed simply because you ran uninstall on the same Windows Installer package used to install the application. You will need to test the original installation package thoroughly to ensure that Uninstallation Leaves the User's Computer in a Clean State. For example, if your application must be registered, the installation package must be authored to clean up the registry when the application is uninstalled.
If your installation package actually does always leave the user's computer in a clean state, then you can remove an application that has been installed using a Windows Installer Package by using the Standard Command Line Option with the /uninstall option, or one of the Windows Installer APIs such as MsiInstallProduct.
If you want to install a newer version of your application over an older version that is already installed, it may be better to develop an update package to update the application. There are several types of updates: Small Updates, Minor Upgrades, and Major Upgrades. See Patching and Upgrades in the documentation to determine what type of updating package you will need to provide to the users of your application.
One of the purposes of the Windows Installer is to support application servicing like this where there may be shared components and multiple updates on the user's system. This can be a more resilient servicing approach because it can require less prior knowledge of the user's computer than an approach of rip-out and replace.
Upvotes: 1