View Full Version : uninstall old before installing new

07-11-2005, 03:13 PM
:confused: Hi guys.
I'm pretty sure that my question is kind of frequently questions in this community but I can't find exactly what I need.
I'm using "InstallShield 11", my project is "Basic MSI Project". What I need is when user installing application, installer should completely uninstall old version (based on version number) from target machine and install new one. I know that exists several ways to do this (e.g. creating custom actions and use some predefined functions like uninstallApplication(), using appropriate switches to "msiexec", etc.) can you give me exact example? And also where in "sequences" should be placed such custom actions?

BTW: I tried to use Update feature and I noted that this feature doesn't work properly in my case. For example, during installation I'm updating settings.xml file (I use "XML File Changes" view) and when I use update feature it corrupts my settings.xml. So I don't want to use InstallShield's because of this bug and because of less control.

Thank you in advance

07-12-2005, 05:45 AM

To uninstall the old version during the install for newer version add a major upgrade item in you uprade table.This will do uninstall the old version without prompting the user.

07-12-2005, 08:12 AM
thank you for your replay...
I tried to do this.. But for some resone it doesn't delete settings.xml file which is the one of my installation files. It doesnt' delete it even if I explicity check "Remove on uninstall" on this file from "XML File Changes" view. I think I need to write custom action that will remove this file.. do you now where in sequences shoud I put such custom action?
Thank you in advance.

07-12-2005, 11:08 AM
It would be recommended that you use an entry in the RemoveFile table instead of a custom action. The RemoveFile table will let you remove the file without having to worry about where to sequence it. Unfortunately the only access to it is via the Direct Editor, but I believe help for it is available if you press F1 in that table.

Another option might be to make sure the component associated with your XML changes actually installs the XML file, even if it's just a practically or completely empty file. I suspect this would help ensure its removal later, but I haven't worked with the XML changes view much myself...