Solved

Has anyone used .NET to detect previous installations and allow the users to decide if they would like to upgrade?

Posted on 2004-10-04
4
195 Views
Last Modified: 2009-05-29
I have a .NET deployment project in which I would like to give the users the option to upgrade if a previous version of the project is detected.  Here is the problem at hand:

A .NET deployment project allows a developer to set the RemovePreviousVersions property in an install package, which (when set to True) automatically uninstalls a previous version prior to installing the current version.  When set to False, the user is presented with a message box stating that an existing version of the application is installed, and the install exits.

How can/does one add a dialog box to the deployment project which:
a) only shows up if a previous version is detected
b) allows the user to upgrade (i.e., remove the previous version) or exit the install

Any information on how to set this up will be most appreciated!

Thanks a bunch!
0
Comment
Question by:dangerwill
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Expert Comment

by:glsac
ID: 12218953
I did this in VB :) Do you need it in .NET?
0
 

Author Comment

by:dangerwill
ID: 12218981
Yes.  This is a .NET install only, and the wrapper is .NET.  If the developers would use Installshield or Wise, this would be easily accomplished.  We know we can place a dialog box in, the problem is how to set it up conditionally during the installation and tweak it from there.

Thanks!
0
 
LVL 16

Accepted Solution

by:
RobertRFreeman earned 500 total points
ID: 12222137
That's a tough one.  I don't think there is a priorVersionExists property available for a conditional command.  It looks as if it's all or nothing with the RemovePreviousVersion property.

If you need to do this, you could check for existing files in the install directory or check for existing entries in the registry (better).
When deploying, copy the msi file to the deployment directory.
Then if you find the entry in the registry or the msi file in the directory, you would prompt the user, then run a custom action to uninstall the prior version.  (Use the setup.msi /x command).
0
 
LVL 16

Expert Comment

by:RobertRFreeman
ID: 12222453
Should be setup.exe /x /qb instead of setup.msi.  (You will need the setup.exe file as well in your install directory for this.)
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question