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 prompting to uninstall


9 replies to this topic

dmaftei

dmaftei
  • Full Members
  • 8 posts

Posted 26 February 2004 - 02:18

Hi all,

I have a simple setup, and I'd like it to always prompt the user to uninstall a previous installation. I noticed that if I rebuild the setup with a new package code and then run it, I get a message from Windows Installer that says that a package is already installed, and I should remove it from Control Panel. However, if I install and then run the same (unmodified) setup, I get to the Maintenance dialog. What I want is to get the Windows Installer message in this case too.

The question is: is there any (simple) way to achieve this behavior?

TIA

Edited by dmaftei, 26 February 2004 - 02:19.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 26 February 2004 - 14:31

Why would you? If the .msi files are exactly identical why would you uninstall it and then reinstall the same again? You could do a reinstall (repair) instead.
The problem is that the uninstall (from control panel) will also run the same .msi file. So if you prevent re-running the .msi file (which might be possible) you are unable to uninstall.
If the new .msi file is not identical to the already installed, then the PackageCode must be different.

dmaftei

dmaftei
  • Full Members
  • 8 posts

Posted 26 February 2004 - 18:18

QUOTE (Stefan Krueger @ 2004-02-26 09:31)
Why would you?

Well, that's a marketing requirement... They don't want "Modify" and "Repair". What they want is the installation to succeed only if the product is not installed. If it is installed, it must be uninstalled, even if the new installation is exactly the same darn thing.

grantmi

grantmi
  • Members
  • 8 posts

Posted 27 February 2004 - 11:14

You could try setting up an Install Condition (General Information - Product Properties.

Your Condition should be "NOT Installed" with a message "Product already installed please uninstall first"

Your installation will only install if it is not already installed.

PS. Installed property will be False if a different version (Package Code) is already installed. So in this case you get the normal message (in your first post)

Cheers Mike

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 27 February 2004 - 14:22

grantmi: the problem with your suggestion is what I already mentioned in my first post: the product can no longer be uninstalled.

dmaftei: you can easily remove the Repair and Modify options from that dialog, so the only option is uninstall. Or you get rid of this dialog all together and immediately uninstall (maybe after a confirmation message box)

grantmi

grantmi
  • Members
  • 8 posts

Posted 27 February 2004 - 15:19

Please see this thread to stop the message coming up when you Uninstall the project.

http://community.ins...threadid=127112

Cheers Mike biggrin.gif

dmaftei

dmaftei
  • Full Members
  • 8 posts

Posted 27 February 2004 - 15:58

I solved the problem, I'm just skipping the "Maintenance Type" dialog. I modifed the text in the "Maintenance Welcome" dialog to read "Your product will be removed", and next I jump directly to "Ready to Remove".

Mike, I tried a while ago the Install Condition, and I got what Stefan said: I couldn't uninstall at all... sad.gif I'll check your other thread though, to see how that works.

Thanks a lot for your suggestions!

Edited by dmaftei, 27 February 2004 - 15:59.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 27 February 2004 - 16:16

grantmi: I don't see how the discussion in the other thread solves the dilemma?

A launch condition of Not Installed will prevent the setup from running a second time, that includes uninstall.
Putting a condition of Not Installed on the LaunchCondition action compensates this, i.e. the setup can always run. The end result is the same as not specifying that launch condition at all, and therefore not a solution to dmaftei's problem.


grantmi

grantmi
  • Members
  • 8 posts

Posted 01 March 2004 - 11:31

Doh!

Cheers Stefan, I can see there was a problem with my logic.

The codition we want to check is NOT Installed

And I am saying only check the Install Condition if we are NOT Installed.

So if we are already installed we won't check the Installed Condition, so the installation will run if we are already installed. Which is not what we want.

Oops, sorry but it does take a bit of work to get your head round it!

Mike

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 01 March 2004 - 14:30

QUOTE (grantmi @ 2004-03-01 11:31)
it does take a bit of work to get your head round it!

I know!