Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Always uninstall first if already installed?


4 replies to this topic

quakey

quakey
  • Full Members
  • 33 posts

Posted 01 December 2004 - 19:58

Hi,

Is there a way to make the installer to always uninstall a previously installed
version of the same product first and then install itself again?

I would like to bypass the whole upgrade concept in MSI since it's giving me a
hard time to do what I need. So it would be easiest if the installer can detect
whether a version (any version) of the same product is already installed and uninstall
it immediately and then proceed to install itself again.

Thanks.

mandy

mandy
  • Members
  • 121 posts

Posted 01 December 2004 - 20:47

The RemoveExistingProducts action can be moved...

QUOTE
Between the InstallValidate action and the InstallInitialize action. In this case, the installer removes the old applications entirely before installing the new applications. This is an inefficient placement for the action because all reused files have to be recopied.


This was taken from the Windows Installer SDK.


quakey

quakey
  • Full Members
  • 33 posts

Posted 01 December 2004 - 21:37

QUOTE (mandy @ 2004-12-01 20:47)
The RemoveExistingProducts action can be moved...

QUOTE
Between the InstallValidate action and the InstallInitialize action. In this case, the installer removes the old applications entirely before installing the new applications. This is an inefficient placement for the action because all reused files have to be recopied.


This was taken from the Windows Installer SDK.

Hi,

I could move it up but it is not enough. I mean if a version (let's assume version 1) is already installed and you try to install another version (version 2) of the product (same ProductCode), the installer won't even let you proceed and give me an error saying another version is already installed and asks me to uninstall it first. I would like to be able to uninstall it before that error shows up (actually it won't even show up if the previous version is uninstalled in the very beginning).

Thank you.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 02 December 2004 - 10:50

If you don't want to automatic uninstall but instead want to cacel you install with an error message telling the user to remove the old version first:
Insert a type 19 custom action (display error message) in both your InstallUI and InstallExecute sequences, with a condition that uses the proprty you have entered in the Upgrade table. If an old version is found this property will be set and the error message will be displayed.

mandy

mandy
  • Members
  • 121 posts

Posted 02 December 2004 - 13:22

Why does the product key have to stay the same?

If the product differences are so great that it warrants a complete removal and reinstall, maybe you should change it?

You haven't explained what you don't like about upgrades.

The easisest way to do what you're describing is to create a major upgrade and move the RemoveExistingProducts action.